@resolveio/client-lib-core 21.5.31 → 21.5.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as i0 from"@angular/core";import{Injectable,HostListener,Input,Component,Directive,ViewChild,ChangeDetectionStrategy,Pipe,LOCALE_ID,Inject,EventEmitter,Output,ViewChildren,ElementRef,NgModule,Optional,ViewEncapsulation,InjectionToken,HostBinding,ContentChildren}from"@angular/core";import{BehaviorSubject,Subject,fromEvent,ReplaySubject,merge,Observable,of}from"rxjs";import*as i1$5 from"ngx-device-detector";import{DeviceDetectorService}from"ngx-device-detector";import{debounceTime,finalize,map}from"rxjs/operators";import*as i2 from"@angular/forms";import{UntypedFormControl,Validators,FormGroup,FormArray,FormsModule,ReactiveFormsModule}from"@angular/forms";import*as i1 from"ngx-toastr";import{ToastrModule}from"ngx-toastr";import moment from"moment-timezone";import{unpack,pack}from"msgpackr";import{detailedDiff}from"deep-object-diff";import*as CryptoJS from"crypto-js";import*as i1$1 from"@angular/router";import{RouterModule}from"@angular/router";import*as i4 from"@angular/common/http";import{HttpHeaders,provideHttpClient,withInterceptorsFromDi}from"@angular/common/http";import*as i1$2 from"@ng-bootstrap/ng-bootstrap";import{NgbTooltipModule,NgbModule,NgbAccordionModule,NgbModalModule}from"@ng-bootstrap/ng-bootstrap";import*as i3 from"@angular/common";import{CommonModule,getCurrencySymbol,formatDate,formatPercent,formatCurrency,formatNumber,JsonPipe,UpperCasePipe,LowerCasePipe,TitleCasePipe}from"@angular/common";import*as i5 from"@resolveio/client-lib-rio-select";import{RioSelectModule,RIO_SELECT_STICKY_ADAPTER}from"@resolveio/client-lib-rio-select";import*as i7 from"@resolveio/client-lib-date-picker";import{RioDatePickerModule,RIO_DATE_PICKER_CONFIG}from"@resolveio/client-lib-date-picker";import{UserAgentApplication}from"msal";import*as i1$3 from"ngx-ui-tour-core";import{TourState,TourService,UI_TOUR_OPTIONS}from"ngx-ui-tour-core";import*as i1$4 from"@angular/platform-browser";import{BrowserAnimationsModule}from"@angular/platform-browser/animations";import moment$1 from"moment";import*as i7$1 from"ngx-file-drop";import{NgxFileDropModule}from"ngx-file-drop";import*as i8 from"@resolveio/client-lib-pdf-viewer";import{PdfViewerModule}from"@resolveio/client-lib-pdf-viewer";class CoreService{isDevice=new BehaviorSubject(!1);fullScreen=new BehaviorSubject(!1);fsActivated=new BehaviorSubject(!1);hasConnected=new BehaviorSubject(!1);navbarModuleData=new BehaviorSubject({title:"",module:"",description:"",description_name:"",tabs:[]});hasStatusMessage=new BehaviorSubject(!1);alertData=new BehaviorSubject({type:"",message:"",timer:0,showing:!1});isInvalidSW=new BehaviorSubject(!1);environment=new BehaviorSubject(null);client=new BehaviorSubject("");publicProgram=new BehaviorSubject(!1);navTabs=new BehaviorSubject([]);tourStops=new BehaviorSubject([]);tourStarted=new BehaviorSubject(!1);isDemo=new BehaviorSubject(!1);isLoggingOut=new BehaviorSubject(!1);constructor(){}setFullScreen(t){this.fullScreen.next(t)}setFsActivated(t){this.fsActivated.next(t)}setHasConnected(t){this.hasConnected.next(t)}setNavbarModuleData(t){const e=t.tabs.filter(t=>null===t.params).concat(t.tabs.filter(t=>null!==t.params)),n={...t,tabs:e};Promise.resolve().then(()=>this.navbarModuleData.next(n))}setHasStatusMessage(t){this.hasStatusMessage.next(t)}setIsDevice(t){this.isDevice.next(t)}setIsInvalidSW(t){this.isInvalidSW.next(t)}setEnvironment(t){this.environment.next(t)}setClient(t){this.client.next(t)}setPublicProgram(t){this.publicProgram.next(t)}setNavTabs(t){const e=Array.isArray(t)?t.slice():t;Promise.resolve().then(()=>this.navTabs.next(e))}setTourStops(t){this.tourStops.next(Array.isArray(t)?t:[])}setTourStarted(t){this.tourStarted.next(t)}setDemo(t){this.isDemo.next(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});class ResizeService{get onResize$(){return this.resizeSubject.asObservable()}resizeSubject;subscription;constructor(){this.resizeSubject=new Subject,"undefined"!=typeof window&&(this.subscription=fromEvent(window,"resize").pipe(debounceTime(150)).subscribe(t=>this.onResize(t)))}onResize(t){this.resizeSubject.next(t.target)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResizeService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResizeService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResizeService,decorators:[{type:Injectable}],ctorParameters:()=>[]});class AlertService{_toastr;constructor(t){this._toastr=t}clearAlert(t){t?this._toastr.clear(t):this._toastr.clear()}registerTapToClear(t){return t&&t.onTap&&t.onTap.subscribe(()=>this._toastr.clear(t.toastId)),t}titleForType(t){return"success"===t?"Success":"info"===t?"Info":"warning"===t?"Warning":"error"===t?"Error":"update"===t?"Update":"Info"}updateAlert(t,e,n="info",o=0){const r=t?.toastRef?.componentInstance;return r?(r.message=e,void 0!==r.title&&(r.title=this.titleForType(n)),t):(t?.toastId&&this._toastr.clear(t.toastId),this.setAlert(n,e,o))}setAlert(t,e,n=5e3){return"success"===t?n?this.registerTapToClear(this._toastr.success(e,"Success",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.success(e,"Success",{disableTimeOut:!0,tapToDismiss:!0})):"info"===t?n?this.registerTapToClear(this._toastr.info(e,"Info",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.info(e,"Info",{disableTimeOut:!0,tapToDismiss:!0})):"warning"===t?n?this.registerTapToClear(this._toastr.warning(e,"Warning",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.warning(e,"Warning",{disableTimeOut:!0,tapToDismiss:!0})):"error"===t?n?this.registerTapToClear(this._toastr.error(e,"Error",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.error(e,"Error",{disableTimeOut:!0,tapToDismiss:!0})):"update"===t?this.registerTapToClear(this._toastr.show(e,"Update",{disableTimeOut:!0,tapToDismiss:!0,toastClass:"ngx-toastr toast-secondary"})):void 0}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AlertService,deps:[{token:i1.ToastrService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AlertService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AlertService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1.ToastrService}]});class LocalStorageService{get(t){return"undefined"==typeof localStorage?null:localStorage.getItem(t)}set(t,e){"undefined"!=typeof localStorage&&localStorage.setItem(t,e)}remove(t){"undefined"!=typeof localStorage&&localStorage.removeItem(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LocalStorageService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LocalStorageService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LocalStorageService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});class SocketService{_storage;debug=!1;reconnectInterval=1e3;timeoutInterval=5e3;timeout=null;readyState;readyState$=new BehaviorSubject(0);protocols=[];ws=null;url;timezone;pingInterval=null;pongTimeout=null;pingIntervalTime=15e3;pongTimeoutTime=12e3;lastActivity=Date.now();missedPongs=0;maxMissedPongs=3;wakeReconnectThreshold=3e5;focusReconnectDebounce=null;onopen=t=>{};onclose=t=>{};onconnecting=()=>{};onmessage=t=>{};onerror=t=>{};constructor(t){this._storage=t,"undefined"!=typeof document&&document.addEventListener("visibilitychange",this.handleVisibilityChange),"undefined"!=typeof window&&window.addEventListener("focus",this.handleWindowFocus)}openSocket(t,e){this.url=t.WS_URL,this.protocols=e,this.timezone=t.TZ_CLIENT,this.connect()}onOpenHandler=t=>{this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.log(new Date,"WS","onopen",this.url),this.readyState=WebSocket.OPEN,this.readyState$.next(this.readyState),this.recordActivity(),this.onopen(t),this.startPinging()};onCloseHandler=t=>{this.ws&&this.readyState!==WebSocket.CLOSED&&(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.ws.removeEventListener("open",this.onOpenHandler),this.ws.removeEventListener("close",this.onCloseHandler),this.ws.removeEventListener("message",this.onMessageHandler),this.ws.removeEventListener("error",this.onErrorHandler),this.ws=null,this.readyState=WebSocket.CLOSED,this.readyState$.next(this.readyState),this.log(new Date,"WS","onclose",this.url),this.onclose(t),setTimeout(()=>this.connect(),this.reconnectInterval),this.stopPinging())};onMessageHandler=t=>{if(this.recordActivity(),"pong"===t.data)return void this.log(new Date,"WS","pong received");if("ping"===t.data)return this.log(new Date,"WS","ping received"),void this.send("pong");const e=(t,e=0,n)=>{const o=void 0!==n?new Uint8Array(t,e,n):new Uint8Array(t,e);try{let t=unpack(o);t=this.convertUTCDateToLocalDate(t),this.onmessage(t)}catch(t){this.log(new Date,"WS","failed to unpack payload",t);try{const t=(new TextDecoder).decode(o),e=JSON.parse(t),n=this.convertUTCDateToLocalDate(e);this.onmessage(n)}catch(t){this.log(new Date,"WS","unable to fallback decode payload",t)}}};if(t.data instanceof ArrayBuffer)e(t.data);else if(ArrayBuffer.isView(t.data)){const n=t.data;e(n.buffer,n.byteOffset,n.byteLength)}else if(t.data instanceof Blob)t.data.arrayBuffer().then(t=>e(t)).catch(t=>this.log(new Date,"WS","failed to decode blob payload",t));else if("string"==typeof t.data)try{const e=JSON.parse(t.data),n=this.convertUTCDateToLocalDate(e);this.onmessage(n)}catch(e){this.log(new Date,"WS","failed to parse text payload",e),this.onmessage(this.convertUTCDateToLocalDate(t.data))}else this.log(new Date,"WS","unsupported message type",typeof t.data,t.data)};onErrorHandler=t=>{this.log(new Date,"WS","onerror",this,t),this.onerror(t),this.reconnect()};connect(){!this.ws&&this.readyState!==WebSocket.CONNECTING&&this._storage.get("accessToken")&&(this.readyState=WebSocket.CONNECTING,this.readyState$.next(this.readyState),this.timeout&&clearTimeout(this.timeout),this.ws=new WebSocket(this.url,this.protocols),this.ws.binaryType="arraybuffer",this.onconnecting(),this.log(new Date,"WS","attempt-connect",this.url),this.timeout=setTimeout(()=>{this.log(new Date,"WS","connection-timeout",this.url),this.close()},this.timeoutInterval),this.ws.onopen=this.onOpenHandler,this.ws.onclose=this.onCloseHandler,this.ws.onmessage=this.onMessageHandler,this.ws.onerror=this.onErrorHandler)}convertUTCDateToLocalDate(t){if(Array.isArray(t))return t.map(t=>this.convertUTCDateToLocalDate(t));if(t&&"object"==typeof t)return Object.keys(t).reduce((e,n)=>(e[n]=this.convertUTCDateToLocalDate(t[n]),e),t);if("string"==typeof t){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(t))return new Date(t)}return t}clearPongTimeout(){this.pongTimeout&&(clearTimeout(this.pongTimeout),this.pongTimeout=null)}recordActivity(){this.lastActivity=Date.now(),this.missedPongs=0,this.clearPongTimeout()}schedulePongTimeout(){this.clearPongTimeout(),this.pongTimeout=setTimeout(()=>{this.handleMissedPong()},this.pongTimeoutTime)}handleMissedPong(){this.pongTimeout=null,this.missedPongs++,this.log(new Date,"WS","pong not received",this.missedPongs,"/",this.maxMissedPongs),this.missedPongs>=this.maxMissedPongs&&(this.log(new Date,"WS","max missed pongs reached, closing connection"),this.reconnect())}startPinging(){this.stopPinging(),this.pingInterval=setInterval(()=>{if(!this.isWebSocketActive())return void this.reconnect();Date.now()-this.lastActivity<this.pingIntervalTime||this.pongTimeout||this.send("ping")&&this.schedulePongTimeout()},this.pingIntervalTime)}stopPinging(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null),this.clearPongTimeout(),this.missedPongs=0}convertDatesToUTC(t,e=new WeakSet){"object"!=typeof t||null===t||e.has(t)||(e.add(t),Object.keys(t).forEach(n=>{if(t[n]instanceof Date){let e=t[n];this.timezone&&this.isLocalMidnight(e)&&(e=moment.tz({year:e.getFullYear(),month:e.getMonth(),date:e.getDate()},this.timezone).startOf("day").toDate()),t[n]=moment(e).utc().toDate()}else"object"==typeof t[n]&&null!==t[n]&&this.convertDatesToUTC(t[n],e)}))}isLocalMidnight(t){return 0===t.getHours()&&0===t.getMinutes()&&0===t.getSeconds()&&0===t.getMilliseconds()}send(...t){if(!this.isWebSocketActive())return this.log(new Date,"WS","send error",this.readyState),this.reconnect(),!1;t.forEach(t=>this.convertDatesToUTC(t));const e=1===t.length?t[0]:t;if("string"==typeof e)this.ws.send(e);else{const t=pack(e);this.ws.send(t)}return!0}close(){return!!this.ws&&(this.log(new Date,"WS","closing socket"),this.readyState=WebSocket.CLOSING,this.readyState$.next(this.readyState),this.ws.close(),!0)}reconnect(){this.log(new Date,"WS","reconnect",this.readyState),this.readyState!==WebSocket.CONNECTING&&this.close()}getBufferAmount(){return this.ws?this.ws.bufferedAmount:20480}log(...t){this.debug&&console.log(...t)}handleVisibilityChange=()=>{"visible"===document.visibilityState&&this.handleWindowFocus()};handleWindowFocus=()=>{this.focusReconnectDebounce&&clearTimeout(this.focusReconnectDebounce),this.focusReconnectDebounce=setTimeout(()=>{if(this.focusReconnectDebounce=null,!this.isWebSocketActive())return void this.reconnect();Date.now()-this.lastActivity>this.wakeReconnectThreshold?this.reconnect():this.send("ping")},200)};isWebSocketActive(){return!!this.ws&&this.ws.readyState===WebSocket.OPEN}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketService,deps:[{token:LocalStorageService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:LocalStorageService}]});const isObject$1=t=>t instanceof Object&&"Object"===t.constructor.name;function round(t,e=0){const n=Math.pow(10,e);return Math.round(t*n+1e-6)/n}function toTitleCase(t){return t.replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})}function isUpperCase(t){return/^[A-Z]*$/.test(t)}function pad(t,e){let n=t+"";for(;n.length<e;)n="0"+n;return n}function deepCopy(t){return JSON.parse(JSON.stringify(t),dateReviver)}function dateReviver(t,e){if("string"==typeof e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(e);if(t)return new Date(Date.UTC(+t[1],+t[2]-1,+t[3],+t[4],+t[5],+t[6].split(".")[0],+t[6].split(".")[1]))}return e}function momentTz(t,e){return t?null!=e?moment(e).tz(t):moment.tz(t):null!=e?moment(e):moment()}function dateOnlyStartOfDayTz(t,e){return t?e?t instanceof Date?moment.tz({year:t.getFullYear(),month:t.getMonth(),date:t.getDate()},e).startOf("day").toDate():"object"==typeof t&&t.year&&t.month&&t.day?moment.tz({year:t.year,month:t.month-1,date:t.day},e).startOf("day").toDate():momentTz(e,t).startOf("day").toDate():moment(t).startOf("day").toDate():null}function dateOnlyEndOfDayTz(t,e){return t?e?t instanceof Date?moment.tz({year:t.getFullYear(),month:t.getMonth(),date:t.getDate()},e).endOf("day").toDate():"object"==typeof t&&t.year&&t.month&&t.day?moment.tz({year:t.year,month:t.month-1,date:t.day},e).endOf("day").toDate():momentTz(e,t).endOf("day").toDate():moment(t).endOf("day").toDate():null}function b64toBlobURL(t,e,n){t=t.replace("data:application/pdf;base64,",""),e=e||"",n=n||512;let o=atob(t),r=[];for(let t=0;t<o.length;t+=n){let e=o.slice(t,t+n),i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let a=new Uint8Array(i);r.push(a)}let i=new Blob(r,{type:e});return URL.createObjectURL(i)}function blobToFile(t,e){return t.lastModifiedDate=new Date,t.name=e,t}function toDataURL(t,e){let n=new XMLHttpRequest;n.onload=function(){let t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n.response)},n.open("GET",t),n.responseType="blob",n.send()}function deepDiffDetails(t,e){let n=deepCopy(t),o=deepCopy(e),r=detailedDiff(n,o),i="";const a=t=>t instanceof Date?moment(t).format("llll"):"object"==typeof t&&null!==t?(Object.keys(t).filter(t=>t.startsWith("_id")||t.startsWith("id_")).forEach(e=>{delete t[e]}),JSON.stringify(t)):"string"==typeof t?`"${t}"`:String(t),s=(t,e)=>null===t||null===e||"object"!=typeof t||"object"!=typeof e?`from: ${a(t)} to: ${a(e)}`:Array.isArray(t)||Array.isArray(e)?((t,e)=>{let n=[];const o=Math.max(t.length,e.length);for(let r=0;r<o;r++)t[r]&&!e[r]?n.push(`Removed at index ${r}: ${a(t[r])}`):!t[r]&&e[r]?n.push(`Added at index ${r}: ${a(e[r])}`):t[r]&&e[r]&&JSON.stringify(t[r])!==JSON.stringify(e[r])&&n.push(`Changed at index ${r}: {${s(t[r],e[r])}}`);return n.join(", ")})(Array.isArray(t)?t:[],Array.isArray(e)?e:[]):Object.keys({...t,...e}).filter(t=>!t.startsWith("_id")&&!t.startsWith("id_")).map(n=>{const o=t?t[n]:void 0,r=e?e[n]:void 0;return`${toTitleCase(n)}: ${s(o,r)}`}).join(", ");return["added","deleted","updated"].forEach(t=>{if(Object.keys(r[t]).length>0){const e=Object.keys(r[t]).filter(e=>"added"===t||("deleted"===t?!r.added[e]:!r.added[e]&&!r.deleted[e])).filter(t=>!t.startsWith("_id")&&!t.startsWith("id_")).map(t=>`\n${toTitleCase(t)}: ${s(n[t],o[t])}`).join(",");i+=e?`${e}`:""}}),i}function generateCronStringFromDate(t){return t.getSeconds()+" "+t.getMinutes()+" "+t.getHours()+" "+t.getDate()+" "+(t.getMonth()+1)+" "+t.getDay()}function s2ab(t){let e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let e=0;e!==t.length;++e)n[e]=255&t.charCodeAt(e);return e}function mergeDeep(t,...e){if(!e.length)return t;const n=e.shift();if(isObject$1(t)&&isObject$1(n))for(const e in n)isObject$1(n[e])?(t[e]||Object.assign(t,{[e]:{}}),mergeDeep(t[e],n[e])):Object.assign(t,{[e]:n[e]});return mergeDeep(t,...e)}function applyMongoUpdate(t,e){const n=deepCopy(t);return e&&(e.$rename&&handleRename(t,e.$rename),e.$set&&handleSet(t,e.$set),e.$inc&&handleInc(t,e.$inc),e.$unset&&handleUnset(t,e.$unset),e.$pull&&handlePull(t,n,e.$pull),e.$push&&handlePush(t,e.$push)),t}function handleRename(t,e){for(const n in e){const o=e[n],[r,i]=resolve(t,n),[a,s]=resolve(t,o);r&&1===i.length?a&&1===s.length?(a[s[0]]=r[i[0]],delete r[i[0]]):logError(a,s,t,o):logError(r,i,t,n)}}function handleSet(t,e){for(const n in e){const o=e[n],[r,i]=resolve(t,n,{force:!0});r&&1===i.length?r[i[0]]=o:logError(r,i,t,n)}}function handleInc(t,e){for(const n in e){const o=e[n],[r,i]=resolve(t,n,{force:!0});r&&1===i.length?r[i[0]]=(r[i[0]]||0)+o:logError(r,i,t,n)}}function handleUnset(t,e){for(const n in e){const[e,o]=resolve(t,n);e&&1===o.length?delete e[o[0]]:logError(e,o,t,n)}}function handlePull(t,e,n){for(const o in n){const r=n[o];for(let n of r){const[r,i]=resolve(t,o),[a,s]=resolve(e,o);r&&1===i.length?r[i[0]].splice(a[s[0]].findIndex(t=>JSON.stringify(t)===JSON.stringify(n)),1):logError(r,i,t,o)}}}function handlePush(t,e){for(const n in e){const o=e[n];for(let e of o){const[o,r]=resolve(t,n);o&&1===r.length?o[r[0]].push(e):logError(o,r,t,n)}}}function logError(t,e,n,o){console.log("Error",t+"/"+e+" - couldn't resolve for "+JSON.stringify(n)+" "+o)}function resolve(t,e,n={}){const o=arrize(e);let r=[];o.length>0&&r.unshift(o.pop());let i=t;for(;o.length>0;){const t=o.shift();if(void 0!==i[t])i=i[t];else{if(!n.force){r.unshift(t),r=o.concat(r);break}const e="number"==typeof o[0],a=0===o.length&&"number"==typeof r[0];i[t]=e||a?[]:{},i=i[t]}}return[i,r]}function arrize(t,e="."){return Array.isArray(t)?t.slice():null==t||!1===t||""===t?[]:t.toString().split(e).map(t=>[void 0,null,!1,""].includes(t)?null:t.toString()).filter(t=>null!==t)}class StorageDB{storage=null;database=null;primaryKey=null;secretKey=null;sep="";constructor(t){t=t||{},this.storage=t.storage||window&&window.localStorage,this.database=t.database||"db",this.primaryKey=t.primaryKey||"_id",this.sep=t.sep||":",this.secretKey=t.secretKey||"",isSupported(this.storage)||(this.storage=null)}encryptData(t){const e=JSON.stringify(t);return CryptoJS.AES.encrypt(e,this.secretKey).toString()}decryptData(t){const e=CryptoJS.AES.decrypt(t,this.secretKey);try{const t=e.toString(CryptoJS.enc.Utf8);return JSON.parse(t,dateReviver)}catch(t){return null}}get(t,e){return new Collection(this,t,e)}getCollections(){let t=[];return Object.keys(this.storage).filter(t=>t.split(":").length>2).forEach(e=>{t.some(t=>t===e.split(":")[1])||t.push(e.split(":")[1])}),t}collection(t,e){return this.get(t,e)}}class Collection{name="";storage=null;path="";primaryKey="";cache={};cacheable=!1;db=null;constructor(t,e,n){n=n||{},this.name=e,this.storage=t.storage||new MockStorage,this.path=t.database+t.sep+e+t.sep,this.primaryKey=n.primaryKey||t.primaryKey,this.cache={},this.cacheable=!t.storage,this.db=t}_isQuotaExceeded(t){return!!t&&("QuotaExceededError"===t.name||(22===t.code||1014===t.code||"string"==typeof t.message&&t.message.includes("exceeded the quota")))}_safeSetItem(t,e){try{return this.storage.setItem(t,e),!0}catch(t){if(this._isQuotaExceeded(t))return!1;throw t}}_initCache(){let t={},e=new RegExp("^"+this.path);for(let n of Object.keys(this.storage))if(e.test(n)){const e=this.storage.getItem(n);t[n]=this.db.decryptData(e)}this.cache=t,this.cacheable=!0}_filter(t,e){e.type=e.type||"data",e.multi=e.multi||!1,this.cacheable||this._initCache();let n,o=[],r="id"===e.type;if("string"==typeof t)t=new RegExp(t);else if("function"==typeof t)n=!0;else if(!t){let t=r?Object.keys(this.cache):Object.values(this.cache);return e.multi?t:t[0]||null}for(let i of Object.keys(this.cache)){let a=this.cache[i];if(n){if(t(i,a.data)){let t=r?i:a;if(!e.multi)return t;o.push(t)}}else if(t.test(i)){let t=r?i:a;if(!e.multi)return t;o.push(t)}}return e.multi?o:null}insert(t,e,n){let o=t instanceof Array;if(o){if(0===t.length)return[]}else t=[t];let r=this.primaryKey,i=this.cacheable;for(let n of t){if(!isObject(n))throw new Error("TypeError: insert data must be an object or an object array");void 0===n[r]&&(n[r]=(new ID).toString());let t=new Date,o={offlineDate:t,offlineDateExpires:e||new Date(t.getTime()+6048e5),data:n};const a=this.db.encryptData(o),s=this.path+n[r],l=this._safeSetItem(s,a);i&&l&&(this.cache[s]=o)}return o?t.map(t=>t._id):t[0]._id}find(t,e,n){let o;t=t||{},(e=e||{}).skip=e.skip||0,e.limit=e.limit,e.sort=e.sort;let r=isObject(t)?null:t instanceof Array?t:[t],i={type:e._filterType||"data",multi:!0};if(r){let t=new RegExp("^"+this.path+"("+r.join("|")+")$");o=this._filter(t,i)}else o=Object.keys(t).length?this._filter((e,n)=>queryMatch(t,n),i):this._filter(null,i);return n||(o=o.map(t=>t.data)),e.sort&&o.sort((t,n)=>sortCompare(e.sort,t,n)),e.limit?o=o.slice(e.skip,e.skip+e.limit):e.skip&&(o=o.slice(e.skip)),o}findOne(t,e){let n;e=e||{};let o=isObject(t=t||{})?null:t,r=isObject(t)?Object.keys(t):[],i=!1,a=!!e.sort,s={type:e._filterType||"data",multi:!1};if(r.length&&r.includes(this.primaryKey)&&(o=t[this.primaryKey],i=!0),o){if(n=this.storage.getItem(this.path+o),n=n?this.db.decryptData(n).data:null,n&&i&&!queryMatch(t,n))return null}else r.length?a?n=this.find(t,e):(n=this._filter((e,n)=>queryMatch(t,n),s),Array.isArray(n)?n=n.map(t=>t.data):n&&(n=n.data)):n=a?this.find(t,e):this._filter(null,s);return!o&&a&&n&&(n=n[0].data||null),n&&"id"===s.type&&(n=this.path+n[this.primaryKey]),n}remove(t,e){if(!t)throw new Error("remove needs a query");(e=e||{}).multi=void 0===e.multi||e.multi;let n=e.multi?"find":"findOne",o=null;o="find"===n?this[n](t,{_filterType:"id"},!0):this[n](t,{_filterType:"id"});let r=this.cacheable;if(e.multi&&!o.length||!e.multi&&!o)return 0;e.multi||(o=[o]);for(let t of o)r&&delete this.cache[t],this.storage.removeItem(t);return o.length}update(t,e,n){if(!t)throw new Error("update needs a query");if(!e||!isObject(e))throw new Error("update needs an object");(n=n||{}).multi=void 0!==n.multi&&n.multi;let o=this[n.multi?"find":"findOne"](t,{_filterType:"id"}),r=this.primaryKey,i=this.cacheable;if(n.multi&&!o.length||!n.multi&&!o)return 0;if(n.multi){if(delete e[r],!Object.keys(e).length)return 0;let t=0;for(let n of o){let o=i?this.cache[n]:this.db.decryptData(this.storage.getItem(n)),r=Object.assign({},o.data,e),a={offlineDate:o.offlineDate,offlineDateExpires:o.offlineDateExpires,data:r};const s=this.db.encryptData(a);this._safeSetItem(n,s)&&(i&&(this.cache[n]=a),t+=1)}return t}{let t=o,n=i?this.cache[t]:this.db.decryptData(this.storage.getItem(t)),a=e[r]&&e[r]!==n.data[r],s=a?this.path+e[r]:t;if(a&&this.findOne(e[r]))throw new Error("Duplicate value '"+e[r]+"' for unique field '"+r+"'");let l=Object.assign({},n.data,e),c={offlineDate:n.offlineDate,offlineDateExpires:n.offlineDateExpires,data:l};const d=this.db.encryptData(c);return this._safeSetItem(s,d)?(i&&(this.cache[s]=c,a&&delete this.cache[t]),a&&this.storage.removeItem(t),l):n.data}}drop(){return this.remove({}),!0}}class ID{constructor(){}toString(){return((new Date).getTime()/1e3).toString(16).substr(-4)+Math.random().toString(16).substr(2,12)}}class MockStorage{length=0;constructor(){this.length=0}key(){}setItem(){}getItem(){}removeItem(){}}const isSupported=t=>{if(!(t&&t instanceof Object))return!1;try{return t.setItem("_supported","1"),t.removeItem("_supported"),!0}catch(t){return!1}},isObject=t=>t instanceof Object&&"Object"===t.constructor.name,queryMatch=(t,e)=>{if(!t||!Object.keys(t).length)return!0;for(let n of Object.keys(t)){let o=t[n];if("$or"===n&&Array.isArray(o))return o.some(t=>queryMatch(t,e));if("$and"===n&&Array.isArray(o))return o.every(t=>queryMatch(t,e));if("$in"===n&&Array.isArray(o))return o.includes(e);if("$nin"===n&&Array.isArray(o))return!o.includes(e);if("$exists"===n&&"boolean"==typeof o)return o?void 0!==e:void 0===e;let r=e[n];if(r||n.split(".").forEach(t=>{r=r?r[t]:e[t]}),o instanceof RegExp){if(!o.test(r))return!1}else if(isObject(o)){for(let t of Object.keys(o))if(Operator._checkExist(t)&&!Operator[t](o[t],r))return!1}else if(o!==r)return!1}return!0},sortCompare=(t,e,n,o,r)=>{o=o||0;let i=(r=r||Object.keys(t))[o];return i?e[i]===n[i]?(o++,sortCompare(t,e,n,o,r)):1===t[i]?e[i]-n[i]:-1===t[i]?n[i]-e[i]:void 0:0},ops=["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin"],isNotNumber=t=>"number"!=typeof t;class Operator{static $eq(t,e){return e===t}static $gt(t,e){if(isNotNumber(t))throw new Error("'$gt' value must be a number");return e>t}static $gte(t,e){if(isNotNumber(t))throw new Error("'$gte' value must be a number");return e>=t}static $lt(t,e){if(isNotNumber(t))throw new Error("'$lt' value must be a number");return e<t}static $lte(t,e){if(isNotNumber(t))throw new Error("'$lte' value must be a number");return e<=t}static $ne(t,e){return e!==t}static $in(t,e){if(!(t instanceof Array))throw new Error("'$in' value must be an array");return t.includes(e)}static $nin(t,e){if(!(t instanceof Array))throw new Error("'$nin' value must be an array");return!t.includes(e)}static $exists(t,e){return t?void 0!==e:void 0===e}static $regex(t,e){if(!(t instanceof RegExp))throw new Error("'$regex' value must be a RegExp");return t.test(e)}static _checkExist(t){if(["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin","$exists","$regex"].includes(t))return!0;throw new Error("unknown operator: '"+t+"'")}}class OfflineManagerService{_storage;storageInitialized=new BehaviorSubject(!1);offlineMode=new BehaviorSubject(!0);_offlineDB;constructor(t){this._storage=t}initStorage(t){this._offlineDB=new StorageDB({storage:window.localStorage,database:"offlineDB",primaryKey:"_id",secretKey:t}),this._offlineDB.getCollections().forEach(t=>{let e=this.find(t,{},{},!0);e.some(t=>!t)?this.dropCollection(t):e.forEach(e=>{e&&e.offlineDateExpires&&"function"==typeof e.offlineDateExpires.getTime&&Date.now()>=e.offlineDateExpires.getTime()&&this.removeDocument(t,e.data._id)})});let e=this._storage.get("user");if(e){if(null===this._offlineDB.decryptData(e)){const t=this._offlineDB.encryptData(e);this._storage.set("user",t)}}let n=this._storage.get("lastURL");if(n){if(null===this._offlineDB.decryptData(n)){const t=this._offlineDB.encryptData(n);this._storage.set("lastURL",t)}}let o=this._storage.get("accessToken");if(o){if(null===this._offlineDB.decryptData(o)){const t=this._offlineDB.encryptData(o);this._storage.set("accessToken",t)}}let r=this._storage.get("refreshToken");if(r){if(null===this._offlineDB.decryptData(r)){const t=this._offlineDB.encryptData(r);this._storage.set("refreshToken",t)}}this.storageInitialized.next(!0)}getStorage(){return this._offlineDB}setOffline(t){this.offlineMode.next(t)}saveUser(t){return this._storage.set("user",this._offlineDB.encryptData(t))}getUser(){return this._storage.get("user")?this._offlineDB.decryptData(this._storage.get("user")):null}removeUser(){this._storage.remove("user")}find(t,e,n={},o=!1){const r=this._offlineDB.get(t);return r?r.find(e,n,o):[]}findOne(t,e){const n=this._offlineDB.get(t);return n?n.findOne(e):null}insertDocument(t,e,n){const o=this._offlineDB.get(t);let r="";return o&&e&&(!Array.isArray(e)||e.length)&&(r=o.insert(e,n)),r}updateDocument(t,e){const n=this._offlineDB.get(t);if(n){if(n.findOne({_id:e._id}))return e.__v+=1,n.update(e._id,e),1}return 0}updateDocumentProps(t,e,n,o){const r=this._offlineDB.get(t);if(r){let t=r.findOne({_id:e});if(t)return n.forEach(e=>{t[e.prop]=e.data}),t.__v+=1,r.update({_id:e},t),1}return 0}removeDocument(t,e){const n=this._offlineDB.get(t);n&&n.remove(e)}dropCollection(t){this._offlineDB.get(t).drop()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:OfflineManagerService,deps:[{token:LocalStorageService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:OfflineManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:OfflineManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:LocalStorageService}]});class TokenManagerService{_storage;_offline;constructor(t,e){this._storage=t,this._offline=e}getToken(t){let e=this._storage.get(t);if(e){const t=this._offline.getStorage();if(!t||"function"!=typeof t.decryptData)return e;const n=t.decryptData(e);return null===n?e:n}return null}setToken(t,e){const n=this._offline.getStorage();n&&"function"==typeof n.encryptData?this._storage.set(t,n.encryptData(e)):this._storage.set(t,e)}removeToken(t){null!==this.getToken(t)&&this._storage.remove(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TokenManagerService,deps:[{token:LocalStorageService},{token:OfflineManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TokenManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TokenManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:LocalStorageService},{type:OfflineManagerService}]});class SocketManagerService{_socket;_offline;_alert;_router;_token;socketStatus;messageId=0;_cbMap=new Map;_subMap=new Map;_subKeyMap=new Map;_offlineUpdates=[];_pendingMessages=[];_sendTimeout=null;_currentLockId="";_chunkAssemblies=new Map;_chunkProgressThresholdBytes=5242880;_chunkTextDecoder=new TextDecoder;_connectionDelayTimeout=null;onerror=function(){};constructor(t,e,n,o,r){this._socket=t,this._offline=e,this._alert=n,this._router=o,this._token=r}getSubArray(){return Array.from(this._subMap.values())}initSocketManager(){this._socket.readyState$.subscribe(t=>{this.socketStatus=t}),this._socket.onmessage=t=>{this.handleMessage(t)},this._socket.onopen=t=>{this._connectionDelayTimeout=setTimeout(async()=>{if(this._connectionDelayTimeout=null,this._offline.setOffline(!1),this._subMap.forEach(t=>{this.send(t.messageRoute,new Date,t.messageId,"subscription","sub",t.subscription,...t.parameters)}),!await this.acquireLock("processingOfflineUpdates"))return;let t=this._offline.find("collectionOffline",{}).sort((t,e)=>t.date.getTime()-e.date.getTime()),e=this._offline.find("methodOffline",{}).sort((t,e)=>t.date.getTime()-e.date.getTime());t.length||e.length?(t.forEach(t=>{let e=this.messageId++;this._offlineUpdates.push({id_offline_doc:t._id,messageId:e,type:"collectionOffline"}),t.data[2]=e,"updateDocument"===t.type?(t.data[4]="updateDocumentOffline",t.data[0]="Offline - "+t.data[0]):"updateDocumentProps"===t.type?(t.data[4]="updateDocumentPropsOffline",t.data[0]="Offline - "+t.data[0]):t.data[0]="Offline - "+t.data[0]}),e.forEach(t=>{let e=this.messageId++;this._offlineUpdates.push({id_offline_doc:t._id,messageId:e,type:"methodOffline"}),t.data[2]=e,t.data[0]="Offline - "+t.data[0]}),this.send("Offline Updates",new Date,this.messageId++,"offline",t.concat(e).sort((t,e)=>t.date.getTime()-e.date.getTime()))):this.releaseLock("processingOfflineUpdates")},100)},this._socket.onerror=t=>{this._connectionDelayTimeout&&clearTimeout(this._connectionDelayTimeout),console.log(new Date,"SOCKET ERROR",t),this.onerror()},this._socket.onclose=t=>{this._connectionDelayTimeout&&clearTimeout(this._connectionDelayTimeout),this._chunkAssemblies.forEach(t=>this.dismissChunkAlert(t)),this._chunkAssemblies.clear()}}handleMessage(t){for(let e of t)this.processReceivedMessage(e)}async acquireLock(t,e=6e4,n=100){let o=Date.now(),r=this.generateUniqueId(),i=JSON.stringify({lockId:r,timestamp:o}),a=this._token.getToken(t);if(a){let{lockId:n,timestamp:r}=JSON.parse(a);if(!(o>r+e))return!1;this._token.setToken(t,i)}else this._token.setToken(t,i);await this.sleep(n);let s=this._token.getToken(t);if(s){let{lockId:t,timestamp:n}=JSON.parse(s);if(t===r&&o<=n+e)return this._currentLockId=r,!0}return!1}sleep(t){return new Promise(e=>setTimeout(e,t))}releaseLock(t){let e=this._token.getToken(t);if(e){let{lockId:n}=JSON.parse(e);n===this._currentLockId&&this._token.removeToken(t)}}generateUniqueId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}processReceivedMessage(t){if(this.handleChunkedPayload(t))return;let e=this._offlineUpdates.findIndex(e=>e.messageId===t.messageId);if(e>=0&&(this._offline.removeDocument(this._offlineUpdates[e].type,this._offlineUpdates[e].id_offline_doc),this._offlineUpdates.splice(e,1),this._offlineUpdates.length||this.releaseLock("processingOfflineUpdates")),"ACK"!==t.data&&"NACK"!==t.data){const e=this._cbMap.get(t.messageId);if(e)return e.cb?(e.cb(t.hasError?t.data:null,t.hasError?null:t.data),e.resolveFn(t.hasError?t.data:null)):t.hasError?e.rejectFn(t.data):e.resolveFn(t.data),void this._cbMap.delete(t.messageId);const n=this._subMap.get(t.messageId);n&&n.subject.next(t.data)}}handleChunkedPayload(t){const e=t&&t.data;if(!e||"object"!=typeof e||!e.__chunked)return!1;const n=e.chunkId;if(!n)return!0;if("start"===e.chunkStatus)return this._chunkAssemblies.set(n,this.createChunkAssembly(n,t,e)),!0;const o=this._chunkAssemblies.get(n);if(!o)return!0;if("chunk"===e.chunkStatus)return this.appendChunkPayload(o,e),this.emitChunkProgress(o),!0;if("end"===e.chunkStatus){if(o.totalChunks&&o.receivedChunks!==o.totalChunks)return this.handleChunkFailure(o,"Incomplete chunk sequence"),this._chunkAssemblies.delete(n),!0;const e=this.tryDecodeChunkBuffer(o,!0);return void 0===e?(this.handleChunkFailure(o,"Failed to decode chunk payload"),this._chunkAssemblies.delete(n),!0):(t.data=e,this.dismissChunkAlert(o),this._chunkAssemblies.delete(n),!1)}return!0}createChunkAssembly(t,e,n){const o=n.totalBytes||0,r={chunkId:t,messageId:e.messageId,hasError:!!e.hasError,encoding:"msgpack"===n.encoding?"msgpack":"json",totalChunks:n.totalChunks||0,totalBytes:o,buffer:o?new Uint8Array(o):new Uint8Array(0),filledBytes:0,receivedChunks:0,targetType:null,showProgress:!1,lastPercent:-1},i=this._subMap.get(e.messageId);if(i)r.targetType="subscription",r.subscription=i;else{const t=this._cbMap.get(e.messageId);t&&(r.targetType="callback",r.callback=t)}return this.initializeChunkProgress(r),r}initializeChunkProgress(t){this.shouldShowChunkProgress(t)&&(t.showProgress=!0,t.lastPercent=-1,this.updateChunkProgress(t,!0))}shouldShowChunkProgress(t){return t.totalBytes?t.totalBytes>=this._chunkProgressThresholdBytes:t.totalChunks>1}appendChunkPayload(t,e){const n=this.extractChunkBytes(e,t.encoding);if(n&&n.byteLength){if(t.buffer&&t.buffer.byteLength>=t.filledBytes+n.byteLength)t.buffer.set(n,t.filledBytes);else if(t.buffer&&t.buffer.byteLength){const e=new Uint8Array(t.filledBytes+n.byteLength);e.set(t.buffer.subarray(0,t.filledBytes),0),e.set(n,t.filledBytes),t.buffer=e,t.totalBytes=t.buffer.byteLength}else t.buffer=new Uint8Array(n),t.totalBytes=t.buffer.byteLength;t.filledBytes+=n.byteLength,t.receivedChunks++,this.updateChunkProgress(t)}}updateChunkProgress(t,e=!1){if(!t.showProgress&&!e)return;if(!t.showProgress&&this.shouldShowChunkProgress(t))t.showProgress=!0;else if(!t.showProgress)return;const n=this.getChunkProgressPercent(t);if(null===n)return;if(!e){if(t.lastPercent>=n)return;if(t.lastPercent>=0&&n<100&&n-t.lastPercent<5)return}t.lastPercent=n;const o=this.buildChunkProgressMessage(t,n);t.alertToast?this.updateChunkAlertMessage(t.alertToast,o):(t.alertToast=this._alert.setAlert("update",o,0),this.configureChunkAlert(t.alertToast))}emitChunkProgress(t){if("subscription"!==t.targetType||!t.subscription)return;if(t.totalChunks&&t.receivedChunks>=t.totalChunks)return;const e=this.tryDecodeChunkBuffer(t,!1);void 0!==e&&t.subscription.subject.next(e)}handleChunkFailure(t,e){const n={chunkId:t.chunkId,message:e};if(console.error(new Date,"WEBSOCKET CHUNK",e,t.chunkId),this.dismissChunkAlert(t),"subscription"===t.targetType&&t.subscription)return void t.subscription.subject.error(n);const o=this._cbMap.get(t.messageId);o&&(o.cb&&o.cb(n,null),o.rejectFn?o.rejectFn(n):o.resolveFn&&o.resolveFn(n),this._cbMap.delete(t.messageId))}tryDecodeChunkBuffer(t,e){if(t.buffer&&t.filledBytes)try{const e=t.filledBytes===t.buffer.byteLength?t.buffer:t.buffer.subarray(0,t.filledBytes);if("msgpack"===t.encoding)return unpack(e);const n=this._chunkTextDecoder.decode(e);return JSON.parse(n,dateReviver)}catch(n){return void(e&&console.error(new Date,"WEBSOCKET CHUNK","Failed to decode chunk payload",t.chunkId,n))}}extractChunkBytes(t,e){return"msgpack"===e?this.ensureUint8Array(t.payload):"string"==typeof t.payload?this.base64ToUint8Array(t.payload):null}ensureUint8Array(t){return t?t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)?new Uint8Array(t):"string"==typeof t?this.base64ToUint8Array(t):null:null}base64ToUint8Array(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}dismissChunkAlert(t){t.alertToast&&(this._alert.clearAlert(t.alertToast.toastId),t.alertToast=void 0),t.showProgress=!1,t.lastPercent=-1}getChunkProgressPercent(t){if(t.totalBytes){const e=Math.min(t.filledBytes,t.totalBytes);return Math.min(100,Math.floor(e/t.totalBytes*100))}if(t.totalChunks){const e=Math.min(t.receivedChunks,t.totalChunks);return Math.min(100,Math.floor(e/t.totalChunks*100))}return null}buildChunkProgressMessage(t,e){const n=t.totalBytes,o=n?Math.min(t.filledBytes,n):0;if(n)return`Downloading data (${e}% • ${this.formatBytes(o)} of ${this.formatBytes(n)})`;if(t.totalChunks){return`Downloading data (${e}% • chunk ${Math.min(t.receivedChunks,t.totalChunks)} of ${t.totalChunks})`}return`Downloading data (${e}%)`}formatBytes(t){if(!t)return"0 B";const e=["B","KB","MB","GB","TB"],n=Math.min(e.length-1,Math.floor(Math.log(t)/Math.log(1024))),o=t/Math.pow(1024,n);return`${o>=10?o.toFixed(0):o.toFixed(1)} ${e[n]}`}configureChunkAlert(t){t&&(t.message=t.message||"",t.portal?.instance&&(t.portal.instance.options.disableTimeOut=!0,t.portal.instance.options.tapToDismiss=!0,t.portal.instance.options.closeButton=!1,t.portal.instance.message=t.message),t.toastRef?.componentInstance&&(t.toastRef.componentInstance.options.disableTimeOut=!0,t.toastRef.componentInstance.options.tapToDismiss=!0,t.toastRef.componentInstance.options.closeButton=!1,t.toastRef.componentInstance.message=t.message))}updateChunkAlertMessage(t,e){t.message=e,t.portal?.instance&&(t.portal.instance.message=e),t.toastRef?.componentInstance&&(t.toastRef.componentInstance.message=e)}openSocket(t,e){this._socket.openSocket(t,e)}closeSocket(){this._token.removeToken("accessToken"),this._socket.close()}resolveCurrentRoute(){const t=this._router?.url||"";return t.includes("?")?t.substring(0,t.indexOf("?")):t}buildSubscriptionKey(t,e,n){let o="";try{o=JSON.stringify(n??[])}catch{o=String(n??"")}return`${t}::${e}::${o}`}sendUnsubscribe(t,e,n,o){this.send(t,new Date,e,"subscription","unsub",n,...o)}releaseSharedSubscription(t){const e=this._subKeyMap.get(t);e&&(e.refCount-=1,e.refCount>0||(this._subKeyMap.delete(t),this.sendUnsubscribe(e.messageRoute,e.messageId,e.subscription,e.parameters),this._subMap.delete(e.messageId)))}call(t,...e){let n=null,o=null,r=new Promise((t,e)=>{n=t,o=e}),i=this.messageId++;const a=e[e.length-1]&&"function"==typeof e[e.length-1]?e.pop():null;this._cbMap.set(i,{messageId:i,cb:a,resolveFn:n,rejectFn:o,retryCnt:0});let s=e.length;for(;(void 0===e[e.length-1]||null===e[e.length-1])&&s>0;)e.pop(),s=e.length;return this.send(this._router.url.includes("?")?this._router.url.substring(0,this._router.url.indexOf("?")):this._router.url,new Date,i,"method",t,...e),r}subscribe(t,...e){const n=deepCopy(e),o=this.resolveCurrentRoute(),r=this.buildSubscriptionKey(o,t,n),i=this._subKeyMap.get(r);if(i)return i.refCount+=1,i.subject.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));const a=new ReplaySubject(1),s=this.messageId++,l={key:r,messageId:s,messageRoute:o,subscription:t,parameters:n,subject:a,refCount:1};this._subMap.set(s,l),this._subKeyMap.set(r,l);const c=a.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));return this.send(o,new Date,s,"subscription","sub",t,...n),c}subscribeBypassRoute(t,...e){const n=deepCopy(e),o="Bypass",r=this.buildSubscriptionKey(o,t,n),i=this._subKeyMap.get(r);if(i)return i.refCount+=1,i.subject.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));const a=new ReplaySubject(1),s=this.messageId++,l={key:r,messageId:s,messageRoute:o,subscription:t,parameters:n,subject:a,refCount:1};this._subMap.set(s,l),this._subKeyMap.set(r,l);const c=a.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));return this.send("Bypass",new Date,s,"subscription","sub",t,...n),c}unsubscribe(t,e,...n){this.send(this.resolveCurrentRoute(),new Date,t,"subscription","unsub",e,...n)}send(...t){this.socketStatus===WebSocket.OPEN?(this._pendingMessages.push(t),this._sendTimeout||(this._sendTimeout=setTimeout(()=>{this._sendTimeout=null;const t=[...this._pendingMessages];this._pendingMessages=[],this._socket.send(t)},25))):"method"===t[3]&&this.handleOfflineMethod(t)}handleOfflineMethod(t){if("insertDocument"===t[4]){if("driver-gps"===t[5])return;this._alert.setAlert("warning","This insert command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"insert",data:t,date:new Date});let e=this._offline.insertDocument(t[5],t[6]),n=this._cbMap.get(t[2]);n&&n.cb&&(n.cb(null,e),this._cbMap.delete(t[2]))}else if("updateDocument"===t[4]){this._alert.setAlert("warning","This update command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"updateDocument",data:t,date:new Date}),this._offline.findOne(t[5],{_id:t[6]._id})?this._offline.updateDocument(t[5],t[6]):console.log("Could not find Offline data",t[5],t[6]);let e=this._cbMap.get(t[2]);e&&e.cb&&(e.cb(null,1),this._cbMap.delete(t[2]))}else if("updateDocumentProps"===t[4]){this._alert.setAlert("warning","This update command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"updateDocumentProps",data:t,date:new Date}),this._offline.findOne(t[5],{_id:t[6]})?this._offline.updateDocumentProps(t[5],t[6],t[7],t[8]):console.log("Could not find Offline data",t[5],t[6]);let e=this._cbMap.get(t[2]);e&&e.cb&&(e.cb(null,1),this._cbMap.delete(t[2]))}else if("removeDocument"===t[4]){this._alert.setAlert("warning","This remove command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"removeDocument",data:t,date:new Date}),this._offline.findOne(t[5],{_id:t[6]})?this._offline.removeDocument(t[5],t[6]):console.log("Could not find Offline data",t[5],t[6]);let e=this._cbMap.get(t[2]);e&&e.cb&&(e.cb(null,1),this._cbMap.delete(t[2]))}else t[0].includes("/dashboard/driver/")&&this._offline.insertDocument("methodOffline",{type:t[4],data:t,date:new Date})}getStatus(){return this._socket.readyState$}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketManagerService,deps:[{token:SocketService},{token:OfflineManagerService},{token:AlertService},{token:i1$1.Router},{token:TokenManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:SocketService},{type:OfflineManagerService},{type:AlertService},{type:i1$1.Router},{type:TokenManagerService}]});class AccountManagerService{_router;_socket;_token;_http;_alert;_offline;user=new BehaviorSubject(null);initCompleted=new BehaviorSubject(!1);loginCompleted=new BehaviorSubject(!1);publicClient=new BehaviorSubject(null);user$;environment=null;publicTokenKey="publicToken";publicActivityKey="publicTokenActivity";publicSessionMaxIdleMs=36e5;publicActivityThrottleMs=15e3;publicActivityListenerBound=!1;publicActivityInterval=null;lastPublicActivityWrite=0;constructor(t,e,n,o,r,i){this._router=t,this._socket=e,this._token=n,this._http=o,this._alert=r,this._offline=i}normalizeUser(t){if(!t)return null;const e=t.roles||{},n={...e,super_admin:!!e.super_admin,approvals:Array.isArray(e.approvals)?e.approvals:[],groups:Array.isArray(e.groups)?e.groups:[],notifications:Array.isArray(e.notifications)?e.notifications:[],miscs:Array.isArray(e.miscs)?e.miscs:[]},o=t.other&&"object"==typeof t.other?t.other:{};return{...t,roles:n,other:o}}initLoginManager(t){this.environment=t,this._offline.storageInitialized.subscribe(t=>{this._socket.initSocketManager(),this.initPublicSessionTracking();let e=this._token.getToken("refreshToken");e?(this.initLogin(e),setInterval(()=>{e=this._token.getToken("refreshToken"),this.initLogin(e)},3e3)):this.initCompleted.next(!0)})}initPublicSessionTracking(t={}){if("number"==typeof t.maxIdleMs&&t.maxIdleMs>0&&(this.publicSessionMaxIdleMs=t.maxIdleMs),"number"==typeof t.throttleMs&&t.throttleMs>0&&(this.publicActivityThrottleMs=t.throttleMs),!this.publicActivityListenerBound&&"undefined"!=typeof window){const t=()=>this.touchPublicSession();window.addEventListener("click",t,{passive:!0}),window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("keydown",t,{passive:!0}),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("touchstart",t,{passive:!0}),this.publicActivityListenerBound=!0}this.publicActivityInterval&&clearInterval(this.publicActivityInterval);const e="number"==typeof t.checkIntervalMs&&t.checkIntervalMs>0?t.checkIntervalMs:6e4;this.publicActivityInterval=setInterval(()=>this.enforcePublicSession(),e),this.restorePublicSession()}initLogin(t){if(navigator.onLine)this._offline.offlineMode.getValue()&&(this._offline.setOffline(!1),this.getAccessToken(t));else if(!this._offline.offlineMode.getValue()||!this.initCompleted.getValue()){this.closeSocket(),this._offline.setOffline(!0);let t=this._offline.getUser();t&&this.setUser(t),this.initCompleted.getValue()||this.initCompleted.next(!0)}}getAccessToken(t){t&&this._http.post(this.environment.SERVER_URL+"/accessToken",{refreshToken:t}).toPromise().then(t=>{t.error?this.initCompleted.next(!0):(this._token.setToken("accessToken",t.result.token),this.setUser(t.result.user),this.openSocket(t.result.token),this.user$&&this.user$.unsubscribe(),this.user$=this._socket.subscribeBypassRoute("userWithId",t.result.user._id).subscribe(t=>{t&&(this.user.getValue()&&this.user.getValue()._id!==t._id?this._socket.call("incorrectUser",this.user.getValue(),t,this._socket.getSubArray()):(this.setUser(t),this.loginCompleted.next(!0),this.initCompleted.next(!0),this._offline.saveUser(t)))}))},t=>{this.initCompleted.next(!0)})}logIn(t,e){return new Promise((n,o)=>{this._http.post(this.environment.SERVER_URL+"/login",{username:t,password:e}).toPromise().then(t=>{t.error?(this._alert.setAlert("error",t.result),o(t.result)):(this._token.setToken("refreshToken",t.result.token),this.getAccessToken(t.result.token),n(t.result.token))},t=>{})})}publicLogIn(t,e){return new Promise((n,o)=>{this._http.post(this.environment.SERVER_URL+"/public/login",{email:t,password:e}).toPromise().then(t=>{t?.error?(this._alert.setAlert("error",t.result||"Unable to sign in"),o(t.result||"Unable to sign in")):(t?.result?.token&&(this._token.setToken(this.publicTokenKey,t.result.token),this.touchPublicSession(!0)),t?.result?.client&&this.publicClient.next(t.result.client),n(t.result))},()=>{this._alert.setAlert("error","Unable to sign in"),o("Unable to sign in")})})}publicRegister(t){return new Promise((e,n)=>{this._http.post(this.environment.SERVER_URL+"/public/register",t).toPromise().then(t=>{t?.error?(this._alert.setAlert("error",t.result||"Unable to create account"),n(t.result||"Unable to create account")):(t?.result?.token&&(this._token.setToken(this.publicTokenKey,t.result.token),this.touchPublicSession(!0)),t?.result?.client&&this.publicClient.next(t.result.client),e(t.result))},()=>{this._alert.setAlert("error","Unable to create account"),n("Unable to create account")})})}publicFetchMe(){return new Promise((t,e)=>{if(this.isPublicSessionExpired())return this.publicLogOut(),void e("No session");const n=this._token.getToken(this.publicTokenKey);if(!n)return this.publicClient.next(null),void e("No session");const o=new HttpHeaders({Authorization:`Bearer ${n}`});this._http.get(this.environment.SERVER_URL+"/public/me",{headers:o}).toPromise().then(n=>{n?.error?(this.publicClient.next(null),e(n.result||"Unable to load session")):(this.publicClient.next(n.result?.client||null),this.touchPublicSession(),t(n.result))},()=>{e("Unable to load session")})})}publicFetchDashboard(){return new Promise((t,e)=>{if(this.isPublicSessionExpired())return this.publicLogOut(),void e("No session");const n=this._token.getToken(this.publicTokenKey);if(!n)return void e("No session");const o=new HttpHeaders({Authorization:`Bearer ${n}`});this._http.get(this.environment.SERVER_URL+"/public/dashboard",{headers:o}).toPromise().then(n=>{n?.error?e(n.result||"Unable to load dashboard"):(this.touchPublicSession(),t(n.result))},()=>{e("Unable to load dashboard")})})}publicLogOut(){this._token.removeToken(this.publicTokenKey),this._token.removeToken(this.publicActivityKey),this.publicClient.next(null)}restorePublicSession(){if(this.publicClient.getValue())return;this._token.getToken(this.publicTokenKey)&&(this.isPublicSessionExpired()?this.publicLogOut():(this.touchPublicSession(!0),this.publicFetchMe().catch(()=>{})))}enforcePublicSession(){this.isPublicSessionExpired()&&this.publicLogOut()}isPublicSessionExpired(){if(!this._token.getToken(this.publicTokenKey))return!1;const t=this.getPublicActivityTimestamp();return!!t&&Date.now()-t>this.publicSessionMaxIdleMs}getPublicActivityTimestamp(){const t=this._token.getToken(this.publicActivityKey);if(!t)return 0;const e=Number(t);return Number.isFinite(e)?e:0}touchPublicSession(t=!1){if(!this._token.getToken(this.publicTokenKey))return;const e=Date.now();!t&&e-this.lastPublicActivityWrite<this.publicActivityThrottleMs||(this.lastPublicActivityWrite=e,this._token.setToken(this.publicActivityKey,String(e)))}logIn365(t){return new Promise((e,n)=>{this._http.post(this.environment.SERVER_URL+"/login365",{id_token:t}).toPromise().then(t=>{t.error?(this._alert.setAlert("error",t.result),n(t.result)):(this._token.setToken("refreshToken",t.result.token),this.getAccessToken(t.result.token),e(t.result.token))},t=>{})})}resetUserPassword(t){return new Promise((e,n)=>{this._http.post(this.environment.SERVER_URL+"/resetPassword",{username:t}).toPromise().then(t=>{e(!0)},t=>{})})}logOut(){return new Promise((t,e)=>{this._router.navigateByUrl("/home"),setTimeout(()=>{this.setUser(null),this._token.removeToken("refreshToken"),this._offline.removeUser(),this.closeSocket(),t(!0)},500)})}openSocket(t){this._socket.openSocket(this.environment,[t])}closeSocket(){this._socket.closeSocket()}setUser(t){this.user.next(this.normalizeUser(t))}getUser(){return this.user.getValue()}getSocketStatus(){return this._socket.getStatus()}isUserInView(t){let e=!1;if(this.isUserSuperAdmin())return!0;let n=this.user.getValue();if(n&&n.roles){const o=Array.isArray(n.roles.groups)?n.roles.groups:[],r=Array.isArray(n.roles.miscs)?n.roles.miscs:[];o.forEach(n=>{n.views.filter(e=>e.startsWith(t)).length&&(e=!0)}),r.filter(e=>e.startsWith(t)).length&&(e=!0),o.filter(e=>e.name===t).length&&(e=!0)}return e}isUserSuperAdmin(){const t=this.user.getValue();return!!(t&&t.roles&&t.roles.super_admin)}isInitCompleted(){return new Promise((t,e)=>{if(this.initCompleted.value)t(!0);else{let e=this.initCompleted.subscribe(n=>{n&&(e.unsubscribe(),t(!0))},()=>{})}})}isLoginCompleted(){return new Promise((t,e)=>{if(this.loginCompleted.value)t(!0);else{let e=this.loginCompleted.subscribe(n=>{n&&(e.unsubscribe(),t(!0))})}})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AccountManagerService,deps:[{token:i1$1.Router},{token:SocketManagerService},{token:TokenManagerService},{token:i4.HttpClient},{token:AlertService},{token:OfflineManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AccountManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AccountManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1$1.Router},{type:SocketManagerService},{type:TokenManagerService},{type:i4.HttpClient},{type:AlertService},{type:OfflineManagerService}]});class ValidationService{constructor(){}wholeNumbersAllowNegative(t){return""===t.value||null===t.value||/^[\-]?\d+$/.test(t.value)?null:{wholeNumbersAllowNegative:{valid:!1}}}wholeNumbersWithZero(t){return""===t.value||null===t.value||/^[0-9]*$/.test(t.value)?null:{wholeNumbersWithZero:{valid:!1}}}wholeNumbersGreaterThanZero(t){return""===t.value||null===t.value||/^[1-9]+[0-9]*$/.test(t.value)?null:{wholeNumbersGreaterThanZero:{valid:!1}}}decimalWithZero(t){return""===t.value||null===t.value||/^\d*\.?\d*$/.test(t.value)?null:{decimalWithZero:{valid:!1}}}decimalGreaterThanZero(t){return""===t.value||null===t.value||/^\s*(?=.*[1-9])\d*(?:\.\d{1,10})?\s*$/.test(t.value)?null:{decimalGreaterThanZero:{valid:!1}}}currency(t){return""===t.value||null===t.value||/^[0-9]\d*(\.\d+)?$/.test(t.value)?null:{currency:{valid:!1}}}currencyGreaterThanZero(t){return""===t.value||null===t.value||/^[0-9]\d*(\.\d+)?$/.test(t.value)&&t.value>0?null:{currency:{valid:!1}}}currencyAllowNegative(t){return""===t.value||null===t.value||/^[\-]?[0-9]\d*(\.\d+)?$/.test(t.value)?null:{currency:{valid:!1}}}phoneNumber(t){return""===t.value||null===t.value||/^1?([2-9])(\d{9})/.test(t.value)?null:{phoneNumber:{valid:!1}}}email(t){return""===t.value||null===t.value||/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t.value)?null:{email:{valid:!1}}}matchPassword(t){let e=t.controls.password,n=t.controls.confirm_password;return e.value&&n.value?e.value===n.value?null:{matchPassword:{isValid:!1}}:null}density(t){return""===t.value||null===t.value||/^[\-]?\d*\.?\d*$/.test(t.value)?null:{density:{valid:!1}}}maxValue(t){return e=>("string"==typeof e.value?parseFloat(e.value):e.value)>t?{maxValue:{max:t}}:null}minValue(t){return e=>("string"==typeof e.value?parseFloat(e.value):e.value)<t?{minValue:{min:t}}:null}multipleOf(t){return e=>("string"==typeof e.value?parseFloat(e.value):e.value)%t!==0?{multipleOf:{value:t}}:null}minLengthArray(t){return e=>e.value&&e.value.length>=t?null:{minLengthArray:{valid:!1}}}maxLengthArray(t){return e=>e.value&&e.value.length<=t?null:{maxLengthArray:{valid:!1}}}validIPAddress(t){return""===t.value||null===t.value||/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(t.value)?null:{validIPAddress:{valid:!1}}}alphaNumericWithDashes(t){return""===t.value||null===t.value||/^[a-zA-Z0-9-_]+$/.test(t.value)?null:{alphaNumericWithDashes:{valid:!1}}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ValidationService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ValidationService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ValidationService,decorators:[{type:Injectable}],ctorParameters:()=>[]});class AwsService{_socket;constructor(t){this._socket=t}dataURItoFile(t,e){let n=atob(t.split(",")[1]),o=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let t=0;t<n.length;t++)i[t]=n.charCodeAt(t);let a=new Blob([r],{type:o});return a.lastModifiedDate=new Date,a.name=e,a}uploadFile(t,e,n,o){return new Promise((r,i)=>{t.size?this.getBase64(t).then(a=>{this._socket.call("uploadFileAndSave",o||t.name,a,t.size,n||-1,e,!0,(t,e)=>{e?r(e):i(t)})}):i("Invalid File")})}getFileWithKey(t,e){this._socket.call("getFile",t,e)}getFileWithId(t,e){this._socket.call("findOne","files",{_id:t},(t,n)=>{this.getFileWithKey(n.key,e)})}deleteFile(t,e){this._socket.call("deleteFile",t,e)}deleteFileWithId(t,e){this._socket.call("findOne","files",{_id:t},(t,n)=>{this.deleteFile(n.key,e)})}deleteFilesWithKeys(t,e){this._socket.call("deleteFiles",t,e)}getBase64(t){return new Promise((e,n)=>{const o=new FileReader;o.readAsDataURL(t),o.onload=()=>e(o.result),o.onerror=t=>n(t)})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AwsService,deps:[{token:SocketManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AwsService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AwsService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:SocketManagerService}]});class BaseComponent{providerService;constructor(t){this.providerService=t}}class ProviderService{_app;_router;_socket;_account;_alert;_vs;_aws;_fb;constructor(t,e,n,o,r,i,a,s){this._app=t,this._router=e,this._socket=n,this._account=o,this._alert=r,this._vs=i,this._aws=a,this._fb=s}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ProviderService,deps:[{token:CoreService},{token:i1$1.Router},{token:SocketManagerService},{token:AccountManagerService},{token:AlertService},{token:ValidationService},{token:AwsService},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ProviderService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ProviderService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:CoreService},{type:i1$1.Router},{type:SocketManagerService},{type:AccountManagerService},{type:AlertService},{type:ValidationService},{type:AwsService},{type:i2.FormBuilder}]});class DialogNotifyContent{activeModal;title;body;handleKeyboardEvent(t){13===t.keyCode&&this.activeModal.close()}constructor(t){this.activeModal=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogNotifyContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DialogNotifyContent,isStandalone:!1,selector:"resolveio-dialog.notify",inputs:{title:"title",body:"body"},host:{listeners:{"document:keypress":"handleKeyboardEvent($event)"}},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-info-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t \t \t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t \t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n ',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogNotifyContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.notify",template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-info-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t \t \t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t \t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n ',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],body:[{type:Input}],handleKeyboardEvent:[{type:HostListener,args:["document:keypress",["$event"]]}]}});class AiFormRegistryService{forms=[];counter=0;registerForm(t){if(!t?.form)return()=>{};const e={id:"ai-form-"+ ++this.counter,...t};return this.forms.push(e),()=>this.unregisterForm(e)}unregisterForm(t){const e="string"==typeof t?t:t?.id;e&&(this.forms=this.forms.filter(t=>t.id!==e))}getFormsForRoute(t){const e=this.normalizeRoute(t);return e?this.forms.filter(t=>this.normalizeRoute(t.route)===e):[...this.forms]}normalizeRoute(t){const e=String(t||"").trim();if(!e)return"";return e.split("?")[0].split("#")[0].trim()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormRegistryService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormRegistryService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormRegistryService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});class AiFormAutoRegisterDirective{formDirective;registry;router;elementRef;aiFormAutoRegister=!0;aiFormLabel="";aiFormIgnore=!1;unregister;constructor(t,e,n,o){this.formDirective=t,this.registry=e,this.router=n,this.elementRef=o}ngOnInit(){this.register()}ngOnDestroy(){this.unregister&&this.unregister()}register(){if(!this.aiFormAutoRegister||this.aiFormIgnore)return;const t=this.elementRef?.nativeElement;if("ignore"===t?.getAttribute("data-ai-form")||"true"===t?.getAttribute("data-ai-ignore"))return;const e=this.formDirective?.form;if(!e)return;const n=this.router?.url||"";this.unregister=this.registry.registerForm({form:e,route:n,element:t,label:(this.aiFormLabel||"").trim()||void 0})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormAutoRegisterDirective,deps:[{token:i2.FormGroupDirective},{token:AiFormRegistryService},{token:i1$1.Router},{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:AiFormAutoRegisterDirective,isStandalone:!0,selector:"form[formGroup]",inputs:{aiFormAutoRegister:"aiFormAutoRegister",aiFormLabel:"aiFormLabel",aiFormIgnore:"aiFormIgnore"},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormAutoRegisterDirective,decorators:[{type:Directive,args:[{selector:"form[formGroup]",standalone:!0}]}],ctorParameters:()=>[{type:i2.FormGroupDirective},{type:AiFormRegistryService},{type:i1$1.Router},{type:i0.ElementRef}],propDecorators:{aiFormAutoRegister:[{type:Input}],aiFormLabel:[{type:Input}],aiFormIgnore:[{type:Input}]}});class FormButtonComponent extends BaseComponent{_services;form;disabled=!1;type="submit";formButton;constructor(t){super(t),this._services=t}getTipErrors(){let t=[];if(this.form&&this.form.invalid&&"object"==typeof this.form.controls){Object.keys(this.form.controls).forEach(e=>{let n=this.form.controls[e];if(n.invalid&&(t.push(e.replace("_id","").replace("id_","").replace("_"," ").replace(/\b\S/g,function(t){return t.toUpperCase()})+" is invalid"),"object"==typeof n.value&&Array.isArray(n.value)&&n.controls))for(let e=0;e<n.controls.length;e++){let o=n.controls[e];if(o.controls){Object.keys(o.controls).forEach(n=>{o.controls[n].invalid&&t.push("["+e+"] -> "+n.replace("_id","").replace("id_","").replace("_"," ").replace(/\b\S/g,function(t){return t.toUpperCase()})+" is invalid")})}}})}return t}isSuperAdmin(){return!(!this._services._account.getUser()||!this._services._account.getUser().roles.super_admin)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonComponent,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:FormButtonComponent,isStandalone:!1,selector:"form-button",inputs:{form:"form",disabled:"disabled",type:"type"},providers:[ProviderService],viewQueries:[{propertyName:"formButton",first:!0,predicate:["formButton"],descendants:!0}],usesInheritance:!0,ngImport:i0,template:'\n\t\t<div style="position: relative; text-align: left; width: 100%">\n\t\t <ng-template #tipContent>\n\t\t <span style="font-weight: bold">Errors:<br></span>\n\t\t <ul>\n\t\t @for (error of getTipErrors(); track error) {\n\t\t <li>{{error}}</li>\n\t\t }\n\t\t </ul>\n\t\t </ng-template>\n\t\t <div [ngbTooltip]="(getTipErrors().length ? tipContent : \'\')" placement="top-left" #t>\n\t\t <button [type]="type" [ngClass]="[\'btn\', form && form.valid ? \'btn-success\' : \'btn-danger\']" [disabled]="!form || !form.valid || disabled" style="width: 200px" [autofocus]="true" #formButton>Submit</button>\n\t\t </div>\n\t\t</div>\n\t\t',isInline:!0,dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$2.NgbTooltip,selector:"[ngbTooltip]",inputs:["animation","autoClose","placement","popperOptions","triggers","positionTarget","container","disableTooltip","tooltipClass","tooltipContext","openDelay","closeDelay","ngbTooltip"],outputs:["shown","hidden"],exportAs:["ngbTooltip"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"form-button",template:'\n\t\t<div style="position: relative; text-align: left; width: 100%">\n\t\t <ng-template #tipContent>\n\t\t <span style="font-weight: bold">Errors:<br></span>\n\t\t <ul>\n\t\t @for (error of getTipErrors(); track error) {\n\t\t <li>{{error}}</li>\n\t\t }\n\t\t </ul>\n\t\t </ng-template>\n\t\t <div [ngbTooltip]="(getTipErrors().length ? tipContent : \'\')" placement="top-left" #t>\n\t\t <button [type]="type" [ngClass]="[\'btn\', form && form.valid ? \'btn-success\' : \'btn-danger\']" [disabled]="!form || !form.valid || disabled" style="width: 200px" [autofocus]="true" #formButton>Submit</button>\n\t\t </div>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:ProviderService}],propDecorators:{form:[{type:Input}],disabled:[{type:Input}],type:[{type:Input}],formButton:[{type:ViewChild,args:["formButton",{static:!1}]}]}});class DialogInputContent{_activeModal;_fb;title="";inputFields=[];formInput;states=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"];constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.formInput=this._fb.group({});for(let t=0;t<this.inputFields.length;t++){let e=this.inputFields[t].data;"datetime"===this.inputFields[t].type&&(e=this.normalizeDateTimeValue(this.inputFields[t].data)),null===this.inputFields[t].validators?this.formInput.addControl(this.inputFields[t].form,new UntypedFormControl({value:e,disabled:this.inputFields[t].disabled})):this.formInput.addControl(this.inputFields[t].form,new UntypedFormControl({value:e,disabled:this.inputFields[t].disabled},this.inputFields[t].validators))}}normalizeDateTimeValue(t){if(!t)return null;if(Array.isArray(t))return this.mergeDateTimeParts(t[0],t[1]);if(t instanceof Date)return this.mergeDateTimeParts(t,t);if(t.date||t.time||this.isDateStruct(t)||this.isTimeStruct(t)){const e=this.toDateStruct(t.date?t.date:t),n=this.toTimeStruct(t.time?t.time:t);return this.mergeDateTimeParts(e,n||null,t.mode)}return t}mergeDateTimeParts(t,e,n="datetime"){const o={mode:n},r=this.toDateStruct(t),i=this.toTimeStruct(e);return r&&(o.date=r),i&&(o.time=i),o}isDateStruct(t){return t&&void 0!==t.year&&void 0!==t.month&&void 0!==t.day}isTimeStruct(t){return t&&void 0!==t.hour&&void 0!==t.minute}toDateStruct(t){return t?t instanceof Date?{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}:this.isDateStruct(t)?{year:t.year,month:t.month,day:t.day}:t.date?this.toDateStruct(t.date):null:null}toTimeStruct(t){return t?t instanceof Date?{hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),ms:t.getMilliseconds()}:this.isTimeStruct(t)?{hour:t.hour,minute:t.minute,second:t.second||0,ms:t.ms||0}:t.time?this.toTimeStruct(t.time):null:null}validateInput(t,e){if(t.disabled)return"";let n=!0;for(let o=0;o<t.validators.length;o++)e.controls[t.form].hasError([t.validatorErrors[o]])&&(n=!1);return n&&null!==e.controls[t.form].value?"is-valid":!t.validators.length||!t.required&&n?"":"is-invalid"}getErrorMessages(t,e){let n=[];for(let o=0;o<t.validators.length;o++)e.controls[t.form].hasError([t.validatorErrors[o]])&&n.push(t.validatorMsg[o]);return n}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogInputContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogInputContent,isStandalone:!1,selector:"resolveio-dialog.input",inputs:{title:"title",inputFields:"inputFields"},ngImport:i0,template:'\n\t\t<form [formGroup]="formInput" novalidate (ngSubmit)="_activeModal.close(this.formInput.controls)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-plus-circle" style="color: green; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t @for (inputField of inputFields; track inputField.label; let i = $index) {\n\t\t <div class="form-group">\n\t\t <label class="form-control-label">{{inputField.label}}</label>\n\t\t @if (formInput.controls[inputField.form].hasError(\'required\') && inputField.required) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].hasError(\'required\') && formInput.controls[inputField.form].invalid) {\n\t\t <em>- Invalid</em>\n\t\t }\n\t\t @if (inputField.type !== \'date\' && inputField.type !== \'datetime\' && inputField.type !== \'state\' && inputField.type !== \'textarea\' && inputField.type !== \'number\' && inputField.type !== \'select\' && inputField.type !== \'boolean\') {\n\t\t <input [autofocus]="i === 0 ? true : false" [focus]="i === 0 ? true : false" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" [type]="(inputField.type ? inputField.type : \'text\')">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'select\') {\n\t\t <rio-select [formControlName]="inputField.form" [ngClass]="[validateInput(inputField, formInput)]" [placeholder]="inputField.placeholder" [options]="inputField.options" optionValueKey="value" optionLabelKey="text"></rio-select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'state\') {\n\t\t <select [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t <option value="">Select State</option>\n\t\t @for (state of states; track state) {\n\t\t <option [value]="state">{{state}}</option>\n\t\t }\n\t\t </select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'textarea\') {\n\t\t <textarea rows="4" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]"></textarea>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'number\') {\n\t\t <input [formControlName]="inputField.form" type="number" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'date\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" placeholder="yyyy-mm-dd" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'datetime\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="datetime"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'boolean\') {\n\t\t <div (click)="formInput.controls[inputField.form].setValue(!formInput.controls[inputField.form].value)">\n\t\t @if (formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-check" style="color: green; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-times" style="color: red; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t <div class="modal-footer">\n\t\t <form-button [form]="formInput"></form-button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </div>\n\t\t</form>\n\t\t',isInline:!0,dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.NgSelectOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.ɵNgSelectMultipleOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NumberValueAccessor,selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]"},{kind:"directive",type:i2.SelectControlValueAccessor,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:["compareWith"]},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"component",type:i7.RioDatePickerComponent,selector:"rio-date-picker",inputs:["enableDate","enableTime","selectionMode","firstDayOfWeek","toggleWeekFirstDay","timezone","minDate","maxDate","disabled","label","allowSeconds","minuteStep","panelWidth"],outputs:["change"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogInputContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.input",template:'\n\t\t<form [formGroup]="formInput" novalidate (ngSubmit)="_activeModal.close(this.formInput.controls)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-plus-circle" style="color: green; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t @for (inputField of inputFields; track inputField.label; let i = $index) {\n\t\t <div class="form-group">\n\t\t <label class="form-control-label">{{inputField.label}}</label>\n\t\t @if (formInput.controls[inputField.form].hasError(\'required\') && inputField.required) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].hasError(\'required\') && formInput.controls[inputField.form].invalid) {\n\t\t <em>- Invalid</em>\n\t\t }\n\t\t @if (inputField.type !== \'date\' && inputField.type !== \'datetime\' && inputField.type !== \'state\' && inputField.type !== \'textarea\' && inputField.type !== \'number\' && inputField.type !== \'select\' && inputField.type !== \'boolean\') {\n\t\t <input [autofocus]="i === 0 ? true : false" [focus]="i === 0 ? true : false" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" [type]="(inputField.type ? inputField.type : \'text\')">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'select\') {\n\t\t <rio-select [formControlName]="inputField.form" [ngClass]="[validateInput(inputField, formInput)]" [placeholder]="inputField.placeholder" [options]="inputField.options" optionValueKey="value" optionLabelKey="text"></rio-select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'state\') {\n\t\t <select [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t <option value="">Select State</option>\n\t\t @for (state of states; track state) {\n\t\t <option [value]="state">{{state}}</option>\n\t\t }\n\t\t </select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'textarea\') {\n\t\t <textarea rows="4" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]"></textarea>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'number\') {\n\t\t <input [formControlName]="inputField.form" type="number" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'date\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" placeholder="yyyy-mm-dd" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'datetime\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="datetime"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'boolean\') {\n\t\t <div (click)="formInput.controls[inputField.form].setValue(!formInput.controls[inputField.form].value)">\n\t\t @if (formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-check" style="color: green; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-times" style="color: red; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t <div class="modal-footer">\n\t\t <form-button [form]="formInput"></form-button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </div>\n\t\t</form>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{title:[{type:Input}],inputFields:[{type:Input}]}});class DialogErrorContent{activeModal;title;body;handleKeyboardEvent(t){13===t.keyCode&&this.activeModal.close()}constructor(t){this.activeModal=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogErrorContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DialogErrorContent,isStandalone:!1,selector:"resolveio-dialog.error",inputs:{title:"title",body:"body"},host:{listeners:{"document:keypress":"handleKeyboardEvent($event)"}},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-times-circle" style="color: red; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n \t',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogErrorContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.error",template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-times-circle" style="color: red; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n \t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],body:[{type:Input}],handleKeyboardEvent:[{type:HostListener,args:["document:keypress",["$event"]]}]}});class DialogConfirmContent{activeModal;title;body;html;handleKeyboardEvent(t){13===t.keyCode&&this.activeModal.close()}constructor(t){this.activeModal=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogConfirmContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DialogConfirmContent,isStandalone:!1,selector:"resolveio-dialog.confirm",inputs:{title:"title",body:"body",html:"html"},host:{listeners:{"document:keypress":"handleKeyboardEvent($event)"}},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t\t<div [innerHTML]="html"></div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-success" (click)="activeModal.close()">Yes</button>\n\t\t\t<button type="button" class="btn btn-danger" (click)="activeModal.dismiss()">No</button>\n\t\t</div>\n \t',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogConfirmContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.confirm",template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t\t<div [innerHTML]="html"></div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-success" (click)="activeModal.close()">Yes</button>\n\t\t\t<button type="button" class="btn btn-danger" (click)="activeModal.dismiss()">No</button>\n\t\t</div>\n \t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],body:[{type:Input}],html:[{type:Input}],handleKeyboardEvent:[{type:HostListener,args:["document:keypress",["$event"]]}]}});class DialogSelectDateTimeContent{_activeModal;_fb;title="";date;showTime=!0;close;allElements;form;constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.date||(this.date=new Date),this.form=this._fb.group({time:[{hour:this.date.getHours(),minute:this.date.getMinutes(),second:0},[Validators.required]],date:[{year:this.date.getFullYear(),month:this.date.getMonth()+1,day:this.date.getDate()},[Validators.required]]})}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100)}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}submitForm(){this._activeModal.close(new Date(this.form.value.date.year,parseInt(this.form.value.date.month)-1,this.form.value.date.day,this.form.value.time.hour,this.form.value.time.minute,this.form.value.time.second,0))}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDateTimeContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectDateTimeContent,isStandalone:!1,selector:"resolveio-dialog.select-datetime",inputs:{title:"title",date:"date",showTime:"showTime"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t \t<style>\n\t \t table {\n\t \t width: 100%;\n\t \t table-layout: fixed;\n\t \t}\n\t \t\n\t \ttr {\n\t \twidth: 100%;\n\t \t}\n\t \t\n\t \ttd {\n\t \twidth: 100%;\n\t \ttext-align: center;\n\t \t}\n\t \t</style>\n\t \t<div #allElements>\n\t \t <form [formGroup]="form" novalidate (ngSubmit)="submitForm()">\n\t \t <div class="modal-header">\n\t \t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t \t </div>\n\t \t <div class="modal-body">\n\t \t <table>\n\t \t <tr>\n\t \t <td style="border: none;">\n\t \t <div class="input-group">\n\t \t <rio-date-picker class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="date" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t @if (showTime) {\n\t \t <td style="border: none;">\n\t \t <div class="offset-3">\n\t \t <rio-date-picker formControlName="time" selectionMode="time" [enableDate]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t }\n\t \t </tr>\n\t \t </table>\n\t \t </div>\n\t \t <div class="modal-footer">\n\t \t <form-button [form]="form"></form-button>\n\t \t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t \t </div>\n\t \t </form>\n\t \t</div>\n\t \t',isInline:!0,styles:["table{width:100%;table-layout:fixed}tr{width:100%}td{width:100%;text-align:center}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"component",type:i7.RioDatePickerComponent,selector:"rio-date-picker",inputs:["enableDate","enableTime","selectionMode","firstDayOfWeek","toggleWeekFirstDay","timezone","minDate","maxDate","disabled","label","allowSeconds","minuteStep","panelWidth"],outputs:["change"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDateTimeContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-datetime",template:'\n\t \t<style>\n\t \t table {\n\t \t width: 100%;\n\t \t table-layout: fixed;\n\t \t}\n\t \t\n\t \ttr {\n\t \twidth: 100%;\n\t \t}\n\t \t\n\t \ttd {\n\t \twidth: 100%;\n\t \ttext-align: center;\n\t \t}\n\t \t</style>\n\t \t<div #allElements>\n\t \t <form [formGroup]="form" novalidate (ngSubmit)="submitForm()">\n\t \t <div class="modal-header">\n\t \t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t \t </div>\n\t \t <div class="modal-body">\n\t \t <table>\n\t \t <tr>\n\t \t <td style="border: none;">\n\t \t <div class="input-group">\n\t \t <rio-date-picker class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="date" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t @if (showTime) {\n\t \t <td style="border: none;">\n\t \t <div class="offset-3">\n\t \t <rio-date-picker formControlName="time" selectionMode="time" [enableDate]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t }\n\t \t </tr>\n\t \t </table>\n\t \t </div>\n\t \t <div class="modal-footer">\n\t \t <form-button [form]="form"></form-button>\n\t \t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t \t </div>\n\t \t </form>\n\t \t</div>\n\t \t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{title:[{type:Input}],date:[{type:Input}],showTime:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class DialogSelectDataLabelsContent{_activeModal;_fb;title="";subtitle="";data;showArraySubData;form;dialogData=[];constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.getKeys()}getKeys(){let t=Object.keys(this.data),e="";t.filter(t=>"_id"!==t&&!t.startsWith("id_")&&"__v"!==t&&"createdAt"!==t&&"updatedAt"!==t).forEach(t=>{if(e=typeof this.data[t],"object"===e)if(Array.isArray(this.data[t])){if(e="array",this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,selected:!0,type:e,subLabel:null,subData:null,subtype:null}),!0===this.showArraySubData){Object.keys(this.data[t][0]).filter(t=>"_id"!==t&&!t.startsWith("id_")).forEach(n=>{this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),subLabel:n.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,type:e,subData:n,selected:!0,subtype:typeof n})})}}else{let n=Object.keys(this.data[t]);n.length?n.filter(t=>"_id"!==t&&!t.startsWith("id_")).forEach(n=>{this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),subLabel:n.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,subData:n,subtype:null,selected:!0,type:e})}):this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,selected:!0,type:e,subData:null,subLabel:null,subtype:null})}else this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,selected:!0,type:e,subData:null,subLabel:null,subtype:null})})}changeSelected(t){t.selected=!t.selected,"array"===t.type&&null===t.subtype&&this.dialogData.filter(e=>e.label===t.label).forEach(e=>{e.selected=t.selected})}submit(){return this.dialogData}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDataLabelsContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectDataLabelsContent,isStandalone:!1,selector:"resolveio-dialog.select-data-labels",inputs:{title:"title",subtitle:"subtitle",data:"data",showArraySubData:"showArraySubData"},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.75em" aria-hidden="true"></i> {{ title }} - {{ subtitle }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-12">\n\t\t @for (label of dialogData; track label.label) {\n\t\t <div class="row">\n\t\t @if (label.subtype === null && label.type !== \'object\') {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel === null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(dialogData)">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDataLabelsContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-data-labels",template:'\n\t\t<div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.75em" aria-hidden="true"></i> {{ title }} - {{ subtitle }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-12">\n\t\t @for (label of dialogData; track label.label) {\n\t\t <div class="row">\n\t\t @if (label.subtype === null && label.type !== \'object\') {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel === null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(dialogData)">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{title:[{type:Input}],subtitle:[{type:Input}],data:[{type:Input}],showArraySubData:[{type:Input}]}});class DialogLoginContent{_activeModal;_fb;msAllowed=!1;showLoginText=!0;publicProgram=!1;usernameInput;form;publicForm;publicRegisterForm;publicMode="login";loginTab="customer";focusTimeout=null;constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.form=this._fb.group({username:["",[Validators.required]],password:["",[Validators.required]],forgotPassword:[!1]}),this.publicForm=this._fb.group({email:["",[Validators.required,Validators.email]],password:["",[Validators.required]]}),this.publicRegisterForm=this._fb.group({companyName:["",[Validators.required]],contactName:[""],email:["",[Validators.required,Validators.email]],password:["",[Validators.required]],confirmPassword:["",[Validators.required]],phone:[""]})}ngAfterViewInit(){this.queueUsernameFocus()}ngOnDestroy(){this.focusTimeout&&(clearTimeout(this.focusTimeout),this.focusTimeout=null)}queueUsernameFocus(){this.focusTimeout=setTimeout(()=>{this.focusTimeout=null,this.usernameInput?.nativeElement?.focus()})}setPublicMode(t){this.publicMode=t}setLoginTab(t){this.loginTab=t,"employee"===t&&this.queueUsernameFocus()}submitPublicLogin(){this.publicForm.invalid?this.publicForm.markAllAsTouched():this._activeModal.close({form:this.publicForm,type:"PUBLIC_LOGIN"})}submitPublicRegister(){this.publicRegisterForm.invalid?this.publicRegisterForm.markAllAsTouched():this.publicRegisterForm.value.password===this.publicRegisterForm.value.confirmPassword?this._activeModal.close({form:this.publicRegisterForm,type:"PUBLIC_REGISTER"}):this.publicRegisterForm.controls.confirmPassword.setErrors({mismatch:!0})}toggleForgotPassword(){this.form.controls.forgotPassword.setValue(!this.form.controls.forgotPassword.value),this.form.controls.forgotPassword.value?(this.form.controls.password.setValue(""),this.form.controls.password.clearValidators(),this.form.controls.password.disable()):(this.form.controls.password.setValidators([Validators.required]),this.form.controls.password.enable()),this.form.controls.password.updateValueAndValidity()}close(t){this._activeModal.close({form:this.form,type:t})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogLoginContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogLoginContent,isStandalone:!1,selector:"resolveio-dialog.login",inputs:{msAllowed:"msAllowed",showLoginText:"showLoginText",publicProgram:"publicProgram"},viewQueries:[{propertyName:"usernameInput",first:!0,predicate:["usernameInput"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t .login-modal {\n\t\t font-family: "Sora", "Space Grotesk", "Segoe UI", Arial, sans-serif;\n\t\t color: #0f172a;\n\t\t }\n\n\t\t .login-modal .modal-body {\n\t\t background: #ffffff;\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-body {\n\t\t position: relative;\n\t\t display: flex;\n\t\t justify-content: center;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body .row {\n\t\t --bs-gutter-x: 0;\n\t\t --bs-gutter-y: 0;\n\t\t margin: 0;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body [class^="col-"],\n\t\t .login-body [class*=" col-"] {\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-card {\n\t\t margin-bottom: 0;\n\t\t padding: 18px;\n\t\t border-radius: 16px;\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);\n\t\t width: 100%;\n\t\t position: relative;\n\t\t }\n\n\t\t .login-close {\n\t\t position: absolute;\n\t\t top: 12px;\n\t\t right: 12px;\n\t\t width: 44px;\n\t\t height: 44px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t border-radius: 12px;\n\t\t background: rgba(15, 23, 42, 0.04);\n\t\t color: #0f172a;\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t line-height: 1;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;\n\t\t }\n\n\t\t .login-close:hover {\n\t\t background: #0f172a;\n\t\t color: #ffffff;\n\t\t transform: translateY(-1px) scale(1.02);\n\t\t box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);\n\t\t }\n\n\t\t .login-close:active {\n\t\t transform: translateY(0) scale(0.98);\n\t\t box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);\n\t\t }\n\n\t\t .login-close:focus-visible {\n\t\t outline: none;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t }\n\n\t\t .login-header {\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t color: #0f172a;\n\t\t margin-bottom: 12px;\n\t\t text-align: center;\n\t\t background: linear-gradient(120deg, #0f172a, #2563eb);\n\t\t -webkit-background-clip: text;\n\t\t background-clip: text;\n\t\t -webkit-text-fill-color: transparent;\n\t\t }\n\n\t\t .login-toggle,\n\t\t .public-toggle {\n\t\t display: inline-flex;\n\t\t gap: 6px;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t padding: 6px;\n\t\t border-radius: 999px;\n\t\t background: #f1f5f9;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t margin: 0 auto 16px;\n\t\t }\n\n\t\t .login-tab-row {\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: space-between;\n\t\t gap: 12px;\n\t\t flex-wrap: wrap;\n\t\t margin-bottom: 12px;\n\t\t }\n\n\t\t .login-tab-row .login-header {\n\t\t margin-bottom: 0;\n\t\t text-align: center;\n\t\t flex: 1;\n\t\t }\n\n\t\t .login-subtoggle {\n\t\t display: flex;\n\t\t justify-content: flex-start;\n\t\t }\n\n\t\t .login-subtoggle .public-toggle {\n\t\t margin: 0 0 16px;\n\t\t }\n\n\t\t .login-toggle .btn,\n\t\t .public-toggle .btn {\n\t\t border-radius: 999px;\n\t\t font-weight: 600;\n\t\t padding: 6px 16px;\n\t\t border: 1px solid transparent;\n\t\t }\n\n\t\t .login-toggle .btn-outline-secondary,\n\t\t .public-toggle .btn-outline-secondary {\n\t\t color: #475569;\n\t\t border-color: rgba(71, 85, 105, 0.35);\n\t\t background: transparent;\n\t\t }\n\n\t\t .login-toggle .btn-primary,\n\t\t .public-toggle .btn-primary {\n\t\t background: linear-gradient(135deg, #2563eb, #38bdf8);\n\t\t border-color: transparent;\n\t\t box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .loginform {\n\t\t margin-top: 10px;\n\t\t }\n\n\t\t .loginform label,\n\t\t .third-party-login-section label {\n\t\t font-size: 13px;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.4px;\n\t\t text-transform: uppercase;\n\t\t color: #475569;\n\t\t }\n\n\t\t .login-modal .form-control {\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #0f172a;\n\t\t height: 48px;\n\t\t border-radius: 12px;\n\t\t padding: 0 14px;\n\t\t }\n\n\t\t .login-modal .form-control::placeholder {\n\t\t color: rgba(15, 23, 42, 0.5);\n\t\t }\n\n\t\t .login-modal .form-control:focus {\n\t\t border-color: #2563eb;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .login-modal .form-control.is-invalid {\n\t\t border-color: rgba(239, 68, 68, 0.8);\n\t\t box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);\n\t\t }\n\n\t\t .employee-login-btn,\n\t\t .third-party-login-btn {\n\t\t width: 100%;\n\t\t border-radius: 12px;\n\t\t height: 46px;\n\t\t border: none;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.3px;\n\t\t }\n\n\t\t .employee-login-btn {\n\t\t background: linear-gradient(135deg, #2563eb, #22d3ee);\n\t\t color: #ffffff;\n\t\t }\n\n\t\t .third-party-login-btn {\n\t\t background: linear-gradient(135deg, #22c55e, #16a34a);\n\t\t color: #ffffff;\n\t\t margin-top: 12px;\n\t\t }\n\n\t\t .disabled-btn {\n\t\t background: rgba(15, 23, 42, 0.05);\n\t\t color: rgba(15, 23, 42, 0.45);\n\t\t border: 1px dashed rgba(15, 23, 42, 0.2);\n\t\t cursor: not-allowed;\n\t\t }\n\n\t\t .third-party-login-section {\n\t\t background: #f8fafc;\n\t\t border-radius: 14px;\n\t\t padding: 16px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .employee-login-section,\n\t\t .third-party-login-section {\n\t\t text-align: center;\n\t\t }\n\n\t\t .public-section {\n\t\t padding: 8px;\n\t\t }\n\n\t\t .contactimg {\n\t\t position: relative;\n\t\t border-radius: 16px;\n\t\t overflow: hidden;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .contactimg::after {\n\t\t content: "";\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t background: linear-gradient(160deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.35));\n\t\t }\n\n\t\t .contactimg > img {\n\t\t width: 100%;\n\t\t display: block;\n\t\t filter: saturate(1.1);\n\t\t }\n\n\t\t .textbox {\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t text-align: center;\n\t\t color: #ffffff;\n\t\t padding: 30px;\n\t\t z-index: 1;\n\t\t }\n\n\t\t .login-logo {\n\t\t margin-bottom: 20px;\n\t\t }\n\n\t\t .form-check a {\n\t\t color: #2563eb;\n\t\t text-decoration: none;\n\t\t }\n\n\t\t .form-check a:hover {\n\t\t color: #1d4ed8;\n\t\t text-decoration: underline;\n\t\t }\n\n\t\t .login-modal .btn-secondary {\n\t\t background: transparent;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #475569;\n\t\t border-radius: 10px;\n\t\t }\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate class="login-modal">\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t @if (publicProgram) {\n\t\t <div class="login-body">\n\t\t <div class="row g-4">\n\t\t <div class="col-12">\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <div class="login-tab-row">\n\t\t <div class="login-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'customer\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'customer\')">Customer</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'employee\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'employee\')">Employee</button>\n\t\t </div>\n\t\t <h3 class="login-header">{{ loginTab === \'customer\' ? \'Customer Access\' : \'Employee Sign In\' }}</h3>\n\t\t </div>\n\t\t @if (loginTab === \'customer\') {\n\t\t <div class="login-subtoggle">\n\t\t <div class="public-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'login\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'login\')">Sign in</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'register\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'register\')">Create account</button>\n\t\t </div>\n\t\t </div>\n\t\t @if (publicMode === \'login\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicForm">\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Your password" autocomplete="current-password">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicLogin()">Sign in</button>\n\t\t <button type="button" class="btn third-party-login-btn disabled-btn" disabled>Google sign-in (coming soon)</button>\n\t\t </div>\n\t\t }\n\t\t @if (publicMode === \'register\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicRegisterForm">\n\t\t <div class="form-group">\n\t\t <label>Company name</label>\n\t\t @if (publicRegisterForm.controls.companyName.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" [ngClass]="[\'form-control\', publicRegisterForm.controls.companyName.valid ? \'is-valid\' : \'is-invalid\']" formControlName="companyName" placeholder="Your company name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Contact name</label>\n\t\t <input type="text" class="form-control" formControlName="contactName" placeholder="Your name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicRegisterForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicRegisterForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicRegisterForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Create a password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Confirm password</label>\n\t\t @if (publicRegisterForm.controls.confirmPassword.hasError(\'mismatch\')) {\n\t\t <em>- Passwords must match</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.confirmPassword.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirmPassword" placeholder="Confirm password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone (optional)</label>\n\t\t <input type="text" class="form-control" formControlName="phone" placeholder="Phone number">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicRegister()">Create account</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t @if (loginTab === \'employee\') {\n\t\t @if (msAllowed) {\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t }\n\t\t @if (!msAllowed) {\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @else {\n\t\t <div class="login-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t @if (showLoginText) {\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="loginform" style="margin: 0px;">\n\t\t @if (!msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee/Customer Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @if (msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee Login</h3>\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t </div>\n\t\t <div class="login-card">\n\t\t <h3 class="login-header">Third Party Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t</form>\n\t\t',isInline:!0,styles:['.login-modal{font-family:Sora,Space Grotesk,Segoe UI,Arial,sans-serif;color:#0f172a}.login-modal .modal-body{background:#fff;padding:0}.login-body{position:relative;display:flex;justify-content:center;width:100%}.login-body .row{--bs-gutter-x: 0;--bs-gutter-y: 0;margin:0;width:100%}.login-body [class^=col-],.login-body [class*=" col-"]{padding:0}.login-card{margin-bottom:0;padding:18px;border-radius:16px;background:#fff;border:1px solid rgba(15,23,42,.08);box-shadow:0 12px 28px #0f172a1a;width:100%;position:relative}.login-close{position:absolute;top:12px;right:12px;width:44px;height:44px;border:1px solid rgba(15,23,42,.08);border-radius:12px;background:#0f172a0a;color:#0f172a;font-size:22px;font-weight:600;line-height:1;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 18px #0f172a1f;transition:transform .18s ease,box-shadow .18s ease,background .18s ease,color .18s ease}.login-close:hover{background:#0f172a;color:#fff;transform:translateY(-1px) scale(1.02);box-shadow:0 10px 22px #0f172a33}.login-close:active{transform:translateY(0) scale(.98);box-shadow:0 4px 12px #0f172a29}.login-close:focus-visible{outline:none;box-shadow:0 0 0 3px #2563eb59,0 6px 18px #0f172a1f}.login-header{font-size:22px;font-weight:600;color:#0f172a;margin-bottom:12px;text-align:center;background:linear-gradient(120deg,#0f172a,#2563eb);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.login-toggle,.public-toggle{display:inline-flex;gap:6px;align-items:center;justify-content:center;padding:6px;border-radius:999px;background:#f1f5f9;border:1px solid rgba(15,23,42,.08);margin:0 auto 16px}.login-tab-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}.login-tab-row .login-header{margin-bottom:0;text-align:center;flex:1}.login-subtoggle{display:flex;justify-content:flex-start}.login-subtoggle .public-toggle{margin:0 0 16px}.login-toggle .btn,.public-toggle .btn{border-radius:999px;font-weight:600;padding:6px 16px;border:1px solid transparent}.login-toggle .btn-outline-secondary,.public-toggle .btn-outline-secondary{color:#475569;border-color:#47556959;background:transparent}.login-toggle .btn-primary,.public-toggle .btn-primary{background:linear-gradient(135deg,#2563eb,#38bdf8);border-color:transparent;box-shadow:0 10px 20px #2563eb33}.loginform{margin-top:10px}.loginform label,.third-party-login-section label{font-size:13px;font-weight:600;letter-spacing:.4px;text-transform:uppercase;color:#475569}.login-modal .form-control{background:#fff;border:1px solid rgba(71,85,105,.35);color:#0f172a;height:48px;border-radius:12px;padding:0 14px}.login-modal .form-control::placeholder{color:#0f172a80}.login-modal .form-control:focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb33}.login-modal .form-control.is-invalid{border-color:#ef4444cc;box-shadow:0 0 0 2px #ef444426}.employee-login-btn,.third-party-login-btn{width:100%;border-radius:12px;height:46px;border:none;font-weight:600;letter-spacing:.3px}.employee-login-btn{background:linear-gradient(135deg,#2563eb,#22d3ee);color:#fff}.third-party-login-btn{background:linear-gradient(135deg,#22c55e,#16a34a);color:#fff;margin-top:12px}.disabled-btn{background:#0f172a0d;color:#0f172a73;border:1px dashed rgba(15,23,42,.2);cursor:not-allowed}.third-party-login-section{background:#f8fafc;border-radius:14px;padding:16px;border:1px solid rgba(15,23,42,.08)}.employee-login-section,.third-party-login-section{text-align:center}.public-section{padding:8px}.contactimg{position:relative;border-radius:16px;overflow:hidden;border:1px solid rgba(15,23,42,.08)}.contactimg:after{content:"";position:absolute;inset:0;background:linear-gradient(160deg,#0f172a0d,#0f172a59)}.contactimg>img{width:100%;display:block;filter:saturate(1.1)}.textbox{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;color:#fff;padding:30px;z-index:1}.login-logo{margin-bottom:20px}.form-check a{color:#2563eb;text-decoration:none}.form-check a:hover{color:#1d4ed8;text-decoration:underline}.login-modal .btn-secondary{background:transparent;border:1px solid rgba(71,85,105,.35);color:#475569;border-radius:10px}\n'],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogLoginContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.login",template:'\n\t\t<style>\n\t\t .login-modal {\n\t\t font-family: "Sora", "Space Grotesk", "Segoe UI", Arial, sans-serif;\n\t\t color: #0f172a;\n\t\t }\n\n\t\t .login-modal .modal-body {\n\t\t background: #ffffff;\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-body {\n\t\t position: relative;\n\t\t display: flex;\n\t\t justify-content: center;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body .row {\n\t\t --bs-gutter-x: 0;\n\t\t --bs-gutter-y: 0;\n\t\t margin: 0;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body [class^="col-"],\n\t\t .login-body [class*=" col-"] {\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-card {\n\t\t margin-bottom: 0;\n\t\t padding: 18px;\n\t\t border-radius: 16px;\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);\n\t\t width: 100%;\n\t\t position: relative;\n\t\t }\n\n\t\t .login-close {\n\t\t position: absolute;\n\t\t top: 12px;\n\t\t right: 12px;\n\t\t width: 44px;\n\t\t height: 44px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t border-radius: 12px;\n\t\t background: rgba(15, 23, 42, 0.04);\n\t\t color: #0f172a;\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t line-height: 1;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;\n\t\t }\n\n\t\t .login-close:hover {\n\t\t background: #0f172a;\n\t\t color: #ffffff;\n\t\t transform: translateY(-1px) scale(1.02);\n\t\t box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);\n\t\t }\n\n\t\t .login-close:active {\n\t\t transform: translateY(0) scale(0.98);\n\t\t box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);\n\t\t }\n\n\t\t .login-close:focus-visible {\n\t\t outline: none;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t }\n\n\t\t .login-header {\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t color: #0f172a;\n\t\t margin-bottom: 12px;\n\t\t text-align: center;\n\t\t background: linear-gradient(120deg, #0f172a, #2563eb);\n\t\t -webkit-background-clip: text;\n\t\t background-clip: text;\n\t\t -webkit-text-fill-color: transparent;\n\t\t }\n\n\t\t .login-toggle,\n\t\t .public-toggle {\n\t\t display: inline-flex;\n\t\t gap: 6px;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t padding: 6px;\n\t\t border-radius: 999px;\n\t\t background: #f1f5f9;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t margin: 0 auto 16px;\n\t\t }\n\n\t\t .login-tab-row {\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: space-between;\n\t\t gap: 12px;\n\t\t flex-wrap: wrap;\n\t\t margin-bottom: 12px;\n\t\t }\n\n\t\t .login-tab-row .login-header {\n\t\t margin-bottom: 0;\n\t\t text-align: center;\n\t\t flex: 1;\n\t\t }\n\n\t\t .login-subtoggle {\n\t\t display: flex;\n\t\t justify-content: flex-start;\n\t\t }\n\n\t\t .login-subtoggle .public-toggle {\n\t\t margin: 0 0 16px;\n\t\t }\n\n\t\t .login-toggle .btn,\n\t\t .public-toggle .btn {\n\t\t border-radius: 999px;\n\t\t font-weight: 600;\n\t\t padding: 6px 16px;\n\t\t border: 1px solid transparent;\n\t\t }\n\n\t\t .login-toggle .btn-outline-secondary,\n\t\t .public-toggle .btn-outline-secondary {\n\t\t color: #475569;\n\t\t border-color: rgba(71, 85, 105, 0.35);\n\t\t background: transparent;\n\t\t }\n\n\t\t .login-toggle .btn-primary,\n\t\t .public-toggle .btn-primary {\n\t\t background: linear-gradient(135deg, #2563eb, #38bdf8);\n\t\t border-color: transparent;\n\t\t box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .loginform {\n\t\t margin-top: 10px;\n\t\t }\n\n\t\t .loginform label,\n\t\t .third-party-login-section label {\n\t\t font-size: 13px;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.4px;\n\t\t text-transform: uppercase;\n\t\t color: #475569;\n\t\t }\n\n\t\t .login-modal .form-control {\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #0f172a;\n\t\t height: 48px;\n\t\t border-radius: 12px;\n\t\t padding: 0 14px;\n\t\t }\n\n\t\t .login-modal .form-control::placeholder {\n\t\t color: rgba(15, 23, 42, 0.5);\n\t\t }\n\n\t\t .login-modal .form-control:focus {\n\t\t border-color: #2563eb;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .login-modal .form-control.is-invalid {\n\t\t border-color: rgba(239, 68, 68, 0.8);\n\t\t box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);\n\t\t }\n\n\t\t .employee-login-btn,\n\t\t .third-party-login-btn {\n\t\t width: 100%;\n\t\t border-radius: 12px;\n\t\t height: 46px;\n\t\t border: none;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.3px;\n\t\t }\n\n\t\t .employee-login-btn {\n\t\t background: linear-gradient(135deg, #2563eb, #22d3ee);\n\t\t color: #ffffff;\n\t\t }\n\n\t\t .third-party-login-btn {\n\t\t background: linear-gradient(135deg, #22c55e, #16a34a);\n\t\t color: #ffffff;\n\t\t margin-top: 12px;\n\t\t }\n\n\t\t .disabled-btn {\n\t\t background: rgba(15, 23, 42, 0.05);\n\t\t color: rgba(15, 23, 42, 0.45);\n\t\t border: 1px dashed rgba(15, 23, 42, 0.2);\n\t\t cursor: not-allowed;\n\t\t }\n\n\t\t .third-party-login-section {\n\t\t background: #f8fafc;\n\t\t border-radius: 14px;\n\t\t padding: 16px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .employee-login-section,\n\t\t .third-party-login-section {\n\t\t text-align: center;\n\t\t }\n\n\t\t .public-section {\n\t\t padding: 8px;\n\t\t }\n\n\t\t .contactimg {\n\t\t position: relative;\n\t\t border-radius: 16px;\n\t\t overflow: hidden;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .contactimg::after {\n\t\t content: "";\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t background: linear-gradient(160deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.35));\n\t\t }\n\n\t\t .contactimg > img {\n\t\t width: 100%;\n\t\t display: block;\n\t\t filter: saturate(1.1);\n\t\t }\n\n\t\t .textbox {\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t text-align: center;\n\t\t color: #ffffff;\n\t\t padding: 30px;\n\t\t z-index: 1;\n\t\t }\n\n\t\t .login-logo {\n\t\t margin-bottom: 20px;\n\t\t }\n\n\t\t .form-check a {\n\t\t color: #2563eb;\n\t\t text-decoration: none;\n\t\t }\n\n\t\t .form-check a:hover {\n\t\t color: #1d4ed8;\n\t\t text-decoration: underline;\n\t\t }\n\n\t\t .login-modal .btn-secondary {\n\t\t background: transparent;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #475569;\n\t\t border-radius: 10px;\n\t\t }\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate class="login-modal">\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t @if (publicProgram) {\n\t\t <div class="login-body">\n\t\t <div class="row g-4">\n\t\t <div class="col-12">\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <div class="login-tab-row">\n\t\t <div class="login-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'customer\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'customer\')">Customer</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'employee\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'employee\')">Employee</button>\n\t\t </div>\n\t\t <h3 class="login-header">{{ loginTab === \'customer\' ? \'Customer Access\' : \'Employee Sign In\' }}</h3>\n\t\t </div>\n\t\t @if (loginTab === \'customer\') {\n\t\t <div class="login-subtoggle">\n\t\t <div class="public-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'login\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'login\')">Sign in</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'register\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'register\')">Create account</button>\n\t\t </div>\n\t\t </div>\n\t\t @if (publicMode === \'login\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicForm">\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Your password" autocomplete="current-password">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicLogin()">Sign in</button>\n\t\t <button type="button" class="btn third-party-login-btn disabled-btn" disabled>Google sign-in (coming soon)</button>\n\t\t </div>\n\t\t }\n\t\t @if (publicMode === \'register\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicRegisterForm">\n\t\t <div class="form-group">\n\t\t <label>Company name</label>\n\t\t @if (publicRegisterForm.controls.companyName.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" [ngClass]="[\'form-control\', publicRegisterForm.controls.companyName.valid ? \'is-valid\' : \'is-invalid\']" formControlName="companyName" placeholder="Your company name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Contact name</label>\n\t\t <input type="text" class="form-control" formControlName="contactName" placeholder="Your name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicRegisterForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicRegisterForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicRegisterForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Create a password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Confirm password</label>\n\t\t @if (publicRegisterForm.controls.confirmPassword.hasError(\'mismatch\')) {\n\t\t <em>- Passwords must match</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.confirmPassword.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirmPassword" placeholder="Confirm password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone (optional)</label>\n\t\t <input type="text" class="form-control" formControlName="phone" placeholder="Phone number">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicRegister()">Create account</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t @if (loginTab === \'employee\') {\n\t\t @if (msAllowed) {\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t }\n\t\t @if (!msAllowed) {\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @else {\n\t\t <div class="login-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t @if (showLoginText) {\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="loginform" style="margin: 0px;">\n\t\t @if (!msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee/Customer Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @if (msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee Login</h3>\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t </div>\n\t\t <div class="login-card">\n\t\t <h3 class="login-header">Third Party Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t</form>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{msAllowed:[{type:Input}],showLoginText:[{type:Input}],publicProgram:[{type:Input}],usernameInput:[{type:ViewChild,args:["usernameInput"]}]}});class ResponsiveButtonGroupComponent extends BaseComponent{_cdRef;_resizeService;_services;collapseSize=900;windowSize=window.innerWidth;windowSizeSubscription=null;constructor(t,e,n){super(n),this._cdRef=t,this._resizeService=e,this._services=n}ngOnInit(){this.windowSizeSubscription=this._resizeService.onResize$.subscribe(t=>{t&&(this.windowSize=t.innerWidth,this._cdRef.detectChanges())})}ngOnDestroy(){this.windowSizeSubscription.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupComponent,deps:[{token:i0.ChangeDetectorRef},{token:ResizeService},{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:ResponsiveButtonGroupComponent,isStandalone:!1,selector:"responsive-button-group",inputs:{collapseSize:"collapseSize"},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"<style>\n\t@media screen and (min-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: inline-flex !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup button {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup a {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\t}\n\n\t@media screen and (max-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: inherit !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup button {\n\t\t\tmargin-top: 5px !important;\n\t\t\twidth: 100% !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup a {\n\t\t\tmargin-top: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n</style>\n\n<div [ngClass]=\"windowSize <= collapseSize ? ['btn-group-vertical', 'xsBtnGroup'] : ['btn-group', 'lgBtnGroup']\">\n\t<ng-content></ng-content>\n</div>\n",styles:["@media screen and (min-width:900px){:host ::ng-deep .xsBtnGroup{display:none!important}:host ::ng-deep .lgBtnGroup{display:inline-flex!important}:host ::ng-deep .lgBtnGroup button{margin-left:5px!important}:host ::ng-deep .lgBtnGroup a{margin-left:5px!important}}@media screen and (max-width:900px){:host ::ng-deep .xsBtnGroup{display:inherit!important}:host ::ng-deep .xsBtnGroup button{margin-top:5px!important;width:100%!important}:host ::ng-deep .xsBtnGroup a{margin-top:5px!important}:host ::ng-deep .lgBtnGroup{display:none!important}}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"responsive-button-group",standalone:!1,template:"<style>\n\t@media screen and (min-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: inline-flex !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup button {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup a {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\t}\n\n\t@media screen and (max-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: inherit !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup button {\n\t\t\tmargin-top: 5px !important;\n\t\t\twidth: 100% !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup a {\n\t\t\tmargin-top: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n</style>\n\n<div [ngClass]=\"windowSize <= collapseSize ? ['btn-group-vertical', 'xsBtnGroup'] : ['btn-group', 'lgBtnGroup']\">\n\t<ng-content></ng-content>\n</div>\n"}]}],ctorParameters:()=>[{type:i0.ChangeDetectorRef},{type:ResizeService},{type:ProviderService}],propDecorators:{collapseSize:[{type:Input}]}});class DialogRegisterContent{_activeModal;_fb;form;constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.form=this._fb.group({username:["",[Validators.required]],name:["",[Validators.required]],phone:["",[Validators.required]],company:["",[Validators.required]],email:["",[Validators.required]]})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogRegisterContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogRegisterContent,isStandalone:!1,selector:"resolveio-dialog.register",ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table {\n\t\t width: 100%;\n\t\t}\n\t\t\n\t\t.navbar-light .navbar-nav .active>.nav-link, .navbar-light .navbar-nav .nav-link.active, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .show>.nav-link {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.navbar-light .navbar-nav .nav-link {\n\t\tcolor:#333;\n\t\t}\n\t\ta.nav-link.loginreg {\n\t\tbackground-color: #0b4499;\n\t\tcolor: #fff !important;\n\t\tborder-radius: 40px;\n\t\t}\n\t\ta.nav-link.loginreg:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t.nav-link {\n\t\tcolor: #333333;\n\t\tfont-size: 150%\n\t\t}\n\t\t.nav-item a.nav-link.active {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.contactimg>img{\n\t\twidth: 100%;\n\t\t}\n\t\t\n\t\t.log-box {\n\t\tpadding-top: 26px;\n\t\tpadding-bottom: 26px;\n\t\t}\n\t\t.loginform .form-control, .register-form .form-control {\n\t\tcolor: #000;\n\t\theight: 52px;\n\t\t}\n\t\t.loginform {\n\t\tmargin-top: 35px;\n\t\t}\n\t\t.loginform label {\n\t\tfont-size: 18px;\n\t\tfont-weight: 600;\n\t\t}\n\t\t\n\t\t.loginbtn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 44px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\t.contactimg {\n\t\tposition: relative;\n\t\t}\n\t\t.login-logo {\n\t\tmargin-bottom: 20px;\n\t\t}\n\t\t\n\t\t.textbox {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tcolor: #fff;\n\t\tpadding: 40px;\n\t\ttransform: translate(0%, -50%);\n\t\ttext-align: center;\n\t\t}\n\t\t.sign-btn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 14px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\tbutton.btn.sign-btn:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate (ngSubmit)="_activeModal.close(form)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> Register</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row bg-white">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="register-form">\n\t\t <div class="form-group">\n\t\t <label>User Name</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" [focus]="true" aria-describedby="emailHelp" placeholder="User Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Full Name</label>\n\t\t @if (form.controls.name.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.name.valid ? \'is-valid\' : \'is-invalid\']" formControlName="name" aria-describedby="emailHelp" placeholder="Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone Number</label>\n\t\t @if (form.controls.phone.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.phone.valid ? \'is-valid\' : \'is-invalid\']" formControlName="phone" placeholder="Phone Number">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Company</label>\n\t\t @if (form.controls.company.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.company.valid ? \'is-valid\' : \'is-invalid\']" formControlName="company" placeholder="Company Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (form.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" class="form-control" [ngClass]="[\'form-control\', form.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="Email">\n\t\t </div>\n\t\t <button type="submit" class="btn sign-btn">Signup</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t <div class="modal-footer">\n\t\t <responsive-button-group>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </responsive-button-group>\n\t\t </div>\n\t\t</form>\n\t\t',isInline:!0,styles:["collapse-table{width:100%}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:#0b4499}.navbar-light .navbar-nav .nav-link{color:#333}a.nav-link.loginreg{background-color:#0b4499;color:#fff!important;border-radius:40px}a.nav-link.loginreg:hover{background:#1668e2}.nav-link{color:#333;font-size:150%}.nav-item a.nav-link.active{color:#0b4499}.contactimg>img{width:100%}.log-box{padding-top:26px;padding-bottom:26px}.loginform .form-control,.register-form .form-control{color:#000;height:52px}.loginform{margin-top:35px}.loginform label{font-size:18px;font-weight:600}.loginbtn{background:#0b4499;width:100%;margin-top:44px;height:52px;font-size:22px;border-radius:2px;color:#fff!important}.contactimg{position:relative}.login-logo{margin-bottom:20px}.textbox{position:absolute;top:50%;color:#fff;padding:40px;transform:translateY(-50%);text-align:center}.sign-btn{background:#0b4499;width:100%;margin-top:14px;height:52px;font-size:22px;border-radius:2px;color:#fff!important}button.btn.sign-btn:hover{background:#1668e2}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogRegisterContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.register",template:'\n\t\t<style>\n\t\t collapse-table {\n\t\t width: 100%;\n\t\t}\n\t\t\n\t\t.navbar-light .navbar-nav .active>.nav-link, .navbar-light .navbar-nav .nav-link.active, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .show>.nav-link {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.navbar-light .navbar-nav .nav-link {\n\t\tcolor:#333;\n\t\t}\n\t\ta.nav-link.loginreg {\n\t\tbackground-color: #0b4499;\n\t\tcolor: #fff !important;\n\t\tborder-radius: 40px;\n\t\t}\n\t\ta.nav-link.loginreg:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t.nav-link {\n\t\tcolor: #333333;\n\t\tfont-size: 150%\n\t\t}\n\t\t.nav-item a.nav-link.active {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.contactimg>img{\n\t\twidth: 100%;\n\t\t}\n\t\t\n\t\t.log-box {\n\t\tpadding-top: 26px;\n\t\tpadding-bottom: 26px;\n\t\t}\n\t\t.loginform .form-control, .register-form .form-control {\n\t\tcolor: #000;\n\t\theight: 52px;\n\t\t}\n\t\t.loginform {\n\t\tmargin-top: 35px;\n\t\t}\n\t\t.loginform label {\n\t\tfont-size: 18px;\n\t\tfont-weight: 600;\n\t\t}\n\t\t\n\t\t.loginbtn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 44px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\t.contactimg {\n\t\tposition: relative;\n\t\t}\n\t\t.login-logo {\n\t\tmargin-bottom: 20px;\n\t\t}\n\t\t\n\t\t.textbox {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tcolor: #fff;\n\t\tpadding: 40px;\n\t\ttransform: translate(0%, -50%);\n\t\ttext-align: center;\n\t\t}\n\t\t.sign-btn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 14px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\tbutton.btn.sign-btn:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate (ngSubmit)="_activeModal.close(form)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> Register</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row bg-white">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="register-form">\n\t\t <div class="form-group">\n\t\t <label>User Name</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" [focus]="true" aria-describedby="emailHelp" placeholder="User Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Full Name</label>\n\t\t @if (form.controls.name.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.name.valid ? \'is-valid\' : \'is-invalid\']" formControlName="name" aria-describedby="emailHelp" placeholder="Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone Number</label>\n\t\t @if (form.controls.phone.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.phone.valid ? \'is-valid\' : \'is-invalid\']" formControlName="phone" placeholder="Phone Number">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Company</label>\n\t\t @if (form.controls.company.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.company.valid ? \'is-valid\' : \'is-invalid\']" formControlName="company" placeholder="Company Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (form.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" class="form-control" [ngClass]="[\'form-control\', form.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="Email">\n\t\t </div>\n\t\t <button type="submit" class="btn sign-btn">Signup</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t <div class="modal-footer">\n\t\t <responsive-button-group>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </responsive-button-group>\n\t\t </div>\n\t\t</form>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}]});class DialogSelectWithButtonsURLContent{_activeModal;_account;url="";close;allElements;title="Select Window Type";selectedType="";options=[{value:"same_tab",text:"Same Tab"},{value:"new_tab",text:"New Tab"},{value:"new_window",text:"New Window"}];constructor(t,e){this._activeModal=t,this._account=e}ngOnInit(){const t=this.resolveRoutingPreference();return"sameTab"===t?(window.open(this.url,"_self"),void this._activeModal.close()):"newTab"===t?(window.open(this.url,"_blank"),void this._activeModal.close()):void("newWindow"===t&&(window.open(this.url,"_blank","toolbar=1,location=1,menubar=1"),this._activeModal.close()))}resolveRoutingPreference(){const t=this._account.getUser()?.settings?.routing_preference;return"sameTab"===t||"newTab"===t||"newWindow"===t?t:"alwaysAsk"}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100)}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}onSelectType(t){this.selectedType=t,this.submit()}submit(){"same_tab"===this.selectedType&&window.open(this.url,"_self"),"new_tab"===this.selectedType&&window.open(this.url,"_blank"),"new_window"===this.selectedType&&window.open(this.url,"_blank","toolbar=1,location=1,menubar=1"),this._activeModal.close()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectWithButtonsURLContent,deps:[{token:i1$2.NgbActiveModal},{token:AccountManagerService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectWithButtonsURLContent,isStandalone:!1,selector:"resolveio-dialog.select-with-buttons-url",inputs:{url:"url"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div class="row">\n\t\t @for (option of options; track option.value) {\n\t\t <div class="col">\n\t\t <button style="width: 100%" type="button" [ngClass]="[\'btn\', selectedType === option.value ? \'btn-success\' : \'btn-warning\']" (click)="onSelectType(option.value)">{{option.text}}</button>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t',isInline:!0,styles:["collapse-table tr:hover{background-color:#add8e6;cursor:pointer}.selected{background-color:#add8e6}collapse-table{width:100%}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectWithButtonsURLContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-with-buttons-url",template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div class="row">\n\t\t @for (option of options; track option.value) {\n\t\t <div class="col">\n\t\t <button style="width: 100%" type="button" [ngClass]="[\'btn\', selectedType === option.value ? \'btn-success\' : \'btn-warning\']" (click)="onSelectType(option.value)">{{option.text}}</button>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:AccountManagerService}],propDecorators:{url:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class CollapseTableComponent{_resizeService;_account;_elementRef;collapseSize;tableFixed=!1;headerFixed=!1;stickyHeaders;secondaryColor=!1;tertiaryColor=!1;windowSize=window.innerWidth;windowSizeSubscription=null;mutationObserver=null;resizeObserver=null;constructor(t,e,n){this._resizeService=t,this._account=e,this._elementRef=n}ngOnInit(){this.windowSizeSubscription=this._resizeService.onResize$.subscribe(t=>{this.windowSize=t.innerWidth,this.updateStickyTopOffset()}),this._account.getUser()&&this._account.getUser().settings&&(document.documentElement.style.setProperty("--primary-table-color",this._account.getUser().settings.table_color),document.documentElement.style.setProperty("--primary-table-font-color",this._account.getUser().settings.table_font_color),document.documentElement.style.setProperty("--font-size",this._account.getUser().settings.font_size+"px"),document.documentElement.style.setProperty("--secondary-table-color",this._account.getUser().settings.secondary_table_color),document.documentElement.style.setProperty("--secondary-table-font-color",this._account.getUser().settings.secondary_table_font_color),document.documentElement.style.setProperty("--tertiary-table-color",this._account.getUser().settings.tertiary_table_color),document.documentElement.style.setProperty("--tertiary-table-font-color",this._account.getUser().settings.tertiary_table_font_color))}ngAfterViewInit(){setTimeout(()=>this.updateStickyTopOffset()),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(()=>this.updateStickyTopOffset()),this.mutationObserver.observe(this._elementRef.nativeElement,{childList:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.updateStickyTopOffset()),this.resizeObserver.observe(this._elementRef.nativeElement))}ngOnChanges(){this.updateStickyTopOffset()}ngOnDestroy(){this.windowSizeSubscription.unsubscribe(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect()}onClick(t){}getCollapseClass(){let t=["table"];const e=this.isStickyHeadersEnabled();return this._elementRef.nativeElement.dataset.collapseTableStickyHeaders=e?"true":"false",this.secondaryColor?t.push("collapseTable-sec"):this.tertiaryColor?t.push("collapseTable-tert"):t.push("collapseTable"),this.tableFixed&&t.push("fixed"),this.headerFixed&&t.push("headerFixed"),e&&t.push("stickyHeaders"),t}getPrimaryColor(){return this._account.getUser()?this._account.getUser().settings.table_color:"#3b3ee3"}updateStickyTopOffset(){const t=this._elementRef.nativeElement,e=this.isStickyHeadersEnabled();let n=0,o=t.parentElement?.closest("collapse-table");for(t.dataset.collapseTableStickyHeaders=e?"true":"false";o;)n++,o=o.parentElement?.closest("collapse-table");t.style.setProperty("--collapse-table-sticky-z",`${Math.max(1,1030-n)}`),t.style.setProperty("--collapse-table-sticky-top","0px")}isStickyHeadersEnabled(){const t=this.toOptionalBoolean(this.stickyHeaders);if(null!==t)return t;const e=this._elementRef.nativeElement,n=e.parentElement?.closest("collapse-table");if(!n)return!0;const o=n.dataset.collapseTableStickyHeaders;if("true"===o)return!0;if("false"===o)return!1;const r=n.querySelector("table");return!r||r.classList.contains("stickyHeaders")}toOptionalBoolean(t){if(null==t)return null;if("boolean"==typeof t)return t;const e=t.trim().toLowerCase();return!e||"true"===e||"false"!==e}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableComponent,deps:[{token:ResizeService},{token:AccountManagerService},{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:CollapseTableComponent,isStandalone:!1,selector:"collapse-table",inputs:{collapseSize:"collapseSize",tableFixed:"tableFixed",headerFixed:"headerFixed",stickyHeaders:"stickyHeaders",secondaryColor:"secondaryColor",tertiaryColor:"tertiaryColor"},usesOnChanges:!0,ngImport:i0,template:'<style>\n\t:host ::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: white;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t}\n\n\t.table-responsive-xl {\n\t\t/* Sticky headers rely on page scroll; avoid creating a local scroll container. */\n\t\toverflow: visible !important;\n\t\tposition: relative;\n\t\tborder-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable,\n\t:host ::ng-deep .collapseTable-sec,\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--primary-table-color);\n\t\t--collapse-table-header-color: var(--primary-table-font-color);\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t\ttable-layout: auto;\n\t\toverflow: visible;\n\t\tposition: relative;\n\t\tborder-collapse: separate;\n\t\tborder-spacing: 0;\n\t\tborder: 1px solid rgba(83, 102, 132, 0.25);\n\t\tborder-radius: 12px;\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: 0 8px 24px rgba(18, 42, 74, 0.12);\n\t}\n\n\t:host ::ng-deep .collapseTable-sec {\n\t\t--collapse-table-header-bg: var(--secondary-table-color);\n\t\t--collapse-table-header-color: var(--secondary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--tertiary-table-color);\n\t\t--collapse-table-header-color: var(--tertiary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable tr,\n\t:host ::ng-deep .collapseTable-sec tr,\n\t:host ::ng-deep .collapseTable-tert tr {\n\t\tpadding: 0;\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr,\n\t:host ::ng-deep .collapseTable-sec tbody tr,\n\t:host ::ng-deep .collapseTable-tert tbody tr {\n\t\tbackground-color: #ffffff;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-sec tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-tert tbody tr:nth-child(even) {\n\t\tbackground-color: rgba(91, 114, 146, 0.04);\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:hover,\n\t:host ::ng-deep .collapseTable-sec tbody tr:hover,\n\t:host ::ng-deep .collapseTable-tert tbody tr:hover {\n\t\tbackground-color: rgba(40, 117, 230, 0.1);\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert th,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tpadding: 10px 12px;\n\t\ttext-align: center;\n\t\tvertical-align: middle;\n\t\tborder-bottom: 1px solid rgba(102, 123, 157, 0.22);\n\t\twhite-space: normal;\n\t\tword-break: normal;\n\t\toverflow-wrap: break-word;\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-tert th {\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tfont-weight: 700;\n\t\tfont-size: var(--font-size);\n\t\tbackground: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.08)), var(--collapse-table-header-bg);\n\t\tcolor: var(--collapse-table-header-color);\n\t\tbox-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);\n\t}\n\n\t:host ::ng-deep .stickyHeaders th {\n\t\tposition: sticky;\n\t\ttop: var(--collapse-table-sticky-top, 0px);\n\t\tz-index: var(--collapse-table-sticky-z, 10);\n\t}\n\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tcolor: #17365d;\n\t\tfont-size: var(--font-size);\n\t\tbackground-color: inherit;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-sec tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-tert tbody:last-of-type > tr:last-child > td {\n\t\tborder-bottom: none;\n\t}\n\n\t.fixed {\n\t\ttable-layout: fixed;\n\t}\n\n\t/* Keep native table flow for sticky headers. Forcing table/table-row display\n\t here can cause multi-row body rendering/sticky issues in some browsers. */\n\t:host ::ng-deep .headerFixed thead {\n\t\tdisplay: table-header-group !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody {\n\t\tdisplay: table-row-group !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody tr {\n\t\tdisplay: table-row !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:first-child {\n\t\tborder-top-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:last-child {\n\t\tborder-top-right-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:first-child {\n\t\tborder-bottom-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:last-child {\n\t\tborder-bottom-right-radius: 12px;\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar {\n\t\theight: 10px;\n\t\twidth: 10px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-thumb {\n\t\tbackground: rgba(85, 108, 143, 0.45);\n\t\tborder-radius: 999px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-track {\n\t\tbackground: rgba(164, 182, 212, 0.18);\n\t}\n\n\t@media screen and (max-width: 768px) {\n\t\t:host ::ng-deep .collapseTable th,\n\t\t:host ::ng-deep .collapseTable td,\n\t\t:host ::ng-deep .collapseTable-sec th,\n\t\t:host ::ng-deep .collapseTable-sec td,\n\t\t:host ::ng-deep .collapseTable-tert th,\n\t\t:host ::ng-deep .collapseTable-tert td {\n\t\t\tpadding: 8px;\n\t\t\tfont-size: calc(var(--font-size) - 1px);\n\t\t}\n\t}\n</style>\n\n<div class="table-responsive-xl">\n\t<table [ngClass]="getCollapseClass()" cellspacing="0" cellpadding="0">\n\t\t<ng-content></ng-content>\n\t</table>\n</div>\n',styles:[":host ::ng-deep :root{--primary-table-color: #3b3ee3;--primary-table-font-color: white;--font-size: 12px;--secondary-table-color: #87ceeb;--secondary-table-font-color: #000000;--tertiary-table-color: #ff4500;--tertiary-table-font-color: #000000}:host{display:block;width:100%}.table-responsive-xl{overflow:visible!important;position:relative;border-radius:12px}:host ::ng-deep .collapseTable,:host ::ng-deep .collapseTable-sec,:host ::ng-deep .collapseTable-tert{--collapse-table-header-bg: var(--primary-table-color);--collapse-table-header-color: var(--primary-table-font-color);margin:0;padding:0;width:100%;max-width:100%;table-layout:auto;overflow:visible;position:relative;border-collapse:separate;border-spacing:0;border:1px solid rgba(83,102,132,.25);border-radius:12px;background-color:#fff;box-shadow:0 8px 24px #122a4a1f}:host ::ng-deep .collapseTable-sec{--collapse-table-header-bg: var(--secondary-table-color);--collapse-table-header-color: var(--secondary-table-font-color)}:host ::ng-deep .collapseTable-tert{--collapse-table-header-bg: var(--tertiary-table-color);--collapse-table-header-color: var(--tertiary-table-font-color)}:host ::ng-deep .collapseTable tr,:host ::ng-deep .collapseTable-sec tr,:host ::ng-deep .collapseTable-tert tr{padding:0;transition:background-color .16s ease}:host ::ng-deep .collapseTable tbody tr,:host ::ng-deep .collapseTable-sec tbody tr,:host ::ng-deep .collapseTable-tert tbody tr{background-color:#fff}:host ::ng-deep .collapseTable tbody tr:nth-child(2n),:host ::ng-deep .collapseTable-sec tbody tr:nth-child(2n),:host ::ng-deep .collapseTable-tert tbody tr:nth-child(2n){background-color:#5b72920a}:host ::ng-deep .collapseTable tbody tr:hover,:host ::ng-deep .collapseTable-sec tbody tr:hover,:host ::ng-deep .collapseTable-tert tbody tr:hover{background-color:#2875e61a}:host ::ng-deep .collapseTable th,:host ::ng-deep .collapseTable td,:host ::ng-deep .collapseTable-sec th,:host ::ng-deep .collapseTable-sec td,:host ::ng-deep .collapseTable-tert th,:host ::ng-deep .collapseTable-tert td{padding:10px 12px;text-align:center;vertical-align:middle;border-bottom:1px solid rgba(102,123,157,.22);white-space:normal;word-break:normal;overflow-wrap:break-word}:host ::ng-deep .collapseTable th,:host ::ng-deep .collapseTable-sec th,:host ::ng-deep .collapseTable-tert th{letter-spacing:.08em;text-transform:uppercase;font-weight:700;font-size:var(--font-size);background:linear-gradient(180deg,#fff3,#00000014),var(--collapse-table-header-bg);color:var(--collapse-table-header-color);box-shadow:inset 0 -1px #00000024}:host ::ng-deep .stickyHeaders th{position:sticky;top:var(--collapse-table-sticky-top, 0px);z-index:var(--collapse-table-sticky-z, 10)}:host ::ng-deep .collapseTable td,:host ::ng-deep .collapseTable-sec td,:host ::ng-deep .collapseTable-tert td{color:#17365d;font-size:var(--font-size);background-color:inherit}:host ::ng-deep .collapseTable tbody:last-of-type>tr:last-child>td,:host ::ng-deep .collapseTable-sec tbody:last-of-type>tr:last-child>td,:host ::ng-deep .collapseTable-tert tbody:last-of-type>tr:last-child>td{border-bottom:none}.fixed{table-layout:fixed}:host ::ng-deep .headerFixed thead{display:table-header-group!important;width:auto!important;table-layout:auto!important}:host ::ng-deep .headerFixed tbody{display:table-row-group!important}:host ::ng-deep .headerFixed tbody tr{display:table-row!important;width:auto!important;table-layout:auto!important}:host ::ng-deep .collapseTable>thead:first-of-type>tr:first-child>th:first-child,:host ::ng-deep .collapseTable-sec>thead:first-of-type>tr:first-child>th:first-child,:host ::ng-deep .collapseTable-tert>thead:first-of-type>tr:first-child>th:first-child{border-top-left-radius:12px}:host ::ng-deep .collapseTable>thead:first-of-type>tr:first-child>th:last-child,:host ::ng-deep .collapseTable-sec>thead:first-of-type>tr:first-child>th:last-child,:host ::ng-deep .collapseTable-tert>thead:first-of-type>tr:first-child>th:last-child{border-top-right-radius:12px}:host ::ng-deep .collapseTable>tbody:last-of-type>tr:last-child>td:first-child,:host ::ng-deep .collapseTable-sec>tbody:last-of-type>tr:last-child>td:first-child,:host ::ng-deep .collapseTable-tert>tbody:last-of-type>tr:last-child>td:first-child{border-bottom-left-radius:12px}:host ::ng-deep .collapseTable>tbody:last-of-type>tr:last-child>td:last-child,:host ::ng-deep .collapseTable-sec>tbody:last-of-type>tr:last-child>td:last-child,:host ::ng-deep .collapseTable-tert>tbody:last-of-type>tr:last-child>td:last-child{border-bottom-right-radius:12px}.hide{display:none}.table-responsive-xl::-webkit-scrollbar{height:10px;width:10px}.table-responsive-xl::-webkit-scrollbar-thumb{background:#556c8f73;border-radius:999px}.table-responsive-xl::-webkit-scrollbar-track{background:#a4b6d42e}@media screen and (max-width:768px){:host ::ng-deep .collapseTable th,:host ::ng-deep .collapseTable td,:host ::ng-deep .collapseTable-sec th,:host ::ng-deep .collapseTable-sec td,:host ::ng-deep .collapseTable-tert th,:host ::ng-deep .collapseTable-tert td{padding:8px;font-size:calc(var(--font-size) - 1px)}}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableComponent,decorators:[{type:Component,args:[{selector:"collapse-table",standalone:!1,template:'<style>\n\t:host ::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: white;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t}\n\n\t.table-responsive-xl {\n\t\t/* Sticky headers rely on page scroll; avoid creating a local scroll container. */\n\t\toverflow: visible !important;\n\t\tposition: relative;\n\t\tborder-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable,\n\t:host ::ng-deep .collapseTable-sec,\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--primary-table-color);\n\t\t--collapse-table-header-color: var(--primary-table-font-color);\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t\ttable-layout: auto;\n\t\toverflow: visible;\n\t\tposition: relative;\n\t\tborder-collapse: separate;\n\t\tborder-spacing: 0;\n\t\tborder: 1px solid rgba(83, 102, 132, 0.25);\n\t\tborder-radius: 12px;\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: 0 8px 24px rgba(18, 42, 74, 0.12);\n\t}\n\n\t:host ::ng-deep .collapseTable-sec {\n\t\t--collapse-table-header-bg: var(--secondary-table-color);\n\t\t--collapse-table-header-color: var(--secondary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--tertiary-table-color);\n\t\t--collapse-table-header-color: var(--tertiary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable tr,\n\t:host ::ng-deep .collapseTable-sec tr,\n\t:host ::ng-deep .collapseTable-tert tr {\n\t\tpadding: 0;\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr,\n\t:host ::ng-deep .collapseTable-sec tbody tr,\n\t:host ::ng-deep .collapseTable-tert tbody tr {\n\t\tbackground-color: #ffffff;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-sec tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-tert tbody tr:nth-child(even) {\n\t\tbackground-color: rgba(91, 114, 146, 0.04);\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:hover,\n\t:host ::ng-deep .collapseTable-sec tbody tr:hover,\n\t:host ::ng-deep .collapseTable-tert tbody tr:hover {\n\t\tbackground-color: rgba(40, 117, 230, 0.1);\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert th,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tpadding: 10px 12px;\n\t\ttext-align: center;\n\t\tvertical-align: middle;\n\t\tborder-bottom: 1px solid rgba(102, 123, 157, 0.22);\n\t\twhite-space: normal;\n\t\tword-break: normal;\n\t\toverflow-wrap: break-word;\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-tert th {\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tfont-weight: 700;\n\t\tfont-size: var(--font-size);\n\t\tbackground: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.08)), var(--collapse-table-header-bg);\n\t\tcolor: var(--collapse-table-header-color);\n\t\tbox-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);\n\t}\n\n\t:host ::ng-deep .stickyHeaders th {\n\t\tposition: sticky;\n\t\ttop: var(--collapse-table-sticky-top, 0px);\n\t\tz-index: var(--collapse-table-sticky-z, 10);\n\t}\n\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tcolor: #17365d;\n\t\tfont-size: var(--font-size);\n\t\tbackground-color: inherit;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-sec tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-tert tbody:last-of-type > tr:last-child > td {\n\t\tborder-bottom: none;\n\t}\n\n\t.fixed {\n\t\ttable-layout: fixed;\n\t}\n\n\t/* Keep native table flow for sticky headers. Forcing table/table-row display\n\t here can cause multi-row body rendering/sticky issues in some browsers. */\n\t:host ::ng-deep .headerFixed thead {\n\t\tdisplay: table-header-group !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody {\n\t\tdisplay: table-row-group !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody tr {\n\t\tdisplay: table-row !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:first-child {\n\t\tborder-top-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:last-child {\n\t\tborder-top-right-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:first-child {\n\t\tborder-bottom-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:last-child {\n\t\tborder-bottom-right-radius: 12px;\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar {\n\t\theight: 10px;\n\t\twidth: 10px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-thumb {\n\t\tbackground: rgba(85, 108, 143, 0.45);\n\t\tborder-radius: 999px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-track {\n\t\tbackground: rgba(164, 182, 212, 0.18);\n\t}\n\n\t@media screen and (max-width: 768px) {\n\t\t:host ::ng-deep .collapseTable th,\n\t\t:host ::ng-deep .collapseTable td,\n\t\t:host ::ng-deep .collapseTable-sec th,\n\t\t:host ::ng-deep .collapseTable-sec td,\n\t\t:host ::ng-deep .collapseTable-tert th,\n\t\t:host ::ng-deep .collapseTable-tert td {\n\t\t\tpadding: 8px;\n\t\t\tfont-size: calc(var(--font-size) - 1px);\n\t\t}\n\t}\n</style>\n\n<div class="table-responsive-xl">\n\t<table [ngClass]="getCollapseClass()" cellspacing="0" cellpadding="0">\n\t\t<ng-content></ng-content>\n\t</table>\n</div>\n'}]}],ctorParameters:()=>[{type:ResizeService},{type:AccountManagerService},{type:i0.ElementRef}],propDecorators:{collapseSize:[{type:Input}],tableFixed:[{type:Input}],headerFixed:[{type:Input}],stickyHeaders:[{type:Input}],secondaryColor:[{type:Input}],tertiaryColor:[{type:Input}]}});class DialogSelectArrayObjsContent{_activeModal;title="";objects=[];multiple=!1;allowNone=!1;close;allElements;selectedIndex=null;selectedItem=null;selectedIndexes=[];selectedItems=[];constructor(t){this._activeModal=t}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100),this.objects.forEach((t,e)=>{t.selected&&(this.selectedIndexes.push(e),this.selectedItems.push(t))})}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}onSelectItem(t){this.multiple?this.selectedItems.some(e=>e.value===this.objects[t].value)?(this.selectedIndexes.splice(this.selectedIndexes.indexOf(t),1),this.selectedItems.splice(this.selectedItems.map(t=>t.value).indexOf(this.objects[t].value),1)):(this.selectedIndexes.push(t),this.selectedItems.push(this.objects[t])):this.objects[t]===this.selectedItem?(this.selectedItem=null,this.selectedIndex=null):(this.selectedItem=this.objects[t],this.selectedIndex=t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayObjsContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectArrayObjsContent,isStandalone:!1,selector:"resolveio-dialog.select-array-objs",inputs:{title:"title",objects:"objects",multiple:"multiple",allowNone:"allowNone"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div style="height: 60vh; overflow-y: auto">\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (object of objects; track object.text; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : i === selectedIndex || selectedIndexes.includes(i)}">\n\t\t <td>{{object.text}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t @if (!allowNone) {\n\t\t <button type="button" [ngClass]="[\'btn\', (selectedItem || selectedItems.length) ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedItem && !selectedItems.length" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t @if (allowNone) {\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',isInline:!0,styles:["collapse-table tr:hover{background-color:#add8e6;cursor:pointer}.selected{background-color:#add8e6}collapse-table{width:100%}\n"],dependencies:[{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayObjsContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-array-objs",template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div style="height: 60vh; overflow-y: auto">\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (object of objects; track object.text; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : i === selectedIndex || selectedIndexes.includes(i)}">\n\t\t <td>{{object.text}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t @if (!allowNone) {\n\t\t <button type="button" [ngClass]="[\'btn\', (selectedItem || selectedItems.length) ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedItem && !selectedItems.length" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t @if (allowNone) {\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],objects:[{type:Input}],multiple:[{type:Input}],allowNone:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class DialogSelectArrayContent{_activeModal;_cdRef;title="";array=[];multiple;selectedIndexes=[];close;allElements;method="list";mappedArray=[];selectIndexes=[];constructor(t,e){this._activeModal=t,this._cdRef=e}ngOnInit(){this.mappedArray=this.array.map((t,e)=>({value:e,text:t})),this.selectedIndexes.forEach(t=>{this.selectIndexes.push(t)})}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100)}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}addDropDown(){let t=this.array.filter((t,e)=>!this.selectedIndexes.includes(e))[0],e=this.array.findIndex(e=>e===t);this.selectedIndexes.push(e),this.selectIndexes.push(e)}onSelectDropdown(t,e){this.onSelectItem(this.selectedIndexes[e]),this.onSelectItem(t)}availableAdd(){return!!this.array.filter((t,e)=>!this.selectedIndexes.includes(e))[0]}getFilteredArray(t){return this.mappedArray.filter(e=>e.value===t||!this.selectedIndexes.includes(e.value))}isInSelectedIndex(t){return!!this.selectedIndexes.includes(t)}onSelectItem(t){this.multiple?this.selectedIndexes.includes(t)?(this.selectedIndexes.splice(this.selectedIndexes.indexOf(t),1),this.selectIndexes.splice(this.selectIndexes.indexOf(t),1)):(this.selectedIndexes.push(t),this.selectIndexes.push(t)):this.selectedIndexes.includes(t)?(this.selectedIndexes=[],this.selectIndexes=[]):(this.selectedIndexes=[t],this.selectIndexes=[t])}getArray(){let t=[];return this.selectedIndexes.forEach(e=>{t.push(this.array[e])}),t}selectAll(){this.selectedIndexes=[],this.selectIndexes=[],this.array.forEach((t,e)=>{this.selectedIndexes.push(e),this.selectIndexes.push(e)})}removeAll(){this.selectedIndexes=[],this.selectIndexes=[]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayContent,deps:[{token:i1$2.NgbActiveModal},{token:i0.ChangeDetectorRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectArrayContent,isStandalone:!1,selector:"resolveio-dialog.select-array",inputs:{title:"title",array:"array",multiple:"multiple",selectedIndexes:"selectedIndexes"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body" style="height: 60vh;">\n\t\t <responsive-button-group>\n\t\t @if (multiple) {\n\t\t <button type="button" class="btn btn-primary" (click)="selectAll()">Select All</button>\n\t\t <button type="button" class="btn btn-danger" (click)="removeAll()">Remove All</button>\n\t\t }\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'list\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'list\'">Use List</button>\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'dropdown\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'dropdown\'">Use Dropdown</button>\n\t\t </responsive-button-group>\n\t\t <div style="height: 50vh; overflow-y: auto; margin-top: 10px">\n\t\t @if (method === \'list\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (data of array; track data; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : isInSelectedIndex(i)}">\n\t\t <td>{{data}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t }\n\t\t @if (method === \'dropdown\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>Item</th>\n\t\t <th>Remove</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (item of selectIndexes; track item; let i = $index) {\n\t\t <tr>\n\t\t <td>\n\t\t <rio-select placeholder="Select Item" [ngModel]="item" (change)="onSelectDropdown($event, i)">\n\t\t @for (data of getFilteredArray(item); track data.value) {\n\t\t <rio-option [value]="data.value">{{data.text}}</rio-option>\n\t\t }\n\t\t </rio-select>\n\t\t </td>\n\t\t <td>\n\t\t <button type="button" class="btn btn-danger" (click)="onSelectItem(item)">Remove</button>\n\t\t </td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t @if (multiple || !selectIndexes.length) {\n\t\t <button type="button" class="btn btn-success" (click)="addDropDown()" [disabled]="!availableAdd()">Add</button>\n\t\t }\n\t\t }\n\t\t</div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" [ngClass]="[\'btn\', selectedIndexes.length ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedIndexes.length || this.selectedIndexes.includes(null)" (click)="_activeModal.close(this.multiple ? getArray() : array[selectedIndexes[0]])">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',isInline:!0,styles:["collapse-table tr:hover{background-color:#add8e6;cursor:pointer}.selected{background-color:#add8e6}collapse-table{width:100%}\n"],dependencies:[{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:i5.RioOptionComponent,selector:"rio-option",inputs:["value","disabled","label","id"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}],changeDetection:i0.ChangeDetectionStrategy.OnPush})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-array",template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body" style="height: 60vh;">\n\t\t <responsive-button-group>\n\t\t @if (multiple) {\n\t\t <button type="button" class="btn btn-primary" (click)="selectAll()">Select All</button>\n\t\t <button type="button" class="btn btn-danger" (click)="removeAll()">Remove All</button>\n\t\t }\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'list\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'list\'">Use List</button>\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'dropdown\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'dropdown\'">Use Dropdown</button>\n\t\t </responsive-button-group>\n\t\t <div style="height: 50vh; overflow-y: auto; margin-top: 10px">\n\t\t @if (method === \'list\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (data of array; track data; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : isInSelectedIndex(i)}">\n\t\t <td>{{data}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t }\n\t\t @if (method === \'dropdown\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>Item</th>\n\t\t <th>Remove</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (item of selectIndexes; track item; let i = $index) {\n\t\t <tr>\n\t\t <td>\n\t\t <rio-select placeholder="Select Item" [ngModel]="item" (change)="onSelectDropdown($event, i)">\n\t\t @for (data of getFilteredArray(item); track data.value) {\n\t\t <rio-option [value]="data.value">{{data.text}}</rio-option>\n\t\t }\n\t\t </rio-select>\n\t\t </td>\n\t\t <td>\n\t\t <button type="button" class="btn btn-danger" (click)="onSelectItem(item)">Remove</button>\n\t\t </td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t @if (multiple || !selectIndexes.length) {\n\t\t <button type="button" class="btn btn-success" (click)="addDropDown()" [disabled]="!availableAdd()">Add</button>\n\t\t }\n\t\t }\n\t\t</div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" [ngClass]="[\'btn\', selectedIndexes.length ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedIndexes.length || this.selectedIndexes.includes(null)" (click)="_activeModal.close(this.multiple ? getArray() : array[selectedIndexes[0]])">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',changeDetection:ChangeDetectionStrategy.OnPush,standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i0.ChangeDetectorRef}],propDecorators:{title:[{type:Input}],array:[{type:Input}],multiple:[{type:Input}],selectedIndexes:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class DialogService{modalService;constructor(t){this.modalService=t}openDialog(t,e={size:"lg",backdrop:"static"}){return this.modalService.open(t,e)}notify(t){const e=this.openDialog(DialogNotifyContent);e.componentInstance.title="Notify",e.componentInstance.body=t}input(t,e){const n=this.openDialog(DialogInputContent);return n.componentInstance.title=t,n.componentInstance.inputFields=e,n.result}error(t){const e=this.openDialog(DialogErrorContent);e.componentInstance.title="Error",e.componentInstance.body=t}confirm(t,e){const n=this.openDialog(DialogConfirmContent);return n.componentInstance.title="Confirm",n.componentInstance.body=t,n.componentInstance.html=e,n.result}selectDateTime(t,e=!0){const n=this.openDialog(DialogSelectDateTimeContent);return n.componentInstance.title="Select Date"+(e?" and Time":""),n.componentInstance.date=t,n.componentInstance.showTime=e,n.result}selectDataLabel(t,e=!0){const n=this.openDialog(DialogSelectDataLabelsContent,{size:"sm",backdrop:"static"});return n.componentInstance.title="Select Data Labels",n.componentInstance.data=t,n.componentInstance.showArraySubData=e,n.result}login(t,e=!0,n=!1){const o=this.openDialog(DialogLoginContent);return o.componentInstance.msAllowed=t,o.componentInstance.showLoginText=e,o.componentInstance.publicProgram=n,o.result}register(){return this.openDialog(DialogRegisterContent).result}selectWithButtonsURL(t){const e=this.openDialog(DialogSelectWithButtonsURLContent);return e.componentInstance.url=t,e.result}selectWithArrayObjs(t,e,n=!1,o=!1){const r=this.openDialog(DialogSelectArrayObjsContent);return r.componentInstance.title=t,r.componentInstance.objects=e,r.componentInstance.multiple=n,r.componentInstance.allowNone=o,r.result}selectArray(t,e,n=!1,o=[]){const r=this.openDialog(DialogSelectArrayContent);return r.componentInstance.title=t,r.componentInstance.array=e,r.componentInstance.multiple=n,r.componentInstance.selectedIndexes=o,r.result}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogService,deps:[{token:i1$2.NgbModal}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1$2.NgbModal}]});class AuthService{_ds;_vs;_alert;_account;_socket;_core;_router;environment=null;userHasPhoneNumber=!1;userData;userAgentApplication;constructor(t,e,n,o,r,i,a){this._ds=t,this._vs=e,this._alert=n,this._account=o,this._socket=r,this._core=i,this._router=a}setupMSSingleSignOn(t){this.environment=t,"/auth365"===window.location.pathname&&window.location.hash&&window.location.hash.startsWith("#id_token=")&&(this.environment.MS_id_token=window.location.hash.replace("#","")),this.userAgentApplication=new UserAgentApplication({auth:{clientId:this.environment.MS_clientId,authority:this.environment.MS_authority,redirectUri:this.environment.MS_redirectUri,validateAuthority:!1,navigateToLoginRequestUrl:!1},framework:{isAngular:!0}})}setEnvironment(t){this.environment=t}setUserHasPhoneNumber(t){this.userHasPhoneNumber=t}registerUser(t,e=!0){return new Promise((n,o)=>{let r=[{label:"User Name",form:"username",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Username is required"],required:!0},{label:"Full Name",form:"fullname",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Full name is required"],required:!0},{label:"Email",form:"email",data:"",validators:[Validators.required,this._vs.email],validatorErrors:["required","email"],validatorMsg:["Email is required","Email is invalid"],required:!0}];this.userHasPhoneNumber&&r.push({label:"Phone",form:"phonenumber",data:"",validators:[this._vs.phoneNumber],validatorErrors:["phoneNumber"],validatorMsg:["Phone number is invalid"],type:"text"}),this._ds.input("Register New User",r).then(r=>{let i={username:r.username.value.trim().toLowerCase(),email:r.email.value.trim().toLowerCase(),fullname:r.fullname.value.trim(),roles:{super_admin:!1,approvals:[],groups:[],notifications:[],miscs:[]},active:!0,readonly:!1,phonenumber:r.phonenumber?r.phonenumber.value:"",other:t,attempts:0,salt:"",hash:""};this._socket.call("createUserAndEmailEnrollment",i,e,(t,e)=>{t?o(t):n(e)})},t=>o())})}editUser(t){let e=[{label:"User Name",form:"username",data:t.username,validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Username is required"],required:!0},{label:"Full Name",form:"fullname",data:t.fullname,validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Full name is required"],required:!0},{label:"Email",form:"email",data:t.email,validators:[Validators.required,this._vs.email],validatorErrors:["required","email"],validatorMsg:["Email is required","Email is invalid"],required:!0}];return this.userHasPhoneNumber&&e.push({label:"Phone",form:"phonenumber",data:t.phonenumber||"",validators:[this._vs.phoneNumber],validatorErrors:["phoneNumber"],validatorMsg:["Phone number is invalid"],type:"text"}),new Promise((n,o)=>{this._ds.input("Edit User",e).then(e=>{e.phonenumber&&e.phonenumber.value?t.phonenumber=e.phonenumber.value:t.phonenumber="",t.email=e.email.value.trim(),this._socket.call("editUser",t._id,e.username.value.trim().toLowerCase(),e.fullname.value.trim(),e.email.value.trim().toLowerCase(),t.phonenumber,(r,i)=>{if(r)this._socket.call("insertErrorLog","AuthService - edituser",[t,r]),o(r);else{let t={username:e.username.value.trim(),fullname:e.fullname.value.trim(),email:e.email.value.trim()};this._alert.setAlert("success","User has been edited"),n(t)}})},t=>{n(!0)})})}loginUser(){return new Promise((t,e)=>{this.loginModal().then(n=>{"PUBLIC_LOGIN"!==n.type?"PUBLIC_REGISTER"!==n.type?"MS"===n.type?this.microsoftSignOn():n.form.value.forgotPassword?this._account.resetUserPassword(n.form.value.username):this._account.logIn(n.form.value.username,n.form.value.password).then(e=>{t(e)},t=>e("Invalid login")):this._account.publicRegister({companyName:n.form.value.companyName,contactName:n.form.value.contactName,email:n.form.value.email,password:n.form.value.password,phone:n.form.value.phone}).then(e=>{this._router.navigateByUrl("/dashboard/client"),t(e)},t=>e(t)):this._account.publicLogIn(n.form.value.email,n.form.value.password).then(e=>{this._router.navigateByUrl("/dashboard/client"),t(e)},t=>e(t))},t=>e())})}microsoftSignOn(){this.userAgentApplication.loginRedirect(["user.read","mail.send"])}loginModal(){const t=!(!this.environment||!this.environment.MS_ALLOWED),e=!this.environment||!this.environment.HIDE_LOGIN_TEXT,n=this._core.publicProgram.getValue();return this._ds.login(t,e,n)}removeUser(t){return new Promise((e,n)=>{this._socket.call("removeDocument","users",t,(o,r)=>{o?(this._ds.error("Could not remove user"),this._socket.call("insertErrorLog","AuthService - removeUser",[t,o]),n(o)):e(!0)})})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthService,deps:[{token:DialogService},{token:ValidationService},{token:AlertService},{token:AccountManagerService},{token:SocketManagerService},{token:CoreService},{token:i1$1.Router}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:DialogService},{type:ValidationService},{type:AlertService},{type:AccountManagerService},{type:SocketManagerService},{type:CoreService},{type:i1$1.Router}]});class AuthPermissionService{modules=[];constructor(){}registerModule(t){this.modules.push(t),this.modules.sort((t,e)=>{let n=t.name,o=e.name;return n<o?-1:n>o?1:0})}getAllModulePermissions(){return this.modules}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthPermissionService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthPermissionService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthPermissionService,decorators:[{type:Injectable}],ctorParameters:()=>[]});class FeatureGateService{_app;constructor(t){this._app=t}isEnabled(t,e=!0){if(!t)return!0;const n=this.getGateConfig();return n?Array.isArray(n)?n.includes(t):"object"==typeof n&&t in n?!!n[t]:e:e}isLinkEnabled(t,e,n=!1){if(!t)return!0;const o=this.normalizeLink(t),r=Array.isArray(e)?e:[];for(let t=0;t<r.length;t++){const e=r[t],i=Array.isArray(e.views)?e.views:[];for(let t=0;t<i.length;t++){const r=i[t];if(this.isLinkMatch(r,o,n))return!(e.gate&&!this.isEnabled(e.gate,!0))&&!(r.gate&&!this.isEnabled(r.gate,!0))}}return!0}getGateConfig(){const t=this._app.environment.value||{};return t.FEATURE_GATES?t.FEATURE_GATES:t.MODULE_GATES?t.MODULE_GATES:t.FEATURE_FLAGS?t.FEATURE_FLAGS:null}normalizeLink(t){if(!t)return"";let e=t.replace(/\?.+$/,"");return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}isLinkMatch(t,e,n){if(!t||!t.link||!e)return!1;if(t.link===e)return!0;if(t.has_parameter){const n=t.link.endsWith("/")?t.link:t.link+"/";if(e.startsWith(n))return!0}if(n){const n=e.endsWith("/")?e:e+"/";if(t.link.startsWith(n))return!0}return!1}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FeatureGateService,deps:[{token:CoreService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FeatureGateService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FeatureGateService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:CoreService}]});class CoreTourService{_tour;_app;activeStep=new BehaviorSubject(null);currentStepIndex=new BehaviorSubject(-1);totalSteps=new BehaviorSubject(0);completed$=new Subject;navTabs=[];customStops=[];autoStartedUserId="";constructor(t,e){this._tour=t,this._app=e,this._tour.setDefaults({enableBackdrop:!0,disablePageScrolling:!0,smoothScroll:!0,centerAnchorOnScroll:!0,showProgress:!0,prevBtnTitle:"Back",nextBtnTitle:"Next",endBtnTitle:"Finish",backdropConfig:{backgroundColor:"rgba(0, 0, 0, 0.45)",offset:6}}),this._tour.start$.subscribe(()=>{this._app.setTourStarted(!0),this.totalSteps.next((this._tour.steps||[]).length)}),this._tour.stepShow$.subscribe(({step:t})=>{this._app.setTourStarted(!0),this.activeStep.next(t),this.currentStepIndex.next(this.resolveStepIndex(t)),this.totalSteps.next((this._tour.steps||[]).length)}),this._tour.end$.subscribe(()=>{const t=this._app.tourStarted.getValue();this._app.setTourStarted(!1),this.activeStep.next(null),this.currentStepIndex.next(-1),this.totalSteps.next((this._tour.steps||[]).length),t&&this.completed$.next()})}configure(t,e){this.navTabs=Array.isArray(t)?t.slice():[],this.customStops=Array.isArray(e)?e.slice():[];const n=this.buildSteps();this._tour.initialize(n)}start(t=!1){if(!this._tour.steps||!this._tour.steps.length)return!1;const e=this._tour.getStatus();return!t&&e===TourState.ON||(e!==TourState.OFF&&this._tour.end(),setTimeout(()=>this._tour.start(),0),!0)}retake(){return this.start(!0)}autoStartIfNeeded(t){return!(!t||!t._id)&&(!this.hasCompletedTour(t)&&(this.autoStartedUserId!==t._id&&(this.autoStartedUserId=t._id,setTimeout(()=>this.start(!0),900),!0)))}hasCompletedTour(t){const e=t&&t.other&&"object"==typeof t.other?t.other:{};return!!(e.tour_completed||e.took_tour||e.core_tour_completed||e.welcome_tour_completed)}resolveModuleDescription(t){const e=String(t||"").trim(),n=e.toLowerCase();return"home"===n?"Start here for your launchpad, announcements, and key shortcuts.":n.includes("admin")?"Use this module for users, permissions, and account administration.":n.includes("dashboard")?"Use dashboards for live status, KPIs, and quick daily actions.":n.includes("manage")?"Use manage for maintenance tables, reference data, and settings.":n.includes("report")?"Use reports for exports, historical views, and printable outputs.":`Use ${e} for workflows related to ${e.toLowerCase()}.`}buildSteps(){const t=[],e=e=>{if(!e||!e.anchorId)return;const n=String(e.stepId||"").trim()||`step-${t.length+1}`;t.some(t=>t.stepId===n)||t.push({...e,stepId:n})};return e({stepId:"shell-nav-main",anchorId:"navBarMain",title:"Top Navigation",content:this.buildTopNavIntro(),isOptional:!0}),e({stepId:"shell-nav-home",anchorId:"topNavHome",title:"Home",content:this.resolveModuleDescription("Home"),isOptional:!0}),this.navTabs.forEach((t,n)=>{const o=String(t?.tourAnchor||"").trim();if(!o)return;const r=this.resolveTabLabel(t)||`Module ${n+1}`;e({stepId:`shell-top-nav-${this.toSlug(r)}-${n+1}`,anchorId:o,title:r,content:this.resolveModuleDescription(r),isOptional:!0})}),e({stepId:"shell-nav-module",anchorId:"navBarModule",title:"Module Views",content:"This left menu changes with your current module and gives you quick access to list, new, edit, and detail pages.",isOptional:!0}),e({stepId:"shell-ai-assistant",anchorId:"aiAssistantToggle",title:"AI Assistant",content:"Open AI Assistant for guided help, field suggestions, and rapid updates without leaving your workflow.",isOptional:!0}),e({stepId:"shell-user-settings",anchorId:"userSettings",title:"Your Settings",content:"Use user settings to tune colors, table density, and rerun this tour any time.",isOptional:!0}),this.customStops.forEach((t,n)=>{t&&e({...t,stepId:String(t.stepId||"").trim()||`custom-stop-${n+1}`,isOptional:!1!==t.isOptional})}),t}buildTopNavIntro(){const t=this.navTabs.map(t=>this.resolveTabLabel(t)).filter(t=>!!t);return t.length?`This top bar is your primary navigation. Key modules: ${t.join(", ")}.`:"This top bar is your primary navigation across the program."}resolveTabLabel(t){return t?"dropdown"===t.type?String(t.label||t.links?.[0]?.label||"").trim():String(t.links?.[0]?.label||t.label||"").trim():""}resolveStepIndex(t){const e=this._tour.steps||[];if(!e.length||!t)return-1;const n=String(t.stepId||"").trim();if(n){const t=e.findIndex(t=>String(t?.stepId||"").trim()===n);if(t>=0)return t}return e.indexOf(t)}toSlug(t){return String(t||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourService,deps:[{token:i1$3.TourService},{token:CoreService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:i1$3.TourService},{type:CoreService}]});class TourAnchorDirective{_el;_renderer;_tour;tourAnchor="";element;registeredAnchorId="";constructor(t,e,n){this._el=t,this._renderer=e,this._tour=n,this.element=t}ngOnInit(){this.syncRegistration()}ngOnChanges(t){t.tourAnchor&&this.syncRegistration()}ngOnDestroy(){this.unregister(),this.hideTourStep()}showTourStep(){this._renderer.addClass(this._el.nativeElement,"rio-tour-anchor-active")}hideTourStep(){this._renderer.removeClass(this._el.nativeElement,"rio-tour-anchor-active")}syncRegistration(){const t=String(this.tourAnchor||"").trim();t!==this.registeredAnchorId&&(this.unregister(),t&&(this._tour.register(t,this),this.registeredAnchorId=t))}unregister(){this.registeredAnchorId&&(this._tour.unregister(this.registeredAnchorId),this.registeredAnchorId="")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TourAnchorDirective,deps:[{token:i0.ElementRef},{token:i0.Renderer2},{token:i1$3.TourService}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:TourAnchorDirective,isStandalone:!0,selector:"[tourAnchor]",inputs:{tourAnchor:"tourAnchor"},usesOnChanges:!0,ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TourAnchorDirective,decorators:[{type:Directive,args:[{selector:"[tourAnchor]",standalone:!0}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:i0.Renderer2},{type:i1$3.TourService}],propDecorators:{tourAnchor:[{type:Input,args:["tourAnchor"]}]}});class CoreTourOverlayComponent{_tour;_coreTour;step=null;stepNumber=0;totalSteps=0;popoverTop=16;popoverLeft=16;subscriptions=[];constructor(t,e){this._tour=t,this._coreTour=e}ngOnInit(){this.subscriptions.push(this._coreTour.activeStep.subscribe(t=>{this.step=t,this.stepNumber=this._coreTour.currentStepIndex.getValue()+1,this.totalSteps=this._coreTour.totalSteps.getValue(),this.updatePosition()})),this.subscriptions.push(this._coreTour.currentStepIndex.subscribe(t=>{this.stepNumber=t+1})),this.subscriptions.push(this._coreTour.totalSteps.subscribe(t=>{this.totalSteps=t})),"undefined"!=typeof window&&(this.subscriptions.push(fromEvent(window,"resize").subscribe(()=>this.updatePosition())),this.subscriptions.push(fromEvent(window,"scroll").subscribe(()=>this.updatePosition())))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}canGoPrev(){return!(!this.step||!this._tour.hasPrev(this.step))}prev(){this.step&&this._tour.prev()}next(){this.step&&(this._tour.hasNext(this.step)?this._tour.next():this.end())}end(){this._tour.end()}nextButtonTitle(){return this.step?this._tour.hasNext(this.step)?this.step.nextBtnTitle||"Next":this.step.endBtnTitle||"Finish":"Next"}updatePosition(){if(!this.step||"undefined"==typeof window)return;const t=String(this.step.anchorId||"").trim(),e=t?this._tour.anchors[t]:null,n=e&&e.element?e.element.nativeElement:null;if(!n)return this.popoverTop=16,void(this.popoverLeft=16);const o=n.getBoundingClientRect(),r=Math.min(360,window.innerWidth-24),i=12;let a=o.bottom+i;a+220>window.innerHeight-i&&(a=o.top-220-i),a=Math.max(i,a);let s=o.left+o.width/2-r/2;s=Math.max(i,Math.min(s,window.innerWidth-r-i)),this.popoverTop=Math.round(a),this.popoverLeft=Math.round(s)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourOverlayComponent,deps:[{token:i1$3.TourService},{token:CoreTourService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:CoreTourOverlayComponent,isStandalone:!0,selector:"rio-core-tour-overlay",ngImport:i0,template:'\n\t\t@if (step) {\n\t\t\t<div [ngClass]="[\'rio-tour-popover\', step.popoverClass || \'\']" [style.top.px]="popoverTop" [style.left.px]="popoverLeft" role="dialog" aria-live="polite">\n\t\t\t\t<div class="rio-tour-header">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="rio-tour-title">{{ step.title || \'Guided Tour\' }}</div>\n\t\t\t\t\t\t@if (stepNumber > 0 && totalSteps > 0) {\n\t\t\t\t\t\t\t<div class="rio-tour-progress">Step {{ stepNumber }} of {{ totalSteps }}</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="end()">Skip</button>\n\t\t\t\t</div>\n\t\t\t\t@if (step.content) {\n\t\t\t\t\t<div class="rio-tour-content">{{ step.content }}</div>\n\t\t\t\t}\n\t\t\t\t<div class="rio-tour-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" [disabled]="!canGoPrev()" (click)="prev()">{{ step.prevBtnTitle || \'Back\' }}</button>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="next()">{{ nextButtonTitle() }}</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t',isInline:!0,styles:[".rio-tour-popover{position:fixed;z-index:1065;width:min(360px,calc(100vw - 24px));background:#fff;border:1px solid rgba(15,23,42,.15);border-radius:12px;box-shadow:0 18px 45px #0f172a47;padding:12px;color:#0f172a}.rio-tour-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.rio-tour-title{font-size:16px;font-weight:700;line-height:20px}.rio-tour-progress{font-size:12px;color:#64748b}.rio-tour-content{font-size:14px;line-height:20px;white-space:pre-line;margin-bottom:12px}.rio-tour-actions{display:flex;justify-content:space-between;gap:8px}\n"],dependencies:[{kind:"ngmodule",type:CommonModule},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourOverlayComponent,decorators:[{type:Component,args:[{selector:"rio-core-tour-overlay",standalone:!0,imports:[CommonModule],template:'\n\t\t@if (step) {\n\t\t\t<div [ngClass]="[\'rio-tour-popover\', step.popoverClass || \'\']" [style.top.px]="popoverTop" [style.left.px]="popoverLeft" role="dialog" aria-live="polite">\n\t\t\t\t<div class="rio-tour-header">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="rio-tour-title">{{ step.title || \'Guided Tour\' }}</div>\n\t\t\t\t\t\t@if (stepNumber > 0 && totalSteps > 0) {\n\t\t\t\t\t\t\t<div class="rio-tour-progress">Step {{ stepNumber }} of {{ totalSteps }}</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="end()">Skip</button>\n\t\t\t\t</div>\n\t\t\t\t@if (step.content) {\n\t\t\t\t\t<div class="rio-tour-content">{{ step.content }}</div>\n\t\t\t\t}\n\t\t\t\t<div class="rio-tour-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" [disabled]="!canGoPrev()" (click)="prev()">{{ step.prevBtnTitle || \'Back\' }}</button>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="next()">{{ nextButtonTitle() }}</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t',styles:[".rio-tour-popover{position:fixed;z-index:1065;width:min(360px,calc(100vw - 24px));background:#fff;border:1px solid rgba(15,23,42,.15);border-radius:12px;box-shadow:0 18px 45px #0f172a47;padding:12px;color:#0f172a}.rio-tour-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.rio-tour-title{font-size:16px;font-weight:700;line-height:20px}.rio-tour-progress{font-size:12px;color:#64748b}.rio-tour-content{font-size:14px;line-height:20px;white-space:pre-line;margin-bottom:12px}.rio-tour-actions{display:flex;justify-content:space-between;gap:8px}\n"]}]}],ctorParameters:()=>[{type:i1$3.TourService},{type:CoreTourService}]});class AiTerminalService{provider;constructor(t){this.provider=t}call(t,...e){return this.provider._socket.call(t,...e)}subscribe(t,...e){return this.provider._socket.subscribe(t,...e)}subscribeBypass(t,...e){return this.provider._socket.subscribeBypassRoute(t,...e)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalService,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:ProviderService}]});class AiPageRouterService{adapters=[];registerAdapter(t){return t?(this.adapters.includes(t)||this.adapters.push(t),()=>this.unregisterAdapter(t)):()=>{}}unregisterAdapter(t){this.adapters=this.adapters.filter(e=>e!==t)}getAdapter(t){const e=this.adapters.filter(e=>e&&e.matches(t)).sort((t,e)=>(e.priority||0)-(t.priority||0));return e.length?e[0]:null}async handleMessage(t){const e=t?.context||{},n=this.getAdapter(e);if(!n)return{handled:!1};try{return await n.handle(t)}catch(t){const e=t?.message||"Unable to handle this request.";return{handled:!0,reply:e,error:e}}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageRouterService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageRouterService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageRouterService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});const DEFAULT_FORM_PATCH_METHOD="aiFormPatch";class AiPageFormAdapterService{router;registry;terminal;id="generic-form";priority=-10;constructor(t,e,n){this.router=t,this.registry=e,this.terminal=n,this.router.registerAdapter(this)}matches(t){return!0}async handle(t){if("all"===t?.context?.mode)return{handled:!1};const e=this.registry.getFormsForRoute(t?.context?.route).filter(t=>!t.element||!1!==t.element.isConnected);if(1!==e.length)return{handled:!1};const n=e[0],o=n?.form;if(!o)return{handled:!1};const r=this.buildFieldCatalog(o);if(!r.length)return{handled:!1};let i;try{i=await this.terminal.call("aiFormPatch",{message:t.message,allowed_fields:r,patch_format:this.buildPatchFormat(),route:t?.context?.route,id_client:t?.context?.idClient,id_app:t?.context?.idApp})}catch(t){const e=t?.message||"Unable to build a form patch.";return{handled:!0,reply:e,error:e}}if(i?.error){const t=i.error||"Unable to build a form patch.";return{handled:!0,reply:t,error:t}}const a=this.normalizePatchFields(i?.patch??i);if(!a.length){return{handled:!0,reply:i?.notes||"No matching fields found for this form."}}const s=this.applyFormPatch(o,a);return{handled:!0,reply:i?.notes||this.buildApplyReply(s),data:{patch:{fields:a},applied_fields:s.applied,skipped_fields:s.invalid}}}buildPatchFormat(){return["{",' "notes": "Short, plain-language explanation of what you filled in.",',' "patch": {',' "fields": [',' { "path": "field_name", "value": "any" }'," ]"," }","}"].join("\n")}buildFieldCatalog(t){const e=[];return this.walkControls(t,"",e),e}walkControls(t,e,n){if(t instanceof FormGroup)Object.keys(t.controls||{}).forEach(o=>{const r=t.controls[o],i=e?`${e}.${o}`:o;this.walkControls(r,i,n)});else{if(t instanceof FormArray){e&&n.push({name:e,type:"array"});const o=t.controls?.[0];return void(o instanceof FormGroup&&Object.keys(o.controls||{}).forEach(t=>{const r=e?`${e}.0.${t}`:`0.${t}`;this.walkControls(o.controls[t],r,n)}))}e&&n.push({name:e,type:this.inferType(t?.value)})}}inferType(t){if(t instanceof Date)return"date";if(Array.isArray(t))return"array";if(null==t)return"unknown";const e=typeof t;return"string"===e||"number"===e||"boolean"===e?e:"object"===e?"object":"unknown"}normalizePatchFields(t){return t?Array.isArray(t)?t.map(t=>this.normalizePatchField(t)).filter(t=>!!t):Array.isArray(t?.fields)?t.fields.map(t=>this.normalizePatchField(t)).filter(t=>!!t):t?.fields&&"object"==typeof t.fields?Object.entries(t.fields).map(([t,e])=>({path:t,value:e})):"object"==typeof t?Object.entries(t).map(([t,e])=>({path:t,value:e})):[]:[]}normalizePatchField(t){if(!t||"object"!=typeof t)return null;const e=String(t.path||t.field||t.name||"").trim();return e?{path:e,value:t.value}:null}applyFormPatch(t,e){const n=[],o=[];return e.forEach(e=>{const r=this.normalizePath(e.path);if(!r)return;const i=t.get(r);if(i)try{void 0!==e.value&&("function"==typeof i.patchValue&&e.value&&"object"==typeof e.value?i.patchValue(e.value):"function"==typeof i.setValue&&i.setValue(e.value),i.markAsDirty({onlySelf:!0}),i.markAsTouched({onlySelf:!0}),i.updateValueAndValidity({onlySelf:!0}),n.push(r))}catch{o.push(r)}else o.push(r)}),t.updateValueAndValidity({emitEvent:!0}),{applied:n,invalid:o}}normalizePath(t){const e=String(t||"").trim();return e?e.replace(/\[(\d+)\]/g,".$1"):""}buildApplyReply(t){return t.applied.length?t.invalid.length?`Applied ${t.applied.length} field${1===t.applied.length?"":"s"}. Skipped ${t.invalid.length} unknown field${1===t.invalid.length?"":"s"}.`:`Applied ${t.applied.length} field${1===t.applied.length?"":"s"} to the form.`:"No matching fields were applied to this form."}applyPatch(t,e){}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageFormAdapterService,deps:[{token:AiPageRouterService},{token:AiFormRegistryService},{token:AiTerminalService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageFormAdapterService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageFormAdapterService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:AiPageRouterService},{type:AiFormRegistryService},{type:AiTerminalService}]});const CSV_EOL="\r\n",CSV_BOM="\ufeff",CSV_DEFAULTS={filename:"export",fieldSeparator:",",quoteStrings:'"',decimalseparator:".",showLabels:!1,showTitle:!1,title:"My Report",useBom:!0,headers:[]};function exportCsv(t,e,n){const o=Array.isArray(t)?t:tryParse(t);if(!Array.isArray(o)||!o.length)return void console.log("Invalid data");const r={...CSV_DEFAULTS,...n};e&&(r.filename=e);const i=normalizeData(o,r);i.title&&!r.showTitle&&(r.showTitle=!0,r.title||(r.title=i.title));let a="";r.useBom&&(a+="\ufeff"),r.showTitle&&r.title&&(a+=`${r.title}\r\n\r\n`);const s=resolveHeaders(r,i.data),l=stripHeaderRow(i.data,s,r),c=resolveRowKeys(l,s);s.length&&(a+=`${s.join(r.fieldSeparator)}\r\n`),l.forEach(t=>{a+=`${resolveRow(t,c,r)}\r\n`});const d=new Blob([a],{type:"text/csv;charset=utf-8;"}),p=`${(r.filename||CSV_DEFAULTS.filename).replace(/ /g,"_")}.csv`;if(navigator.msSaveBlob)navigator.msSaveBlob(d,p);else{const t=document.createElement("a");t.href=URL.createObjectURL(d),t.setAttribute("visibility","hidden"),t.download=p,document.body.appendChild(t),t.click(),document.body.removeChild(t)}}function resolveHeaders(t,e){return t.headers&&t.headers.length?t.headers:t.showLabels&&e.length&&!Array.isArray(e[0])&&"object"==typeof e[0]?collectKeysInOrder(e):[]}function resolveRowKeys(t,e){return e.length?e:!t.length||Array.isArray(t[0])||"object"!=typeof t[0]?[]:Object.keys(t[0])}function resolveRow(t,e,n){return Array.isArray(t)?t.map(t=>formatValue(t,n)).join(n.fieldSeparator):e.length?e.map(e=>formatValue(t[e],n)).join(n.fieldSeparator):Object.keys(t).map(e=>formatValue(t[e],n)).join(n.fieldSeparator)}function formatValue(t,e){if("locale"===e.decimalseparator&&isFloat(t))return t.toLocaleString();if("."!==e.decimalseparator&&isFloat(t))return t.toString().replace(".",e.decimalseparator);if("string"==typeof t){const n=parseIsoDate(t);n&&(t=n.toLocaleString());let o=t.replace(/"/g,'""');return(e.quoteStrings||t.indexOf(",")>-1||t.indexOf("\n")>-1||t.indexOf("\r")>-1)&&(o=`${e.quoteStrings}${o}${e.quoteStrings}`),o}return"boolean"==typeof t?t?"TRUE":"FALSE":null==t?"":t}function normalizeData(t,e){if(!e.showLabels||!t.length||Array.isArray(t[0])||"object"!=typeof t[0])return{data:t};const[n,...o]=t;if(isTitleRow(n)){const t=Object.keys(n);return{data:o,title:String(n[t[0]])}}return{data:t}}function stripHeaderRow(t,e,n){if(!n.showLabels||!e.length||!t.length)return t;const[o,...r]=t;return isHeaderValueRow(o,e)?r:t}function collectKeysInOrder(t){const e=[];return t.forEach(t=>{Array.isArray(t)||"object"!=typeof t||Object.keys(t).forEach(t=>{-1===e.indexOf(t)&&e.push(t)})}),e}function isHeaderValueRow(t,e){return!(Array.isArray(t)||"object"!=typeof t||!e.length)&&e.every(e=>t[e]===e)}function isTitleRow(t){if(Array.isArray(t)||"object"!=typeof t||null===t)return!1;const e=Object.keys(t);if(1!==e.length)return!1;const n=t[e[0]];return"string"==typeof n&&n===e[0]}function tryParse(t){try{return JSON.parse(t)}catch(t){return console.log("Invalid CSV data",t),[]}}function isFloat(t){return+t===t&&(!isFinite(t)||Boolean(t%1))}const ISO_DATE_REGEX=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})$/;function parseIsoDate(t){if(!ISO_DATE_REGEX.test(t))return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}class DomSanitizorPipe{_sanitizer;constructor(t){this._sanitizer=t}transform(t,e="html"){switch(e){case"html":return this._sanitizer.bypassSecurityTrustHtml(t);case"style":return this._sanitizer.bypassSecurityTrustStyle(t);case"script":return this._sanitizer.bypassSecurityTrustScript(t);case"url":return this._sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this._sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error(`Invalid safe type specified: ${e}`)}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DomSanitizorPipe,deps:[{token:i1$4.DomSanitizer}],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:DomSanitizorPipe,isStandalone:!1,name:"safe"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DomSanitizorPipe,decorators:[{type:Pipe,args:[{name:"safe",standalone:!1}]}],ctorParameters:()=>[{type:i1$4.DomSanitizer}]});const AI_TERMINAL_SUBSCRIPTION_COOLDOWN_MS=5e3,AI_TERMINAL_PROGRESS_ANALYZE_MS=4500,AI_TERMINAL_PROGRESS_DRAFT_MS=9e3,AI_TERMINAL_DEFAULT_TITLE="Ask AI About the System",AI_TERMINAL_LOCAL_CONVERSATION_PREFIX="local-convo",AI_TERMINAL_REQUEST_PREFIX="req",AI_TERMINAL_EXPORT_MAX_ROWS=5e3,AI_TERMINAL_USD_CURRENCY_TEXT_PATTERN=/\b(?:USD|US\$)(?:\s| | |[\u00A0\u202F\u2007])*\$?\s*([-+]?[0-9][0-9,]*(?:\.[0-9]+)?)/gi,AI_TERMINAL_PROMPT_FAVORITES_STORAGE_KEY="resolveioAiPromptFavorites.v1",AI_TERMINAL_PROMPT_FAVORITES_MAX=25,AI_TERMINAL_ISSUE_REPORT_MIN_REASON_CHARS=8,AI_TERMINAL_DISPLAY_ROW_PREVIEW_LIMIT=250,AI_TERMINAL_NON_CURRENCY_COLUMN_PATTERN=/\b(invoice\s*number|count|qty|quantity|index|rank|sequence|seq|id|code|ticket|number)\b/,AI_TERMINAL_CURRENCY_HINT_PATTERN=/\b(amount|price|cost|balance|fee|revenue|tax|billing|charge|payment|profit|margin|due)\b/,AI_TERMINAL_MONEY_TOTAL_PATTERN=/\b(sub\s*total|subtotal|grand\s*total|paid\s*total)\b/,AI_TERMINAL_TOTAL_WITH_MONEY_HINT_PATTERN=/\btotal\b.*\b(amount|revenue|sales|tax|price|cost|balance|paid|due|charge|billing|profit|margin)\b/,AI_TERMINAL_SUPPORT_TICKET_DIRECT_REQUEST_PATTERN=/\b(create|open|file|submit|raise)\b[\w\s]{0,40}\b(support\s*ticket|ticket)\b/i,AI_TERMINAL_SUPPORT_TICKET_AFFIRMATIVE_PATTERN=/\b(yes|yep|yeah|please|do it|go ahead|open it|create it|file it|submit it)\b/i,AI_TERMINAL_SUPPORT_TICKET_PROMPT_PATTERN=/\b(open|create|file|submit|raise)\b[\w\s]{0,40}\b(support\s*ticket|ticket)\b/i,DEFAULT_METHODS={conversationCreate:"aiTerminalConversationCreate",conversationUpdate:"aiTerminalConversationUpdate",conversationDelete:"aiTerminalConversationDelete",runOpenAI:"aiTerminalRun",uploadOpenAI:"aiTerminalUploadFile",runCodex:"aiCoderTerminalRunCodex",uploadCodex:"aiCoderTerminalUploadFile",reportIssue:"aiCoderTerminalReportIssue",deployTest:"aiCoderTerminalDeployTest",conversationsPublication:"aiTerminalConversations",messagesPublication:"aiTerminalMessages"};class AiTerminalComponent{terminal;services;pageRouter;_pageFormAdapter;locale;idClient="";idApp="";title="AI Terminal";config=null;conversationStatus="active";messageLimit=200;placeholder="Describe the change or ask a question...";singleConversation=!1;contextMode="auto";contextRoute="";paused=!1;bypassRouteSubscriptions=!1;messageScroll;conversations=[];messages=[];visibleMessages=[];activeConversationId="";activeConversation=null;messageText="";pendingFiles=[];promptFavoriteEnabled=!1;promptFavorites=[];isSending=!1;isDeployingTest=!1;isLoading=!1;errorMessage="";infoMessage="";editingConversationId="";editingTitle="";favoritePromptEditOpen=!1;favoritePromptEditOriginal="";favoritePromptEditValue="";issueReportOpen=!1;issueReportMessageId="";issueReportConversationId="";issueReportReason="";issueReportExpected="";isSubmittingIssueReport=!1;messagePartsCache=new Map;messageMarkdownCache=new Map;messageTablePresenceCache=new Map;displayTableCache=new Map;messageContentOverrides=new Map;messageDisplayOverrides=new Map;supportTicketMap=new Map;supportTicketInFlight=new Set;serverMessages=[];localMessagesByConversation=new Map;localMessageCounter=0;requestCounter=0;localConversationCounter=0;collapsedTableIds=new Set;expandedDebugIds=new Set;pendingProgressTimers=new Map;supportTicketStorageKey="resolveioAiSupportTicketMap";promptFavoritesStorageKey="resolveioAiPromptFavorites.v1";mongoReadCache=new Map;mongoReadInFlight=new Set;exportingMessageIds=new Set;loadingAllRowsMessageIds=new Set;fullDisplayPromises=new Map;fullDisplayCache=new Map;pulledAllMessageIds=new Set;subscribedConversationId="";conversationsSub;messagesSub;conversationsSubKey="";messagesSubKey="";subscriptionsPaused=!1;pauseTimer=null;pendingConversationId="";pendingConversation=null;createConversationPromise=null;currencySymbol="$";aiDebugEnabled=!1;timeZoneLabel=this.resolveTimeZoneLabel();constructor(t,e,n,o,r){this.terminal=t,this.services=e,this.pageRouter=n,this._pageFormAdapter=o,this.locale=r;try{this.currencySymbol=getCurrencySymbol("USD","narrow",this.locale)}catch{this.currencySymbol="$"}}get _services(){return this.services}refreshDebugFlag(){if("undefined"!=typeof window)try{const t=String(localStorage.getItem("resolveio.ai.debug")||"").trim().toLowerCase();this.aiDebugEnabled="1"===t||"true"===t||"on"===t}catch{this.aiDebugEnabled=!1}else this.aiDebugEnabled=!1}debugNow(){return"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()}debugLog(t,e){if(!this.aiDebugEnabled||"undefined"==typeof console||"function"!=typeof console.debug)return;const n=e&&"object"==typeof e?e:{};console.debug(`[AI.Terminal] ${t}`,n)}ngOnInit(){this.refreshDebugFlag(),this.loadSupportTicketMap(),this.loadPromptFavorites(),this.paused||this.subscribeConversations()}ngOnChanges(t){this.refreshDebugFlag(),t.paused&&(this.paused?this.schedulePause():(this.cancelPause(),(this.subscriptionsPaused||!this.conversationsSub||this.conversationsSub.closed)&&(this.subscriptionsPaused=!1,this.subscribeConversations(!0)),this.ensureMessageSubscription()),this.debugLog("paused.changed",{paused:this.paused,subscriptionsPaused:this.subscriptionsPaused,hasConversationsSub:!!this.conversationsSub&&!this.conversationsSub.closed,hasMessagesSub:!!this.messagesSub&&!this.messagesSub.closed})),(t.idClient||t.idApp||t.config)&&(this.loadPromptFavorites(),this.paused||this.subscribeConversations(),this.updateVisibleMessages(),this.debugLog("identity.changed",{idClient:this.idClient||"",idApp:this.idApp||"",hasConfig:!!this.config}))}ngOnDestroy(){this.cancelPause(),this.pendingProgressTimers.forEach(t=>t.forEach(t=>clearTimeout(t))),this.pendingProgressTimers.clear(),this.unsubscribeAll()}isCodexMode(){return"codex"===this.resolveMode()}showAdvanced(){return!0===this.resolveConfig()?.showAdvanced}showToolMessages(){const t=this.resolveConfig();return void 0!==t?.showToolMessages?!!t.showToolMessages:this.showAdvanced()}allowUploads(){return!1!==this.resolveConfig()?.allowUploads}maxFileMb(){return Number(this.resolveConfig()?.maxFileMb)||50}maxTotalMb(){return Number(this.resolveConfig()?.maxTotalMb)||100}deleteFilesAfterRun(){const t=this.resolveConfig();return!1!==t?.deleteFilesAfterRun}totalTokens(){return(this.messages||[]).reduce((t,e)=>t+(e?.usage?.total_tokens||0),0)}filteredMessages(){return this.visibleMessages}messageParts(t){const e=this.getMessageContent(t);if(!e)return[];const n=this.messageRenderCacheKey(t),o=this.messageUpdatedAtKey(t),r=this.messagePartsCache.get(n);if(r&&r.updatedAtKey===o)return r.value;const i=this.splitMessageContent(e);return this.messagePartsCache.set(n,{updatedAtKey:o,value:i}),i}messageMarkdown(t){let e=this.getMessageContent(t);if(!e)return"";t?.metadata?.tool_result?.output?.display&&(e=this.stripMarkdownTables(e));const n=this.messageRenderCacheKey(t),o=this.messageUpdatedAtKey(t),r=this.messageMarkdownCache.get(n);if(r&&r.updatedAtKey===o)return r.value;const i=this.markdownToHtml(e);return this.messageMarkdownCache.set(n,{updatedAtKey:o,value:i}),i}clearMessageRenderCaches(){this.messagePartsCache.clear(),this.messageMarkdownCache.clear(),this.messageTablePresenceCache.clear(),this.displayTableCache.clear()}messageRenderCacheKey(t){const e=String(t?._id||"").trim();return e||`${t?.role||"message"}:${this.messageTimestamp(t)}`}messageUpdatedAtKey(t){return this.messageTimestamp(t)}updateVisibleMessages(){this.showToolMessages()?this.visibleMessages=[...this.messages||[]]:this.visibleMessages=(this.messages||[]).filter(t=>"tool"!==t?.role)}trackByMessagePart(t,e){return e?.route?`route-${e.route}-${t}`:`text-${t}-${e.text?.length||0}`}markdownToHtml(t){const e=String(t||"").replace(/\r\n/g,"\n");if(!e.trim())return"";const n=e.split("\n"),o=[];let r=[],i=!1,a=!1;const s=()=>{if(!r.length)return;const t=r.map(t=>this.formatInlineMarkdown(t)).join("<br>");o.push(`<p>${t}</p>`),r=[]},l=()=>{i&&(o.push("</ul>"),i=!1),a&&(o.push("</ol>"),a=!1)};for(let t=0;t<n.length;t+=1){const e=n[t],c=e.trim();if(this.isMarkdownTableHeader(e,n[t+1])){s(),l();const e=this.parseMarkdownTable(n,t);o.push(e.html),t=e.nextIndex-1;continue}const d=e.match(/^\s*(#{1,6})\s+(.*)$/);if(d){s(),l();const t=d[1].length;o.push(`<h${t}>${this.formatInlineMarkdown(d[2])}</h${t}>`);continue}const p=e.match(/^\s*[-*\u2022]\s+(.*)$/);if(p){s(),a&&(o.push("</ol>"),a=!1),i||(o.push("<ul>"),i=!0),o.push(`<li>${this.formatInlineMarkdown(p[1])}</li>`);continue}const u=e.match(/^\s*\d+\.\s+(.*)$/);u?(s(),i&&(o.push("</ul>"),i=!1),a||(o.push("<ol>"),a=!0),o.push(`<li>${this.formatInlineMarkdown(u[1])}</li>`)):c?r.push(e):(s(),l())}return s(),l(),o.join("\n").trim()}formatInlineMarkdown(t){let e=this.escapeHtml(t);const n=[];e=e.replace(/`([^`]+)`/g,(t,e)=>{const o=`__CODE_${n.length}__`;return n.push(`<code>${e}</code>`),o});const o=[];return e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,e,n)=>{const r=`__LINK_${o.length}__`;return o.push(this.buildAnchor(e,n)),r}),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/(^|[^*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),e=this.linkifyRoutes(e),o.forEach((t,n)=>{e=e.replace(`__LINK_${n}__`,t)}),n.forEach((t,n)=>{e=e.replace(`__CODE_${n}__`,t)}),e}escapeHtml(t){return String(t||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}linkifyRoutes(t){return t.replace(/\/[a-z0-9][a-z0-9/_-]*(?:\?[a-z0-9=&%._-]+)?(?:#[a-z0-9._-]+)?/gi,(e,n,o)=>{const r="number"==typeof n?n:0,i="string"==typeof o?o:t;return">"===(r>0?i[r-1]:"")||this.isRouteBoundary(i,r)?this.buildAnchor(e,e):e})}buildAnchor(t,e){const n=String(e||"").trim();if(!n)return t;const o=/^https?:\/\//i.test(n);return n.startsWith("/")||o?`<a href="${n}" target="_blank" rel="noopener" class="ai-terminal-route-link">${t}</a>`:t}isMarkdownTableHeader(t,e){if(!t||!e)return!1;if(!t.includes("|"))return!1;const n=e.trim();return!!n.includes("|")&&(/^[:|\-\s]+$/.test(n)&&n.includes("-"))}parseMarkdownTable(t,e){const n=this.splitMarkdownTableRow(t[e]);let o=e+2;const r=[];for(;o<t.length;){const e=t[o];if(!e.trim()||!e.includes("|"))break;r.push(this.splitMarkdownTableRow(e)),o+=1}const i=n.length||1,a=t=>{const e=t.slice(0,i);for(;e.length<i;)e.push("");return e};return{html:`<div class="ai-terminal-table-wrap"><table class="ai-terminal-table"><thead><tr>${a(n).map(t=>`<th>${this.formatInlineMarkdown(t)}</th>`).join("")}</tr></thead><tbody>${r.map(t=>`<tr>${a(t).map(t=>`<td>${this.formatInlineMarkdown(t)}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`,nextIndex:o}}splitMarkdownTableRow(t){const e=String(t||"").trim();if(!e)return[];return e.replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}formatFileSize(t){if(!t||!Number.isFinite(t))return"0 B";if(t<1024)return`${t} B`;const e=t/1024;if(e<1024)return`${e.toFixed(1)} KB`;return`${(e/1024).toFixed(1)} MB`}trackByConversation(t,e){return e?._id||`convo-${t}`}trackByMessage(t,e){return e?._id||`message-${t}`}trackByFavoritePrompt(t,e){return`${t}-${e}`}async createConversation(){this.errorMessage="";try{const{id:t,conversation:e}=await this.createNewConversation();if(!t||!e)return;this.pendingConversationId=t,this.pendingConversation=e,this.activeConversationId=t,this.activeConversation=e,this.conversations=this.mergePendingConversation(this.conversations),this.localMessagesByConversation.set(t,[]),this.refreshMergedMessages(),this.paused||this.subscribeMessages(t)}catch(t){this.errorMessage=t?.message||"Unable to create a new conversation."}}setActiveConversation(t){t?._id&&(this.activeConversationId=t._id,this.activeConversation=t,this.subscribeMessages(t._id))}startRename(t){t?._id&&(this.editingConversationId=t._id,this.editingTitle=t.title||"")}cancelRename(){this.editingConversationId="",this.editingTitle=""}async saveRename(t){if(!t?._id)return;const e=(this.editingTitle||"").trim();if(e)try{await this.terminal.call(this.methodNames().conversationUpdate||DEFAULT_METHODS.conversationUpdate,t._id,{title:e}),this.cancelRename()}catch(t){this.errorMessage=t?.message||"Unable to rename conversation."}else this.cancelRename()}async deleteConversation(t){if(!t?._id)return;if(window.confirm("Delete this conversation?"))try{await this.terminal.call(this.methodNames().conversationDelete||DEFAULT_METHODS.conversationDelete,t._id),this.localMessagesByConversation.delete(t._id),this.activeConversationId===t._id&&(this.activeConversationId="",this.activeConversation=null,this.messages=[])}catch(t){this.errorMessage=t?.message||"Unable to delete conversation."}}async sendMessage(){if(this.isSending)return;const t=(this.messageText||"").trim();if(!t)return;this.promptFavoriteEnabled&&this.addPromptFavorite(t),this.promptFavoriteEnabled=!1,this.errorMessage="",this.isSending=!0;const e=this.generateRequestId();this.messageText="";let n="",o="",r="",i="";try{n=this.ensureLocalConversationForSend(),o=n;if(!0===this.resolveConfig()?.pageRouterEnabled&&!this.pendingFiles.length){const o=this.buildPageRouterContext(t),i=await this.pageRouter.handleMessage({message:t,context:o});if(i?.handled){r=this.appendLocalMessage(n,"user",t,{request_id:e});const o=i.reply||(i.error?`Unable to complete request: ${i.error}`:"Done.");return o&&this.appendLocalMessage(n,"assistant",o,{...i.data||{},request_id:e}),i.error&&(this.errorMessage=i.error),void(this.pendingFiles=[])}}r=this.appendLocalMessage(n,"user",t,{request_id:e}),i=this.appendLocalMessage(n,"assistant","Queued...",{progress:["Queued"],request_id:e},{pending:!0}),i&&this.schedulePendingProgress(i),n=await this.ensureConversationId(),n&&o&&n!==o&&this.reparentLocalConversation(o,n),n&&i&&this.updateLocalMessage(n,i,{content:"Planning...",metadata:{progress:["Planning"],pending:!0,request_id:e}}),n&&this.subscribedConversationId!==n&&this.subscribeMessages(n);const a=await this.uploadPendingFiles(),s={id_conversation:n||void 0,id_client:this.idClient||void 0,id_app:this.idApp||void 0,message:t,request_id:e,attachments:a,delete_files_after_run:this.deleteFilesAfterRun(),context:this.buildMessageContext(t)};if("openai"===this.resolveMode()){s.guardrails=!1!==this.resolveConfig()?.guardrails,s.profile_id=this.resolveConfig()?.profileId,s.config={mode:"openai",model:this.resolveConfig()?.model,system_prompt:this.resolveConfig()?.systemPrompt,user_prompt_template:this.resolveConfig()?.userPromptTemplate,response_format:this.resolveConfig()?.responseFormat,temperature:this.resolveConfig()?.temperature,max_tokens:this.resolveConfig()?.maxTokens};const t=await this.terminal.call(this.methodNames().runOpenAI||DEFAULT_METHODS.runOpenAI,s);this.applyServerMessageToLocal(n,e,t?.message),this.afterRunResponse(t?.conversation)}else{if(!s.id_app)throw new Error("App id is required for code changes.");const t=this.resolveMongoConfig();t&&(s.mongo=t);const o=this.resolveCodexPayloadConfig();o&&(s.config=o);const r=await this.terminal.call(this.methodNames().runCodex||DEFAULT_METHODS.runCodex,s);this.applyServerMessageToLocal(n,e,r?.message,r?.tool_result),this.afterRunResponse(r?.conversation)}this.pendingFiles=[]}catch(t){this.errorMessage=t?.message||"Unable to send message.",n&&r&&this.removeLocalMessage(n,r),n&&i&&this.removeLocalMessage(n,i)}finally{this.isSending=!1}}async startNewConversation(){this.pendingConversationId="",this.pendingConversation=null,this.activeConversationId="",this.activeConversation=null,this.promptFavoriteEnabled=!1,this.subscribedConversationId="",this.serverMessages=[],this.messages=[],this.refreshMergedMessages(),await this.createConversation()}async deployTest(){if(this.activeConversationId&&!this.isDeployingTest){this.errorMessage="",this.infoMessage="",this.isDeployingTest=!0;try{const t=await this.terminal.call(this.methodNames().deployTest||DEFAULT_METHODS.deployTest,this.activeConversationId);this.infoMessage=t?.build_id?`Test deploy started (${t.build_id}).`:"Test deploy started."}catch(t){this.errorMessage=t?.message||"Unable to deploy test build."}finally{this.isDeployingTest=!1}}}handleFileSelect(t){const e=t.target,n=Array.from(e?.files||[]);if(!n.length)return;const o=1024*this.maxFileMb()*1024,r=1024*this.maxTotalMb()*1024;let i=this.pendingFiles.reduce((t,e)=>t+e.size,0);n.forEach(t=>{t.size>o?this.errorMessage=`File ${t.name} exceeds ${this.maxFileMb()}MB.`:i+t.size>r?this.errorMessage=`Total upload size exceeds ${this.maxTotalMb()}MB.`:(i+=t.size,this.pendingFiles.push(t))}),e.value=""}removePendingFile(t){this.pendingFiles.splice(t,1)}clearComposer(){this.messageText="",this.pendingFiles=[],this.promptFavoriteEnabled=!1}togglePromptFavorite(){this.promptFavoriteEnabled=!this.promptFavoriteEnabled}async runFavoritePrompt(t){const e=this.normalizeFavoritePrompt(t);e&&!this.isSending&&(this.messageText=e,this.promptFavoriteEnabled=!1,await this.sendMessage())}removeFavoritePrompt(t,e){e&&(e.preventDefault(),e.stopPropagation()),this.removePromptFavorite(t)}startFavoritePromptEdit(t,e){e&&(e.preventDefault(),e.stopPropagation());const n=this.normalizeFavoritePrompt(t);n&&(this.favoritePromptEditOriginal=n,this.favoritePromptEditValue=n,this.favoritePromptEditOpen=!0)}cancelFavoritePromptEdit(){this.favoritePromptEditOpen=!1,this.favoritePromptEditOriginal="",this.favoritePromptEditValue=""}canSaveFavoritePromptEdit(){if(!this.favoritePromptEditOpen)return!1;const t=this.normalizeFavoritePrompt(this.favoritePromptEditValue);return!!t&&t.toLowerCase()!==this.favoritePromptEditOriginal.toLowerCase()}saveFavoritePromptEdit(){if(!this.favoritePromptEditOpen)return;const t=this.normalizeFavoritePrompt(this.favoritePromptEditOriginal),e=this.normalizeFavoritePrompt(this.favoritePromptEditValue);if(!t||!e)return;const n=t.toLowerCase(),o=this.promptFavorites.map(t=>{const o=this.normalizeFavoritePrompt(t);return o.toLowerCase()===n?e:o}),r=[],i=new Set;o.forEach(t=>{const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase();i.has(n)||(i.add(n),r.push(e))}),this.promptFavorites=r.slice(0,25),this.savePromptFavorites(),this.cancelFavoritePromptEdit()}canToggleFavoriteForMessage(t){return"user"===t?.role&&!!this.extractFavoritePromptFromMessage(t)}isMessagePromptFavorited(t){return this.isPromptFavorited(this.extractFavoritePromptFromMessage(t))}toggleMessagePromptFavorite(t,e){e&&(e.preventDefault(),e.stopPropagation());const n=this.extractFavoritePromptFromMessage(t);n&&(this.isPromptFavorited(n)?this.removePromptFavorite(n):this.addPromptFavorite(n))}resolveConfig(){return this.config||null}resolveMongoConfig(){const t=this.resolveConfig()?.mongo;return t?void 0===t.access&&void 0!==t.readonly?{...t,access:t.readonly?"read":"readWrite"}:t:null}resolveMode(){return this.resolveConfig()?.mode||"openai"}resolveCodexPayloadConfig(){const t=this.resolveConfig();if(!t)return null;const e=String(t.model||"").trim(),n=this.resolveCodexFallbackModels(t);if(!e&&!n.length)return null;const o={mode:"codex"};return e&&(o.model=e),1===n.length?o.fallback_model=n[0]:n.length>1&&(o.fallback_models=n),o}resolveCodexFallbackModels(t){const e=[],n=t=>{const n=String(t||"").trim();n&&!e.includes(n)&&e.push(n)};if(Array.isArray(t.fallbackModels))t.fallbackModels.forEach(n);else{const e=String(t?.fallbackModels||"").trim();e&&e.split(",").forEach(n)}return n(t.fallbackModel),e}resolveBranchEnabled(){const t=this.resolveConfig();return void 0!==t?.branchEnabled?!!t.branchEnabled:"codex"===this.resolveMode()}methodNames(){return{...DEFAULT_METHODS,...this.resolveConfig()?.methodNames||{}}}subscribeConversations(t=!1){const e=this.debugNow();if(this.debugLog("subscribeConversations.start",{preserveMessages:t,paused:this.paused,idClient:this.idClient||"",idApp:this.idApp||"",status:this.conversationStatus||"active"}),this.paused)return this.isLoading=!1,void this.debugLog("subscribeConversations.skip.paused");const n=this.methodNames().conversationsPublication||DEFAULT_METHODS.conversationsPublication,o=JSON.stringify({publication:n,idClient:this.idClient||"",idApp:this.idApp||"",status:this.conversationStatus||"active",bypass:!!this.bypassRouteSubscriptions});if(this.conversationsSub&&!this.conversationsSub.closed&&this.conversationsSubKey===o)return this.conversations=this.filterConversations(this.conversations||[]),this.ensureActiveConversation(t),this.isLoading=!1,void this.debugLog("subscribeConversations.reuse",{count:this.conversations.length,elapsedMs:Math.round(this.debugNow()-e)});this.conversationsSubKey=o,this.conversationsSub?.unsubscribe(),this.isLoading=!0;const r=this.bypassRouteSubscriptions?this.terminal.subscribeBypass(n,this.idClient||"",this.idApp||"",this.conversationStatus||"active"):this.terminal.subscribe(n,this.idClient||"",this.idApp||"",this.conversationStatus||"active");this.conversationsSub=r.subscribe({next:n=>{this.conversations=this.mergePendingConversation(this.filterConversations(n||[])),this.ensureActiveConversation(t),this.isLoading=!1,this.debugLog("subscribeConversations.next",{count:this.conversations.length,activeConversationId:this.activeConversationId||"",elapsedMs:Math.round(this.debugNow()-e)})},error:()=>{this.errorMessage="Unable to load conversations.",this.isLoading=!1,this.debugLog("subscribeConversations.error",{elapsedMs:Math.round(this.debugNow()-e)})}})}filterConversations(t){const e=this.resolveMode();return(t||[]).filter(t=>!e||(!t.mode||t.mode===e))}ensureActiveConversation(t=!1){if(this.activeConversationId){const e=this.conversations.find(t=>t._id===this.activeConversationId);if(e)return this.activeConversation=e,void(t&&this.subscribeMessages(e._id,!0))}this.conversations.length?this.setActiveConversation(this.conversations[0]):(this.activeConversationId="",this.activeConversation=null,this.messages=[],this.serverMessages=[],this.refreshMergedMessages(),this.messagesSub?.unsubscribe())}subscribeMessages(t,e=!1){const n=this.debugNow();if(this.debugLog("subscribeMessages.start",{conversationId:t||"",preserveExisting:e,paused:this.paused,messageLimit:this.messageLimit}),this.paused)return void this.debugLog("subscribeMessages.skip.paused",{conversationId:t||""});const o=this.methodNames().messagesPublication||DEFAULT_METHODS.messagesPublication,r=JSON.stringify({publication:o,conversationId:t,limit:this.messageLimit,bypass:!!this.bypassRouteSubscriptions});if(this.messagesSub&&!this.messagesSub.closed&&this.messagesSubKey===r)return void this.debugLog("subscribeMessages.reuse",{conversationId:t||"",elapsedMs:Math.round(this.debugNow()-n)});this.messagesSubKey=r,this.messagesSub?.unsubscribe();const i=this.subscribedConversationId===t;this.subscribedConversationId=t,e&&i||(this.serverMessages=[],this.refreshMergedMessages());const a=this.bypassRouteSubscriptions?this.terminal.subscribeBypass(o,t,this.messageLimit):this.terminal.subscribe(o,t,this.messageLimit);this.messagesSub=a.subscribe({next:e=>{this.serverMessages=this.capMessages(e||[]),this.refreshMergedMessages(),this.debugLog("subscribeMessages.next",{conversationId:t||"",serverCount:this.serverMessages.length,elapsedMs:Math.round(this.debugNow()-n)})},error:()=>{this.errorMessage="Unable to load messages.",this.debugLog("subscribeMessages.error",{conversationId:t||"",elapsedMs:Math.round(this.debugNow()-n)})}})}async uploadPendingFiles(){if(!this.allowUploads()||!this.pendingFiles.length)return[];const t=await this.ensureConversationId(),e=[];for(const n of this.pendingFiles){const o=await this.readFileAsBase64(n),r="codex"===this.resolveMode()?this.methodNames().uploadCodex||DEFAULT_METHODS.uploadCodex:this.methodNames().uploadOpenAI||DEFAULT_METHODS.uploadOpenAI,i=await this.terminal.call(r,t,n.name,o,n.size,n.type);e.push({id:i?.id_file||i?.id,name:i?.name||n.name,type:i?.type||n.type,size:i?.size||n.size,local_path:i?.local_path})}return e}readFileAsBase64(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=()=>{const t="string"==typeof o.result?o.result:"",n=t.includes(",")?t.split(",")[1]:t;e(n)},o.onerror=()=>{n(o.error||new Error("Unable to read file."))},o.readAsDataURL(t)})}afterRunResponse(t){if(t?._id){const e=this.subscribedConversationId!==t._id;this.activeConversationId=t._id,this.activeConversation=t,!this.paused&&e&&this.subscribeMessages(t._id)}}handleComposerKeydown(t){t.isComposing||"Enter"===t.key&&(t.shiftKey||(t.preventDefault(),!this.isSending&&(this.messageText||"").trim()&&this.sendMessage()))}buildMessageContext(t){const e=String(this.contextRoute||"").trim();if("all"===this.contextMode)return{mode:"all"};if("current"===this.contextMode)return e?{mode:"current",route:e}:{mode:"all"};if(!e)return{mode:"all"};const n=String(t||"").toLowerCase();return[/\bthis\s+(page|screen|view|panel|form|tab|section|dialog|modal|drawer)\b/,/\bon\s+this\b/,/\bcurrent\s+(page|screen|view)\b/,/\bhere\b/,/\bwhy\s+is\s+(this|it)\b/,/\bwhy\s+does\s+(this|it)\b/,/\bwhat\s+is\s+(this|it)\b/].some(t=>t.test(n))?{mode:"current",route:e}:{mode:"all"}}buildPageRouterContext(t){const e=String(this.contextRoute||"").trim(),n=this.buildMessageContext(t).mode,o=this.services?._app?.environment?.value||{},r=o.FEATURE_FLAGS&&"object"==typeof o.FEATURE_FLAGS?o.FEATURE_FLAGS:o.FEATURE_GATES&&"object"==typeof o.FEATURE_GATES?o.FEATURE_GATES:o.MODULE_GATES&&"object"==typeof o.MODULE_GATES?o.MODULE_GATES:void 0;return{route:e||void 0,mode:n,idClient:this.idClient||void 0,idApp:this.idApp||void 0,featureFlags:r}}refreshMergedMessages(){const t=this.aiDebugEnabled,e=t?this.debugNow():0,n=this.activeConversationId||"";let o=n&&this.localMessagesByConversation.get(n)||[];if(o=this.syncLocalMessages(n,o,this.serverMessages),this.messages=this.mergeMessages(this.serverMessages,o),this.applyStoredSupportTicketOverrides(),this.applyStoredMongoReadOverrides(),this.processSupportTicketDirectives(this.messages),this.processMongoDirectives(this.messages),this.updateVisibleMessages(),this.scrollToBottom(),t){const t=Math.round(this.debugNow()-e);(t>=20||this.supportTicketInFlight.size||this.mongoReadInFlight.size)&&this.debugLog("refreshMergedMessages",{conversationId:n||"",serverCount:this.serverMessages.length,localCount:o.length,mergedCount:this.messages.length,mongoInFlight:this.mongoReadInFlight.size,supportTicketInFlight:this.supportTicketInFlight.size,elapsedMs:t})}}mergeMessages(t,e){const n=new Set;(e||[]).forEach(t=>{if(!this.isPendingAssistantMessage(t))return;const e=String(t?.metadata?.request_id||"").trim();e&&n.add(e)});const o=[...(t||[]).filter(t=>{if("assistant"!==t?.role||!0!==t?.metadata?.pending)return!0;const e=String(t?.metadata?.request_id||"").trim();return!e||!n.has(e)}),...e||[]],r=new Set;return o.filter(t=>{const e=String(t?._id||"").trim()||`${t?.role||"message"}:${this.messageTimestamp(t)}:${t?.content||""}`;return!r.has(e)&&(r.add(e),!0)}).sort((t,e)=>this.compareMessages(t,e))}capMessages(t){if(!Array.isArray(t)||!t.length)return[];const e=Number(this.messageLimit),n=Number.isFinite(e)?Math.min(Math.max(Math.round(e),1),400):200;return t.length<=n?t:t.slice(t.length-n)}syncLocalMessages(t,e,n){if(!t||!e.length||!n.length)return e;const o=new Map,r=[],i=new Set,a=new Set,s=new Map;n.forEach(t=>{const e=t?.role||"",n=this.normalizeMessageContent(t?.content);if(e&&n){const t=`${e}::${n}`;o.set(t,(o.get(t)||0)+1)}if("assistant"===e){const e=this.messageTimestamp(t);e>0&&r.push(e)}const l=String(t?.metadata?.request_id||"").trim();l&&(i.add(l),"assistant"===e&&(a.add(l),s.has(l)||s.set(l,t)))});let l=!1;s.size&&(e=(e||[]).map(t=>{if(!this.isPendingAssistantMessage(t))return t;const e=String(t?.metadata?.request_id||"").trim();if(!e)return t;const n=s.get(e);if(!n?.metadata?.pending)return t;const o=this.mergeProgressLists(t?.metadata?.progress,n?.metadata?.progress),r=Array.isArray(t?.metadata?.progress)?t.metadata?.progress:[];if(!o.length)return t;return o.length!==r.length||o.some((t,e)=>t!==r[e])?(l=!0,{...t,metadata:{...t.metadata||{},progress:o},updatedAt:new Date}):t}));const c=[],d=e.filter(t=>{if(!this.isLocalMessage(t))return!0;const e=String(t?.metadata?.request_id||"").trim();if(this.isPendingAssistantMessage(t)){if(e){const n=s.get(e);if(n)return!0===n?.metadata?.pending||(t?._id&&c.push(String(t._id)),!1)}const n=this.messageTimestamp(t);if(e&&a.has(e))return t?._id&&c.push(String(t._id)),!1;if(!n||!r.length)return!0;const o=!r.some(t=>t>=n);return!o&&t?._id&&c.push(String(t._id)),o}if(e&&i.has(e))return t?._id&&c.push(String(t._id)),!1;const n=t?.role||"",l=this.normalizeMessageContent(t?.content);if(!n||!l)return!0;const d=`${n}::${l}`,p=o.get(d)||0;return!(p>0)||(o.set(d,p-1),t?._id&&c.push(String(t._id)),!1)});return d.length!==e.length?(this.localMessagesByConversation.set(t,d),c.forEach(t=>this.clearPendingProgressTimers(t))):l&&this.localMessagesByConversation.set(t,d),d}messageTimestamp(t){const e=t?.createdAt,n=t?.updatedAt,o=e?new Date(e).getTime():0;if(o)return o;const r=n?new Date(n).getTime():0;if(r)return r;const i=String(t?.metadata?.request_id||"").trim();if(i){const t=i.match(/-(\d{10,})-/);if(t?.[1]){const e=Number(t[1]);if(Number.isFinite(e)&&e>0)return e}}return 0}compareMessages(t,e){const n=this.messageTimestamp(t),o=this.messageTimestamp(e),r=String(t?.role||"").toLowerCase(),i=String(e?.role||"").toLowerCase(),a=String(t?.metadata?.request_id||"").trim(),s=String(e?.metadata?.request_id||"").trim();if("assistant"===r&&"user"===i&&a&&(!s||a===s))return 1;if("assistant"===i&&"user"===r&&s&&(!a||a===s))return-1;if(0===n&&0!==o)return 1;if(0===o&&0!==n)return-1;if(n!==o)return n-o;if(a&&a===s){const n=this.roleSortRank(t)-this.roleSortRank(e);if(0!==n)return n}const l=this.roleSortRank(t)-this.roleSortRank(e);if(0!==l)return l;const c=String(t?._id||""),d=String(e?._id||"");if(c&&d&&c!==d)return c.localeCompare(d);const p=String(t?.content||""),u=String(e?.content||"");return p.localeCompare(u)}roleSortRank(t){const e=String(t?.role||"").toLowerCase();return"user"===e?0:"assistant"===e?1:"tool"===e?2:3}isLocalMessage(t){return!0===t?.metadata?.local}isPendingAssistantMessage(t){return this.isLocalMessage(t)&&"assistant"===t?.role&&!0===t?.metadata?.pending}normalizeMessageContent(t){return this.normalizeUsdCurrencyText(String(t||"").trim())}normalizeUsdCurrencyText(t){const e=String(t||"");return e?e.replace(AI_TERMINAL_USD_CURRENCY_TEXT_PATTERN,(t,e)=>`$${e}`):""}mergeProgressLists(t,e){const n=[],o=new Set,r=t=>{const e=String(t||"").trim();if(!e)return;const r=e.toLowerCase();o.has(r)||(o.add(r),n.push(e))};return(Array.isArray(t)?t:[]).forEach(r),(Array.isArray(e)?e:[]).forEach(r),n}appendLocalMessage(t,e,n,o,r){const i=String(n||"").trim();if(!t||!i)return"";const a=new Date,s=`local-${a.getTime()}-${this.localMessageCounter++}`,l={...o||{},local:!0};r?.pending&&(l.pending=!0);const c={_id:s,id_conversation:t,role:e,content:i,metadata:l,createdAt:a,updatedAt:a},d=this.localMessagesByConversation.get(t)||[];return d.push(c),this.localMessagesByConversation.set(t,d),this.refreshMergedMessages(),s}removeLocalMessage(t,e){if(!t||!e)return;const n=this.localMessagesByConversation.get(t)||[];if(!n.length)return;const o=n.filter(t=>t?._id!==e);o.length!==n.length&&(this.localMessagesByConversation.set(t,o),this.clearPendingProgressTimers(e),this.refreshMergedMessages())}updateLocalMessage(t,e,n){if(!t||!e)return;const o=this.localMessagesByConversation.get(t)||[];if(!o.length)return;const r=o.findIndex(t=>t?._id===e);if(-1===r)return;const i=o[r],a={...i,...n,metadata:{...i.metadata||{},...n.metadata||{}},updatedAt:n.updatedAt||new Date};o[r]=a,this.localMessagesByConversation.set(t,o),this.refreshMergedMessages()}findLocalMessageById(t){if(!t)return null;for(const[e,n]of this.localMessagesByConversation.entries()){const o=(n||[]).find(e=>e?._id===t);if(o)return{conversationId:e,message:o}}return null}schedulePendingProgress(t){if(!t)return;this.clearPendingProgressTimers(t);const e=[];[{delay:4500,label:"Analyzing request"},{delay:9e3,label:"Drafting response"}].forEach(n=>{const o=setTimeout(()=>{const e=this.findLocalMessageById(t);if(!e||!e.message?.metadata?.pending)return void this.clearPendingProgressTimers(t);const o=Array.isArray(e.message.metadata?.progress)?[...e.message.metadata.progress]:[];o.map(t=>String(t||"").toLowerCase()).includes(n.label.toLowerCase())||(o.push(n.label),this.updateLocalMessage(e.conversationId,t,{metadata:{progress:o}}))},n.delay);e.push(o)}),this.pendingProgressTimers.set(t,e)}clearPendingProgressTimers(t){const e=this.pendingProgressTimers.get(t);e&&(e.forEach(t=>clearTimeout(t)),this.pendingProgressTimers.delete(t))}applyServerMessageToLocal(t,e,n,o){if(!t||!e||!n)return;const r=this.localMessagesByConversation.get(t)||[],i=r.findIndex(t=>"assistant"===t?.role&&t?.metadata?.request_id===e);if(-1===i)return;const a=r[i],s={...a.metadata||{},...n.metadata||{},pending:!1};o&&(s.tool_result=o);const l={...a,content:n.content||a.content,metadata:s,usage:n.usage||a.usage,createdAt:n.createdAt||a.createdAt,updatedAt:n.updatedAt||new Date};r[i]=l,this.localMessagesByConversation.set(t,r),this.clearPendingProgressTimers(a?._id||n._id||""),this.refreshMergedMessages()}async ensureConversationId(){if(this.activeConversationId&&!this.isLocalConversationId(this.activeConversationId))return this.activeConversationId;const t=this.activeConversationId,{id:e,conversation:n}=await this.createNewConversation();return e&&(this.activeConversationId=e,n&&(this.pendingConversationId=e,this.pendingConversation=n,this.conversations=this.mergePendingConversation(this.conversations)),t&&t!==e&&this.reparentLocalConversation(t,e)),e}ensureLocalConversationForSend(){if(this.activeConversationId)return this.activeConversationId;const t=new Date,e=`local-convo-${t.getTime()}-${this.localConversationCounter++}`,n={_id:e,id_client:this.idClient||void 0,id_app:this.idApp||void 0,title:"Ask AI About the System",mode:this.resolveMode(),status:this.conversationStatus||"active",profile_id:this.resolveConfig()?.profileId,metadata:{pending:!0,local:!0},createdAt:t,updatedAt:t};return this.pendingConversationId=e,this.pendingConversation=n,this.activeConversationId=e,this.activeConversation=n,this.conversations=this.mergePendingConversation(this.conversations),this.localMessagesByConversation.has(e)||this.localMessagesByConversation.set(e,[]),this.refreshMergedMessages(),e}isLocalConversationId(t){return String(t||"").startsWith("local-convo-")}reparentLocalConversation(t,e){if(!t||!e||t===e)return;const n=this.localMessagesByConversation.get(t)||[];if(n.length){const t=n.map(t=>({...t,id_conversation:e})),o=this.localMessagesByConversation.get(e)||[];this.localMessagesByConversation.set(e,[...o,...t])}this.localMessagesByConversation.delete(t),this.activeConversationId===t&&(this.activeConversationId=e),this.subscribedConversationId===t&&(this.subscribedConversationId=e),this.pendingConversationId===t&&(this.pendingConversationId=e),this.pendingConversation&&this.pendingConversation._id===t&&(this.pendingConversation={...this.pendingConversation,_id:e})}generateRequestId(){return`req-${Date.now()}-${this.requestCounter++}`}scrollToBottom(){setTimeout(()=>{const t=this.messageScroll?.nativeElement;t&&(t.scrollTop=t.scrollHeight)},50)}splitMessageContent(t){const e=String(t||"");if(!e)return[];const n=/\/[a-z0-9][a-z0-9/_-]*(?:\?[a-z0-9=&%_-]+)?(?:#[a-z0-9_-]+)?/g,o=[];let r,i=0;for(;null!==(r=n.exec(e));){const t=r[0],n=r.index;if(!this.isRouteBoundary(e,n))continue;n>i&&o.push({text:e.slice(i,n)});const a=this.shouldLinkRoute(t);o.push(a?{text:t,route:t}:{text:t}),i=n+t.length}return i<e.length&&o.push({text:e.slice(i)}),o.length?o:[{text:e}]}isRouteBoundary(t,e){if(0===e)return!0;const n=t[e-1];return/[\s\[\]({'"`.,;:!?]/.test(n)}getMessageContent(t){const e=String(t?._id||"").trim();return e&&this.messageContentOverrides.has(e)?this.normalizeUsdCurrencyText(this.messageContentOverrides.get(e)||""):this.normalizeUsdCurrencyText(String(t?.content||""))}displayTableForMessage(t){const e=this.resolveDisplayTable(t);if(!e)return null;const n=this.getMessageContent(t);return this.hasMarkdownTable(t,n)&&!t?.metadata?.tool_result?.output?.display?null:e}isTableCollapsed(t){const e=String(t?._id||"").trim();return!!e&&this.collapsedTableIds.has(e)}toggleTable(t){const e=String(t?._id||"").trim();e&&(this.collapsedTableIds.has(e)?this.collapsedTableIds.delete(e):this.collapsedTableIds.add(e))}resolveTimeZoneLabel(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"Local"}catch{return"Local"}}pendingProgress(t){if(!t?.metadata?.pending)return null;const e=t?.metadata?.progress,n=Array.isArray(e)?e.map(t=>String(t||"").trim()).filter(Boolean):[],o=n.length?n:["Planning"],r=this.resolvePendingElapsed(t),i=[];r>=4500&&i.push("Analyzing request"),r>=9e3&&i.push("Drafting response");const a=[],s=new Set;return[...o,...i].forEach(t=>{const e=String(t||"").trim();if(!e)return;const n=e.toLowerCase();s.has(n)||(s.add(n),a.push(e))}),a.length?a:null}resolvePendingElapsed(t){const e=this.messageTimestamp(t);return e?Math.max(0,Date.now()-e):0}ensureMessageSubscription(){if(this.paused)return;const t=this.activeConversationId||"";if(!t||this.isLocalConversationId(t))return;const e=this.methodNames().messagesPublication||DEFAULT_METHODS.messagesPublication,n=JSON.stringify({publication:e,conversationId:t,limit:this.messageLimit,bypass:!!this.bypassRouteSubscriptions});(!this.messagesSub||this.messagesSub.closed||this.messagesSubKey!==n)&&this.subscribeMessages(t,!0)}formatDisplayCell(t,e){if(null==t||""===t)return"N/A";if(Array.isArray(t))return this.truncateText(t.map(t=>String(t)).join(", "),200);if(t instanceof Date)return formatDate(t,"short",this.locale);if("object"==typeof t)try{return this.truncateText(JSON.stringify(t),200)}catch{return this.truncateText(String(t),200)}const n=this.formatScalarValue(t,e);return this.truncateText(n,200)}formatScalarValue(t,e){const n=this.resolveNumericValue(t),o=String(e||"").toLowerCase();if(this.isDateColumn(o)&&this.isLikelyDateValue(t)){const e=t instanceof Date?t:new Date(t);if(!Number.isNaN(e.getTime()))return formatDate(e,"short",this.locale)}if(null!==n){if(this.isPercentColumn(o)){return formatPercent(n>1&&n<=100?n/100:n,this.locale,"1.0-2")}return this.isCurrencyColumn(o)?formatCurrency(n,this.locale,this.currencySymbol,"USD","1.2-2"):formatNumber(n,this.locale,"1.0-2")}if(this.isLikelyDateValue(t)&&this.isDateColumn(o)){const e=t instanceof Date?t:new Date(t);if(!Number.isNaN(e.getTime()))return formatDate(e,"short",this.locale)}return String(t)}resolveNumericValue(t){if("number"==typeof t&&Number.isFinite(t))return t;if("string"==typeof t){const e=t.trim();if(!e)return null;let n=!1,o=e;const r=o.match(/^\((.+)\)$/);if(r?.[1]&&(n=!0,o=r[1].trim()),o=o.replace(/^\$/,"").replace(/,/g,""),!o||!/^[+-]?(?:\d+|\d*\.\d+)%?$/.test(o)||!/[0-9]/.test(o))return null;const i=o.endsWith("%")?o.slice(0,-1):o,a=Number(i);if(!Number.isFinite(a))return null;const s=n?-a:a;return Number.isFinite(s)?s:null}return null}isPercentColumn(t){return/(percent|pct|percentage|ratio|rate)\b/.test(t)}isCurrencyColumn(t){const e=String(t||"").toLowerCase().replace(/[_-]+/g," ").trim();if(!e)return!1;const n=AI_TERMINAL_CURRENCY_HINT_PATTERN.test(e)||AI_TERMINAL_MONEY_TOTAL_PATTERN.test(e)||AI_TERMINAL_TOTAL_WITH_MONEY_HINT_PATTERN.test(e);return!(AI_TERMINAL_NON_CURRENCY_COLUMN_PATTERN.test(e)&&!n)&&(!(/\btotal\b/.test(e)&&!n)&&n)}isDateColumn(t){return/(date|time|created|updated|timestamp|at)\b/.test(t)}isLikelyDateValue(t){if(!t)return!1;if(t instanceof Date)return!0;if("string"==typeof t){if(!/[0-9]/.test(t))return!1;const e=Date.parse(t);return!Number.isNaN(e)}return!1}resolveDisplayTable(t){const e=String(t?._id||"").trim(),n=e?this.messageDisplayOverrides.get(e):null,o=t?.metadata?.tool_result?.output?.display,r=n||o;if(!r||!Array.isArray(r.columns)||!Array.isArray(r.rows))return e&&this.displayTableCache.delete(e),null;if(e){const t=this.displayTableCache.get(e);if(t&&t.source===r)return t.value}const i=!0===r.includeIds,a=r.columns.filter(t=>i||!this.shouldHideDisplayColumn(t)).map(t=>({key:t,label:this.formatDisplayColumn(t)}));if(!a.length)return e&&this.displayTableCache.delete(e),null;const s=Array.isArray(r.rows)?r.rows:[],l=s.length>250?s.slice(0,250):s,c=l.map(t=>{const e={};return a.forEach(({key:n,label:o})=>{e[o]=t?.[n]??t?.[o]}),e}),d={...r,columns:a.map(t=>t.label),rows:c,truncated:!0===r.truncated||s.length>l.length};return e&&this.displayTableCache.set(e,{source:r,value:d}),d}isSuperAdmin(){return!!this.services?._account?.isUserSuperAdmin()}resolveDebugPayload(t){const e=t?.metadata?.debug;if(e&&"object"==typeof e)return e;const n=t?.metadata?.tool_result?.output?.debug;if(n&&"object"==typeof n)return n;const o=t?.metadata?.tool_result?.debug;return o&&"object"==typeof o?o:null}showDebugForMessage(t){return!!this.isSuperAdmin()&&("assistant"===t?.role&&!!this.resolveDebugPayload(t))}canCopyMessage(t){return!(!t||t.metadata?.pending||"assistant"!==t.role&&"user"!==t.role)}canReportIssue(t){return!!String(t?._id||"").trim()&&"assistant"===t?.role&&!0!==t?.metadata?.pending}openIssueReport(t,e){e&&(e.preventDefault(),e.stopPropagation()),this.canReportIssue(t)&&(this.issueReportOpen=!0,this.issueReportMessageId=String(t?._id||"").trim(),this.issueReportConversationId=String(t?.id_conversation||this.activeConversationId||"").trim(),this.issueReportReason="",this.issueReportExpected="",this.isSubmittingIssueReport=!1)}cancelIssueReport(){this.isSubmittingIssueReport||(this.issueReportOpen=!1,this.issueReportMessageId="",this.issueReportConversationId="",this.issueReportReason="",this.issueReportExpected="")}canSubmitIssueReport(){return!(!this.issueReportOpen||this.isSubmittingIssueReport)&&this.issueReportReason.trim().length>=8}async submitIssueReport(){if(!this.canSubmitIssueReport())return;const t=String(this.issueReportMessageId||"").trim(),e=String(this.issueReportConversationId||this.activeConversationId||"").trim();if(t&&e){this.errorMessage="",this.infoMessage="",this.isSubmittingIssueReport=!0;try{const n={id_message:t,id_conversation:e,id_client:this.idClient||void 0,id_app:this.idApp||void 0,reason:this.issueReportReason.trim(),expected:this.issueReportExpected.trim()||void 0,metadata:{source:"ai-terminal-ui"}},o=await this.terminal.call(this.methodNames().reportIssue||DEFAULT_METHODS.reportIssue,n),r=String(o?.id_issue_report||"").trim();this.infoMessage=r?`Issue reported (${r}). Thank you.`:"Issue reported. Thank you.",this._services._alert.setAlert("success",this.infoMessage),this.isSubmittingIssueReport=!1,this.cancelIssueReport()}catch(t){this.errorMessage=t?.message||"Unable to report issue."}finally{this.isSubmittingIssueReport=!1}}else this.errorMessage="Unable to report issue: missing conversation context."}canCopyConversation(){return(this.messages||[]).some(t=>!(!t||t.metadata?.pending)&&(("assistant"===t.role||"user"===t.role)&&!!String(this.getMessageContent(t)||"").trim()))}async copyConversation(){const t=this.buildConversationCopyText();if(!t)return;let e=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(t),e=!0)}catch{}e||(e=this.copyTextFallback(t)),e&&this._services._alert.setAlert("success","Conversation copied to clipboard")}async copyMessage(t){if(!this.canCopyMessage(t))return;let e=null,n=!1;if(this.canExportMessage(t))try{e=await this.fetchFullDisplayForMessage(t)}catch{n=!0}const o=this.buildCopyText(t,e);if(!o)return;let r=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(o),r=!0)}catch{}r||(r=this.copyTextFallback(o)),r&&(n?this._services._alert.setAlert("warning","Copied preview content. Full table could not be loaded."):this._services._alert.setAlert("success","Copied to clipboard"))}async copyAssistantResponse(t){await this.copyMessage(t)}buildConversationCopyText(){const t=(this.messages||[]).filter(t=>!(!t||t.metadata?.pending)&&("user"===t.role||"assistant"===t.role));if(!t.length)return"";let e=0,n=0;const o=[],r=this.isSuperAdmin();return t.forEach(t=>{const i=String(this.getMessageContent(t)||"").trim();if(i){if("user"===t.role){e+=1;const t=1===e?"Request":"Follow Up Request";return void o.push(`${t}:\n${i}`)}if("assistant"===t.role){n+=1;let e=`${1===n?"Response":"Follow Up Response"}:\n${i}`;if(r){const n=this.resolveDebugPayload(t);if(n){const t=this.stringifyCopyDebug(n);t&&(e=`${e}\n\nDebug:\n${t}`)}}o.push(e)}}}),o.join("\n\n").trim()}buildCopyText(t,e){const n=this.getMessageContent(t);let o=String(n||"").trim();if(e?.rows?.length){const t=this.buildDisplayTableMarkdown(e);if(t){const e=this.stripMarkdownTables(o);o=e?`${e}\n\n${t}`:t}}if(this.isSuperAdmin()){const e=this.resolveDebugPayload(t);if(e){const t=this.stringifyCopyDebug(e);t&&(o=o?`${o}\n\nDebug:\n${t}`:`Debug:\n${t}`)}}return o.trim()}buildDisplayTableMarkdown(t){if(!t||!Array.isArray(t.rows)||!t.rows.length)return"";const e=Array.isArray(t.columns)&&t.columns.length?t.columns:Object.keys(t.rows[0]||{});if(!e.length)return"";return[`| ${e.join(" | ")} |`,`| ${e.map(()=>"---").join(" | ")} |`,...t.rows.map(t=>`| ${e.map(e=>this.escapeMarkdownCell(this.formatExportCell(t?.[e],e))).join(" | ")} |`)].join("\n").trim()}escapeMarkdownCell(t){return String(t??"").replace(/\r?\n/g," ").replace(/\|/g,"\\|")}stringifyCopyDebug(t){try{return JSON.stringify(t,null,2)}catch{return String(t||"")}}copyTextFallback(t){const e=String(t||"");if(!e)return!1;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.top="-1000px",n.style.opacity="0",document.body.appendChild(n),n.select();let o=!1;try{o=document.execCommand("copy")}catch{}finally{document.body.removeChild(n)}return o}toggleDebug(t){const e=String(t?._id||"").trim();e&&(this.expandedDebugIds.has(e)?this.expandedDebugIds.delete(e):this.expandedDebugIds.add(e))}isDebugCollapsed(t){const e=String(t?._id||"").trim();return!e||!this.expandedDebugIds.has(e)}debugText(t){const e=this.resolveDebugPayload(t);if(!e)return"";try{return this.truncateText(JSON.stringify(e,null,2),8e3)}catch{return this.truncateText(String(e),8e3)}}canExportMessage(t){return!!this.resolveExportableToolResult(t)}canPullAllMessage(t){const e=String(t?._id||"").trim();return!(!e||this.pulledAllMessageIds.has(e))&&this.canExportMessage(t)}isExportingMessage(t){const e=String(t?._id||"").trim();return!!e&&this.exportingMessageIds.has(e)}isPullingAllMessage(t){const e=String(t?._id||"").trim();return!!e&&this.loadingAllRowsMessageIds.has(e)}isAllRowsLoaded(t){const e=String(t?._id||"").trim();if(!e||!this.pulledAllMessageIds.has(e))return!1;const n=this.messageDisplayOverrides.get(e)||this.fullDisplayCache.get(e)||null;return!0!==n?.truncated}async pullAllMessageTable(t){if(String(t?._id||"").trim()&&!this.isPullingAllMessage(t)&&this.canPullAllMessage(t)){this.errorMessage="",this.infoMessage="";try{const e=await this.fetchFullDisplayForMessage(t,{applyToTable:!0});if(!e?.rows?.length)return void(this.infoMessage="No rows returned.");e.truncated?this.infoMessage=`Loaded ${e.rows.length} rows (max 5000). Narrow filters to fetch more.`:this.infoMessage=`Loaded ${e.rows.length} rows.`}catch(t){this.errorMessage=t?.message||"Unable to load all rows."}}}async exportMessageTable(t){const e=String(t?._id||"").trim();if(!e||this.isExportingMessage(t)||!this.canExportMessage(t))return;const n=this.resolveExportableToolResult(t);if(n){this.exportingMessageIds.add(e),this.errorMessage="",this.infoMessage="";try{const e=await this.fetchFullDisplayForMessage(t);if(!e?.rows?.length)return void(this.infoMessage="No rows returned to export.");const o=Array.isArray(e.columns)&&e.columns.length?e.columns:Object.keys(e.rows[0]||{}),r=e.rows.map(t=>{const e={};return o.forEach(n=>{e[n]=this.formatExportCell(t?.[n],n)}),e});exportCsv(r,this.buildExportFilename(n,e),{showLabels:!0,headers:o}),e.truncated?this.infoMessage=`Exported ${r.length} rows (max 5000). Narrow filters to export more.`:this.infoMessage=`Exported ${r.length} rows.`}catch(t){this.errorMessage=t?.message||"Unable to export data."}finally{this.exportingMessageIds.delete(e)}}}resolveExportableToolResult(t){const e=t?.metadata?.tool_result;return e?.input&&e?.type?"mongo_read"!==e.type&&"mongo_agg"!==e.type?null:e:null}buildFullFetchRequest(t){const e={...t.input||{}},n=e.options&&"object"==typeof e.options?{...e.options}:{};n.export=!0,n.skip=0,n.limit=5e3,e.options=n,"mongo_agg"===t.type&&(e.pipeline=this.removeAggregateLimitStages(e.pipeline)),!e.permissionView&&this.contextRoute&&(e.permissionView=this.contextRoute),!e.id_client&&this.idClient&&(e.id_client=this.idClient);const o=this.resolveMongoConfig();return o&&(e.mongo=o),{methodName:"mongo_agg"===t.type?"aiAssistantMongoAggregate":"aiAssistantMongoRead",payload:e}}removeAggregateLimitStages(t){return Array.isArray(t)?t.filter(t=>t&&"object"==typeof t&&!Array.isArray(t)).map(t=>({...t})).filter(t=>!Object.prototype.hasOwnProperty.call(t,"$limit")):[]}async fetchFullDisplayForMessage(t,e){const n=String(t?._id||"").trim();if(!n)return null;const o=!0===e?.applyToTable;if(!(!0===e?.forceRefresh)&&this.fullDisplayCache.has(n)){const t=this.fullDisplayCache.get(n)||null;return o&&t&&(this.messageDisplayOverrides.set(n,t),this.pulledAllMessageIds.add(n),this.clearMessageRenderCaches()),t}const r=this.fullDisplayPromises.get(n);if(r){const t=await r;return o&&t&&(this.messageDisplayOverrides.set(n,t),this.pulledAllMessageIds.add(n),this.clearMessageRenderCaches()),t}const i=this.resolveExportableToolResult(t);if(!i)return null;const a=this.buildFullFetchRequest(i),s=(async()=>{this.loadingAllRowsMessageIds.add(n);const t=await this.terminal.call(a.methodName,a.payload),e=t?.display;if(!e)throw new Error("No table data returned.");return this.fullDisplayCache.set(n,e),o&&(this.messageDisplayOverrides.set(n,e),this.pulledAllMessageIds.add(n),this.clearMessageRenderCaches()),e})().finally(()=>{this.loadingAllRowsMessageIds.delete(n),this.fullDisplayPromises.delete(n)});return this.fullDisplayPromises.set(n,s),await s}formatExportCell(t,e){if(null==t||""===t)return"";if(Array.isArray(t))return t.map(t=>this.formatExportCell(t,e)).join(", ");if(t instanceof Date)return formatDate(t,"short",this.locale);if("object"==typeof t)try{return JSON.stringify(t)}catch{return String(t)}return this.formatScalarValue(t,e)}buildExportFilename(t,e){return`${String(t?.output?.collection||t?.input?.collection||"export").trim()||"export"}-${formatDate(new Date,"yyyyMMdd-HHmm",this.locale)}-${e?.rows?.length||0}rows`}shouldHideDisplayColumn(t){const e=String(t||"").trim().toLowerCase().replace(/\s+/g,"_");if(!e)return!0;if("_id"===e||"__v"===e)return!0;if(e.startsWith("id_"))return!0;const n=e.split(".");return(n[n.length-1]||"").startsWith("id_")}formatDisplayColumn(t){const e=String(t||"").trim();if(!e)return"";if("_id"===e)return"id";if("_group"===e)return"Group";const n=e.replace(/[\s_]+/g,"").toLowerCase();return"createdat"===n?"Created At":"updatedat"===n?"Updated At":e}hasMarkdownTable(t,e){const n=this.messageRenderCacheKey(t),o=this.messageUpdatedAtKey(t),r=this.messageTablePresenceCache.get(n);if(r&&r.updatedAtKey===o)return r.value;const i=this.containsMarkdownTable(e);return this.messageTablePresenceCache.set(n,{updatedAtKey:o,value:i}),i}containsMarkdownTable(t){const e=String(t||"").split("\n");for(let t=0;t<e.length-1;t+=1)if(this.isMarkdownTableHeader(e[t],e[t+1]))return!0;return!1}stripMarkdownTables(t){const e=String(t||"").split("\n"),n=[];for(let t=0;t<e.length;t+=1)if(this.isMarkdownTableHeader(e[t],e[t+1]))for(t+=1;t+1<e.length;){const n=e[t+1];if(!n||!n.includes("|"))break;t+=1}else n.push(e[t]);return n.join("\n").trim()}addPromptFavorite(t){const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase(),o=[e,...this.promptFavorites.filter(t=>this.normalizeFavoritePrompt(t).toLowerCase()!==n)];this.promptFavorites=o.slice(0,25),this.savePromptFavorites()}removePromptFavorite(t){const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase(),o=this.promptFavorites.filter(t=>this.normalizeFavoritePrompt(t).toLowerCase()!==n);o.length!==this.promptFavorites.length&&(this.promptFavorites=o,this.savePromptFavorites())}isPromptFavorited(t){const e=this.normalizeFavoritePrompt(t);if(!e)return!1;const n=e.toLowerCase();return this.promptFavorites.some(t=>this.normalizeFavoritePrompt(t).toLowerCase()===n)}extractFavoritePromptFromMessage(t){return t&&"user"===t.role?this.normalizeFavoritePrompt(t.content||""):""}normalizeFavoritePrompt(t){return String(t||"").replace(/\s+/g," ").trim()}loadPromptFavorites(){try{const t=this.readPromptFavoritesPayload(),e=this.resolvePromptFavoritesScopeKey(),n=Array.isArray(t?.[e])?t[e]:[],o=[],r=new Set;n.forEach(t=>{const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase();r.has(n)||(r.add(n),o.push(e))}),this.promptFavorites=o.slice(0,25)}catch{this.promptFavorites=[]}}savePromptFavorites(){try{const t=this.readPromptFavoritesPayload(),e=this.resolvePromptFavoritesScopeKey(),n=(this.promptFavorites||[]).map(t=>this.normalizeFavoritePrompt(t)).filter(Boolean).slice(0,25);n.length?t[e]=n:delete t[e],localStorage.setItem(this.promptFavoritesStorageKey,JSON.stringify(t))}catch{}}readPromptFavoritesPayload(){try{const t=localStorage.getItem(this.promptFavoritesStorageKey);if(!t)return{};const e=JSON.parse(t||"{}");if(!e||"object"!=typeof e)return{};const n={};return Object.entries(e).forEach(([t,e])=>{t&&Array.isArray(e)&&(n[t]=e.map(t=>this.normalizeFavoritePrompt(t)).filter(Boolean))}),n}catch{return{}}}resolvePromptFavoritesScopeKey(){return`${String(this.idClient||"").trim().toLowerCase()||"global"}::${String(this.idApp||"").trim().toLowerCase()||"global"}::${String(this.resolveMode()||"openai").trim().toLowerCase()||"openai"}`}loadSupportTicketMap(){try{const t=localStorage.getItem(this.supportTicketStorageKey);if(!t)return;const e=JSON.parse(t||"{}");Object.entries(e||{}).forEach(([t,e])=>{"string"==typeof t&&"string"==typeof e&&this.supportTicketMap.set(t,e)})}catch{}}saveSupportTicketMap(){try{const t={};this.supportTicketMap.forEach((e,n)=>{t[n]=e}),localStorage.setItem(this.supportTicketStorageKey,JSON.stringify(t))}catch{}}applyStoredSupportTicketOverrides(){if(!this.supportTicketMap.size)return;let t=!1;(this.messages||[]).forEach(e=>{const n=String(e?._id||"").trim();if(!n)return;const o=this.supportTicketMap.get(n);if(!o)return;const r=this.extractSupportTicketDirective(String(e?.content||"")),i=r?.cleaned||String(e?.content||""),a=this.appendSupportTicketLink(i,o);this.messageContentOverrides.get(n)!==a&&(this.messageContentOverrides.set(n,a),t=!0)}),t&&this.clearMessageRenderCaches()}processSupportTicketDirectives(t){const e=this.findLatestAssistantDirective(t,t=>this.extractSupportTicketDirective(t));if(!e)return;const{message:n,index:o,directive:r}=e,i=String(n?._id||"").trim();if(!i)return;if(this.supportTicketMap.has(i)||this.supportTicketInFlight.has(i))return;this.messageContentOverrides.get(i)!==r.cleaned&&(this.messageContentOverrides.set(i,r.cleaned),this.clearMessageRenderCaches());this.hasSupportTicketConsent(t,o)?(this.debugLog("supportDirective.execute",{id:i}),this.supportTicketInFlight.add(i),this.createSupportTicketFromDirective(i,r).finally(()=>this.supportTicketInFlight.delete(i))):this.debugLog("supportDirective.skip.noConsent",{id:i})}hasSupportTicketConsent(t,e){if(!Array.isArray(t)||e<0)return!1;const n=t.slice(0,e),o=n.slice().reverse().find(t=>"user"===t?.role);if(!o?.content)return!1;const r=String(o.content||"").trim();if(AI_TERMINAL_SUPPORT_TICKET_DIRECT_REQUEST_PATTERN.test(r))return!0;if(!AI_TERMINAL_SUPPORT_TICKET_AFFIRMATIVE_PATTERN.test(r))return!1;const i=n.slice().reverse().find(t=>"assistant"===t?.role);if(!i?.content)return!1;const a=String(i.content||"").trim();return AI_TERMINAL_SUPPORT_TICKET_PROMPT_PATTERN.test(a)}extractSupportTicketDirective(t){const e=String(t||"").split("\n"),n=e.findIndex(t=>t.trim().replace(/^[-*•]+\s*/,"").toUpperCase().startsWith("SUPPORT_TICKET_CREATE:"));if(-1===n)return null;const o=e[n].trim().replace(/^[-*•]+\s*/,"").split(":").slice(1).join(":").trim();let r="",i="",a="";const s=this.parseSupportTicketDirectivePayload(o);if(s?(r=s.summary,i=s.internalRecommendations,a=s.codeChangeRecommendations):r=o,!r){const t=e.slice(n+1).find(t=>t.trim());t&&(r=t.trim())}return{summary:r||"",internalRecommendations:i,codeChangeRecommendations:a,cleaned:e.filter((t,e)=>e!==n).join("\n").trim()}}parseSupportTicketDirectivePayload(t){const e=String(t||"").trim();if(!e||!e.startsWith("{"))return null;try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return null;const n=t;return{summary:this.normalizeSupportTicketDirectiveText(n.summary),internalRecommendations:this.normalizeSupportTicketDirectiveText(n.internal_recommendations,n.internalRecommendations,n.recommendations,n.recommendation,n.internal_notes),codeChangeRecommendations:this.normalizeSupportTicketDirectiveText(n.code_change_recommendations,n.codeChangeRecommendations,n.code_recommendations,n.codex_recommendations,n.fix_plan,n.implementation_plan)}}catch{return null}}normalizeSupportTicketDirectiveText(...t){for(const e of t)if("string"==typeof e){const t=e.trim();if(t)return t}return""}appendSupportTicketLink(t,e){const n=String(t||"").trim(),o=`Support ticket created: /support-ticket/detail/${e}`;return n?n.includes(o)?n:`${n}\n\n${o}`.trim():o}async createSupportTicketFromDirective(t,e){const n=this.resolveSupportTicketIssue(e.summary),o=this.buildSupportTicketPayload(n,{summary:e.summary,internalRecommendations:e.internalRecommendations,codeChangeRecommendations:e.codeChangeRecommendations,sourceMessageId:t});if(o)try{const e=await this.terminal.call("supportInsertSupportTicket",o),n=String(e||"").trim();if(!n)throw new Error("Support ticket creation failed.");this.supportTicketMap.set(t,n),this.saveSupportTicketMap();const r=this.messageContentOverrides.get(t)||"",i=this.appendSupportTicketLink(r,n);this.messageContentOverrides.set(t,i),this.clearMessageRenderCaches()}catch(t){this.errorMessage=t?.message||"Unable to create support ticket."}else this.errorMessage="Unable to create support ticket."}applyStoredMongoReadOverrides(){if(!this.mongoReadCache.size)return;let t=!1;(this.messages||[]).forEach(e=>{const n=String(e?._id||"").trim();if(!n)return;const o=this.mongoReadCache.get(n);o&&this.messageContentOverrides.get(n)!==o&&(this.messageContentOverrides.set(n,o),t=!0)}),t&&this.clearMessageRenderCaches()}processMongoDirectives(t){const e=this.findLatestAssistantDirective(t,t=>this.extractMongoDirective(t));if(!e)return;const{message:n,directive:o}=e,r=String(n?._id||"").trim();if(!r)return;if(this.mongoReadCache.has(r)||this.mongoReadInFlight.has(r))return;this.messageContentOverrides.get(r)!==o.cleaned&&(this.messageContentOverrides.set(r,o.cleaned),this.clearMessageRenderCaches()),this.debugLog("mongoDirective.execute",{id:r,type:o.type,collection:String(o?.payload?.collection||"")}),this.mongoReadInFlight.add(r);("aggregate"===o.type?this.createMongoAggregateFromDirective(r,o.payload,o.cleaned):this.createMongoReadFromDirective(r,o.payload,o.cleaned)).finally(()=>this.mongoReadInFlight.delete(r))}findLatestAssistantDirective(t,e){if(!Array.isArray(t)||!t.length)return null;for(let n=t.length-1;n>=0;n-=1){const o=t[n];if("assistant"!==o?.role)continue;const r=e(String(o?.content||""));if(r)return{message:o,index:n,directive:r}}return null}extractMongoDirective(t){const e=String(t||"").split("\n"),n=e.findIndex(t=>{const e=t.trim().replace(/^[-*•]+\s*/,"").toUpperCase();return e.startsWith("MONGO_READ:")||e.startsWith("MONGO_AGG:")||e.startsWith("MONGO_AGGREGATE:")});if(-1===n)return null;const o=e[n].trim().replace(/^[-*•]+\s*/,""),r=o.toUpperCase();let i=null;if(r.startsWith("MONGO_READ:")?i="read":(r.startsWith("MONGO_AGG:")||r.startsWith("MONGO_AGGREGATE:"))&&(i="aggregate"),!i)return null;const a=o.indexOf(":"),s=a>=0?o.slice(a+1).trim():"";if(!s)return null;try{const t=JSON.parse(s);if(!t||"object"!=typeof t)return null;return{type:i,payload:t,cleaned:e.filter((t,e)=>e!==n).join("\n").trim()}}catch{return null}}resolveMongoCountIntent(t){const e=this.messages||[],n=this.findPreviousUserMessage(t,e);return!!n?.content&&this.isMongoCountQuestion(n.content)}findPreviousUserMessage(t,e){if(!t||!e.length)return null;const n=e.findIndex(e=>String(e?._id||"").trim()===t);if(n>0)for(let t=n-1;t>=0;t-=1)if("user"===e[t]?.role)return e[t];for(let t=e.length-1;t>=0;t-=1)if("user"===e[t]?.role)return e[t];return null}isMongoCountQuestion(t){const e=String(t||"").toLowerCase();if(!e)return!1;return[/\bhow many\b/,/\bnumber of\b/,/\bcount\b/,/\btotal (number|count)\b/,/\btotal (records|entries|items)\b/].some(t=>t.test(e))}async createMongoReadFromDirective(t,e,n){const o={...e||{}},r=this.resolveMongoCountIntent(t),i=r||!0===o?.options?.includeTotal;if(i){const t=o.options&&"object"==typeof o.options?{...o.options}:{};!0!==t.includeTotal&&(t.includeTotal=!0),r&&("number"!=typeof t.limit&&(t.limit=1),t.projection&&"object"==typeof t.projection&&Object.keys(t.projection).length||(t.projection={_id:1})),o.options=t}!o.permissionView&&this.contextRoute&&(o.permissionView=this.contextRoute),!o.id_client&&this.idClient&&(o.id_client=this.idClient);const a=this.resolveMongoConfig();a&&(o.mongo=a);try{const e=await this.terminal.call("aiAssistantMongoRead",o);e?.display?this.messageDisplayOverrides.set(t,e.display):this.messageDisplayOverrides.delete(t);const a=this.formatMongoReadResult(e,{collection:o.collection,includeTotal:i,countIntent:r}),s=this.appendMongoReadResult(n,a);this.mongoReadCache.set(t,s),this.messageContentOverrides.set(t,s),this.clearMessageRenderCaches()}catch(e){const o=String(e?.message||"Unable to read data."),r=/access denied|permission scope required|super admin required/i.test(o)?"Data access via AI requires the appropriate module permissions. I can explain how to view this data in the app or request access.":`Mongo read failed: ${o}`,i=this.appendMongoReadResult(n,r);this.mongoReadCache.set(t,i),this.messageContentOverrides.set(t,i),this.messageDisplayOverrides.delete(t),this.clearMessageRenderCaches()}}async createMongoAggregateFromDirective(t,e,n){const o={...e||{}};!o.permissionView&&this.contextRoute&&(o.permissionView=this.contextRoute),!o.id_client&&this.idClient&&(o.id_client=this.idClient);const r=this.resolveMongoConfig();r&&(o.mongo=r);try{const e=await this.terminal.call("aiAssistantMongoAggregate",o);e?.display?this.messageDisplayOverrides.set(t,e.display):this.messageDisplayOverrides.delete(t);const r=this.formatMongoAggregateResult(e,{collection:o.collection}),i=this.appendMongoReadResult(n,r);this.mongoReadCache.set(t,i),this.messageContentOverrides.set(t,i),this.clearMessageRenderCaches()}catch(e){const o=String(e?.message||"Unable to aggregate data."),r=/access denied|permission scope required|super admin required/i.test(o)?"Data access via AI requires the appropriate module permissions. I can explain how to view this data in the app or request access.":`Mongo aggregate failed: ${o}`,i=this.appendMongoReadResult(n,r);this.mongoReadCache.set(t,i),this.messageContentOverrides.set(t,i),this.messageDisplayOverrides.delete(t),this.clearMessageRenderCaches()}}appendMongoReadResult(t,e){const n=String(t||"").trim(),o=String(e||"").trim();return o?n?n.includes(o)?n:`${n}\n\n${o}`.trim():o:n}formatCollectionLabel(t){const e=String(t||"").trim();return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim():""}formatMongoReadResult(t,e){const n=Array.isArray(t?.documents)?t.documents:[],o=t?.display,r="number"==typeof t?.total?t.total:null,i=!0===e?.includeTotal,a=!0===e?.countIntent,s=null!==r&&(i||a);if(!n.length){if(s){const t=this.formatCollectionLabel(e?.collection);return t?`Total ${t}: ${r}.`:`Total records: ${r}.`}return"Mongo read summary: No results found."}if(s&&a){const t=this.formatCollectionLabel(e?.collection);return t?`Total ${t}: ${r}.`:`Total records: ${r}.`}const l=o?.rows?.length??n.length,c=[];if(s){const t=this.formatCollectionLabel(e?.collection);c.push(t?`Total ${t}: ${r}.`:`Total records: ${r}.`)}c.push(`Preview: ${l} row${1===l?"":"s"}.`),o?.columns?.length&&c.push(`Columns: ${o.columns.join(", ")}`);return`Mongo read summary:\n${c.map(t=>`- ${t}`).join("\n")}`.trim()}formatMongoAggregateResult(t,e){const n=Array.isArray(t?.documents)?t.documents:[],o=t?.display;if(!n.length){const t=this.formatCollectionLabel(e?.collection);return t?`Mongo aggregate summary (${t}): No results found.`:"Mongo aggregate summary: No results found."}const r=o?.rows?.length??n.length,i=[];i.push(`Preview: ${r} group${1===r?"":"s"}.`),o?.columns?.length&&i.push(`Columns: ${o.columns.join(", ")}`);const a=i.map(t=>`- ${t}`).join("\n"),s=this.formatCollectionLabel(e?.collection);return`${s?`Mongo aggregate summary (${s}):`:"Mongo aggregate summary:"}\n${a}`.trim()}formatMongoAggregateDocumentSummary(t,e){if(!t||"object"!=typeof t)return`${e}) ${String(t)}`;const n=[];if(Object.prototype.hasOwnProperty.call(t,"_id")){const e=this.formatMongoAggregateId(t._id);e&&n.push(`_id: ${e}`)}const o=Object.keys(t).filter(t=>"_id"!==t);for(const e of o){if(n.length>=4)break;const o=t[e];null!=o&&("object"!=typeof o&&n.push(`${e}: ${String(o)}`))}return n.length?`${e}) ${n.join(" • ")}`:`${e}) [group]`}formatMongoAggregateId(t){if(null==t)return"";if(t&&"object"==typeof t){const e="function"==typeof t.toHexString?t.toHexString():"";if(e)return e}if(Array.isArray(t)){const e=t.slice(0,2).map(t=>String(t)).join(", ");return t.length>2?`[${e}, ...]`:`[${e}]`}if("object"==typeof t){const e=String(t);if(e&&"[object Object]"!==e)return e;const n=Object.keys(t);if(!n.length)return"[object]";const o=n.slice(0,2).map(e=>`${e}: ${String(t[e])}`);return n.length>2?`{ ${o.join(", ")}, ... }`:`{ ${o.join(", ")} }`}return String(t)}formatMongoDocumentSummary(t,e){if(!t||"object"!=typeof t)return`${e}) ${String(t)}`;const n=Object.keys(t),o=n.includes("_id")?["_id",...n.filter(t=>"_id"!==t)]:n,r=[];for(const e of o){if(r.length>=4)break;const n=t[e];null!=n&&("object"!=typeof n&&r.push(`${e}: ${String(n)}`))}return r.length?`${e}) ${r.join(" • ")}`:`${e}) [record]`}resolveSupportTicketIssue(t){const e=String(t||"").trim();if(e)return this.truncateText(e,1400);const n=(this.messages||[]).slice().reverse().find(t=>"user"===t?.role);return n?.content?this.truncateText(String(n.content),1400):"Support request from AI assistant."}buildSupportTicketPayload(t,e){const n=this.services?._account?.getUser?.(),o=this.services?._app?.client?.getValue?.(),r=String(this.idClient||o||"").trim();if(!n||!r)return null;const i=new Date,a=`${i.getFullYear()}/${i.getMonth()+1}/${i.getDate()}`,s=this.buildSupportTicketAiRecommendations(e,i);return{__v:0,type:"General Inquery",priority:"Low",issue:t||"Support request from AI assistant.",support_ticket_number:0,support_ticket_number_string:"0",status:"Opened",substatus:"New",client:r,id_client:r,messages:[],date_created:i,date_created_string:a,id_user_created:n._id,user_created:n.fullname,billable:!1,date_investigation:null,date_closed:null,files:[],current_watchers:[],client_user:{id_user:n._id,user:n.fullname,email:n.email?n.email:""},tasks:[],notes:[],users_assigned:[],estimated_billable_hours:null,billable_hours:null,bill_description:"",difficulty:1,ai_recommendations:s}}buildSupportTicketAiRecommendations(t,e){const n=this.truncateText(String(t?.summary||""),2e3),o=this.truncateText(String(t?.internalRecommendations||""),8e3),r=this.truncateText(String(t?.codeChangeRecommendations||""),12e3);return Boolean(n&&n.trim()||o&&o.trim()||r&&r.trim())?{source:"ai-assistant",hidden_from_client:!0,created_at:e,source_message_id:String(t?.sourceMessageId||"").trim(),summary:n||"",internal_recommendations:o||"",code_change_recommendations:r||""}:null}truncateText(t,e){const n=String(t||"").trim();return n.length<=e?n:`${n.slice(0,Math.max(0,e-3))}...`}shouldLinkRoute(t){if(!t)return!1;const e=String(this.contextRoute||"").trim();return!e||t!==e}unsubscribeAll(){this.conversationsSub?.unsubscribe(),this.messagesSub?.unsubscribe()}schedulePause(){this.pauseTimer&&clearTimeout(this.pauseTimer),this.pauseTimer=setTimeout(()=>{this.pauseTimer=null,this.paused&&(this.subscriptionsPaused=!0,this.unsubscribeAll())},5e3)}cancelPause(){this.pauseTimer&&(clearTimeout(this.pauseTimer),this.pauseTimer=null)}async createNewConversation(){if(this.createConversationPromise)return this.createConversationPromise;this.createConversationPromise=this.createConversationInternal();try{return await this.createConversationPromise}finally{this.createConversationPromise=null}}async createConversationInternal(){const t={id_client:this.idClient||void 0,id_app:this.idApp||void 0,title:"Ask AI About the System",mode:this.resolveMode(),branch_enabled:this.resolveBranchEnabled(),status:this.conversationStatus||"active",profile_id:this.resolveConfig()?.profileId},e=await this.terminal.call(this.methodNames().conversationCreate||DEFAULT_METHODS.conversationCreate,t),n=e?.id_conversation||e?._id||"";if(!n)return{id:"",conversation:null};const o=new Date;return{id:n,conversation:{_id:n,id_client:t.id_client,id_app:t.id_app,title:t.title,mode:t.mode,branch_enabled:t.branch_enabled,status:t.status,profile_id:t.profile_id,metadata:{pending:!0,local:!0},createdAt:o,updatedAt:o}}}mergePendingConversation(t){if(!this.pendingConversationId||!this.pendingConversation)return t;const e=(t||[]).find(t=>t?._id===this.pendingConversationId);return e&&!e?.metadata?.pending?(this.pendingConversationId="",this.pendingConversation=null,t):e?t:[this.pendingConversation,...t||[]]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalComponent,deps:[{token:AiTerminalService},{token:ProviderService},{token:AiPageRouterService},{token:AiPageFormAdapterService},{token:LOCALE_ID}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:AiTerminalComponent,isStandalone:!1,selector:"rio-ai-terminal",inputs:{idClient:"idClient",idApp:"idApp",title:"title",config:"config",conversationStatus:"conversationStatus",messageLimit:"messageLimit",placeholder:"placeholder",singleConversation:"singleConversation",contextMode:"contextMode",contextRoute:"contextRoute",paused:"paused",bypassRouteSubscriptions:"bypassRouteSubscriptions"},providers:[ProviderService,AiTerminalService,AiPageFormAdapterService],viewQueries:[{propertyName:"messageScroll",first:!0,predicate:["messageScroll"],descendants:!0}],usesOnChanges:!0,ngImport:i0,template:'<div class="ai-terminal-shell" [class.single-conversation]="singleConversation">\n\t<div class="ai-terminal-sidebar" *ngIf="!singleConversation">\n\t\t<div class="ai-terminal-sidebar-header">\n\t\t\t<div>\n\t\t\t\t<h5>{{ title }}</h5>\n\t\t\t\t<p class="ai-terminal-muted" *ngIf="idApp">App: {{ idApp }}</p>\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="createConversation()">New Chat</button>\n\t\t</div>\n\n\t\t<div class="ai-terminal-sidebar-body">\n\t\t\t<div class="ai-terminal-empty" *ngIf="isLoading">Loading conversations...</div>\n\t\t\t<div class="ai-terminal-empty" *ngIf="!isLoading && !conversations.length">No conversations yet.</div>\n\n\t\t\t<div class="ai-terminal-conversation"\n\t\t\t\t*ngFor="let conversation of conversations; trackBy: trackByConversation"\n\t\t\t\t[class.is-active]="conversation._id === activeConversationId">\n\t\t\t\t<div class="ai-terminal-conversation-main" (click)="setActiveConversation(conversation)">\n\t\t\t\t\t<div class="ai-terminal-conversation-title" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t\t{{ conversation.title && conversation.title !== \'New Conversation\' ? conversation.title : \'Ask AI About the System\' }}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-edit" *ngIf="editingConversationId === conversation._id">\n\t\t\t\t\t\t<input type="text" class="form-control form-control-sm" [(ngModel)]="editingTitle"\n\t\t\t\t\t\t\t(keyup.enter)="saveRename(conversation)" (keyup.escape)="cancelRename()">\n\t\t\t\t\t\t<div class="ai-terminal-inline-actions">\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="saveRename(conversation)">Save</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="cancelRename()">Cancel</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-meta">\n\t\t\t\t\t\t<span *ngIf="conversation.updatedAt">{{ conversation.updatedAt | date: \'short\' }}</span>\n\t\t\t\t\t\t<span *ngIf="conversation.branch_name && isCodexMode()">{{ conversation.branch_name }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-conversation-actions" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm" (click)="startRename(conversation)">Rename</button>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger ai-terminal-delete-btn" (click)="deleteConversation(conversation)">Delete</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div class="ai-terminal-main">\n\t\t<div class="ai-terminal-main-header">\n\t\t\t<div>\n\t\t\t\t<h4>{{ activeConversation?.title && activeConversation?.title !== \'New Conversation\' ? activeConversation?.title : \'Ask AI About the System\' }}</h4>\n\t\t\t\t<div class="ai-terminal-meta-row">\n\t\t\t\t\t<span *ngIf="activeConversation?.branch_name && isCodexMode()">Branch: {{ activeConversation?.branch_name }}</span>\n\t\t\t\t\t<span *ngIf="showAdvanced() && totalTokens()">Tokens: {{ totalTokens() | number }}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="ai-terminal-main-actions">\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation && canCopyConversation()"\n\t\t\t\t\t(click)="copyConversation()" [disabled]="isSending">\n\t\t\t\t\tCopy Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation"\n\t\t\t\t\t(click)="startNewConversation()" [disabled]="isSending">\n\t\t\t\t\tNew Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-primary"\n\t\t\t\t\t*ngIf="isCodexMode() && activeConversation?.branch_name"\n\t\t\t\t\t(click)="deployTest()" [disabled]="isDeployingTest">\n\t\t\t\t\t{{ isDeployingTest ? \'Deploying...\' : \'Deploy to Test\' }}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="ai-terminal-alert" *ngIf="errorMessage">\n\t\t\t<div class="alert alert-danger">{{ errorMessage }}</div>\n\t\t</div>\n\t\t<div class="ai-terminal-alert" *ngIf="infoMessage">\n\t\t\t<div class="alert alert-success">{{ infoMessage }}</div>\n\t\t</div>\n\n\t\t\t<div class="ai-terminal-messages" #messageScroll>\n\t\t\t\t<div class="ai-terminal-empty" *ngIf="!messages.length">\n\t\t\t\t\t<div class="ai-terminal-favorites" *ngIf="promptFavorites.length">\n\t\t\t\t\t\t<p class="ai-terminal-empty-title">Favorites</p>\n\t\t\t\t\t\t<div class="ai-terminal-favorite-list">\n\t\t\t\t\t\t\t<div class="ai-terminal-favorite-item" *ngFor="let prompt of promptFavorites; trackBy: trackByFavoritePrompt">\n\t\t\t\t\t\t\t\t<button type="button" class="ai-terminal-favorite-run" (click)="runFavoritePrompt(prompt)">\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-star">★</span>\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-text">{{ prompt }}</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<div class="ai-terminal-favorite-actions">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-edit"\n\t\t\t\t\t\t\t\t\t\t(click)="startFavoritePromptEdit(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Edit favorite prompt">\n\t\t\t\t\t\t\t\t\t\t✎\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-remove"\n\t\t\t\t\t\t\t\t\t\t(click)="removeFavoritePrompt(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Remove favorite prompt">\n\t\t\t\t\t\t\t\t\t\t×\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p class="ai-terminal-empty-title">Try one of these to get started:</p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>How do I get to the invoice report?</li>\n\t\t\t\t\t\t<li>Where is the setting for <feature>?</li>\n\t\t\t\t\t\t<li>Give me a checklist for <task>.</li>\n\t\t\t\t\t<li>Explain what this screen does and the fields I need.</li>\n\t\t\t\t\t<li>Flag anomalies in inventory for the last 3 months.</li>\n\t\t\t\t\t<li>Summarize invoice totals for <client> over the last <X> months.</li>\n\t\t\t\t\t<li>Show trends in invoice volume and average value for <client> over the past 6 months.</li>\n\t\t\t\t\t<li>List top 5 variance items in inventory counts this quarter.</li>\n\t\t\t\t\t<li>Help me fill out this form using data I paste (e.g., from Excel).</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message"\n\t\t\t\t\t*ngFor="let message of visibleMessages; trackBy: trackByMessage"\n\t\t\t\t\t[class.user]="message.role === \'user\'"\n\t\t\t\t\t[class.assistant]="message.role === \'assistant\'"\n\t\t\t\t\t[class.pending]="message.metadata?.pending"\n\t\t\t\t\t[class.tool]="message.role === \'tool\'">\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-message-favorite-toggle"\n\t\t\t\t\t\t*ngIf="canToggleFavoriteForMessage(message)"\n\t\t\t\t\t\t[class.is-active]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t(click)="toggleMessagePromptFavorite(message, $event)"\n\t\t\t\t\t\t[attr.aria-pressed]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t[attr.title]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'"\n\t\t\t\t\t\t[attr.aria-label]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'">\n\t\t\t\t\t\t{{ isMessagePromptFavorited(message) ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class="ai-terminal-message-role">{{ message.role }}</div>\n\t\t\t\t<ng-container *ngIf="pendingProgress(message) as progress; else messageBody">\n\t\t\t\t\t<div class="ai-terminal-message-progress">\n\t\t\t\t\t\t<ul class="ai-terminal-progress-list">\n\t\t\t\t\t\t\t<li class="ai-terminal-progress-item" *ngFor="let item of progress">{{ item }}</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #messageBody>\n\t\t\t\t\t<div class="ai-terminal-message-body" [innerHTML]="messageMarkdown(message) | safe:\'html\'"></div>\n\t\t\t\t</ng-template>\n\t\t\t\t\t<div class="ai-terminal-message-table" *ngIf="displayTableForMessage(message) as display">\n\t\t\t\t\t\t<div class="ai-terminal-table-meta">\n\t\t\t\t\t\t\t<span>{{ isAllRowsLoaded(message) ? \'Rows\' : \'Preview\' }}: {{ display.rows?.length || 0 }} rows</span>\n\t\t\t\t\t\t\t<span *ngIf="display.total !== undefined && display.total !== null">Total: {{ display.total }}</span>\n\t\t\t\t\t\t\t<span *ngIf="display.truncated">Truncated</span>\n\t\t\t\t\t\t\t<span *ngIf="isAllRowsLoaded(message)">All rows loaded</span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-meta-spacer"></span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-tz">Timezone: {{ timeZoneLabel }}</span>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-pull"\n\t\t\t\t\t\t\t\t*ngIf="canPullAllMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isPullingAllMessage(message) || isExportingMessage(message)"\n\t\t\t\t\t\t\t\t(click)="pullAllMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isPullingAllMessage(message) ? \'Loading...\' : \'Pull All\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-export"\n\t\t\t\t\t\t\t\t*ngIf="canExportMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isExportingMessage(message) || isPullingAllMessage(message)"\n\t\t\t\t\t\t\t\t(click)="exportMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isExportingMessage(message) ? \'Exporting...\' : \'Export\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-table-toggle" (click)="toggleTable(message)">\n\t\t\t\t\t\t\t\t{{ isTableCollapsed(message) ? \'Show Table\' : \'Hide Table\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ai-terminal-table-wrap" *ngIf="!isTableCollapsed(message)">\n\t\t\t\t\t\t\t<collapse-table>\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th *ngFor="let column of display.columns">{{ column }}</th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr *ngFor="let row of display.rows">\n\t\t\t\t\t\t\t\t\t\t<td *ngFor="let column of display.columns">{{ formatDisplayCell(row[column], column) }}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-debug" *ngIf="showDebugForMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-debug-toggle" (click)="toggleDebug(message)">\n\t\t\t\t\t\t{{ isDebugCollapsed(message) ? \'Show Debug\' : \'Hide Debug\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<pre class="ai-terminal-debug-body" *ngIf="!isDebugCollapsed(message)">{{ debugText(message) }}</pre>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-actions" [class.ai-terminal-message-actions-user]="message.role === \'user\'" *ngIf="canCopyMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-copy-btn" (click)="copyMessage(message)">\n\t\t\t\t\t\t<i class="fa fa-copy" aria-hidden="true"></i>\n\t\t\t\t\t\tCopy\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-report-btn"\n\t\t\t\t\t\t*ngIf="canReportIssue(message)"\n\t\t\t\t\t\t(click)="openIssueReport(message, $event)">\n\t\t\t\t\t\t<i class="fa fa-flag" aria-hidden="true"></i>\n\t\t\t\t\t\tReport Issue\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-meta" *ngIf="showAdvanced() && message.usage?.total_tokens">\n\t\t\t\t\tTokens: {{ message.usage?.total_tokens | number }}\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-attachments" *ngIf="message.attachments?.length">\n\t\t\t\t\t<div class="ai-terminal-attachment" *ngFor="let attachment of message.attachments">\n\t\t\t\t\t\t<span>{{ attachment.name }}</span>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(attachment.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-composer">\n\t\t\t\t<div class="ai-terminal-composer-input-wrap">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclass="form-control ai-terminal-composer-input"\n\t\t\t\t\t\trows="2"\n\t\t\t\t\t\t[placeholder]="placeholder"\n\t\t\t\t\t\t(keydown)="handleComposerKeydown($event)"\n\t\t\t\t\t\t[(ngModel)]="messageText"></textarea>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-composer-favorite-toggle"\n\t\t\t\t\t\t[class.is-active]="promptFavoriteEnabled"\n\t\t\t\t\t\t[disabled]="isSending"\n\t\t\t\t\t\t(click)="togglePromptFavorite()"\n\t\t\t\t\t\t[attr.aria-pressed]="promptFavoriteEnabled"\n\t\t\t\t\t\t[attr.title]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'"\n\t\t\t\t\t\t[attr.aria-label]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'">\n\t\t\t\t\t\t{{ promptFavoriteEnabled ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="ai-terminal-composer-row">\n\t\t\t\t\t<div class="ai-terminal-upload" *ngIf="allowUploads()">\n\t\t\t\t\t\t<input type="file" class="form-control" multiple (change)="handleFileSelect($event)">\n\t\t\t\t\t<small class="ai-terminal-muted">Max {{ maxFileMb() }}MB per file • {{ maxTotalMb() }}MB total</small>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-actions">\n\t\t\t\t\t<button type="button" class="btn btn-outline-secondary" (click)="clearComposer()" [disabled]="isSending">Clear</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="sendMessage()" [disabled]="isSending || !messageText.trim()">\n\t\t\t\t\t\t{{ isSending ? \'Sending...\' : \'Send\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-pending" *ngIf="pendingFiles.length">\n\t\t\t\t<div class="ai-terminal-pending-title">Attachments</div>\n\t\t\t\t<div class="ai-terminal-pending-item" *ngFor="let file of pendingFiles; let i = index">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ file.name }}</strong>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(file.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger" (click)="removePendingFile(i)">Remove</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="favoritePromptEditOpen" (click)="cancelFavoritePromptEdit()">\n\t<div class="ai-terminal-favorite-edit-modal" role="dialog" aria-modal="true" aria-label="Edit favorite prompt" (click)="$event.stopPropagation()">\n\t\t<h5>Edit Favorite Request</h5>\n\t\t<textarea\n\t\t\tclass="form-control"\n\t\t\trows="5"\n\t\t\t(keydown.escape)="cancelFavoritePromptEdit()"\n\t\t\t[(ngModel)]="favoritePromptEditValue"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" (click)="cancelFavoritePromptEdit()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSaveFavoritePromptEdit()" (click)="saveFavoritePromptEdit()">Save</button>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="issueReportOpen" (click)="cancelIssueReport()">\n\t<div class="ai-terminal-favorite-edit-modal ai-terminal-issue-report-modal" role="dialog" aria-modal="true" aria-label="Report issue with assistant response" (click)="$event.stopPropagation()">\n\t\t<h5>Report AI Response Issue</h5>\n\t\t<label for="ai-terminal-issue-reason">What was wrong?</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-reason"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Describe what was inaccurate, missing, or confusing."\n\t\t\t[(ngModel)]="issueReportReason"></textarea>\n\t\t<label for="ai-terminal-issue-expected">What did you expect instead? (Optional)</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-expected"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Share the result or format you expected."\n\t\t\t[(ngModel)]="issueReportExpected"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" [disabled]="isSubmittingIssueReport" (click)="cancelIssueReport()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSubmitIssueReport()" (click)="submitIssueReport()">\n\t\t\t\t{{ isSubmittingIssueReport ? \'Submitting...\' : \'Submit Report\' }}\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".ai-terminal-shell{display:grid;grid-template-columns:280px minmax(0,1fr);gap:1rem;align-items:stretch}.ai-terminal-shell.single-conversation{grid-template-columns:minmax(0,1fr)}.ai-terminal-sidebar,.ai-terminal-main{background:#fff;border:1px solid rgba(148,163,184,.25);border-radius:14px;box-shadow:0 10px 24px #0f172a0f}.ai-terminal-sidebar{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-sidebar-header h5{font-size:1rem;margin:0}.ai-terminal-sidebar-body{flex:1;overflow:auto;padding-top:.5rem;font-size:.85rem}.ai-terminal-main{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-main-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-main-header h4{font-size:1.15rem;margin:0}.ai-terminal-main-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-meta-row{display:flex;gap:.75rem;font-size:.72rem;color:#64748b}.ai-terminal-muted{color:#64748b;font-size:.72rem;margin:0}.ai-terminal-conversation{border:1px solid transparent;border-radius:12px;padding:.6rem .7rem;margin-bottom:.5rem;background:#f8fafc;transition:border-color .2s ease,box-shadow .2s ease}.ai-terminal-conversation.is-active{border-color:#3b82f699;box-shadow:0 6px 14px #3b82f626;background:#eff6ff}.ai-terminal-conversation-main{cursor:pointer}.ai-terminal-conversation-title{font-weight:600;font-size:.85rem;margin-bottom:.35rem;color:#0f172a}.ai-terminal-conversation-meta{display:flex;gap:.5rem;font-size:.75rem;color:#64748b}.ai-terminal-conversation-actions{display:flex;justify-content:space-between;margin-top:.4rem}.ai-terminal-inline-actions{display:flex;gap:.35rem;margin-top:.4rem}.ai-terminal-conversation-edit input{margin-bottom:.4rem}.ai-terminal-alert{margin-top:.5rem}.ai-terminal-messages{flex:1;overflow-y:auto;padding:.75rem .25rem;display:flex;flex-direction:column;gap:.75rem}.ai-terminal-message{position:relative;padding:.75rem .85rem;border-radius:14px;background:#f8fafc;border:1px solid rgba(148,163,184,.2)}.ai-terminal-message-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.05rem;line-height:1;padding:0;width:1.35rem;height:1.35rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-message-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-message-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-message.user{background:#e0f2fe;border-color:#0ea5e94d}.ai-terminal-message.assistant{background:#f1f5f9}.ai-terminal-message.pending{border-style:dashed;border-color:#94a3b873;background:#f8fafc}.ai-terminal-message.pending .ai-terminal-message-body{letter-spacing:.2em;font-weight:600;animation:ai-terminal-thinking 1.2s ease-in-out infinite;color:#64748b}.ai-terminal-message-progress{color:#334155;font-size:.78rem}.ai-terminal-progress-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem}.ai-terminal-progress-item{display:inline-flex;align-self:flex-start;padding:.2rem .6rem;border-radius:999px;background:#94a3b833;color:#334155;font-weight:600;font-size:.85rem}.ai-terminal-message.tool{background:#fef3c7;border-color:#f59e0b66}.ai-terminal-message-role{font-size:.7rem;letter-spacing:.05em;text-transform:uppercase;color:#64748b;margin-bottom:.35rem}.ai-terminal-message-body{color:#0f172a;white-space:normal;line-height:1.6;font-size:.82rem}.ai-terminal-message-body p{margin:0 0 .35rem}.ai-terminal-message.user .ai-terminal-message-body p{margin:0}.ai-terminal-message.user .ai-terminal-message-actions{margin-top:0}.ai-terminal-message-body p:last-child{margin-bottom:0}.ai-terminal-message-body ul,.ai-terminal-message-body ol{margin:.35rem 0 .6rem 1.4rem;padding:0}.ai-terminal-message-body h1,.ai-terminal-message-body h2,.ai-terminal-message-body h3,.ai-terminal-message-body h4,.ai-terminal-message-body h5,.ai-terminal-message-body h6{margin:0 0 .5rem;font-weight:600}.ai-terminal-message-body code{background:#94a3b833;border-radius:4px;padding:.1rem .3rem;font-size:.85em}.ai-terminal-route-link{color:#2563eb;text-decoration:underline;cursor:pointer}.ai-terminal-route-link:hover{color:#1d4ed8}.ai-terminal-message-meta{margin-top:.35rem;font-size:.68rem;color:#64748b}.ai-terminal-message-actions{margin-top:.35rem;display:flex;justify-content:flex-end;gap:.65rem}.ai-terminal-message-actions.ai-terminal-message-actions-user{margin-top:0}.ai-terminal-copy-btn{padding:0;font-weight:600;color:#2563eb;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-copy-btn:hover{color:#1d4ed8}.ai-terminal-report-btn{padding:0;font-weight:600;color:#b45309;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-report-btn:hover{color:#92400e}.ai-terminal-message-table{margin-top:.6rem}.ai-terminal-table-meta{display:flex;flex-wrap:wrap;gap:.75rem;font-size:.75rem;color:#64748b;margin-bottom:.35rem;align-items:center}.ai-terminal-table-meta-spacer{flex:1 1 auto}.ai-terminal-table-tz{font-weight:600}.ai-terminal-table-toggle,.ai-terminal-table-export,.ai-terminal-table-pull{padding:0;font-weight:600}.ai-terminal-message-debug{margin-top:.5rem}.ai-terminal-debug-toggle{padding:0;font-weight:600}.ai-terminal-debug-body{margin:.35rem 0 0;padding:.5rem .75rem;background:#0f172a;color:#e2e8f0;border-radius:8px;font-size:.75rem;white-space:pre-wrap;word-break:break-word}.ai-terminal-table-wrap{width:100%;overflow-x:auto}.ai-terminal-table-wrap collapse-table{display:block;width:100%}.ai-terminal-table{width:100%;border-collapse:collapse;font-size:.78rem}.ai-terminal-table th,.ai-terminal-table td{border:1px solid rgba(148,163,184,.3);padding:.35rem .5rem;vertical-align:top;white-space:nowrap}.ai-terminal-table thead{background:#94a3b826}.ai-terminal-table tbody tr:nth-child(2n){background:#94a3b814}.ai-terminal-message-attachments{margin-top:.5rem;border-top:1px dashed rgba(148,163,184,.4);padding-top:.4rem}.ai-terminal-attachment{display:flex;justify-content:space-between;font-size:.8rem}.ai-terminal-composer{border-top:1px solid rgba(148,163,184,.2);padding-top:.75rem;display:flex;flex-direction:column;gap:.6rem}.ai-terminal-composer-input-wrap{position:relative}.ai-terminal-composer-input{min-height:60px;padding:.85rem 2.7rem .85rem 1rem;border-radius:16px;border:1px solid rgba(234,179,8,.45);background:#fff7cc;box-shadow:0 10px 20px #eab3081f;font-size:.95rem;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease;resize:vertical}.ai-terminal-composer-input:focus{border-color:#f59e0bbf;background:#fff3b0;box-shadow:0 0 0 3px #fbbf2459,0 12px 24px #eab30833}.ai-terminal-composer-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.15rem;line-height:1;padding:0;width:1.5rem;height:1.5rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-composer-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-composer-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-composer-row{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap}.ai-terminal-upload{flex:1;min-width:220px}.ai-terminal-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-pending{background:#f8fafc;border:1px dashed rgba(148,163,184,.4);border-radius:12px;padding:.6rem .75rem}.ai-terminal-pending-title{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin-bottom:.4rem}.ai-terminal-pending-item{display:flex;justify-content:space-between;align-items:center;border-top:1px solid rgba(148,163,184,.2);padding-top:.4rem;margin-top:.4rem}.ai-terminal-empty-title{margin:0 0 .45rem;color:#64748b;font-size:.78rem;font-weight:600}.ai-terminal-favorites{margin-bottom:.9rem;padding:.6rem;border:1px solid rgba(148,163,184,.24);border-radius:12px;background:#f8fafc}.ai-terminal-favorite-list{display:flex;flex-direction:column;gap:.4rem}.ai-terminal-favorite-item{display:flex;align-items:center;gap:.4rem;width:100%;min-width:0}.ai-terminal-favorite-actions{display:inline-flex;align-items:center;gap:.35rem}.ai-terminal-favorite-run{flex:1;display:inline-flex;align-items:center;gap:.5rem;min-width:0;border:1px solid rgba(148,163,184,.3);border-radius:10px;padding:.45rem .55rem;background:#fff;color:#0f172a;font-size:.78rem;line-height:1.2;text-align:left;transition:border-color .2s ease,background-color .2s ease}.ai-terminal-favorite-run:hover{border-color:#f59e0bbf;background:#fffbeb}.ai-terminal-favorite-run-star{color:#d4a017;font-size:.86rem;line-height:1;flex:0 0 auto}.ai-terminal-favorite-run-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-terminal-favorite-edit,.ai-terminal-favorite-remove{border:1px solid rgba(148,163,184,.3);border-radius:10px;background:#fff;width:2rem;height:2rem;font-size:1rem;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-favorite-edit{color:#1d4ed8}.ai-terminal-favorite-remove{color:#b91c1c}.ai-terminal-empty{color:#94a3b8;font-size:.78rem;padding:.5rem .2rem}.ai-terminal-favorite-edit-overlay{position:fixed;inset:0;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:1rem;z-index:1060}.ai-terminal-favorite-edit-modal{width:min(560px,100%);background:#fff;border:1px solid rgba(148,163,184,.4);border-radius:12px;padding:.9rem;box-shadow:0 18px 40px #0f172a33;display:flex;flex-direction:column;gap:.65rem}.ai-terminal-favorite-edit-modal h5{margin:0;font-size:.95rem}.ai-terminal-favorite-edit-modal textarea{min-height:9rem}.ai-terminal-issue-report-modal textarea{min-height:7rem}.ai-terminal-issue-report-modal label{margin:0;font-size:.8rem;font-weight:600;color:#334155}.ai-terminal-favorite-edit-actions{display:flex;justify-content:flex-end;gap:.45rem}@keyframes ai-terminal-thinking{0%{opacity:.35}50%{opacity:1}to{opacity:.35}}@media(max-width:980px){.ai-terminal-shell{grid-template-columns:1fr}}\n"],dependencies:[{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"directive",type:i3.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{kind:"directive",type:i3.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{kind:"pipe",type:DomSanitizorPipe,name:"safe"},{kind:"pipe",type:i3.DecimalPipe,name:"number"},{kind:"pipe",type:i3.DatePipe,name:"date"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalComponent,decorators:[{type:Component,args:[{selector:"rio-ai-terminal",providers:[ProviderService,AiTerminalService,AiPageFormAdapterService],standalone:!1,template:'<div class="ai-terminal-shell" [class.single-conversation]="singleConversation">\n\t<div class="ai-terminal-sidebar" *ngIf="!singleConversation">\n\t\t<div class="ai-terminal-sidebar-header">\n\t\t\t<div>\n\t\t\t\t<h5>{{ title }}</h5>\n\t\t\t\t<p class="ai-terminal-muted" *ngIf="idApp">App: {{ idApp }}</p>\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="createConversation()">New Chat</button>\n\t\t</div>\n\n\t\t<div class="ai-terminal-sidebar-body">\n\t\t\t<div class="ai-terminal-empty" *ngIf="isLoading">Loading conversations...</div>\n\t\t\t<div class="ai-terminal-empty" *ngIf="!isLoading && !conversations.length">No conversations yet.</div>\n\n\t\t\t<div class="ai-terminal-conversation"\n\t\t\t\t*ngFor="let conversation of conversations; trackBy: trackByConversation"\n\t\t\t\t[class.is-active]="conversation._id === activeConversationId">\n\t\t\t\t<div class="ai-terminal-conversation-main" (click)="setActiveConversation(conversation)">\n\t\t\t\t\t<div class="ai-terminal-conversation-title" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t\t{{ conversation.title && conversation.title !== \'New Conversation\' ? conversation.title : \'Ask AI About the System\' }}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-edit" *ngIf="editingConversationId === conversation._id">\n\t\t\t\t\t\t<input type="text" class="form-control form-control-sm" [(ngModel)]="editingTitle"\n\t\t\t\t\t\t\t(keyup.enter)="saveRename(conversation)" (keyup.escape)="cancelRename()">\n\t\t\t\t\t\t<div class="ai-terminal-inline-actions">\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="saveRename(conversation)">Save</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="cancelRename()">Cancel</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-meta">\n\t\t\t\t\t\t<span *ngIf="conversation.updatedAt">{{ conversation.updatedAt | date: \'short\' }}</span>\n\t\t\t\t\t\t<span *ngIf="conversation.branch_name && isCodexMode()">{{ conversation.branch_name }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-conversation-actions" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm" (click)="startRename(conversation)">Rename</button>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger ai-terminal-delete-btn" (click)="deleteConversation(conversation)">Delete</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div class="ai-terminal-main">\n\t\t<div class="ai-terminal-main-header">\n\t\t\t<div>\n\t\t\t\t<h4>{{ activeConversation?.title && activeConversation?.title !== \'New Conversation\' ? activeConversation?.title : \'Ask AI About the System\' }}</h4>\n\t\t\t\t<div class="ai-terminal-meta-row">\n\t\t\t\t\t<span *ngIf="activeConversation?.branch_name && isCodexMode()">Branch: {{ activeConversation?.branch_name }}</span>\n\t\t\t\t\t<span *ngIf="showAdvanced() && totalTokens()">Tokens: {{ totalTokens() | number }}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="ai-terminal-main-actions">\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation && canCopyConversation()"\n\t\t\t\t\t(click)="copyConversation()" [disabled]="isSending">\n\t\t\t\t\tCopy Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation"\n\t\t\t\t\t(click)="startNewConversation()" [disabled]="isSending">\n\t\t\t\t\tNew Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-primary"\n\t\t\t\t\t*ngIf="isCodexMode() && activeConversation?.branch_name"\n\t\t\t\t\t(click)="deployTest()" [disabled]="isDeployingTest">\n\t\t\t\t\t{{ isDeployingTest ? \'Deploying...\' : \'Deploy to Test\' }}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="ai-terminal-alert" *ngIf="errorMessage">\n\t\t\t<div class="alert alert-danger">{{ errorMessage }}</div>\n\t\t</div>\n\t\t<div class="ai-terminal-alert" *ngIf="infoMessage">\n\t\t\t<div class="alert alert-success">{{ infoMessage }}</div>\n\t\t</div>\n\n\t\t\t<div class="ai-terminal-messages" #messageScroll>\n\t\t\t\t<div class="ai-terminal-empty" *ngIf="!messages.length">\n\t\t\t\t\t<div class="ai-terminal-favorites" *ngIf="promptFavorites.length">\n\t\t\t\t\t\t<p class="ai-terminal-empty-title">Favorites</p>\n\t\t\t\t\t\t<div class="ai-terminal-favorite-list">\n\t\t\t\t\t\t\t<div class="ai-terminal-favorite-item" *ngFor="let prompt of promptFavorites; trackBy: trackByFavoritePrompt">\n\t\t\t\t\t\t\t\t<button type="button" class="ai-terminal-favorite-run" (click)="runFavoritePrompt(prompt)">\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-star">★</span>\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-text">{{ prompt }}</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<div class="ai-terminal-favorite-actions">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-edit"\n\t\t\t\t\t\t\t\t\t\t(click)="startFavoritePromptEdit(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Edit favorite prompt">\n\t\t\t\t\t\t\t\t\t\t✎\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-remove"\n\t\t\t\t\t\t\t\t\t\t(click)="removeFavoritePrompt(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Remove favorite prompt">\n\t\t\t\t\t\t\t\t\t\t×\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p class="ai-terminal-empty-title">Try one of these to get started:</p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>How do I get to the invoice report?</li>\n\t\t\t\t\t\t<li>Where is the setting for <feature>?</li>\n\t\t\t\t\t\t<li>Give me a checklist for <task>.</li>\n\t\t\t\t\t<li>Explain what this screen does and the fields I need.</li>\n\t\t\t\t\t<li>Flag anomalies in inventory for the last 3 months.</li>\n\t\t\t\t\t<li>Summarize invoice totals for <client> over the last <X> months.</li>\n\t\t\t\t\t<li>Show trends in invoice volume and average value for <client> over the past 6 months.</li>\n\t\t\t\t\t<li>List top 5 variance items in inventory counts this quarter.</li>\n\t\t\t\t\t<li>Help me fill out this form using data I paste (e.g., from Excel).</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message"\n\t\t\t\t\t*ngFor="let message of visibleMessages; trackBy: trackByMessage"\n\t\t\t\t\t[class.user]="message.role === \'user\'"\n\t\t\t\t\t[class.assistant]="message.role === \'assistant\'"\n\t\t\t\t\t[class.pending]="message.metadata?.pending"\n\t\t\t\t\t[class.tool]="message.role === \'tool\'">\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-message-favorite-toggle"\n\t\t\t\t\t\t*ngIf="canToggleFavoriteForMessage(message)"\n\t\t\t\t\t\t[class.is-active]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t(click)="toggleMessagePromptFavorite(message, $event)"\n\t\t\t\t\t\t[attr.aria-pressed]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t[attr.title]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'"\n\t\t\t\t\t\t[attr.aria-label]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'">\n\t\t\t\t\t\t{{ isMessagePromptFavorited(message) ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class="ai-terminal-message-role">{{ message.role }}</div>\n\t\t\t\t<ng-container *ngIf="pendingProgress(message) as progress; else messageBody">\n\t\t\t\t\t<div class="ai-terminal-message-progress">\n\t\t\t\t\t\t<ul class="ai-terminal-progress-list">\n\t\t\t\t\t\t\t<li class="ai-terminal-progress-item" *ngFor="let item of progress">{{ item }}</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #messageBody>\n\t\t\t\t\t<div class="ai-terminal-message-body" [innerHTML]="messageMarkdown(message) | safe:\'html\'"></div>\n\t\t\t\t</ng-template>\n\t\t\t\t\t<div class="ai-terminal-message-table" *ngIf="displayTableForMessage(message) as display">\n\t\t\t\t\t\t<div class="ai-terminal-table-meta">\n\t\t\t\t\t\t\t<span>{{ isAllRowsLoaded(message) ? \'Rows\' : \'Preview\' }}: {{ display.rows?.length || 0 }} rows</span>\n\t\t\t\t\t\t\t<span *ngIf="display.total !== undefined && display.total !== null">Total: {{ display.total }}</span>\n\t\t\t\t\t\t\t<span *ngIf="display.truncated">Truncated</span>\n\t\t\t\t\t\t\t<span *ngIf="isAllRowsLoaded(message)">All rows loaded</span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-meta-spacer"></span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-tz">Timezone: {{ timeZoneLabel }}</span>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-pull"\n\t\t\t\t\t\t\t\t*ngIf="canPullAllMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isPullingAllMessage(message) || isExportingMessage(message)"\n\t\t\t\t\t\t\t\t(click)="pullAllMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isPullingAllMessage(message) ? \'Loading...\' : \'Pull All\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-export"\n\t\t\t\t\t\t\t\t*ngIf="canExportMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isExportingMessage(message) || isPullingAllMessage(message)"\n\t\t\t\t\t\t\t\t(click)="exportMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isExportingMessage(message) ? \'Exporting...\' : \'Export\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-table-toggle" (click)="toggleTable(message)">\n\t\t\t\t\t\t\t\t{{ isTableCollapsed(message) ? \'Show Table\' : \'Hide Table\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ai-terminal-table-wrap" *ngIf="!isTableCollapsed(message)">\n\t\t\t\t\t\t\t<collapse-table>\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th *ngFor="let column of display.columns">{{ column }}</th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr *ngFor="let row of display.rows">\n\t\t\t\t\t\t\t\t\t\t<td *ngFor="let column of display.columns">{{ formatDisplayCell(row[column], column) }}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-debug" *ngIf="showDebugForMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-debug-toggle" (click)="toggleDebug(message)">\n\t\t\t\t\t\t{{ isDebugCollapsed(message) ? \'Show Debug\' : \'Hide Debug\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<pre class="ai-terminal-debug-body" *ngIf="!isDebugCollapsed(message)">{{ debugText(message) }}</pre>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-actions" [class.ai-terminal-message-actions-user]="message.role === \'user\'" *ngIf="canCopyMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-copy-btn" (click)="copyMessage(message)">\n\t\t\t\t\t\t<i class="fa fa-copy" aria-hidden="true"></i>\n\t\t\t\t\t\tCopy\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-report-btn"\n\t\t\t\t\t\t*ngIf="canReportIssue(message)"\n\t\t\t\t\t\t(click)="openIssueReport(message, $event)">\n\t\t\t\t\t\t<i class="fa fa-flag" aria-hidden="true"></i>\n\t\t\t\t\t\tReport Issue\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-meta" *ngIf="showAdvanced() && message.usage?.total_tokens">\n\t\t\t\t\tTokens: {{ message.usage?.total_tokens | number }}\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-attachments" *ngIf="message.attachments?.length">\n\t\t\t\t\t<div class="ai-terminal-attachment" *ngFor="let attachment of message.attachments">\n\t\t\t\t\t\t<span>{{ attachment.name }}</span>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(attachment.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-composer">\n\t\t\t\t<div class="ai-terminal-composer-input-wrap">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclass="form-control ai-terminal-composer-input"\n\t\t\t\t\t\trows="2"\n\t\t\t\t\t\t[placeholder]="placeholder"\n\t\t\t\t\t\t(keydown)="handleComposerKeydown($event)"\n\t\t\t\t\t\t[(ngModel)]="messageText"></textarea>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-composer-favorite-toggle"\n\t\t\t\t\t\t[class.is-active]="promptFavoriteEnabled"\n\t\t\t\t\t\t[disabled]="isSending"\n\t\t\t\t\t\t(click)="togglePromptFavorite()"\n\t\t\t\t\t\t[attr.aria-pressed]="promptFavoriteEnabled"\n\t\t\t\t\t\t[attr.title]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'"\n\t\t\t\t\t\t[attr.aria-label]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'">\n\t\t\t\t\t\t{{ promptFavoriteEnabled ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="ai-terminal-composer-row">\n\t\t\t\t\t<div class="ai-terminal-upload" *ngIf="allowUploads()">\n\t\t\t\t\t\t<input type="file" class="form-control" multiple (change)="handleFileSelect($event)">\n\t\t\t\t\t<small class="ai-terminal-muted">Max {{ maxFileMb() }}MB per file • {{ maxTotalMb() }}MB total</small>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-actions">\n\t\t\t\t\t<button type="button" class="btn btn-outline-secondary" (click)="clearComposer()" [disabled]="isSending">Clear</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="sendMessage()" [disabled]="isSending || !messageText.trim()">\n\t\t\t\t\t\t{{ isSending ? \'Sending...\' : \'Send\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-pending" *ngIf="pendingFiles.length">\n\t\t\t\t<div class="ai-terminal-pending-title">Attachments</div>\n\t\t\t\t<div class="ai-terminal-pending-item" *ngFor="let file of pendingFiles; let i = index">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ file.name }}</strong>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(file.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger" (click)="removePendingFile(i)">Remove</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="favoritePromptEditOpen" (click)="cancelFavoritePromptEdit()">\n\t<div class="ai-terminal-favorite-edit-modal" role="dialog" aria-modal="true" aria-label="Edit favorite prompt" (click)="$event.stopPropagation()">\n\t\t<h5>Edit Favorite Request</h5>\n\t\t<textarea\n\t\t\tclass="form-control"\n\t\t\trows="5"\n\t\t\t(keydown.escape)="cancelFavoritePromptEdit()"\n\t\t\t[(ngModel)]="favoritePromptEditValue"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" (click)="cancelFavoritePromptEdit()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSaveFavoritePromptEdit()" (click)="saveFavoritePromptEdit()">Save</button>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="issueReportOpen" (click)="cancelIssueReport()">\n\t<div class="ai-terminal-favorite-edit-modal ai-terminal-issue-report-modal" role="dialog" aria-modal="true" aria-label="Report issue with assistant response" (click)="$event.stopPropagation()">\n\t\t<h5>Report AI Response Issue</h5>\n\t\t<label for="ai-terminal-issue-reason">What was wrong?</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-reason"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Describe what was inaccurate, missing, or confusing."\n\t\t\t[(ngModel)]="issueReportReason"></textarea>\n\t\t<label for="ai-terminal-issue-expected">What did you expect instead? (Optional)</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-expected"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Share the result or format you expected."\n\t\t\t[(ngModel)]="issueReportExpected"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" [disabled]="isSubmittingIssueReport" (click)="cancelIssueReport()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSubmitIssueReport()" (click)="submitIssueReport()">\n\t\t\t\t{{ isSubmittingIssueReport ? \'Submitting...\' : \'Submit Report\' }}\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".ai-terminal-shell{display:grid;grid-template-columns:280px minmax(0,1fr);gap:1rem;align-items:stretch}.ai-terminal-shell.single-conversation{grid-template-columns:minmax(0,1fr)}.ai-terminal-sidebar,.ai-terminal-main{background:#fff;border:1px solid rgba(148,163,184,.25);border-radius:14px;box-shadow:0 10px 24px #0f172a0f}.ai-terminal-sidebar{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-sidebar-header h5{font-size:1rem;margin:0}.ai-terminal-sidebar-body{flex:1;overflow:auto;padding-top:.5rem;font-size:.85rem}.ai-terminal-main{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-main-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-main-header h4{font-size:1.15rem;margin:0}.ai-terminal-main-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-meta-row{display:flex;gap:.75rem;font-size:.72rem;color:#64748b}.ai-terminal-muted{color:#64748b;font-size:.72rem;margin:0}.ai-terminal-conversation{border:1px solid transparent;border-radius:12px;padding:.6rem .7rem;margin-bottom:.5rem;background:#f8fafc;transition:border-color .2s ease,box-shadow .2s ease}.ai-terminal-conversation.is-active{border-color:#3b82f699;box-shadow:0 6px 14px #3b82f626;background:#eff6ff}.ai-terminal-conversation-main{cursor:pointer}.ai-terminal-conversation-title{font-weight:600;font-size:.85rem;margin-bottom:.35rem;color:#0f172a}.ai-terminal-conversation-meta{display:flex;gap:.5rem;font-size:.75rem;color:#64748b}.ai-terminal-conversation-actions{display:flex;justify-content:space-between;margin-top:.4rem}.ai-terminal-inline-actions{display:flex;gap:.35rem;margin-top:.4rem}.ai-terminal-conversation-edit input{margin-bottom:.4rem}.ai-terminal-alert{margin-top:.5rem}.ai-terminal-messages{flex:1;overflow-y:auto;padding:.75rem .25rem;display:flex;flex-direction:column;gap:.75rem}.ai-terminal-message{position:relative;padding:.75rem .85rem;border-radius:14px;background:#f8fafc;border:1px solid rgba(148,163,184,.2)}.ai-terminal-message-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.05rem;line-height:1;padding:0;width:1.35rem;height:1.35rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-message-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-message-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-message.user{background:#e0f2fe;border-color:#0ea5e94d}.ai-terminal-message.assistant{background:#f1f5f9}.ai-terminal-message.pending{border-style:dashed;border-color:#94a3b873;background:#f8fafc}.ai-terminal-message.pending .ai-terminal-message-body{letter-spacing:.2em;font-weight:600;animation:ai-terminal-thinking 1.2s ease-in-out infinite;color:#64748b}.ai-terminal-message-progress{color:#334155;font-size:.78rem}.ai-terminal-progress-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem}.ai-terminal-progress-item{display:inline-flex;align-self:flex-start;padding:.2rem .6rem;border-radius:999px;background:#94a3b833;color:#334155;font-weight:600;font-size:.85rem}.ai-terminal-message.tool{background:#fef3c7;border-color:#f59e0b66}.ai-terminal-message-role{font-size:.7rem;letter-spacing:.05em;text-transform:uppercase;color:#64748b;margin-bottom:.35rem}.ai-terminal-message-body{color:#0f172a;white-space:normal;line-height:1.6;font-size:.82rem}.ai-terminal-message-body p{margin:0 0 .35rem}.ai-terminal-message.user .ai-terminal-message-body p{margin:0}.ai-terminal-message.user .ai-terminal-message-actions{margin-top:0}.ai-terminal-message-body p:last-child{margin-bottom:0}.ai-terminal-message-body ul,.ai-terminal-message-body ol{margin:.35rem 0 .6rem 1.4rem;padding:0}.ai-terminal-message-body h1,.ai-terminal-message-body h2,.ai-terminal-message-body h3,.ai-terminal-message-body h4,.ai-terminal-message-body h5,.ai-terminal-message-body h6{margin:0 0 .5rem;font-weight:600}.ai-terminal-message-body code{background:#94a3b833;border-radius:4px;padding:.1rem .3rem;font-size:.85em}.ai-terminal-route-link{color:#2563eb;text-decoration:underline;cursor:pointer}.ai-terminal-route-link:hover{color:#1d4ed8}.ai-terminal-message-meta{margin-top:.35rem;font-size:.68rem;color:#64748b}.ai-terminal-message-actions{margin-top:.35rem;display:flex;justify-content:flex-end;gap:.65rem}.ai-terminal-message-actions.ai-terminal-message-actions-user{margin-top:0}.ai-terminal-copy-btn{padding:0;font-weight:600;color:#2563eb;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-copy-btn:hover{color:#1d4ed8}.ai-terminal-report-btn{padding:0;font-weight:600;color:#b45309;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-report-btn:hover{color:#92400e}.ai-terminal-message-table{margin-top:.6rem}.ai-terminal-table-meta{display:flex;flex-wrap:wrap;gap:.75rem;font-size:.75rem;color:#64748b;margin-bottom:.35rem;align-items:center}.ai-terminal-table-meta-spacer{flex:1 1 auto}.ai-terminal-table-tz{font-weight:600}.ai-terminal-table-toggle,.ai-terminal-table-export,.ai-terminal-table-pull{padding:0;font-weight:600}.ai-terminal-message-debug{margin-top:.5rem}.ai-terminal-debug-toggle{padding:0;font-weight:600}.ai-terminal-debug-body{margin:.35rem 0 0;padding:.5rem .75rem;background:#0f172a;color:#e2e8f0;border-radius:8px;font-size:.75rem;white-space:pre-wrap;word-break:break-word}.ai-terminal-table-wrap{width:100%;overflow-x:auto}.ai-terminal-table-wrap collapse-table{display:block;width:100%}.ai-terminal-table{width:100%;border-collapse:collapse;font-size:.78rem}.ai-terminal-table th,.ai-terminal-table td{border:1px solid rgba(148,163,184,.3);padding:.35rem .5rem;vertical-align:top;white-space:nowrap}.ai-terminal-table thead{background:#94a3b826}.ai-terminal-table tbody tr:nth-child(2n){background:#94a3b814}.ai-terminal-message-attachments{margin-top:.5rem;border-top:1px dashed rgba(148,163,184,.4);padding-top:.4rem}.ai-terminal-attachment{display:flex;justify-content:space-between;font-size:.8rem}.ai-terminal-composer{border-top:1px solid rgba(148,163,184,.2);padding-top:.75rem;display:flex;flex-direction:column;gap:.6rem}.ai-terminal-composer-input-wrap{position:relative}.ai-terminal-composer-input{min-height:60px;padding:.85rem 2.7rem .85rem 1rem;border-radius:16px;border:1px solid rgba(234,179,8,.45);background:#fff7cc;box-shadow:0 10px 20px #eab3081f;font-size:.95rem;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease;resize:vertical}.ai-terminal-composer-input:focus{border-color:#f59e0bbf;background:#fff3b0;box-shadow:0 0 0 3px #fbbf2459,0 12px 24px #eab30833}.ai-terminal-composer-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.15rem;line-height:1;padding:0;width:1.5rem;height:1.5rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-composer-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-composer-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-composer-row{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap}.ai-terminal-upload{flex:1;min-width:220px}.ai-terminal-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-pending{background:#f8fafc;border:1px dashed rgba(148,163,184,.4);border-radius:12px;padding:.6rem .75rem}.ai-terminal-pending-title{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin-bottom:.4rem}.ai-terminal-pending-item{display:flex;justify-content:space-between;align-items:center;border-top:1px solid rgba(148,163,184,.2);padding-top:.4rem;margin-top:.4rem}.ai-terminal-empty-title{margin:0 0 .45rem;color:#64748b;font-size:.78rem;font-weight:600}.ai-terminal-favorites{margin-bottom:.9rem;padding:.6rem;border:1px solid rgba(148,163,184,.24);border-radius:12px;background:#f8fafc}.ai-terminal-favorite-list{display:flex;flex-direction:column;gap:.4rem}.ai-terminal-favorite-item{display:flex;align-items:center;gap:.4rem;width:100%;min-width:0}.ai-terminal-favorite-actions{display:inline-flex;align-items:center;gap:.35rem}.ai-terminal-favorite-run{flex:1;display:inline-flex;align-items:center;gap:.5rem;min-width:0;border:1px solid rgba(148,163,184,.3);border-radius:10px;padding:.45rem .55rem;background:#fff;color:#0f172a;font-size:.78rem;line-height:1.2;text-align:left;transition:border-color .2s ease,background-color .2s ease}.ai-terminal-favorite-run:hover{border-color:#f59e0bbf;background:#fffbeb}.ai-terminal-favorite-run-star{color:#d4a017;font-size:.86rem;line-height:1;flex:0 0 auto}.ai-terminal-favorite-run-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-terminal-favorite-edit,.ai-terminal-favorite-remove{border:1px solid rgba(148,163,184,.3);border-radius:10px;background:#fff;width:2rem;height:2rem;font-size:1rem;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-favorite-edit{color:#1d4ed8}.ai-terminal-favorite-remove{color:#b91c1c}.ai-terminal-empty{color:#94a3b8;font-size:.78rem;padding:.5rem .2rem}.ai-terminal-favorite-edit-overlay{position:fixed;inset:0;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:1rem;z-index:1060}.ai-terminal-favorite-edit-modal{width:min(560px,100%);background:#fff;border:1px solid rgba(148,163,184,.4);border-radius:12px;padding:.9rem;box-shadow:0 18px 40px #0f172a33;display:flex;flex-direction:column;gap:.65rem}.ai-terminal-favorite-edit-modal h5{margin:0;font-size:.95rem}.ai-terminal-favorite-edit-modal textarea{min-height:9rem}.ai-terminal-issue-report-modal textarea{min-height:7rem}.ai-terminal-issue-report-modal label{margin:0;font-size:.8rem;font-weight:600;color:#334155}.ai-terminal-favorite-edit-actions{display:flex;justify-content:flex-end;gap:.45rem}@keyframes ai-terminal-thinking{0%{opacity:.35}50%{opacity:1}to{opacity:.35}}@media(max-width:980px){.ai-terminal-shell{grid-template-columns:1fr}}\n"]}]}],ctorParameters:()=>[{type:AiTerminalService},{type:ProviderService},{type:AiPageRouterService},{type:AiPageFormAdapterService},{type:void 0,decorators:[{type:Inject,args:[LOCALE_ID]}]}],propDecorators:{idClient:[{type:Input}],idApp:[{type:Input}],title:[{type:Input}],config:[{type:Input}],conversationStatus:[{type:Input}],messageLimit:[{type:Input}],placeholder:[{type:Input}],singleConversation:[{type:Input}],contextMode:[{type:Input}],contextRoute:[{type:Input}],paused:[{type:Input}],bypassRouteSubscriptions:[{type:Input}],messageScroll:[{type:ViewChild,args:["messageScroll",{static:!1}]}]}});const BASE_SYSTEM_PROMPT=["You are the ResolveIO in-app AI assistant for this product.","- You can only help users understand and navigate the existing codebase and UI.","- Never share code or file contents. All code is proprietary.","- Do not suggest or perform any hacking, bypass, or security abuse.","- Do not access databases directly, secrets, or other users' data.","- If the user has a customer portal scope (other.id_customer), only discuss that customer's data and what is visible in their customer portal. Never reference other customers or internal/admin-only data. If asked for anything outside the portal, say it isn't available.","- Do not change local browser data or run destructive actions.","- Provide detailed, expert-level explanations grounded in this product. Avoid generic answers.","- When explaining why something happens, describe the specific workflow, fields, and auto-filled data involved (what fills, where it comes from, and when it triggers). If unsure, ask a clarifying question about the screen or workflow.",'- When asked "why is this happening," respond with: cause, trigger, data source(s), and expected vs actual outcome.',"- For troubleshooting, ask clarifying questions only when needed to proceed; otherwise answer directly, then give a short decision tree (If X, do Y; If not, do Z).","- Provide checklists for common tasks, highlighting required fields and common pitfalls.",'- If asked "where is this set," give the screen/workflow name and navigation steps to reach it.','- If asked "what changed," summarize release notes if known; if not available, say so and suggest where to check or offer a support ticket.','- After answering, optionally suggest 0-1 related next steps only when helpful. Do not ask for "next steps" every time.',"- If access is blocked, name the permission/role needed and how to request it.","- Prefer high-level product guidance; only mention file paths if explicitly requested.","- Only include an in-app route when the user explicitly asks for navigation or a link to another screen. Never include the route for the current screen.",'- Avoid vague labels like "Operations app"; use the specific screen/workflow name.',"- Do not mention other client projects or ask which client; if clarification is needed, ask about the screen or workflow without listing other clients.","- Respond in English only. Do not include non-English text or characters unless required for JSON, links, or tool directives.",'- Respond with a single clear message; be thorough but stay focused. Do not add labels like "Customer-facing summary" or "Work ticket summary" and do not include estimated hours.','- Use structured responses by default: short heading, then bullet points. For "how do I" questions, provide a step-by-step list (numbered) with explicit page/screen names and actions.','- When giving steps, include navigation guidance like "Go to <screen>" and "Click/Select/Enter <field>" so the user can follow it exactly.',"- If context scope is provided (ex: current page), prioritize that screen in your answer.","- If a request is out of scope, offer to create a support ticket and provide a short summary.",'- If you identify a likely product issue, confirm the issue and ask: "Do you want me to open a support ticket?" before creating one.',"- If the user explicitly asks to create/open/file a support ticket, or explicitly confirms after your prompt, end your response with a single line in one of these formats:","- SUPPORT_TICKET_CREATE: <one-line summary>",'- SUPPORT_TICKET_CREATE: {"summary":"<customer-safe summary>","internal_recommendations":"<internal-only diagnosis and fix recommendation>","code_change_recommendations":"<codex-ready implementation notes>"}',"- Prefer the JSON form when you have useful internal recommendations. Keep the customer-safe summary concise.","- Only include SUPPORT_TICKET_CREATE when the user clearly wants a ticket created. Do not claim a ticket is created unless you include that line.",'- Do not end responses with tentative phrasing like "I could" or "I’m going to." Complete the request or state what is required to proceed.',"- Use the codebase context to choose correct collections/fields/workflows and use MONGO_READ/MONGO_AGG to answer with real data when needed.","- For direct questions, answer first. Ask a single follow-up only if required to run a query or resolve missing details.","- If you need database data to answer, end your response with a single line exactly in this format:",'- MONGO_READ: {"collection":"<name>","query":{...},"options":{"projection":{...},"sort":{...},"limit":20},"permissionView":"</route>"}',"- If you need grouped/aggregated data (totals by user, rankings, trends), end your response with a single line exactly in this format:",'- MONGO_AGG: {"collection":"<name>","pipeline":[...],"options":{"allowDiskUse":true,"limit":20},"permissionView":"</route>"}',"- For invoice data, set permissionView to an invoice-capable route (ex: /invoice/list or /report-builder). Do not use /report/* routes.","- For revenue/sales/billing questions, use invoices and sum paid_total (fallback to grand_total) with date_paid and Paid/Closed status when available.","- For blend ticket summaries, use product = blend_name (fallback chemical), total volume = chemical_recipe_quantity, and unit = lb when blend_in_pounds is true otherwise gal.","- For relative date ranges (last/past/recent), include an upper bound <= $$NOW unless the user specifies a future end date.","- Keep queries minimal, read-only, and avoid user/credential data unless the user is a super admin.","- Assume you are not a super admin unless explicitly told otherwise.","- Only request data when the user has permission for that module; invoice data requires invoice view access.","- If the user lacks permission, answer without data and explain how to view it in the app or request access.","- For simple counts or time-range totals, use MONGO_READ (includeTotal). For breakdowns, rankings, or sums grouped by a field, use MONGO_AGG.",'- Before issuing MONGO_READ or MONGO_AGG, verify the collection name and key fields by checking collection/model definitions in the current app (look for "collectionName:" and date fields like date_created/date_completed/createdAt). Do not invent collection names.',"- For creation-date questions when both date_created and createdAt exist, match both with $or so results are not missed.","- When grouping by fields that can be arrays (drivers, deliveries, routes, chemicals), $unwind first and group by both id and name when available.","- Use MONGO_READ/MONGO_AGG only to produce summaries/snapshots/health checks (not raw dumps) when permitted.","- When referencing data, summarize it in bullets and avoid raw JSON or dumps.","- Format currency as $1,234.56 (no USD prefix) with two decimals.","- Use medium reasoning effort."].join("\n"),DEFAULT_AI_ASSISTANT_CODEX_MODEL="gpt-5.3-codex",DEFAULT_AI_ASSISTANT_CODEX_FALLBACK_MODEL="gpt-5.2-codex";class AiAssistantComponent{router;_account;renderer;ngZone;idClient="";idApp="";title="AI Assistant";open=!1;supportTicketRoute="/support-ticket/new";supportTicketEnabled=!0;config=null;topOffset=0;panelHeight=0;currentRoute="";hoverEnabled=!0;openRequested=new EventEmitter;closed=new EventEmitter;terminal;panelRef;terminalConfig;contextMode="auto";hoverOpened=!1;panelWidthPx=null;isResizing=!1;resizeMinWidth=0;resizeMaxWidth=0;resizeStartWidth=0;suppressRailClick=!1;resizeMoved=!1;aiDebugEnabled=!1;detachResizeMoveListener=null;detachResizeEndListener=null;constructor(t,e,n,o){this.router=t,this._account=e,this.renderer=n,this.ngZone=o,this.terminalConfig=this.buildTerminalConfig()}refreshAiDebugFlag(){if("undefined"!=typeof window)try{const t=String(localStorage.getItem("resolveio.ai.debug")||"").trim().toLowerCase();this.aiDebugEnabled="1"===t||"true"===t||"on"===t}catch{this.aiDebugEnabled=!1}else this.aiDebugEnabled=!1}debugLog(t,e){if(!this.aiDebugEnabled||"undefined"==typeof console||"function"!=typeof console.debug)return;const n=e&&"object"==typeof e?e:{};console.debug(`[AI.Assistant] ${t}`,n)}ngOnChanges(t){this.refreshAiDebugFlag(),t.open&&!this.open&&(this.hoverOpened=!1,this.isResizing=!1,this.suppressRailClick=!1,this.unbindResizeListeners()),t.open&&this.debugLog("open.changed",{open:this.open,topOffset:this.topOffset,panelHeight:this.panelHeight,route:this.currentRoute||""}),(t.idApp||t.config)&&(this.terminalConfig=this.buildTerminalConfig())}ngOnDestroy(){this.unbindResizeListeners()}buildTerminalConfig(){return{mode:"codex",model:"gpt-5.3-codex",fallbackModel:"gpt-5.2-codex",guardrails:!0,allowUploads:!1,showAdvanced:!1,showToolMessages:!1,deleteFilesAfterRun:!0,pageRouterEnabled:!0,systemPrompt:this.buildSystemPrompt(),...this.config||{}}}closePanel(){this.hoverOpened=!1,this.debugLog("closePanel"),this.closed.emit()}handleRailClick(t){t?.stopPropagation(),this.suppressRailClick?this.suppressRailClick=!1:this.open||(this.hoverOpened=!1,this.debugLog("openRequested.railClick"),this.openRequested.emit())}handleRailMouseDown(t){this.open&&this.startResize(t)}handleRailEnter(){this.hoverEnabled&&!this.open&&(this.hoverOpened=!0,this.debugLog("openRequested.railHover"),this.openRequested.emit())}handleRailLeave(){this.hoverEnabled&&this.hoverOpened&&(this.hoverOpened=!1,this.closePanel())}setContextMode(t){this.contextMode="all"===t||"auto"===t?t:"current"}get contextRouteLabel(){return this.currentRoute||"Current page"}openSupportTicket(){if(!this.supportTicketEnabled)return;const t=this.buildSupportTicketSummary();t&&localStorage.setItem("resolveioSupportTicketDraft",JSON.stringify({issue:t,source:"ai-assistant",createdAt:(new Date).toISOString()})),this.closed.emit(),this.supportTicketRoute&&this.router.navigateByUrl(this.supportTicketRoute)}handleBackdropClick(t){t&&t.stopPropagation()}get panelWidthStyle(){return"number"==typeof this.panelWidthPx&&this.panelWidthPx>0?`${this.panelWidthPx}px`:"33.33vw"}startResize(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.resizeMoved=!1,this.suppressRailClick=!1;const n=this.panelRef?.nativeElement?.getBoundingClientRect().width,o=n||this.defaultPanelWidth();this.resizeStartWidth=this.clampPanelWidth(o);const r=this.defaultPanelWidth();this.resizeMinWidth=e?Math.max(r,this.resizeStartWidth):r,this.resizeMaxWidth=this.resolveMaxWidth(this.resizeMinWidth),this.panelWidthPx=this.clampPanelWidth(this.resizeStartWidth,this.resizeMinWidth,this.resizeMaxWidth),this.bindResizeListeners()}bindResizeListeners(){this.detachResizeMoveListener||this.detachResizeEndListener||"undefined"==typeof window||this.ngZone.runOutsideAngular(()=>{this.detachResizeMoveListener=this.renderer.listen("window","mousemove",t=>{this.handleResizeMoveOutsideAngular(t)}),this.detachResizeEndListener=this.renderer.listen("window","mouseup",()=>{this.handleResizeEndOutsideAngular()})})}unbindResizeListeners(){this.detachResizeMoveListener&&(this.detachResizeMoveListener(),this.detachResizeMoveListener=null),this.detachResizeEndListener&&(this.detachResizeEndListener(),this.detachResizeEndListener=null)}handleResizeMoveOutsideAngular(t){if(!this.isResizing||"undefined"==typeof window)return;const e=window.innerWidth-t.clientX,n=Math.abs(e-this.resizeStartWidth)>2;this.ngZone.run(()=>{this.isResizing&&(n&&(this.resizeMoved=!0,this.suppressRailClick=!0),this.panelWidthPx=this.clampPanelWidth(e,this.resizeMinWidth,this.resizeMaxWidth))})}handleResizeEndOutsideAngular(){this.isResizing&&this.ngZone.run(()=>this.finishResize())}finishResize(){this.isResizing?(this.isResizing=!1,this.resizeMoved&&this.suppressRailClick&&setTimeout(()=>{this.suppressRailClick=!1},0),this.unbindResizeListeners()):this.unbindResizeListeners()}clampPanelWidth(t,e,n){const o="number"==typeof e?e:window.innerWidth/3,r="number"==typeof n?n:Math.max(o,window.innerWidth-46);return Math.min(Math.max(t,o),r)}defaultPanelWidth(){return Math.round(window.innerWidth/3)}resolveMaxWidth(t){return Math.max(t,window.innerWidth-46)}buildSystemPrompt(){const t=String(this.idApp||"").trim(),e=t?`- Current app: ${t}. Treat this as the only project for this conversation.`:"- Treat the current app as the only project for this conversation.",n=this.buildCustomerScopeLine();return[BASE_SYSTEM_PROMPT,e,n].filter(Boolean).join("\n")}buildCustomerScopeLine(){const t=String(this._account.getUser()?.other?.id_customer||"").trim();return t?`- Customer portal scope: yes (id_customer: ${t}).`:""}buildSupportTicketSummary(){const t=this.terminal,e=t?.activeConversation,n=(t?.messages||[]).slice().reverse(),o=n.find(t=>"user"===t?.role),r=n.find(t=>"assistant"===t?.role),i=[],a=(e?.title||this.title||"").trim();return a&&i.push(`Conversation: ${a}`),o?.content&&i.push(`User request:\n${this.truncate(this.sanitizeSummary(o.content),1400)}`),r?.content&&i.push(`Assistant summary:\n${this.truncate(this.sanitizeSummary(r.content),2e3)}`),i.join("\n\n").trim()}sanitizeSummary(t){return String(t||"").replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/\s{3,}/g," ").trim()}truncate(t,e){const n=String(t||"").trim();return n.length<=e?n:`${n.slice(0,Math.max(0,e-3))}...`}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiAssistantComponent,deps:[{token:i1$1.Router},{token:AccountManagerService},{token:i0.Renderer2},{token:i0.NgZone}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:AiAssistantComponent,isStandalone:!1,selector:"rio-ai-assistant",inputs:{idClient:"idClient",idApp:"idApp",title:"title",open:"open",supportTicketRoute:"supportTicketRoute",supportTicketEnabled:"supportTicketEnabled",config:"config",topOffset:"topOffset",panelHeight:"panelHeight",currentRoute:"currentRoute",hoverEnabled:"hoverEnabled"},outputs:{openRequested:"openRequested",closed:"closed"},viewQueries:[{propertyName:"terminal",first:!0,predicate:AiTerminalComponent,descendants:!0},{propertyName:"panelRef",first:!0,predicate:["panelRef"],descendants:!0}],usesOnChanges:!0,ngImport:i0,template:'<div class="ai-assistant-overlay" [class.is-open]="open"></div>\n<div\n\tclass="ai-assistant-drawer"\n\t[class.is-open]="open"\n\t[style.--ai-panel-width]="panelWidthStyle"\n\t[style.top.px]="topOffset"\n\t[style.height.px]="panelHeight">\n\t<button\n\t\ttype="button"\n\t\tclass="ai-assistant-rail"\n\t\t(click)="handleRailClick($event)"\n\t\t(mousedown)="handleRailMouseDown($event)">\n\t\t<span class="ai-assistant-rail-label">AI Assistant</span>\n\t</button>\n\t\t<div class="ai-assistant-panel" #panelRef [class.is-open]="open" (click)="$event.stopPropagation()">\n\t\t<div class="ai-assistant-resize-handle" (mousedown)="startResize($event)"></div>\n\t\t\t<div class="ai-assistant-header">\n\t\t\t\t<div class="ai-assistant-title">\n\t\t\t\t\t<h4>{{ title }}</h4>\n\t\t\t\t\t<p class="ai-assistant-subtitle">Ask about workflows, routes, and where features live.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-assistant-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-danger ai-assistant-close" (click)="closePanel()">Close</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<div class="ai-assistant-context">\n\t\t\t<div class="ai-assistant-context-controls">\n\t\t\t\t<select class="form-select form-select-sm" [value]="contextMode" (change)="setContextMode($event.target.value)" aria-label="Context">\n\t\t\t\t\t<option value="auto">Auto</option>\n\t\t\t\t\t<option value="current">Current Page</option>\n\t\t\t\t\t<option value="all">All Pages</option>\n\t\t\t\t</select>\n\t\t\t\t@if (contextMode !== \'all\') {\n\t\t\t\t\t<div class="ai-assistant-context-route">{{ contextRouteLabel }}</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t\t<div class="ai-assistant-body">\n\t\t\t\t@if (open) {\n\t\t\t\t\t<rio-ai-terminal\n\t\t\t\t\t\t[idClient]="idClient"\n\t\t\t\t\t\t[idApp]="idApp"\n\t\t\t\t\t\t[title]="title"\n\t\t\t\t\t\t[config]="terminalConfig"\n\t\t\t\t\t\t[conversationStatus]="\'active\'"\n\t\t\t\t\t\t[messageLimit]="80"\n\t\t\t\t\t\t[singleConversation]="true"\n\t\t\t\t\t\t[contextMode]="contextMode"\n\t\t\t\t\t\t[contextRoute]="currentRoute"\n\t\t\t\t\t\t[bypassRouteSubscriptions]="true"\n\t\t\t\t\t\t[paused]="false"\n\t\t\t\t\t\t[placeholder]="\'Ask about features, navigation, how things work, or request summaries/anomaly checks...\'">\n\t\t\t\t\t</rio-ai-terminal>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n',styles:[':host{position:fixed;inset:0;z-index:10000;pointer-events:none;--ai-rail-width: 46px;--ai-panel-width: 33.33vw;--ai-shadow: rgba(15, 23, 42, .2)}.ai-assistant-overlay{position:fixed;inset:0;background:transparent;opacity:0;pointer-events:none;transition:opacity .25s ease}.ai-assistant-overlay.is-open{opacity:0;pointer-events:none}.ai-assistant-drawer{position:fixed;right:-1px;display:flex;align-items:stretch;height:100%;min-height:360px;width:calc(var(--ai-rail-width) + var(--ai-panel-width));transform:translate(calc(100% - var(--ai-rail-width)));transition:transform .35s ease;pointer-events:auto}.ai-assistant-drawer.is-open{transform:translate(0)}.ai-assistant-rail{width:var(--ai-rail-width);border:none;background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;box-shadow:inset 1px 0 #fff3,inset -1px 0 #fff3;transition:background .2s ease,box-shadow .2s ease}.ai-assistant-rail:hover{background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));box-shadow:inset 1px 0 #ffffff47,inset -1px 0 #ffffff47}.ai-assistant-drawer.is-open .ai-assistant-rail{cursor:col-resize}.ai-assistant-rail-label{writing-mode:vertical-rl;transform:rotate(0);transform-origin:center;letter-spacing:.2em;font-size:.72rem;font-weight:700;text-transform:uppercase}.ai-assistant-panel{width:min(var(--ai-panel-width),100vw - var(--ai-rail-width));height:100%;background:#f8fafc;box-shadow:-18px 0 36px var(--ai-shadow);display:flex;flex-direction:column;gap:.75rem;padding:.9rem 1rem 1rem;border-radius:18px 0 0 18px;border:1px solid rgba(148,163,184,.3);position:relative;overflow:hidden}.ai-assistant-resize-handle{position:absolute;left:0;top:0;width:8px;height:100%;cursor:col-resize;z-index:2;background:linear-gradient(90deg,#94a3b866,#94a3b800)}.ai-assistant-header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.ai-assistant-title h4{margin:0;font-weight:700}.ai-assistant-subtitle{margin:.25rem 0 0;color:#475569;font-size:.85rem}.ai-assistant-actions{display:flex;flex:0 0 clamp(180px,24vw,260px)}.ai-assistant-close{width:100%;box-shadow:0 6px 14px #dc262640;font-weight:600;padding-inline:1rem}.ai-assistant-context{display:block;align-items:center;gap:.75rem;background:#eef2ff;border-radius:12px;padding:.5rem .75rem;border:1px solid rgba(129,140,248,.35)}.ai-assistant-context-label{font-weight:600;color:#1e293b;font-size:.85rem;text-transform:uppercase;letter-spacing:.08em}.ai-assistant-context-controls{display:grid;grid-template-columns:minmax(120px,20%) 1fr;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0}.ai-assistant-context-controls select{width:100%}.ai-assistant-context-route{font-size:.8rem;color:#334155;background:#fffc;border-radius:999px;padding:.15rem .6rem;border:1px solid rgba(148,163,184,.4);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-assistant-body{flex:1;overflow:hidden}.ai-assistant-empty{color:#6c757d;font-size:.95rem;text-align:center;padding:24px 16px}:host ::ng-deep .ai-terminal-shell{height:100%}:host ::ng-deep .ai-terminal-sidebar,:host ::ng-deep .ai-terminal-main{min-height:0;max-height:100%}:host ::ng-deep .ai-terminal-messages{height:100%}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn{padding:.2rem .4rem;font-size:0;line-height:1}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn:before{content:"\\f1f8";font-family:FontAwesome;font-size:.9rem}:host ::ng-deep .ai-terminal-actions{width:100%;flex-wrap:nowrap;align-items:stretch}:host ::ng-deep .ai-terminal-actions .btn-primary{flex:1 1 auto;width:auto}:host ::ng-deep .ai-terminal-actions .btn-outline-secondary{flex:0 0 auto}@media(max-width:1200px){:host{display:none}}\n'],dependencies:[{kind:"component",type:AiTerminalComponent,selector:"rio-ai-terminal",inputs:["idClient","idApp","title","config","conversationStatus","messageLimit","placeholder","singleConversation","contextMode","contextRoute","paused","bypassRouteSubscriptions"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiAssistantComponent,decorators:[{type:Component,args:[{selector:"rio-ai-assistant",standalone:!1,template:'<div class="ai-assistant-overlay" [class.is-open]="open"></div>\n<div\n\tclass="ai-assistant-drawer"\n\t[class.is-open]="open"\n\t[style.--ai-panel-width]="panelWidthStyle"\n\t[style.top.px]="topOffset"\n\t[style.height.px]="panelHeight">\n\t<button\n\t\ttype="button"\n\t\tclass="ai-assistant-rail"\n\t\t(click)="handleRailClick($event)"\n\t\t(mousedown)="handleRailMouseDown($event)">\n\t\t<span class="ai-assistant-rail-label">AI Assistant</span>\n\t</button>\n\t\t<div class="ai-assistant-panel" #panelRef [class.is-open]="open" (click)="$event.stopPropagation()">\n\t\t<div class="ai-assistant-resize-handle" (mousedown)="startResize($event)"></div>\n\t\t\t<div class="ai-assistant-header">\n\t\t\t\t<div class="ai-assistant-title">\n\t\t\t\t\t<h4>{{ title }}</h4>\n\t\t\t\t\t<p class="ai-assistant-subtitle">Ask about workflows, routes, and where features live.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-assistant-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-danger ai-assistant-close" (click)="closePanel()">Close</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<div class="ai-assistant-context">\n\t\t\t<div class="ai-assistant-context-controls">\n\t\t\t\t<select class="form-select form-select-sm" [value]="contextMode" (change)="setContextMode($event.target.value)" aria-label="Context">\n\t\t\t\t\t<option value="auto">Auto</option>\n\t\t\t\t\t<option value="current">Current Page</option>\n\t\t\t\t\t<option value="all">All Pages</option>\n\t\t\t\t</select>\n\t\t\t\t@if (contextMode !== \'all\') {\n\t\t\t\t\t<div class="ai-assistant-context-route">{{ contextRouteLabel }}</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t\t<div class="ai-assistant-body">\n\t\t\t\t@if (open) {\n\t\t\t\t\t<rio-ai-terminal\n\t\t\t\t\t\t[idClient]="idClient"\n\t\t\t\t\t\t[idApp]="idApp"\n\t\t\t\t\t\t[title]="title"\n\t\t\t\t\t\t[config]="terminalConfig"\n\t\t\t\t\t\t[conversationStatus]="\'active\'"\n\t\t\t\t\t\t[messageLimit]="80"\n\t\t\t\t\t\t[singleConversation]="true"\n\t\t\t\t\t\t[contextMode]="contextMode"\n\t\t\t\t\t\t[contextRoute]="currentRoute"\n\t\t\t\t\t\t[bypassRouteSubscriptions]="true"\n\t\t\t\t\t\t[paused]="false"\n\t\t\t\t\t\t[placeholder]="\'Ask about features, navigation, how things work, or request summaries/anomaly checks...\'">\n\t\t\t\t\t</rio-ai-terminal>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n',styles:[':host{position:fixed;inset:0;z-index:10000;pointer-events:none;--ai-rail-width: 46px;--ai-panel-width: 33.33vw;--ai-shadow: rgba(15, 23, 42, .2)}.ai-assistant-overlay{position:fixed;inset:0;background:transparent;opacity:0;pointer-events:none;transition:opacity .25s ease}.ai-assistant-overlay.is-open{opacity:0;pointer-events:none}.ai-assistant-drawer{position:fixed;right:-1px;display:flex;align-items:stretch;height:100%;min-height:360px;width:calc(var(--ai-rail-width) + var(--ai-panel-width));transform:translate(calc(100% - var(--ai-rail-width)));transition:transform .35s ease;pointer-events:auto}.ai-assistant-drawer.is-open{transform:translate(0)}.ai-assistant-rail{width:var(--ai-rail-width);border:none;background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;box-shadow:inset 1px 0 #fff3,inset -1px 0 #fff3;transition:background .2s ease,box-shadow .2s ease}.ai-assistant-rail:hover{background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));box-shadow:inset 1px 0 #ffffff47,inset -1px 0 #ffffff47}.ai-assistant-drawer.is-open .ai-assistant-rail{cursor:col-resize}.ai-assistant-rail-label{writing-mode:vertical-rl;transform:rotate(0);transform-origin:center;letter-spacing:.2em;font-size:.72rem;font-weight:700;text-transform:uppercase}.ai-assistant-panel{width:min(var(--ai-panel-width),100vw - var(--ai-rail-width));height:100%;background:#f8fafc;box-shadow:-18px 0 36px var(--ai-shadow);display:flex;flex-direction:column;gap:.75rem;padding:.9rem 1rem 1rem;border-radius:18px 0 0 18px;border:1px solid rgba(148,163,184,.3);position:relative;overflow:hidden}.ai-assistant-resize-handle{position:absolute;left:0;top:0;width:8px;height:100%;cursor:col-resize;z-index:2;background:linear-gradient(90deg,#94a3b866,#94a3b800)}.ai-assistant-header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.ai-assistant-title h4{margin:0;font-weight:700}.ai-assistant-subtitle{margin:.25rem 0 0;color:#475569;font-size:.85rem}.ai-assistant-actions{display:flex;flex:0 0 clamp(180px,24vw,260px)}.ai-assistant-close{width:100%;box-shadow:0 6px 14px #dc262640;font-weight:600;padding-inline:1rem}.ai-assistant-context{display:block;align-items:center;gap:.75rem;background:#eef2ff;border-radius:12px;padding:.5rem .75rem;border:1px solid rgba(129,140,248,.35)}.ai-assistant-context-label{font-weight:600;color:#1e293b;font-size:.85rem;text-transform:uppercase;letter-spacing:.08em}.ai-assistant-context-controls{display:grid;grid-template-columns:minmax(120px,20%) 1fr;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0}.ai-assistant-context-controls select{width:100%}.ai-assistant-context-route{font-size:.8rem;color:#334155;background:#fffc;border-radius:999px;padding:.15rem .6rem;border:1px solid rgba(148,163,184,.4);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-assistant-body{flex:1;overflow:hidden}.ai-assistant-empty{color:#6c757d;font-size:.95rem;text-align:center;padding:24px 16px}:host ::ng-deep .ai-terminal-shell{height:100%}:host ::ng-deep .ai-terminal-sidebar,:host ::ng-deep .ai-terminal-main{min-height:0;max-height:100%}:host ::ng-deep .ai-terminal-messages{height:100%}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn{padding:.2rem .4rem;font-size:0;line-height:1}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn:before{content:"\\f1f8";font-family:FontAwesome;font-size:.9rem}:host ::ng-deep .ai-terminal-actions{width:100%;flex-wrap:nowrap;align-items:stretch}:host ::ng-deep .ai-terminal-actions .btn-primary{flex:1 1 auto;width:auto}:host ::ng-deep .ai-terminal-actions .btn-outline-secondary{flex:0 0 auto}@media(max-width:1200px){:host{display:none}}\n']}]}],ctorParameters:()=>[{type:i1$1.Router},{type:AccountManagerService},{type:i0.Renderer2},{type:i0.NgZone}],propDecorators:{idClient:[{type:Input}],idApp:[{type:Input}],title:[{type:Input}],open:[{type:Input}],supportTicketRoute:[{type:Input}],supportTicketEnabled:[{type:Input}],config:[{type:Input}],topOffset:[{type:Input}],panelHeight:[{type:Input}],currentRoute:[{type:Input}],hoverEnabled:[{type:Input}],openRequested:[{type:Output}],closed:[{type:Output}],terminal:[{type:ViewChild,args:[AiTerminalComponent]}],panelRef:[{type:ViewChild,args:["panelRef"]}]}});class ScrollDirective{onScroll=new EventEmitter;bottomOffset=100;topOffset=100;constructor(){}scrolled(t){this.elementScrollEvent(t)}windowScrolled(t){this.windowScrollEvent(t)}windowScrollEvent(t){const e=t.target,n=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,o=n<this.topOffset,r={isReachingBottom:e.body.offsetHeight-(window.innerHeight+n)<this.bottomOffset,isReachingTop:o,originalEvent:t,isWindowEvent:!0};this.onScroll.emit(r)}elementScrollEvent(t){const e=t.target,n=e.scrollHeight-e.scrollTop,o=e.offsetHeight,r=e.scrollTop<this.topOffset,i={isReachingBottom:n-o<this.bottomOffset,isReachingTop:r,originalEvent:t,isWindowEvent:!1};this.onScroll.emit(i)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ScrollDirective,deps:[],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:ScrollDirective,isStandalone:!1,selector:"[detect-scroll]",inputs:{bottomOffset:"bottomOffset",topOffset:"topOffset"},outputs:{onScroll:"onScroll"},host:{listeners:{scroll:"scrolled($event)","window:scroll":"windowScrolled($event)"}},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ScrollDirective,decorators:[{type:Directive,args:[{selector:"[detect-scroll]",standalone:!1}]}],ctorParameters:()=>[],propDecorators:{onScroll:[{type:Output}],bottomOffset:[{type:Input}],topOffset:[{type:Input}],scrolled:[{type:HostListener,args:["scroll",["$event"]]}],windowScrolled:[{type:HostListener,args:["window:scroll",["$event"]]}]}});class NavbarMainComponent extends BaseComponent{_services;auth;_ds;_app;dropdowns;scrollable;logo="";navTabs=[];fontSize=12;publicProgram=!1;digitalSign=!1;showSupport=!0;aiAssistantVisible=!0;aiToggle=new EventEmitter;user=null;collapseShowing=!1;client="";isResolveIO=!1;tourStarted=!1;dropdownLeftTimer=null;scrollRightInterval=null;scrollLeftInterval=null;isDemo=!1;constructor(t,e,n,o){super(t),this._services=t,this.auth=e,this._ds=n,this._app=o}ngOnInit(){this._services._account.user.subscribe(t=>{this.user=t}),this.client=this._app.client.getValue(),this.tourStarted=this._services._app.tourStarted.getValue(),this.client||(this.isResolveIO=!0),this._services._app.tourStarted.subscribe(t=>{this.tourStarted=t}),this._services._app.isDemo.subscribe(t=>{this.isDemo=t})}ngAfterViewInit(){this.dropdownLeftTimer=setInterval(()=>{this.calculateDropdownsLeft()},500),document.documentElement.style.setProperty("--font-size",this.fontSize+"px")}ngOnDestroy(){this.dropdownLeftTimer&&(clearInterval(this.dropdownLeftTimer),this.dropdownLeftTimer=null)}async logout(){this._app.isLoggingOut.next(!0),await this._services._account.logOut(),this._app.isLoggingOut.next(!1)}login(){this.auth.loginUser().then(()=>{},t=>{})}hasScrolled(){return this.scrollable.nativeElement.scrollLeft<=0&&this.stopScrollRight(),this.scrollable.nativeElement.scrollLeft>0}hasMoreScroll(){return this.scrollable.nativeElement.scrollWidth<=this.scrollable.nativeElement.clientWidth+this.scrollable.nativeElement.scrollLeft&&this.stopScrollLeft(),this.scrollable.nativeElement.scrollWidth>this.scrollable.nativeElement.clientWidth+this.scrollable.nativeElement.scrollLeft}startScrollRight(){this.scrollRightInterval=setInterval(()=>{this.scrollable.nativeElement.scrollLeft-=2},1)}stopScrollRight(){clearInterval(this.scrollRightInterval)}scrollRightOnce(){this.scrollable.nativeElement.scrollLeft-=50}startScrollLeft(){this.scrollLeftInterval=setInterval(()=>{this.scrollable.nativeElement.scrollLeft+=2},1)}stopScrollLeft(){clearInterval(this.scrollLeftInterval)}scrollLeftOnce(){this.scrollable.nativeElement.scrollLeft+=50}handleNavLinkClick(t){if(t&&(t.metaKey||t.ctrlKey)){const e=t.currentTarget;e&&e.href&&(window.open(e.href,"_blank"),t.preventDefault(),t.stopPropagation())}}toggleAiAssistant(t){t&&(t.preventDefault(),t.stopPropagation()),this.aiToggle.emit()}calculateDropdownsLeft(){if(this.dropdowns&&this.dropdowns.toArray()&&this.dropdowns.toArray().length&&this.scrollable){const t=[];return this.navTabs.filter(t=>"dropdown"===t.type).forEach(e=>{const n=e.label||"",o=this.dropdowns.toArray().filter(t=>t.nativeElement.innerText.split("\n")[0].replace(/[^A-Za-z0-9]/g,"")===n.replace(/[^A-Za-z0-9]/g,""))[0],r=o?o.nativeElement.querySelector(".dropdown-menu"):null,i=o?Math.max(o.nativeElement.offsetLeft-this.scrollable.nativeElement.scrollLeft,this.scrollable.nativeElement.offsetLeft):0;if(r){parseInt(r.style.left||"0",10)!==i&&t.push({dropDownMenu:r,nextLeft:i})}}),t.length&&t.forEach(t=>{t.dropDownMenu.style.left=t.nextLeft+"px"}),!0}return!1}isInRole(t){if(!t)return!0;if(this.isSuperAdmin())return!0;if(this.user&&this.user.roles.groups)for(let e=0;e<this.user.roles.groups.length;e++){let n=this.user.roles.groups[e];for(let e=0;e<n.views.length;e++){let o=n.views[e];if(o===t||o.startsWith(t+"/"))return!0}}return!1}isSuperAdmin(){return!(!this.user||!this.user.roles)&&this.user.roles.super_admin}isInOneRole(t){if(this.isSuperAdmin())return!0;for(let e=0;e<t.length;e++){let n=t[e];if(!n)return!0;if(this._services._account.isUserInView(n))return!0}return!1}navigateTo(t){this._services._router.navigateByUrl(t)}help(){this._ds.input("What do you need help with?",[{label:"Title of Problem",form:"problem_title",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Problem title is required."],required:!0},{label:"Description of Problem",form:"problem_desc",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Problem description is required."],required:!0,type:"textarea"}]).then(t=>{this._services._socket.call("getHelpNotification",this._services._account.getUser().fullname,t.problem_title.value,t.problem_desc.value)},()=>{})}isCustomer(){const t=this._services._account.getUser();return!(!t||!t.other)&&!(!t.other.customers||!t.other.customers.length)}getWindowWidth(){return window.innerWidth}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarMainComponent,deps:[{token:ProviderService},{token:AuthService},{token:DialogService},{token:CoreService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:NavbarMainComponent,isStandalone:!1,selector:"navbar-main",inputs:{logo:"logo",navTabs:"navTabs",fontSize:"fontSize",publicProgram:"publicProgram",digitalSign:"digitalSign",showSupport:"showSupport",aiAssistantVisible:"aiAssistantVisible"},outputs:{aiToggle:"aiToggle"},providers:[ProviderService],viewQueries:[{propertyName:"scrollable",first:!0,predicate:["scrollable"],descendants:!0,static:!0},{propertyName:"dropdowns",predicate:["dropdowns"],descendants:!0}],usesInheritance:!0,ngImport:i0,template:'<style>\n\t:root {\n\t\t--font-size: 12;\n\t}\n\n\t:host ::ng-deep * {\n\t\tfont-size: var(--font-size);\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.navbarMain a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t\t.navbarMain .dropdown-menu {\n\t\t\tmargin-left: 10px;\n\t\t}\n\t\t.navbar-divider-pipe {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.navbar-divider-hr {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\theight: 1px;\n\t\t\tborder: 0;\n\t\t\tborder-top: 1px solid white;\n\t\t\tbackground-color: white;\n\t\t\tcolor: white;\n\t\t\topacity: 1;\n\t\t\tmargin: 0.25rem 0;\n\t\t}\n\t}\n\t@media (min-width: 1200px) {\n\t\t.scrollable-x {\n\t\t\tmax-width: 60vw;\n\t\t\toverflow-x: auto;\n\t\t\toverflow-y: visible;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t::-webkit-scrollbar {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.verticalAlign {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t.dropdown {\n\t\t\tposition: static;\n\t\t}\n\t}\n\n\t.navbar li {\n\t\tcursor: pointer;\n\t\ttext-align: center;\n\t}\n\n\t.navbarMain {\n\t\tposition: relative;\n\t\tz-index: 1035;\n\t}\n\n\t.navbarMain .dropdown-menu {\n\t\tz-index: 1036;\n\t}\n\n\t.navbar-divider-pipe {\n\t\tdisplay: inline-block;\n\t\talign-self: stretch;\n\t\twidth: 1px;\n\t\tbackground-color: white;\n\t\topacity: 0.8;\n\t\tmargin: 0 0.75rem;\n\t}\n\n\t.navbar-dark .navbar-nav .nav-link:hover,\n\t.navbar-dark .navbar-nav .nav-link:focus {\n\t\tcolor: gray;\n\t}\n\t.navbar-divider-item {\n\t\tdisplay: flex;\n\t\talign-items: stretch;\n\t}\n</style>\n\n<div class="row">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark navbarMain" style="width: 100%">\n\t\t<a class="navbar-brand" href="#">\n\t\t\t@if (!isDemo) {\n\t\t\t\t<img [src]="logo" style="width: auto; height: 36px" />\n\t\t\t}\n\t\t</a>\n\t\t<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" aria-controls="navbarMainNav" aria-expanded="false" aria-label="Toggle navigation">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" id="navbarMainNav">\n\t\t\t<ul class="navbar-nav">\n\t\t\t\t@if (!publicProgram && !digitalSign) {\n\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" [style.border-right]="getWindowWidth() > 1200 ? \'1px solid white\' : \'\'" tourAnchor="topNavHome">\n\t\t\t\t\t\t<a class="nav-link" routerLink="home" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLinkActive="active">Home</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasScrolled()) {\n\t\t\t\t<div (mouseover)="startScrollRight()" (mouseout)="stopScrollRight()" (click)="scrollRightOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-left" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<ul [ngClass]="[\'navbar-nav\', \'scrollable-x\']" #scrollable detect-scroll (onScroll)="calculateDropdownsLeft()">\n\t\t\t\t@for (tab of navTabs; track tab.label || tab.links?.[0]?.routerLink || i; let i = $index) {\n\t\t\t\t\t@if (tab.type === \'link\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && !digitalSign && isInRole(tab.links[0].role)) {\n\t\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" [tourAnchor]="tab.tourAnchor" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" [routerLink]="tab.links[0].routerLink" routerLinkActive="active">{{ tab.links[0].label }}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@if (tab.type === \'dropdown\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && isInOneRole(tab.roles)) {\n\t\t\t\t\t\t\t<li #dropdowns class="nav-item dropdown">\n\t\t\t\t\t\t\t\t<a class="nav-link dropdown-toggle" [class.disabled]="tourStarted ? true : null" id="navbarDropdownAsset" role="button" [tourAnchor]="tab.tourAnchor" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n\t\t\t\t\t\t\t\t\t{{ tab.label }}\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<div class="dropdown-menu bg-dark" aria-labelledby="navbarDropdownAsset" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t\t@for (link of tab.links; track link.routerLink || link.label) {\n\t\t\t\t\t\t\t\t\t\t@if ((publicProgram || user) && isInRole(link.role)) {\n\t\t\t\t\t\t\t\t\t\t\t<a class="dropdown-item nav-link" (click)="handleNavLinkClick($event)" [routerLink]="link.routerLink">{{ link.label }}</a>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasMoreScroll()) {\n\t\t\t\t<div (mouseover)="startScrollLeft()" (mouseout)="stopScrollLeft()" (click)="scrollLeftOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-right" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (getWindowWidth() < 1200) {\n\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t}\n\t\t\t@if ((!publicProgram || user) && !digitalSign) {\n\t\t\t\t<ul [ngClass]="[\'navbar-nav\', \'ms-auto\']">\n\t\t\t\t\t@if (user && getWindowWidth() > 1200 && aiAssistantVisible) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" tourAnchor="aiAssistantToggle">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="toggleAiAssistant($event)" [class.disabled]="tourStarted ? true : null">AI Assistant</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && client && (showSupport || isSuperAdmin())) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" style="height: 30px" tourAnchor="supportSection">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="support-ticket" routerLinkActive="active">Support</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="logs" routerLinkActive="active">Logs</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="super-admin" routerLinkActive="active">Super Admin</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item navbar-divider-item">\n\t\t\t\t\t\t\t@if (getWindowWidth() > 1200) {\n\t\t\t\t\t\t\t\t<span class="navbar-divider-pipe" aria-hidden="true"></span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!user) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="login()" style="cursor: pointer" routerLinkActive="active">Login</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" tourAnchor="userSettings">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="user-settings">Hello {{ user.fullname }}!</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" style="cursor: pointer" (click)="logout()" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null">Logout</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t</ul>\n\t\t\t}\n\t\t</div>\n\t</nav>\n</div>\n',styles:[":root{--font-size: 12}:host ::ng-deep *{font-size:var(--font-size)}@media(max-width:1200px){.navbarMain a{font-size:18px!important}.navbarMain .dropdown-menu{margin-left:10px}.navbar-divider-pipe{display:none}.navbar-divider-hr{display:block;width:100%;height:1px;border:0;border-top:1px solid white;background-color:#fff;color:#fff;opacity:1;margin:.25rem 0}}@media(min-width:1200px){.scrollable-x{max-width:60vw;overflow-x:auto;overflow-y:visible;align-items:center}::-webkit-scrollbar{display:none}.verticalAlign{display:flex;align-items:center}.dropdown{position:static}}.navbar li{cursor:pointer;text-align:center}.navbarMain{position:relative;z-index:1035}.navbarMain .dropdown-menu{z-index:1036}.navbar-divider-pipe{display:inline-block;align-self:stretch;width:1px;background-color:#fff;opacity:.8;margin:0 .75rem}.navbar-dark .navbar-nav .nav-link:hover,.navbar-dark .navbar-nav .nav-link:focus{color:gray}.navbar-divider-item{display:flex;align-items:stretch}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$1.RouterLink,selector:"[routerLink]",inputs:["target","queryParams","fragment","queryParamsHandling","state","info","relativeTo","preserveFragment","skipLocationChange","replaceUrl","routerLink"]},{kind:"directive",type:i1$1.RouterLinkActive,selector:"[routerLinkActive]",inputs:["routerLinkActiveOptions","ariaCurrentWhenActive","routerLinkActive"],outputs:["isActiveChange"],exportAs:["routerLinkActive"]},{kind:"directive",type:TourAnchorDirective,selector:"[tourAnchor]",inputs:["tourAnchor"]},{kind:"directive",type:ScrollDirective,selector:"[detect-scroll]",inputs:["bottomOffset","topOffset"],outputs:["onScroll"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarMainComponent,decorators:[{type:Component,args:[{selector:"navbar-main",providers:[ProviderService],standalone:!1,template:'<style>\n\t:root {\n\t\t--font-size: 12;\n\t}\n\n\t:host ::ng-deep * {\n\t\tfont-size: var(--font-size);\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.navbarMain a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t\t.navbarMain .dropdown-menu {\n\t\t\tmargin-left: 10px;\n\t\t}\n\t\t.navbar-divider-pipe {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.navbar-divider-hr {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\theight: 1px;\n\t\t\tborder: 0;\n\t\t\tborder-top: 1px solid white;\n\t\t\tbackground-color: white;\n\t\t\tcolor: white;\n\t\t\topacity: 1;\n\t\t\tmargin: 0.25rem 0;\n\t\t}\n\t}\n\t@media (min-width: 1200px) {\n\t\t.scrollable-x {\n\t\t\tmax-width: 60vw;\n\t\t\toverflow-x: auto;\n\t\t\toverflow-y: visible;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t::-webkit-scrollbar {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.verticalAlign {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t.dropdown {\n\t\t\tposition: static;\n\t\t}\n\t}\n\n\t.navbar li {\n\t\tcursor: pointer;\n\t\ttext-align: center;\n\t}\n\n\t.navbarMain {\n\t\tposition: relative;\n\t\tz-index: 1035;\n\t}\n\n\t.navbarMain .dropdown-menu {\n\t\tz-index: 1036;\n\t}\n\n\t.navbar-divider-pipe {\n\t\tdisplay: inline-block;\n\t\talign-self: stretch;\n\t\twidth: 1px;\n\t\tbackground-color: white;\n\t\topacity: 0.8;\n\t\tmargin: 0 0.75rem;\n\t}\n\n\t.navbar-dark .navbar-nav .nav-link:hover,\n\t.navbar-dark .navbar-nav .nav-link:focus {\n\t\tcolor: gray;\n\t}\n\t.navbar-divider-item {\n\t\tdisplay: flex;\n\t\talign-items: stretch;\n\t}\n</style>\n\n<div class="row">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark navbarMain" style="width: 100%">\n\t\t<a class="navbar-brand" href="#">\n\t\t\t@if (!isDemo) {\n\t\t\t\t<img [src]="logo" style="width: auto; height: 36px" />\n\t\t\t}\n\t\t</a>\n\t\t<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" aria-controls="navbarMainNav" aria-expanded="false" aria-label="Toggle navigation">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" id="navbarMainNav">\n\t\t\t<ul class="navbar-nav">\n\t\t\t\t@if (!publicProgram && !digitalSign) {\n\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" [style.border-right]="getWindowWidth() > 1200 ? \'1px solid white\' : \'\'" tourAnchor="topNavHome">\n\t\t\t\t\t\t<a class="nav-link" routerLink="home" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLinkActive="active">Home</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasScrolled()) {\n\t\t\t\t<div (mouseover)="startScrollRight()" (mouseout)="stopScrollRight()" (click)="scrollRightOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-left" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<ul [ngClass]="[\'navbar-nav\', \'scrollable-x\']" #scrollable detect-scroll (onScroll)="calculateDropdownsLeft()">\n\t\t\t\t@for (tab of navTabs; track tab.label || tab.links?.[0]?.routerLink || i; let i = $index) {\n\t\t\t\t\t@if (tab.type === \'link\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && !digitalSign && isInRole(tab.links[0].role)) {\n\t\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" [tourAnchor]="tab.tourAnchor" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" [routerLink]="tab.links[0].routerLink" routerLinkActive="active">{{ tab.links[0].label }}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@if (tab.type === \'dropdown\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && isInOneRole(tab.roles)) {\n\t\t\t\t\t\t\t<li #dropdowns class="nav-item dropdown">\n\t\t\t\t\t\t\t\t<a class="nav-link dropdown-toggle" [class.disabled]="tourStarted ? true : null" id="navbarDropdownAsset" role="button" [tourAnchor]="tab.tourAnchor" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n\t\t\t\t\t\t\t\t\t{{ tab.label }}\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<div class="dropdown-menu bg-dark" aria-labelledby="navbarDropdownAsset" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t\t@for (link of tab.links; track link.routerLink || link.label) {\n\t\t\t\t\t\t\t\t\t\t@if ((publicProgram || user) && isInRole(link.role)) {\n\t\t\t\t\t\t\t\t\t\t\t<a class="dropdown-item nav-link" (click)="handleNavLinkClick($event)" [routerLink]="link.routerLink">{{ link.label }}</a>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasMoreScroll()) {\n\t\t\t\t<div (mouseover)="startScrollLeft()" (mouseout)="stopScrollLeft()" (click)="scrollLeftOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-right" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (getWindowWidth() < 1200) {\n\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t}\n\t\t\t@if ((!publicProgram || user) && !digitalSign) {\n\t\t\t\t<ul [ngClass]="[\'navbar-nav\', \'ms-auto\']">\n\t\t\t\t\t@if (user && getWindowWidth() > 1200 && aiAssistantVisible) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" tourAnchor="aiAssistantToggle">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="toggleAiAssistant($event)" [class.disabled]="tourStarted ? true : null">AI Assistant</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && client && (showSupport || isSuperAdmin())) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" style="height: 30px" tourAnchor="supportSection">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="support-ticket" routerLinkActive="active">Support</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="logs" routerLinkActive="active">Logs</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="super-admin" routerLinkActive="active">Super Admin</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item navbar-divider-item">\n\t\t\t\t\t\t\t@if (getWindowWidth() > 1200) {\n\t\t\t\t\t\t\t\t<span class="navbar-divider-pipe" aria-hidden="true"></span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!user) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="login()" style="cursor: pointer" routerLinkActive="active">Login</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" tourAnchor="userSettings">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="user-settings">Hello {{ user.fullname }}!</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" style="cursor: pointer" (click)="logout()" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null">Logout</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t</ul>\n\t\t\t}\n\t\t</div>\n\t</nav>\n</div>\n'}]}],ctorParameters:()=>[{type:ProviderService},{type:AuthService},{type:DialogService},{type:CoreService}],propDecorators:{dropdowns:[{type:ViewChildren,args:["dropdowns"]}],scrollable:[{type:ViewChild,args:["scrollable",{static:!0}]}],logo:[{type:Input,args:["logo"]}],navTabs:[{type:Input,args:["navTabs"]}],fontSize:[{type:Input,args:["fontSize"]}],publicProgram:[{type:Input,args:["publicProgram"]}],digitalSign:[{type:Input,args:["digitalSign"]}],showSupport:[{type:Input,args:["showSupport"]}],aiAssistantVisible:[{type:Input,args:["aiAssistantVisible"]}],aiToggle:[{type:Output}]}});class FilterEqualPipe{transform(t,e,n){return t?t.filter(t=>t[e]===n):[]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterEqualPipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FilterEqualPipe,isStandalone:!1,name:"filterEqual",pure:!1})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterEqualPipe,decorators:[{type:Pipe,args:[{name:"filterEqual",pure:!1,standalone:!1}]}]});class FilterNotEqualPipe{transform(t,e,n){return t?t.filter(t=>t[e]!==n):[]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterNotEqualPipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FilterNotEqualPipe,isStandalone:!1,name:"filterNotEqual"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterNotEqualPipe,decorators:[{type:Pipe,args:[{name:"filterNotEqual",standalone:!1}]}]});class NavbarModuleComponent extends BaseComponent{_cdRef;_services;sideNavHeight;sideNavWidth;menuData={title:"",module:null,description:null,description_name:"Description",tabs:[]};selectedTab=null;currentRoute="";routerEvents$=[];tourStarted=!1;drawerOpen=!1;isDeviceWidth=window.innerWidth<=1200;constructor(t,e){super(e),this._cdRef=t,this._services=e}ngOnInit(){this.tourStarted=this._services._app.tourStarted.getValue(),this.routerEvents$.push(this._services._router.events.subscribe(t=>{this._services._router.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,"")===this.currentRoute&&this.selectedTab||this.selectTabFromRouter()})),this.routerEvents$.push(this._services._app.navbarModuleData.subscribe(t=>{this.menuData=t,this._services._router.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,"")===this.currentRoute&&this.selectedTab||this.selectTabFromRouter()})),this.routerEvents$.push(this._services._app.tourStarted.subscribe(t=>{this.tourStarted=t}))}onResize(){this.isDeviceWidth=window.innerWidth<=1200}ngOnDestroy(){this.routerEvents$.forEach(t=>{t.unsubscribe()})}selectTabFromRouter(){if(this.menuData)if("/"===this._services._router.url)this.selectedTab=this.menuData.tabs[0];else{for(this.currentRoute=this._services._router.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,""),this.selectedTab=null;!this.selectedTab&&this.currentRoute.split("/").length>2;){for(let t=0;t<this.menuData.tabs.length;t++){let e=this.menuData.tabs[t];if(e.link===this.currentRoute){this.selectedTab=e;break}}this.currentRoute=this.currentRoute.replace(/(\/[^\/]+$)/,"")}this.selectedTab||(this.selectedTab=this.menuData.tabs[0])}}tabClass(t){return this.selectedTab&&this.selectedTab.label===t.label?"active":""}handleNavLinkClick(t){if(t&&(t.metaKey||t.ctrlKey)){const e=t.currentTarget;e&&e.href&&(window.open(e.href,"_blank"),t.preventDefault(),t.stopPropagation())}}onNavLinkClick(t){this.handleNavLinkClick(t),!t.defaultPrevented&&window.innerWidth<=1200&&(this.drawerOpen=!1)}toggleDrawer(){this.drawerOpen=!this.drawerOpen}navigateTo(t){this.selectedTab!==t&&(this.selectedTab=t,null===t.params?this._services._router.navigateByUrl(t.link):this._services._router.navigateByUrl(t.link+"/"+t.params),window.innerWidth<=1200&&(this.drawerOpen=!1))}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarModuleComponent,deps:[{token:i0.ChangeDetectorRef},{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:NavbarModuleComponent,isStandalone:!1,selector:"navbar-module",inputs:{sideNavHeight:"sideNavHeight",sideNavWidth:"sideNavWidth"},host:{listeners:{"window:resize":"onResize()"}},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\t.navbarModule li {\n\t\tcursor: pointer;\n\t}\n\t.navbarModule li.active {\n\t\tborder-left: 3px solid #d19b3d;\n\t}\n\t.navbarModule nav {\n\t\twidth: 100%;\n\t}\n\t.navbar-module-container {\n\t\tmargin-left: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t\tmargin-right: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t}\n\n\t.navbarModule .nav-link {\n\t\tmargin-left: 10px;\n\t}\n\n\t@media (min-width: 1200px) {\n\t\t.navbarModule {\n\t\t\theight: 95vh;\n\t\t\tmargin-left: -10px;\n\t\t}\n\n\t\thr {\n\t\t\tborder-top: white 1px solid;\n\t\t}\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.device-drawer-margin {\n\t\t\tmargin-left: 10px !important;\n\t\t}\n\n\t\thr {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.navbarModule a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t}\n</style>\n\n<div class="navbar-module-container">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark flex-xl-column navbarModule" [style.height]="sideNavHeight ? sideNavHeight + \'px\' : \'\'" [style.width]="sideNavWidth ? sideNavWidth : \'\'">\n\t\t<div href="#" style="color: white; font-size: 16px; margin-left: 10px;">\n\t\t\t{{ menuData.title }}\n\t\t</div>\n\t\t<button class="navbar-toggler" type="button" [attr.aria-controls]="\'navbarModuleNav\'" [attr.aria-expanded]="drawerOpen" aria-label="Toggle navigation" (click)="toggleDrawer()">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" [class.show]="drawerOpen" [ngClass]="{ \'device-drawer-margin\': isDeviceWidth }" id="navbarModuleNav" style="align-items: baseline; width: 100%; overflow-y: auto; overflow-x: hidden">\n\t\t\t<ul class="navbar-nav" style="display: block; float: left; width: 100%">\n\t\t\t\t@for (tab of menuData.tabs | filterNotEqual: \'params\' : \'0\'; track tab.label; let i = $index) {\n\t\t\t\t\t@if (tab.params !== null && menuData.tabs[i - 1] && menuData.tabs[i - 1].params === null) {\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div href="#" style="color: white; font-size: 16px">Selected {{ menuData.module }}</div>\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div style="color: white; margin-left: 5px; text-decoration: underline; font-size: 14px">{{ menuData.description_name }}:</div>\n\t\t\t\t\t\t<div style="color: white; margin-left: 8px; font-size: 12px">{{ menuData.description }}</div>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t}\n\t\t\t\t\t<li [ngClass]="[\'nav-item\', tabClass(tab)]" [tourAnchor]="tab.tourAnchor">\n\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null" (click)="onNavLinkClick($event)" [routerLink]="[tab.params ? tab.link + \'/\' + tab.params : tab.link]" routerLinkActive="active">{{ tab.label }}</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t</div>\n\t</nav>\n</div>\n',styles:[".navbarModule li{cursor:pointer}.navbarModule li.active{border-left:3px solid #d19b3d}.navbarModule nav{width:100%}.navbar-module-container{margin-left:calc(var(--bs-gutter-x, 1.5rem) / -2);margin-right:calc(var(--bs-gutter-x, 1.5rem) / -2)}.navbarModule .nav-link{margin-left:10px}@media(min-width:1200px){.navbarModule{height:95vh;margin-left:-10px}hr{border-top:white 1px solid}}@media(max-width:1200px){.device-drawer-margin{margin-left:10px!important}hr{display:none}.navbarModule a{font-size:18px!important}}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$1.RouterLink,selector:"[routerLink]",inputs:["target","queryParams","fragment","queryParamsHandling","state","info","relativeTo","preserveFragment","skipLocationChange","replaceUrl","routerLink"]},{kind:"directive",type:i1$1.RouterLinkActive,selector:"[routerLinkActive]",inputs:["routerLinkActiveOptions","ariaCurrentWhenActive","routerLinkActive"],outputs:["isActiveChange"],exportAs:["routerLinkActive"]},{kind:"directive",type:TourAnchorDirective,selector:"[tourAnchor]",inputs:["tourAnchor"]},{kind:"pipe",type:FilterNotEqualPipe,name:"filterNotEqual"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarModuleComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"navbar-module",standalone:!1,template:'<style>\n\t.navbarModule li {\n\t\tcursor: pointer;\n\t}\n\t.navbarModule li.active {\n\t\tborder-left: 3px solid #d19b3d;\n\t}\n\t.navbarModule nav {\n\t\twidth: 100%;\n\t}\n\t.navbar-module-container {\n\t\tmargin-left: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t\tmargin-right: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t}\n\n\t.navbarModule .nav-link {\n\t\tmargin-left: 10px;\n\t}\n\n\t@media (min-width: 1200px) {\n\t\t.navbarModule {\n\t\t\theight: 95vh;\n\t\t\tmargin-left: -10px;\n\t\t}\n\n\t\thr {\n\t\t\tborder-top: white 1px solid;\n\t\t}\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.device-drawer-margin {\n\t\t\tmargin-left: 10px !important;\n\t\t}\n\n\t\thr {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.navbarModule a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t}\n</style>\n\n<div class="navbar-module-container">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark flex-xl-column navbarModule" [style.height]="sideNavHeight ? sideNavHeight + \'px\' : \'\'" [style.width]="sideNavWidth ? sideNavWidth : \'\'">\n\t\t<div href="#" style="color: white; font-size: 16px; margin-left: 10px;">\n\t\t\t{{ menuData.title }}\n\t\t</div>\n\t\t<button class="navbar-toggler" type="button" [attr.aria-controls]="\'navbarModuleNav\'" [attr.aria-expanded]="drawerOpen" aria-label="Toggle navigation" (click)="toggleDrawer()">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" [class.show]="drawerOpen" [ngClass]="{ \'device-drawer-margin\': isDeviceWidth }" id="navbarModuleNav" style="align-items: baseline; width: 100%; overflow-y: auto; overflow-x: hidden">\n\t\t\t<ul class="navbar-nav" style="display: block; float: left; width: 100%">\n\t\t\t\t@for (tab of menuData.tabs | filterNotEqual: \'params\' : \'0\'; track tab.label; let i = $index) {\n\t\t\t\t\t@if (tab.params !== null && menuData.tabs[i - 1] && menuData.tabs[i - 1].params === null) {\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div href="#" style="color: white; font-size: 16px">Selected {{ menuData.module }}</div>\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div style="color: white; margin-left: 5px; text-decoration: underline; font-size: 14px">{{ menuData.description_name }}:</div>\n\t\t\t\t\t\t<div style="color: white; margin-left: 8px; font-size: 12px">{{ menuData.description }}</div>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t}\n\t\t\t\t\t<li [ngClass]="[\'nav-item\', tabClass(tab)]" [tourAnchor]="tab.tourAnchor">\n\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null" (click)="onNavLinkClick($event)" [routerLink]="[tab.params ? tab.link + \'/\' + tab.params : tab.link]" routerLinkActive="active">{{ tab.label }}</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t</div>\n\t</nav>\n</div>\n'}]}],ctorParameters:()=>[{type:i0.ChangeDetectorRef},{type:ProviderService}],propDecorators:{sideNavHeight:[{type:Input}],sideNavWidth:[{type:Input}],onResize:[{type:HostListener,args:["window:resize"]}]}});class CoreComponent extends BaseComponent{_deviceDet;_ds;_resizeService;_services;_offline;_storage;_auth;_aps;_featureGates;_tourManager;environment;logo="";navTabs=[];userHasPhoneNumber=!1;client="";showNavbarModule=!0;publicProgram=!1;showSupport=!0;aiAssistantEnabled=!0;tourStops=[];el_navBarMain;el_navBarModule;el_mobileNavigationBar;el_mobileResolveioFooter;year=(new Date).getFullYear().toString();fullScreen=!1;windowSizeHeight=this.getViewportHeight();windowSizeWidth=this.getViewportWidth();navbarMainHeight=56;navbarModuleHeight=0;statusHeight=0;connectedHeight=0;isDevice=!1;showNavigationMenu=!1;mobileNavigationBarHeight=54;mobileResolveioFooterHeight=20;swFlagAlert=null;isConnected=!1;isConnecting=!1;socketStatus;user;status;collapsableMenu=!0;fontSize=12;openedWindow=!1;aiAssistantOpen=!1;aiAssistantAppId="resolveio-assistant";aiAssistantConfig=null;currentRoute="";isOffline=!1;foundUpdate=!1;orientation="portrait";digitalSign=!1;savingTourCompletion=!1;aiDebugEnabled=!1;navbarResizeObserver=null;handleVisualViewportChange=()=>{this.windowSizeHeight=this.getViewportHeight(),this.windowSizeWidth=this.getViewportWidth(),this.updateStandaloneNavigation(),this.refreshLayoutMeasurements()};constructor(t,e,n,o,r,i,a,s,l,c){super(o),this._deviceDet=t,this._ds=e,this._resizeService=n,this._services=o,this._offline=r,this._storage=i,this._auth=a,this._aps=s,this._featureGates=l,this._tourManager=c}refreshAiDebugFlag(){if("undefined"!=typeof window)try{const t=String(localStorage.getItem("resolveio.ai.debug")||"").trim().toLowerCase();this.aiDebugEnabled="1"===t||"true"===t||"on"===t}catch{this.aiDebugEnabled=!1}else this.aiDebugEnabled=!1}aiDebugLog(t,e){if(!this.aiDebugEnabled||"undefined"==typeof console||"function"!=typeof console.debug)return;const n=e&&"object"==typeof e?e:{};console.debug(`[AI.Core] ${t}`,n)}ngOnInit(){this.refreshAiDebugFlag(),this._services._app.setEnvironment(this.environment),this.aiAssistantAppId=this.resolveAiAssistantAppId(),this.aiAssistantConfig=this.resolveAiAssistantConfig(),this.currentRoute=this._services._router?.url||"",this._offline.initStorage(this.environment.OFFLINE_DB_SECRET_KEY),this._services._app.setClient(this.client),this._services._app.setNavTabs(this.filterNavTabs(this.navTabs)),this._services._app.setTourStops(Array.isArray(this.tourStops)?this.tourStops:[]),this.configureTour(),this._services._app.navTabs.subscribe(()=>this.configureTour()),this._services._app.tourStops.subscribe(()=>this.configureTour()),this._tourManager.completed$.subscribe(()=>this.saveTourCompletion()),this._services._account.initLoginManager(this.environment),this.environment&&this.environment.MS_ALLOWED?this._auth.setupMSSingleSignOn(this.environment):this.environment&&this._auth.setEnvironment(this.environment),this._auth.setUserHasPhoneNumber(this.userHasPhoneNumber),this._resizeService.onResize$.subscribe(t=>{this.windowSizeHeight=this.getViewportHeight(t),this.windowSizeWidth=this.getViewportWidth(t),this.updateStandaloneNavigation(),this.refreshLayoutMeasurements()}),this._services._app.fullScreen.subscribe(t=>{this.fullScreen=t}),this._services._account.user.subscribe(t=>{t&&t.settings?(this.collapsableMenu=t.settings.collapsable_menu,this.fontSize=t.settings.font_size,document.documentElement.style.setProperty("--warning-color",t.settings.warning_color),document.documentElement.style.setProperty("--warning-font-color",t.settings.warning_font_color),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.warning_color,.5)),document.documentElement.style.setProperty("--warning-hover-color",t.settings.warning_hover_color),document.documentElement.style.setProperty("--success-color",t.settings.success_color),document.documentElement.style.setProperty("--success-font-color",t.settings.success_font_color),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.success_color,.5)),document.documentElement.style.setProperty("--success-hover-color",t.settings.success_hover_color),document.documentElement.style.setProperty("--danger-color",t.settings.danger_color),document.documentElement.style.setProperty("--danger-font-color",t.settings.danger_font_color),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.danger_color,.5)),document.documentElement.style.setProperty("--danger-hover-color",t.settings.danger_hover_color),document.documentElement.style.setProperty("--info-color",t.settings.info_color),document.documentElement.style.setProperty("--info-font-color",t.settings.info_font_color),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.info_color,.5)),document.documentElement.style.setProperty("--info-hover-color",t.settings.info_hover_color),document.documentElement.style.setProperty("--primary-color",t.settings.primary_color),document.documentElement.style.setProperty("--primary-font-color",t.settings.primary_font_color),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.primary_color,.5)),document.documentElement.style.setProperty("--primary-hover-color",t.settings.primary_hover_color),document.documentElement.style.setProperty("--secondary-color",t.settings.secondary_color),document.documentElement.style.setProperty("--secondary-font-color",t.settings.secondary_font_color),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.secondary_color,.5)),document.documentElement.style.setProperty("--secondary-hover-color",t.settings.secondary_hover_color)):!t||t.other.customers&&t.other.customers.length||t.other.id_customer||t.settings||this.openedWindow?(document.documentElement.style.setProperty("--warning-color","#ffc107"),document.documentElement.style.setProperty("--warning-font-color","#000000"),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem rgba(222, 170, 12, 0.5)"),document.documentElement.style.setProperty("--warning-hover-color","#e0a800"),document.documentElement.style.setProperty("--success-color","#28a745"),document.documentElement.style.setProperty("--success-font-color","#ffffff"),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem rgba(72, 180, 97, 0.5)"),document.documentElement.style.setProperty("--success-hover-color","#218838"),document.documentElement.style.setProperty("--danger-color","#dc3545"),document.documentElement.style.setProperty("--danger-font-color","#ffffff"),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem rgba(225, 83, 97, 0.5)"),document.documentElement.style.setProperty("--danger-hover-color","#c82333"),document.documentElement.style.setProperty("--info-color","#17a2b8"),document.documentElement.style.setProperty("--info-font-color","#ffffff"),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem rgba(58, 176, 195, 0.5)"),document.documentElement.style.setProperty("--info-hover-color","#138496"),document.documentElement.style.setProperty("--primary-color","#007bff"),document.documentElement.style.setProperty("--primary-font-color","#ffffff"),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem rgba(38, 143, 255, 0.5)"),document.documentElement.style.setProperty("--primary-hover-color","#0069d9"),document.documentElement.style.setProperty("--secondary-color","#868e96"),document.documentElement.style.setProperty("--secondary-font-color","#ffffff"),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem rgba(130, 138, 145, 0.5)"),document.documentElement.style.setProperty("--secondary-hover-color","#5a6268"),this.fontSize=12):(this.openedWindow=!0,document.documentElement.style.setProperty("--warning-color","#ffc107"),document.documentElement.style.setProperty("--warning-font-color","#000000"),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem rgba(222, 170, 12, 0.5)"),document.documentElement.style.setProperty("--warning-hover-color","#e0a800"),document.documentElement.style.setProperty("--success-color","#28a745"),document.documentElement.style.setProperty("--success-font-color","#ffffff"),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem rgba(72, 180, 97, 0.5)"),document.documentElement.style.setProperty("--success-hover-color","#218838"),document.documentElement.style.setProperty("--danger-color","#dc3545"),document.documentElement.style.setProperty("--danger-font-color","#ffffff"),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem rgba(225, 83, 97, 0.5)"),document.documentElement.style.setProperty("--danger-hover-color","#c82333"),document.documentElement.style.setProperty("--info-color","#17a2b8"),document.documentElement.style.setProperty("--info-font-color","#ffffff"),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem rgba(58, 176, 195, 0.5)"),document.documentElement.style.setProperty("--info-hover-color","#138496"),document.documentElement.style.setProperty("--primary-color","#007bff"),document.documentElement.style.setProperty("--primary-font-color","#ffffff"),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem rgba(38, 143, 255, 0.5)"),document.documentElement.style.setProperty("--primary-hover-color","#0069d9"),document.documentElement.style.setProperty("--secondary-color","#868e96"),document.documentElement.style.setProperty("--secondary-font-color","#ffffff"),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem rgba(130, 138, 145, 0.5)"),document.documentElement.style.setProperty("--secondary-hover-color","#5a6268"),this.fontSize=12,this._ds.notify("Hello, "+t.fullname+" it looks like there are no user settings saved for you. To adjust your user settings click your name at the top of the page next to the logout button, adjust any settings you want, then click submit to apply them."),this._services._router.navigateByUrl(this._services._router.url.split("/")[0]+"/user-settings/settings")),this.user=t,this.isDevice||this.digitalSign||this._tourManager.autoStartIfNeeded(t)}),this._deviceDet.isMobile()||this._deviceDet.isTablet()?(this._services._app.setIsDevice(!0),this.isDevice=!0):(this._services._app.setIsDevice(!1),this.isDevice=!1),this.updateStandaloneNavigation(),this.bindVisualViewportListeners(),this.environment.IS_PRODUCTION&&this._services._socket.subscribeBypassRoute("flagUpdateWithType","newSW").subscribe(t=>{t?(this.swFlagAlert=this._services._alert.setAlert("info","This page will reload once new version has been downloaded",0),this._services._app.setIsInvalidSW(!0),navigator.serviceWorker?navigator.serviceWorker.getRegistrations().then(t=>{t&&t.length||setTimeout(()=>{window.location.reload()},3e3)},t=>{setTimeout(()=>{window.location.reload()},3e3)}):setTimeout(()=>{window.location.reload()},3e3)):this.swFlagAlert&&(this._services._app.setIsInvalidSW(!1),this._services._alert.clearAlert(this.swFlagAlert.toastId),this.swFlagAlert=null)}),this._offline.offlineMode.subscribe(t=>{this.isOffline=t}),this._services._account.getSocketStatus().subscribe(t=>{this.socketStatus=t,this.publicProgram||this.digitalSign?this.connectedHeight=0:(this.user?(this.socketStatus===WebSocket.OPEN?(this.isConnected=!0,this.isConnecting=!1):(this.isConnected=!1,this.socketStatus===WebSocket.CONNECTING?this.isConnecting=!0:this.isConnecting=!1),this.isConnected?this.connectedHeight=0:this.connectedHeight=40):(this.isConnected=!1,this.isConnecting=!1,this.connectedHeight=40),this.isConnected||(this.aiAssistantOpen=!1))}),this._services._socket.subscribeBypassRoute("appstatus").subscribe(t=>{this.status=t,this._services._app.setHasStatusMessage(!!this.status),this.statusHeight=this.publicProgram||this.digitalSign?0:this.status?40:0});let t,e=!1,n=this._storage.get("lastURL");this._services._router.events.subscribe(t=>{t.url&&t.url.startsWith("/digital-sign?")&&(this.digitalSign=!0),t.urlAfterRedirects?this.currentRoute=t.urlAfterRedirects:t.url&&(this.currentRoute=t.url),this.refreshLayoutMeasurements(),this.isDevice&&(n&&"/"!==n&&!e&&(""!==t.url&&"/"!==t.url||this._services._router.navigateByUrl(n)),e=!0,t.url?this._storage.set("lastURL",t.url):t.urlAfterRedirects&&this._storage.set("lastURL",t.urlAfterRedirects))}),window.addEventListener("orientationchange",()=>{-90===window.orientation&&(this.orientation="landscape"),90===window.orientation&&(this.orientation="landscape"),0===window.orientation&&(this.orientation="portrait")},!0),document.addEventListener("focus",function(){document.activeElement instanceof HTMLElement&&"INPUT"===document.activeElement.nodeName&&"number"===document.activeElement.type&&(t=!0,document.addEventListener("mousewheel",handleMousewheelEvent,{passive:!0}))},!0),document.addEventListener("blur",function(){t&&(t=!1,document.removeEventListener("mousewheel",handleMousewheelEvent))},!0),window.addEventListener("dragover",t=>{(t||event).preventDefault()},!1),window.addEventListener("drop",t=>{(t||event).preventDefault()},!1)}ngAfterViewInit(){this.refreshLayoutMeasurements(),this.observeLayoutElements(),requestAnimationFrame(()=>this.refreshLayoutMeasurements())}ngOnDestroy(){this.navbarResizeObserver&&(this.navbarResizeObserver.disconnect(),this.navbarResizeObserver=null);const t="undefined"!=typeof window?window.visualViewport:null;t&&(t.removeEventListener("resize",this.handleVisualViewportChange),t.removeEventListener("scroll",this.handleVisualViewportChange))}filterNavTabs(t){if(!Array.isArray(t))return[];const e=this._aps.getAllModulePermissions(),n=[];return t.forEach(t=>{if(!t||!Array.isArray(t.links))return void n.push(t);const o=t.links.filter(t=>this.isRoleGateEnabled(t.role,e));if(!o.length)return;const r={...t,links:o};if("dropdown"===t.type){const n=Array.isArray(t.roles)?t.roles.filter(t=>this.isRoleGateEnabled(t,e)):[];if(!n.length)return;r.roles=n}n.push(r)}),n}isRoleGateEnabled(t,e){return!t||this._featureGates.isLinkEnabled(t,e,!0)}getNavbarModuleHeight(){return this.navbarModuleHeight>0?this.navbarModuleHeight:0}updateStandaloneNavigation(){const t=this.showNavigationMenu,e=this.windowSizeWidth<=1200;this.showNavigationMenu=this.isDevice&&e&&this.isStandaloneWebApp(),!e&&this.aiAssistantEnabled||(this.aiAssistantOpen=!1),t!==this.showNavigationMenu&&"undefined"!=typeof window&&requestAnimationFrame(()=>this.refreshLayoutMeasurements())}isStandaloneWebApp(){if("undefined"==typeof window)return!1;const t=!0===window.navigator.standalone,e="undefined"!=typeof document&&"string"==typeof document.referrer&&document.referrer.startsWith("android-app://"),n="function"==typeof window.matchMedia&&(window.matchMedia("(display-mode: standalone)").matches||window.matchMedia("(display-mode: fullscreen)").matches||window.matchMedia("(display-mode: minimal-ui)").matches);return t||e||n}toggleAiAssistant(){this.refreshAiDebugFlag(),this.aiAssistantEnabled&&this.isConnected&&(this.aiAssistantOpen=!this.aiAssistantOpen,this.aiDebugLog("toggleAiAssistant",{open:this.aiAssistantOpen,route:this.currentRoute||"",windowWidth:this.windowSizeWidth,windowHeight:this.windowSizeHeight}))}openAiAssistant(){this.refreshAiDebugFlag(),this.aiAssistantEnabled&&this.isConnected&&(this.aiAssistantOpen=!0,this.aiDebugLog("openAiAssistant",{open:this.aiAssistantOpen,route:this.currentRoute||"",windowWidth:this.windowSizeWidth,windowHeight:this.windowSizeHeight}))}closeAiAssistant(){this.aiAssistantOpen=!1,this.aiDebugLog("closeAiAssistant",{open:this.aiAssistantOpen,route:this.currentRoute||"",windowWidth:this.windowSizeWidth,windowHeight:this.windowSizeHeight})}getAiAssistantTopOffset(){return this.navbarMainHeight+this.statusHeight+this.connectedHeight}getAiAssistantHeight(){const t=this.getAiAssistantTopOffset(),e=this.showNavigationMenu?54+this.getNavbarModuleHeight():0,n=!this.isDevice||this.isDevice&&this.showNavigationMenu?20:0,o=this.windowSizeHeight-t-e-n;return o>0?o:0}getMainScrollHeight(){const t=this.getNavbarModuleHeight(),e=t>100?0:t,n=this.navbarMainHeight+(this.publicProgram||this.digitalSign?0:this.statusHeight)+(this.publicProgram||this.digitalSign?0:this.connectedHeight),o=this.isDevice&&this.windowSizeWidth<=1200&&!this.showNavigationMenu?e:0,r=this.isDevice&&this.showNavigationMenu?e:0,i=this.windowSizeHeight-o-n-r-this.getShellBottomOffset()-5;return i>0?i:0}getBottomNavSpacerHeight(){return 0}getAiAssistantReservedWidth(){if(!this.aiAssistantEnabled||!this.user||this.isDevice||this.windowSizeWidth<=1200||this.digitalSign||this.publicProgram)return 0;return 46}resolveAiAssistantClientId(){const t=String(this.user?.other?.id_client||this.user?.id_client||this.user?.idClient||"").trim();return t||String(this.client||"").trim()}resolveAiAssistantAppId(){const t=this.environment||{},e=t.AI_ASSISTANT_APP_ID||t.APP_ID||t.CLIENT_APP_ID||"";return String(e||"resolveio-assistant").trim()}resolveAiAssistantConfig(){const t=this.environment||{},e=this.normalizeOptionalEnvString(t.AI_ASSISTANT_CODEX_MODEL||t.AI_TERMINAL_CODEX_MODEL||t.AI_DASHBOARD_CODEX_MODEL),n=this.resolveEnvModelList(t.AI_ASSISTANT_CODEX_FALLBACK_MODELS||t.AI_TERMINAL_CODEX_FALLBACK_MODELS||t.AI_DASHBOARD_CODEX_FALLBACK_MODELS),o=this.normalizeOptionalEnvString(t.AI_ASSISTANT_CODEX_FALLBACK_MODEL||t.AI_TERMINAL_CODEX_FALLBACK_MODEL||t.AI_DASHBOARD_CODEX_FALLBACK_MODEL);if(o&&!n.includes(o)&&n.unshift(o),e){const t=n.filter(t=>t!==e);n.length=0,t.forEach(t=>n.push(t))}if(!e&&!n.length)return null;const r={};return e&&(r.model=e),1===n.length?r.fallbackModel=n[0]:n.length>1&&(r.fallbackModels=n),r}resolveEnvModelList(t){const e=[],n=t=>{const n=this.normalizeOptionalEnvString(t);n&&!e.includes(n)&&e.push(n)};if(Array.isArray(t))return t.forEach(n),e;const o=this.normalizeOptionalEnvString(t);return o?(o.split(",").forEach(n),e):e}normalizeOptionalEnvString(t){return"string"==typeof t?t.trim():""}configureTour(){const t=this._services._app.navTabs.getValue(),e=this._services._app.tourStops.getValue();this._tourManager.configure(Array.isArray(t)?t:[],Array.isArray(e)?e:[])}saveTourCompletion(){const t=this._services._account.getUser();if(!t||!t._id||this.savingTourCompletion||this._tourManager.hasCompletedTour(t))return;const e={...t.other||{},tour_completed:!0,core_tour_completed:!0,tour_completed_at:(new Date).toISOString()};this.savingTourCompletion=!0,this._services._socket.call("updateDocumentProps","users",t._id,[{prop:"other",data:e}],t.__v,(n,o)=>{if(this.savingTourCompletion=!1,!o)return;const r={...t,other:e,__v:o&&o.__v?o.__v:t.__v};this._services._account.setUser(r)})}onPushBackButton(){window.history.back()}onPushReloadButton(){window.location.reload()}onPushForwardButton(){window.history.forward()}openNav(){let t=document.getElementById("navSid"),e=document.getElementById("main_cont");t&&e&&("40px"===t.style.width&&"45px"===e.style.paddingLeft?(t.style.width="195px",e.style.paddingLeft="210px"):(t.style.width="40px",e.style.paddingLeft="45px"))}closeNav(){let t=document.getElementById("navSid"),e=document.getElementById("main_cont");t&&e&&(t.style.width="40px",e.style.paddingLeft="45px")}bindVisualViewportListeners(){const t="undefined"!=typeof window?window.visualViewport:null;t&&(t.addEventListener("resize",this.handleVisualViewportChange),t.addEventListener("scroll",this.handleVisualViewportChange))}observeLayoutElements(){if("undefined"==typeof ResizeObserver)return;this.navbarResizeObserver&&this.navbarResizeObserver.disconnect(),this.navbarResizeObserver=new ResizeObserver(()=>this.refreshLayoutMeasurements());const t=this.getNavbarMainElement(),e=this.getNavbarModuleElement();t&&this.navbarResizeObserver.observe(t),e&&this.navbarResizeObserver.observe(e)}refreshLayoutMeasurements(){const t=this.navbarMainHeight,e=this.navbarModuleHeight,n=this.mobileNavigationBarHeight,o=this.mobileResolveioFooterHeight,r=this.measureElementHeight(this.getNavbarMainElement());r>0&&(this.navbarMainHeight=r);const i=this.measureElementHeight(this.getNavbarModuleElement());i>0&&(this.navbarModuleHeight=i);const a=this.measureElementHeight(this.getMobileNavigationBarElement());a>0&&(this.mobileNavigationBarHeight=a);const s=this.measureElementHeight(this.getMobileResolveioFooterElement());s>0&&(this.mobileResolveioFooterHeight=s),!this.aiDebugEnabled||t===this.navbarMainHeight&&e===this.navbarModuleHeight&&n===this.mobileNavigationBarHeight&&o===this.mobileResolveioFooterHeight||this.aiDebugLog("refreshLayoutMeasurements",{navbarMainHeight:this.navbarMainHeight,navbarModuleHeight:this.navbarModuleHeight,mobileNavigationBarHeight:this.mobileNavigationBarHeight,mobileResolveioFooterHeight:this.mobileResolveioFooterHeight})}getNavbarMainElement(){const t=this.el_navBarMain?.nativeElement;return t?t.querySelector(".navbarMain")||t:null}getNavbarModuleElement(){const t=this.el_navBarModule?.nativeElement;return t?t.querySelector(".navbarModule")||t:null}getMobileNavigationBarElement(){return this.el_mobileNavigationBar?.nativeElement||null}getMobileResolveioFooterElement(){return this.el_mobileResolveioFooter?.nativeElement||null}getMobileBottomOverlayHeight(){if(!this.isDevice||!this.showNavigationMenu)return 0;const t=this.mobileNavigationBarHeight+this.mobileResolveioFooterHeight;return t>0?t:74}getMobileResolveioFooterOverlayHeight(){const t=this.mobileResolveioFooterHeight;return t>0?t:20}getShellBottomOffset(){return this.isDevice&&this.showNavigationMenu?this.getMobileBottomOverlayHeight():this.isDevice?this.getMobileResolveioFooterOverlayHeight():20}measureElementHeight(t){if(!t)return 0;const e=(t.getBoundingClientRect?t.getBoundingClientRect().height:0)||t.offsetHeight||t.clientHeight||0;return e>0?Math.round(e):0}getViewportHeight(t){if("undefined"==typeof window)return 0;const e=window.visualViewport,n=e?.height||t?.innerHeight||window.innerHeight;return n>0?Math.round(n):0}getViewportWidth(t){if("undefined"==typeof window)return 0;const e=window.visualViewport,n=e?.width||t?.innerWidth||window.innerWidth;return n>0?Math.round(n):0}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreComponent,deps:[{token:i1$5.DeviceDetectorService},{token:DialogService},{token:ResizeService},{token:ProviderService},{token:OfflineManagerService},{token:LocalStorageService},{token:AuthService},{token:AuthPermissionService},{token:FeatureGateService},{token:CoreTourService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:CoreComponent,isStandalone:!1,selector:"resolveio-client-lib-core",inputs:{environment:"environment",logo:"logo",navTabs:"navTabs",userHasPhoneNumber:"userHasPhoneNumber",client:"client",showNavbarModule:"showNavbarModule",publicProgram:"publicProgram",showSupport:"showSupport",aiAssistantEnabled:"aiAssistantEnabled",tourStops:"tourStops"},providers:[ProviderService],viewQueries:[{propertyName:"el_navBarMain",first:!0,predicate:["navBarMain"],descendants:!0,read:ElementRef,static:!0},{propertyName:"el_navBarModule",first:!0,predicate:["navBarModule"],descendants:!0,read:ElementRef,static:!0},{propertyName:"el_mobileNavigationBar",first:!0,predicate:["mobileNavigationBar"],descendants:!0,read:ElementRef},{propertyName:"el_mobileResolveioFooter",first:!0,predicate:["mobileResolveioFooter"],descendants:!0,read:ElementRef}],usesInheritance:!0,ngImport:i0,template:'<style>\n\t:root {\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t:host ::ng-deep .btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\t:host ::ng-deep .btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\t:host ::ng-deep .btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\t:host ::ng-deep .btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\t:host ::ng-deep .btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\t:host ::ng-deep .btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\t:host ::ng-deep .btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\t:host ::ng-deep .btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\t:host ::ng-deep .btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\t:host ::ng-deep .btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\t:host ::ng-deep .btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t@media print {\n\t\t.dontPrint * {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t.myDivToPrintCs {\n\t\t\tbackground-color: white;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t\tfont-size: 12px;\n\t\t\tline-height: 12px;\n\t\t\tpage-break-after: avoid;\n\t\t\tdisplay: initial;\n\t\t}\n\n\t\t.removeOverflow {\n\t\t\toverflow-y: hidden !important;\n\t\t\theight: 100% !important;\n\t\t}\n\t}\n\n\t.hideThis {\n\t\tdisplay: none !important;\n\t}\n\n\t.navSidbar {\n\t\twidth: 0px;\n\t\tposition: fixed;\n\t\tz-index: 1;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\toverflow: hidden;\n\t\ttransition: 0.5s;\n\t\tpadding-top: 0px;\n\t}\n\n\t.navSidbar a {\n\t\tpadding: 8px 8px 8px 32px;\n\t\ttext-decoration: none;\n\t\tfont-size: 25px;\n\t\tcolor: #818181;\n\t\tdisplay: block;\n\t\ttransition: 0.3s;\n\t}\n\n\t.navSidbar a:hover {\n\t\tcolor: #f1f1f1;\n\t}\n\n\t.openbtn {\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\tborder: none;\n\t\tcolor: #fff;\n\t\tpadding: 5px 20px;\n\t\tfont-size: 18px;\n\t\tright: 0;\n\t\ttop: 0px;\n\t\tposition: absolute;\n\t\tz-index: 999999;\n\t\tcursor: pointer;\n\t\tfloat: right;\n\t\theight: 100%;\n\t}\n\n\t.openbtn span {\n\t\tfont-size: 20px;\n\t\tdisplay: block;\n\t\theight: auto;\n\t\twidth: auto;\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tleft: 50%;\n\t\ttop: 50%;\n\t\ttransform: translate(-50%, -50%) rotate(-90deg);\n\t\tmargin-top: -55px;\n\t\tletter-spacing: 30px;\n\t}\n\n\t.ai-openbtn {\n\t\tdisplay: none;\n\t}\n\t#main_cont {\n\t\ttransition: padding-left 0.5s;\n\t}\n\n\t.sid_inr {\n\t\tpadding-left: 25px;\n\t}\n\n\t@keyframes shimmer {\n\t\t0%,\n\t\t50% {\n\t\t\tbackground-position: 120% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -80% 0;\n\t\t}\n\t}\n\n\t.shimmer::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tbackground: linear-gradient(-75deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 60%);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: shimmer 5s linear infinite;\n\t\tanimation-fill-mode: forwards;\n\t\tz-index: 11;\n\t}\n\n\t.shell-status-banner {\n\t\tmin-height: 40px;\n\t\ttext-align: center;\n\t\tbackground-color: red;\n\t\tcolor: white;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 0 12px;\n\t}\n\n\t.shell-status-banner__message {\n\t\twidth: 100%;\n\t\tpadding: 9px 0;\n\t\tline-height: 1.2;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.scroll-shell {\n\t\toverscroll-behavior-y: contain;\n\t}\n\n\t.scroll-bottom-spacer {\n\t\tpointer-events: none;\n\t}\n\n\t.mobile-resolveio-footer {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: env(safe-area-inset-bottom);\n\t\theight: 20px;\n\t\ttext-align: center;\n\t\tfont-style: italic;\n\t\tfont-weight: bold;\n\t\tbackground-color: lightgray;\n\t\tz-index: 10019;\n\t}\n\n\t.mobile-resolveio-footer.with-mobile-nav {\n\t\tbottom: calc(54px + env(safe-area-inset-bottom));\n\t}\n\n\t.mobile-navigation-bar {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\theight: calc(54px + env(safe-area-inset-bottom));\n\t\tpadding-bottom: env(safe-area-inset-bottom);\n\t\tbackground-color: lightgray;\n\t\tz-index: 10020;\n\t}\n\n\t:host ::ng-deep .rio-tour-anchor-active {\n\t\tposition: relative;\n\t\tz-index: 1062;\n\t\toutline: 2px solid #ffb300;\n\t\toutline-offset: 3px;\n\t\tborder-radius: 6px;\n\t\tbox-shadow: 0 0 0 4px rgba(255, 179, 0, 0.25);\n\t}\n\n\t@media all and (max-width: 768px) {\n\t\t.shell-status-banner {\n\t\t\tmin-height: 32px;\n\t\t\tpadding: 0 8px;\n\t\t}\n\n\t\t.shell-status-banner__message {\n\t\t\tpadding: 6px 0;\n\t\t\tfont-size: 12px;\n\t\t}\n\t}\n</style>\n@if (isDevice) {\n\t<link rel="stylesheet" type="text/css" href="/assets/css/tablet.css" />\n}\n<div #shell [style.height.px]="isDevice && showNavigationMenu ? windowSizeHeight : null" [style.overflow]="isDevice && showNavigationMenu ? \'hidden\' : null">\n\t@if (user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** OFFLINE MODE ***</div>\n\t\t</div>\n\t}\n\t@if (!user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** PLEASE LOGIN ***</div>\n\t\t</div>\n\t}\n\t@if (status) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer" [title]="status.message">*** {{ status.message }} ***</div>\n\t\t</div>\n\t}\n\t@if (fullScreen) {\n\t\t<router-outlet name="jobboardfsoutlet"></router-outlet>\n\t}\n\t<div [ngClass]="[\'container-fluid\', fullScreen ? \'hideThis\' : \'\']" [style.font-size.px]="fontSize">\n\t\t<div class="dontPrint">\n\t\t\t<navbar-main style="width: 100%" tourAnchor="navBarMain" #navBarMain [logo]="logo" [showSupport]="showSupport" [navTabs]="navTabs" [fontSize]="fontSize" [publicProgram]="publicProgram || digitalSign" [digitalSign]="digitalSign" [aiAssistantVisible]="aiAssistantEnabled && isConnected" (aiToggle)="toggleAiAssistant()"></navbar-main>\n\t\t</div>\n\t\t<rio-core-tour-overlay></rio-core-tour-overlay>\n\t\t<ng-template ngbModalContainer></ng-template>\n\t\t@if (aiAssistantEnabled && user && isConnected && !isDevice && windowSizeWidth > 1200 && !digitalSign && !publicProgram) {\n\t\t\t<rio-ai-assistant\n\t\t\t\t[idClient]="resolveAiAssistantClientId()"\n\t\t\t\t[idApp]="aiAssistantAppId"\n\t\t\t\t[config]="aiAssistantConfig"\n\t\t\t\t[open]="aiAssistantOpen"\n\t\t\t\t[currentRoute]="currentRoute"\n\t\t\t\t[topOffset]="getAiAssistantTopOffset()"\n\t\t\t\t[panelHeight]="getAiAssistantHeight()"\n\t\t\t\t(openRequested)="openAiAssistant()"\n\t\t\t\t(closed)="closeAiAssistant()"></rio-ai-assistant>\n\t\t}\n\t\t\t<div class="row">\n\t\t\t\t@if (showNavbarModule && !digitalSign) {\n\t\t\t\t\t<div id="navSid" [ngClass]="[\'dontPrint\', windowSizeWidth > 1200 && collapsableMenu ? \'navSidbar\' : \'col-xl-1\']" [style.width]="windowSizeWidth > 1200 && collapsableMenu ? \'40px\' : windowSizeWidth > 1200 ? \'\' : \'100%\'" [style.margin-top.px]="windowSizeWidth > 1200 && collapsableMenu ? navbarMainHeight + statusHeight + connectedHeight : 0">\n\t\t\t\t\t\t@if (windowSizeWidth > 1200 && collapsableMenu) {\n\t\t\t\t\t\t\t<div class="openbtn" (mouseenter)="openNav()"><span>MENU</span></div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<div [ngClass]="windowSizeWidth > 1200 && collapsableMenu ? \'sid_inr\' : \'\'">\n\t\t\t\t\t\t\t<navbar-module #navBarModule tourAnchor="navBarModule" [sideNavWidth]="windowSizeWidth > 1200 && collapsableMenu ? \'90%\' : \'auto\'" [sideNavHeight]="windowSizeWidth > 1200 ? windowSizeHeight - navbarMainHeight - statusHeight - connectedHeight - (showNavigationMenu ? 54 + getNavbarModuleHeight() : 0) - 20 : \'\'"></navbar-module>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div [id]="windowSizeWidth > 1200 ? \'main_cont\' : \'main_cont_mobile\'" [ngClass]="[windowSizeWidth > 1200 && collapsableMenu ? \'col-xl-12\' : \'col-xl-11\']" [style.padding-left]="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? 45 + \'px\' : null" [style.padding-right.px]="getAiAssistantReservedWidth()" (mouseenter)="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? closeNav() : null" style="padding-top: 5px">\n\t\t\t\t\t<div style="-webkit-overflow-scrolling: touch" [style.overflow-y]="isDevice && !showNavigationMenu ? \'initial\' : \'scroll\'" [style.height.px]="getMainScrollHeight()" class="removeOverflow scroll-shell">\n\t\t\t\t\t\t<router-outlet></router-outlet>\n\t\t\t\t\t\t<div class="scroll-bottom-spacer" [style.height.px]="getBottomNavSpacerHeight()" aria-hidden="true"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t@if (isDevice) {\n\t\t\t\t\t<div #mobileResolveioFooter class="mobile-resolveio-footer dontPrint" [class.with-mobile-nav]="showNavigationMenu">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t\t@if (isDevice && showNavigationMenu) {\n\t\t\t\t\t<div #mobileNavigationBar class="mobile-navigation-bar dontPrint">\n\t\t\t\t\t\t<table style="width: 100%">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushBackButton()"><i class="fa fa-arrow-left" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushReloadButton()"><i class="fa fa-refresh" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushForwardButton()"><i class="fa fa-arrow-right" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!isDevice) {\n\t\t\t\t\t<div style="text-align: center; height: 20px; font-style: italic; font-weight: bold; background-color: lightgray; margin-left: -15px; margin-right: -15px">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n',styles:[':root{--warning-color: #ffc107;--warning-font-color: #000000;--warning-hover-color: #e0a800;--warning-shadow-color: 0 0 0 .2rem rgba(222, 170, 12, .5);--success-color: #28a745;--success-font-color: #ffffff;--success-hover-color: #218838;--success-shadow-color: 0 0 0 .2rem rgba(72, 180, 97, .5);--danger-color: #dc3545;--danger-font-color: #ffffff;--danger-hover-color: #c82333;--danger-shadow-color: 0 0 0 .2rem rgba(225, 83, 97, .5);--info-color: #17a2b8;--info-font-color: #ffffff;--info-hover-color: #138496;--info-shadow-color: 0 0 0 .2rem rgba(58, 176, 195, .5);--primary-color: #007bff;--primary-font-color: #ffffff;--primary-hover-color: #0069d9;--primary-shadow-color: 0 0 0 .2rem rgba(38, 143, 255, .5);--secondary-color: #868e96;--secondary-font-color: #ffffff;--secondary-hover-color: #5a6268;--secondary-shadow-color: 0 0 0 .2rem rgba(130, 138, 145, .5)}:host ::ng-deep .btn-warning{color:var(--warning-font-color);background-color:var(--warning-color);border-color:var(--warning-color)}:host ::ng-deep .btn-warning:focus,.btn-warning.focus{box-shadow:var(--warning-shadow-color)}:host ::ng-deep .btn-warning:hover{color:var(--warning-font-color);background-color:var(--warning-hover-color);border-color:var(--warning-hover-color)}:host ::ng-deep .btn-success{color:var(--success-font-color);background-color:var(--success-color);border-color:var(--success-color)}:host ::ng-deep .btn-success:focus,.btn-success.focus{box-shadow:var(--success-shadow-color)}:host ::ng-deep .btn-success:hover{color:var(--success-font-color);background-color:var(--success-hover-color);border-color:var(--success-hover-color)}:host ::ng-deep .btn-danger{color:var(--danger-font-color);background-color:var(--danger-color);border-color:var(--danger-color)}:host ::ng-deep .btn-danger:focus,.btn-danger.focus{box-shadow:var(--danger-shadow-color)}:host ::ng-deep .btn-danger:hover{color:var(--danger-font-color);background-color:var(--danger-hover-color);border-color:var(--danger-hover-color)}:host ::ng-deep .btn-info{color:var(--info-font-color);background-color:var(--info-color);border-color:var(--info-color)}:host ::ng-deep .btn-info:focus,.btn-info.focus{box-shadow:var(--info-shadow-color)}:host ::ng-deep .btn-info:hover{color:var(--info-font-color);background-color:var(--info-hover-color);border-color:var(--info-hover-color)}:host ::ng-deep .btn-primary{color:var(--primary-font-color);background-color:var(--primary-color);border-color:var(--primary-color)}:host ::ng-deep .btn-primary:focus,.btn-primary.focus{box-shadow:var(--primary-shadow-color)}:host ::ng-deep .btn-primary:hover{color:var(--primary-font-color);background-color:var(--primary-hover-color);border-color:var(--primary-hover-color)}:host ::ng-deep .btn-secondary{color:var(--secondary-font-color);background-color:var(--secondary-color);border-color:var(--secondary-color)}:host ::ng-deep .btn-secondary:focus,.btn-secondary.focus{box-shadow:var(--secondary-shadow-color)}:host ::ng-deep .btn-secondary:hover{color:var(--secondary-font-color);background-color:var(--secondary-hover-color);border-color:var(--secondary-hover-color)}@media print{.dontPrint *{display:none!important}.myDivToPrintCs{background-color:#fff;height:100%;width:100%;font-size:12px;line-height:12px;page-break-after:avoid;display:initial}.removeOverflow{overflow-y:hidden!important;height:100%!important}}.hideThis{display:none!important}.navSidbar{width:0px;position:fixed;z-index:1;top:0;left:0;background-color:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1))!important;overflow:hidden;transition:.5s;padding-top:0}.navSidbar a{padding:8px 8px 8px 32px;text-decoration:none;font-size:25px;color:#818181;display:block;transition:.3s}.navSidbar a:hover{color:#f1f1f1}.openbtn{background-color:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1))!important;border:none;color:#fff;padding:5px 20px;font-size:18px;right:0;top:0;position:absolute;z-index:999999;cursor:pointer;float:right;height:100%}.openbtn span{font-size:20px;display:block;height:auto;width:auto;text-align:center;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-90deg);margin-top:-55px;letter-spacing:30px}.ai-openbtn{display:none}#main_cont{transition:padding-left .5s}.sid_inr{padding-left:25px}@keyframes shimmer{0%,50%{background-position:120% 0}to{background-position:-80% 0}}.shimmer:before{content:"";position:absolute;inset:0;background:linear-gradient(-75deg,#fff0 40%,#ffffffb3,#fff0 60%);background-size:200% 100%;animation:shimmer 5s linear infinite;animation-fill-mode:forwards;z-index:11}.shell-status-banner{min-height:40px;text-align:center;background-color:red;color:#fff;display:flex;align-items:center;justify-content:center;padding:0 12px}.shell-status-banner__message{width:100%;padding:9px 0;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scroll-shell{overscroll-behavior-y:contain}.scroll-bottom-spacer{pointer-events:none}.mobile-resolveio-footer{position:fixed;left:0;right:0;bottom:env(safe-area-inset-bottom);height:20px;text-align:center;font-style:italic;font-weight:700;background-color:#d3d3d3;z-index:10019}.mobile-resolveio-footer.with-mobile-nav{bottom:calc(54px + env(safe-area-inset-bottom))}.mobile-navigation-bar{position:fixed;left:0;right:0;bottom:0;height:calc(54px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background-color:#d3d3d3;z-index:10020}:host ::ng-deep .rio-tour-anchor-active{position:relative;z-index:1062;outline:2px solid #ffb300;outline-offset:3px;border-radius:6px;box-shadow:0 0 0 4px #ffb30040}@media all and (max-width:768px){.shell-status-banner{min-height:32px;padding:0 8px}.shell-status-banner__message{padding:6px 0;font-size:12px}}\n'],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$1.RouterOutlet,selector:"router-outlet",inputs:["name","routerOutletData"],outputs:["activate","deactivate","attach","detach"],exportAs:["outlet"]},{kind:"directive",type:TourAnchorDirective,selector:"[tourAnchor]",inputs:["tourAnchor"]},{kind:"component",type:CoreTourOverlayComponent,selector:"rio-core-tour-overlay"},{kind:"component",type:AiAssistantComponent,selector:"rio-ai-assistant",inputs:["idClient","idApp","title","open","supportTicketRoute","supportTicketEnabled","config","topOffset","panelHeight","currentRoute","hoverEnabled"],outputs:["openRequested","closed"]},{kind:"component",type:NavbarMainComponent,selector:"navbar-main",inputs:["logo","navTabs","fontSize","publicProgram","digitalSign","showSupport","aiAssistantVisible"],outputs:["aiToggle"]},{kind:"component",type:NavbarModuleComponent,selector:"navbar-module",inputs:["sideNavHeight","sideNavWidth"]}]})}function handleMousewheelEvent(){document.activeElement.blur()}function hexToRGB$1(t,e){let n=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e?"rgba("+n+", "+o+", "+r+", "+e+")":"rgb("+n+", "+o+", "+r+")"}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"resolveio-client-lib-core",standalone:!1,template:'<style>\n\t:root {\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t:host ::ng-deep .btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\t:host ::ng-deep .btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\t:host ::ng-deep .btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\t:host ::ng-deep .btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\t:host ::ng-deep .btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\t:host ::ng-deep .btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\t:host ::ng-deep .btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\t:host ::ng-deep .btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\t:host ::ng-deep .btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\t:host ::ng-deep .btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\t:host ::ng-deep .btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t@media print {\n\t\t.dontPrint * {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t.myDivToPrintCs {\n\t\t\tbackground-color: white;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t\tfont-size: 12px;\n\t\t\tline-height: 12px;\n\t\t\tpage-break-after: avoid;\n\t\t\tdisplay: initial;\n\t\t}\n\n\t\t.removeOverflow {\n\t\t\toverflow-y: hidden !important;\n\t\t\theight: 100% !important;\n\t\t}\n\t}\n\n\t.hideThis {\n\t\tdisplay: none !important;\n\t}\n\n\t.navSidbar {\n\t\twidth: 0px;\n\t\tposition: fixed;\n\t\tz-index: 1;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\toverflow: hidden;\n\t\ttransition: 0.5s;\n\t\tpadding-top: 0px;\n\t}\n\n\t.navSidbar a {\n\t\tpadding: 8px 8px 8px 32px;\n\t\ttext-decoration: none;\n\t\tfont-size: 25px;\n\t\tcolor: #818181;\n\t\tdisplay: block;\n\t\ttransition: 0.3s;\n\t}\n\n\t.navSidbar a:hover {\n\t\tcolor: #f1f1f1;\n\t}\n\n\t.openbtn {\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\tborder: none;\n\t\tcolor: #fff;\n\t\tpadding: 5px 20px;\n\t\tfont-size: 18px;\n\t\tright: 0;\n\t\ttop: 0px;\n\t\tposition: absolute;\n\t\tz-index: 999999;\n\t\tcursor: pointer;\n\t\tfloat: right;\n\t\theight: 100%;\n\t}\n\n\t.openbtn span {\n\t\tfont-size: 20px;\n\t\tdisplay: block;\n\t\theight: auto;\n\t\twidth: auto;\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tleft: 50%;\n\t\ttop: 50%;\n\t\ttransform: translate(-50%, -50%) rotate(-90deg);\n\t\tmargin-top: -55px;\n\t\tletter-spacing: 30px;\n\t}\n\n\t.ai-openbtn {\n\t\tdisplay: none;\n\t}\n\t#main_cont {\n\t\ttransition: padding-left 0.5s;\n\t}\n\n\t.sid_inr {\n\t\tpadding-left: 25px;\n\t}\n\n\t@keyframes shimmer {\n\t\t0%,\n\t\t50% {\n\t\t\tbackground-position: 120% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -80% 0;\n\t\t}\n\t}\n\n\t.shimmer::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tbackground: linear-gradient(-75deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 60%);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: shimmer 5s linear infinite;\n\t\tanimation-fill-mode: forwards;\n\t\tz-index: 11;\n\t}\n\n\t.shell-status-banner {\n\t\tmin-height: 40px;\n\t\ttext-align: center;\n\t\tbackground-color: red;\n\t\tcolor: white;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 0 12px;\n\t}\n\n\t.shell-status-banner__message {\n\t\twidth: 100%;\n\t\tpadding: 9px 0;\n\t\tline-height: 1.2;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.scroll-shell {\n\t\toverscroll-behavior-y: contain;\n\t}\n\n\t.scroll-bottom-spacer {\n\t\tpointer-events: none;\n\t}\n\n\t.mobile-resolveio-footer {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: env(safe-area-inset-bottom);\n\t\theight: 20px;\n\t\ttext-align: center;\n\t\tfont-style: italic;\n\t\tfont-weight: bold;\n\t\tbackground-color: lightgray;\n\t\tz-index: 10019;\n\t}\n\n\t.mobile-resolveio-footer.with-mobile-nav {\n\t\tbottom: calc(54px + env(safe-area-inset-bottom));\n\t}\n\n\t.mobile-navigation-bar {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\theight: calc(54px + env(safe-area-inset-bottom));\n\t\tpadding-bottom: env(safe-area-inset-bottom);\n\t\tbackground-color: lightgray;\n\t\tz-index: 10020;\n\t}\n\n\t:host ::ng-deep .rio-tour-anchor-active {\n\t\tposition: relative;\n\t\tz-index: 1062;\n\t\toutline: 2px solid #ffb300;\n\t\toutline-offset: 3px;\n\t\tborder-radius: 6px;\n\t\tbox-shadow: 0 0 0 4px rgba(255, 179, 0, 0.25);\n\t}\n\n\t@media all and (max-width: 768px) {\n\t\t.shell-status-banner {\n\t\t\tmin-height: 32px;\n\t\t\tpadding: 0 8px;\n\t\t}\n\n\t\t.shell-status-banner__message {\n\t\t\tpadding: 6px 0;\n\t\t\tfont-size: 12px;\n\t\t}\n\t}\n</style>\n@if (isDevice) {\n\t<link rel="stylesheet" type="text/css" href="/assets/css/tablet.css" />\n}\n<div #shell [style.height.px]="isDevice && showNavigationMenu ? windowSizeHeight : null" [style.overflow]="isDevice && showNavigationMenu ? \'hidden\' : null">\n\t@if (user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** OFFLINE MODE ***</div>\n\t\t</div>\n\t}\n\t@if (!user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** PLEASE LOGIN ***</div>\n\t\t</div>\n\t}\n\t@if (status) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer" [title]="status.message">*** {{ status.message }} ***</div>\n\t\t</div>\n\t}\n\t@if (fullScreen) {\n\t\t<router-outlet name="jobboardfsoutlet"></router-outlet>\n\t}\n\t<div [ngClass]="[\'container-fluid\', fullScreen ? \'hideThis\' : \'\']" [style.font-size.px]="fontSize">\n\t\t<div class="dontPrint">\n\t\t\t<navbar-main style="width: 100%" tourAnchor="navBarMain" #navBarMain [logo]="logo" [showSupport]="showSupport" [navTabs]="navTabs" [fontSize]="fontSize" [publicProgram]="publicProgram || digitalSign" [digitalSign]="digitalSign" [aiAssistantVisible]="aiAssistantEnabled && isConnected" (aiToggle)="toggleAiAssistant()"></navbar-main>\n\t\t</div>\n\t\t<rio-core-tour-overlay></rio-core-tour-overlay>\n\t\t<ng-template ngbModalContainer></ng-template>\n\t\t@if (aiAssistantEnabled && user && isConnected && !isDevice && windowSizeWidth > 1200 && !digitalSign && !publicProgram) {\n\t\t\t<rio-ai-assistant\n\t\t\t\t[idClient]="resolveAiAssistantClientId()"\n\t\t\t\t[idApp]="aiAssistantAppId"\n\t\t\t\t[config]="aiAssistantConfig"\n\t\t\t\t[open]="aiAssistantOpen"\n\t\t\t\t[currentRoute]="currentRoute"\n\t\t\t\t[topOffset]="getAiAssistantTopOffset()"\n\t\t\t\t[panelHeight]="getAiAssistantHeight()"\n\t\t\t\t(openRequested)="openAiAssistant()"\n\t\t\t\t(closed)="closeAiAssistant()"></rio-ai-assistant>\n\t\t}\n\t\t\t<div class="row">\n\t\t\t\t@if (showNavbarModule && !digitalSign) {\n\t\t\t\t\t<div id="navSid" [ngClass]="[\'dontPrint\', windowSizeWidth > 1200 && collapsableMenu ? \'navSidbar\' : \'col-xl-1\']" [style.width]="windowSizeWidth > 1200 && collapsableMenu ? \'40px\' : windowSizeWidth > 1200 ? \'\' : \'100%\'" [style.margin-top.px]="windowSizeWidth > 1200 && collapsableMenu ? navbarMainHeight + statusHeight + connectedHeight : 0">\n\t\t\t\t\t\t@if (windowSizeWidth > 1200 && collapsableMenu) {\n\t\t\t\t\t\t\t<div class="openbtn" (mouseenter)="openNav()"><span>MENU</span></div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<div [ngClass]="windowSizeWidth > 1200 && collapsableMenu ? \'sid_inr\' : \'\'">\n\t\t\t\t\t\t\t<navbar-module #navBarModule tourAnchor="navBarModule" [sideNavWidth]="windowSizeWidth > 1200 && collapsableMenu ? \'90%\' : \'auto\'" [sideNavHeight]="windowSizeWidth > 1200 ? windowSizeHeight - navbarMainHeight - statusHeight - connectedHeight - (showNavigationMenu ? 54 + getNavbarModuleHeight() : 0) - 20 : \'\'"></navbar-module>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div [id]="windowSizeWidth > 1200 ? \'main_cont\' : \'main_cont_mobile\'" [ngClass]="[windowSizeWidth > 1200 && collapsableMenu ? \'col-xl-12\' : \'col-xl-11\']" [style.padding-left]="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? 45 + \'px\' : null" [style.padding-right.px]="getAiAssistantReservedWidth()" (mouseenter)="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? closeNav() : null" style="padding-top: 5px">\n\t\t\t\t\t<div style="-webkit-overflow-scrolling: touch" [style.overflow-y]="isDevice && !showNavigationMenu ? \'initial\' : \'scroll\'" [style.height.px]="getMainScrollHeight()" class="removeOverflow scroll-shell">\n\t\t\t\t\t\t<router-outlet></router-outlet>\n\t\t\t\t\t\t<div class="scroll-bottom-spacer" [style.height.px]="getBottomNavSpacerHeight()" aria-hidden="true"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t@if (isDevice) {\n\t\t\t\t\t<div #mobileResolveioFooter class="mobile-resolveio-footer dontPrint" [class.with-mobile-nav]="showNavigationMenu">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t\t@if (isDevice && showNavigationMenu) {\n\t\t\t\t\t<div #mobileNavigationBar class="mobile-navigation-bar dontPrint">\n\t\t\t\t\t\t<table style="width: 100%">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushBackButton()"><i class="fa fa-arrow-left" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushReloadButton()"><i class="fa fa-refresh" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushForwardButton()"><i class="fa fa-arrow-right" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!isDevice) {\n\t\t\t\t\t<div style="text-align: center; height: 20px; font-style: italic; font-weight: bold; background-color: lightgray; margin-left: -15px; margin-right: -15px">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n'}]}],ctorParameters:()=>[{type:i1$5.DeviceDetectorService},{type:DialogService},{type:ResizeService},{type:ProviderService},{type:OfflineManagerService},{type:LocalStorageService},{type:AuthService},{type:AuthPermissionService},{type:FeatureGateService},{type:CoreTourService}],propDecorators:{environment:[{type:Input,args:["environment"]}],logo:[{type:Input,args:["logo"]}],navTabs:[{type:Input,args:["navTabs"]}],userHasPhoneNumber:[{type:Input,args:["userHasPhoneNumber"]}],client:[{type:Input,args:["client"]}],showNavbarModule:[{type:Input,args:["showNavbarModule"]}],publicProgram:[{type:Input,args:["publicProgram"]}],showSupport:[{type:Input,args:["showSupport"]}],aiAssistantEnabled:[{type:Input,args:["aiAssistantEnabled"]}],tourStops:[{type:Input,args:["tourStops"]}],el_navBarMain:[{type:ViewChild,args:["navBarMain",{read:ElementRef,static:!0}]}],el_navBarModule:[{type:ViewChild,args:["navBarModule",{read:ElementRef,static:!0}]}],el_mobileNavigationBar:[{type:ViewChild,args:["mobileNavigationBar",{read:ElementRef}]}],el_mobileResolveioFooter:[{type:ViewChild,args:["mobileResolveioFooter",{read:ElementRef}]}]}});class HomeComponent extends BaseComponent{_route;auth;_services;_http;_app;menuData={title:"Home",module:null,description:null,description_name:null,tabs:[{link:"home",params:null,label:"Home"}]};selectedSolution="Asset";loggingOut$=null;subscription$=null;isLoggedIn;form;constructor(t,e,n,o,r){super(n),this._route=t,this.auth=e,this._services=n,this._http=o,this._app=r}ngOnInit(){this._services._app.setNavbarModuleData(this.menuData),this.loggingOut$=this._app.isLoggingOut.subscribe(t=>{t||(this._services._account.getUser()?this._services._account.getUser().settings&&this._services._account.getUser().settings.opening_route&&"/home"!==this._services._account.getUser().settings.opening_route?this._services._router.navigateByUrl(this._services._account.getUser().settings.opening_route):"/home"!==this._services._router.url&&this._services._router.navigateByUrl("/home"):(this.subscription$&&this.subscription$.unsubscribe(),this.subscription$=this._services._account.user.subscribe(t=>{t&&t.settings&&t.settings.opening_route&&"/home"!==t.settings.opening_route?this._services._router.navigateByUrl(t.settings.opening_route):"/home"!==this._services._router.url&&this._services._router.navigateByUrl("/home")},()=>{})))})}ngOnDestroy(){this.subscription$&&this.subscription$.unsubscribe(),this.loggingOut$&&this.loggingOut$.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HomeComponent,deps:[{token:i1$1.ActivatedRoute},{token:AuthService},{token:ProviderService},{token:i4.HttpClient},{token:CoreService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:HomeComponent,isStandalone:!1,selector:"resolveio-home",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<div class="home-hero h-100">\n\t<div class="row h-100 m-0">\n\t\t<div class="col-lg-12 h-100">\n\t\t\t<div class="jumbotron jumbotron-fluid h-100 home-hero__jumbotron">\n\t\t\t\t<div class="container text-center h-100 home-hero__container">\n\t\t\t\t\t<img src="/assets/images/ResolveIO.png" class="img-fluid home-hero__logo" alt="ResolveIO logo" />\n\t\t\t\t\t<p class="home-hero__tagline">The All-in-One Solution Software</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".home-hero{height:100%;overflow-x:hidden}.home-hero__jumbotron{padding-bottom:0}.home-hero__container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding-left:1.5rem;padding-right:1.5rem}.home-hero__logo{width:100%;max-width:750px;height:auto;object-fit:contain}.home-hero__tagline{font-size:24px;font-style:italic}@media(max-width:767.98px){.home-hero__container{padding-left:1.25rem;padding-right:1.25rem}.home-hero__tagline{font-size:18px}}\n"]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HomeComponent,decorators:[{type:Component,args:[{selector:"resolveio-home",providers:[ProviderService],standalone:!1,template:'<div class="home-hero h-100">\n\t<div class="row h-100 m-0">\n\t\t<div class="col-lg-12 h-100">\n\t\t\t<div class="jumbotron jumbotron-fluid h-100 home-hero__jumbotron">\n\t\t\t\t<div class="container text-center h-100 home-hero__container">\n\t\t\t\t\t<img src="/assets/images/ResolveIO.png" class="img-fluid home-hero__logo" alt="ResolveIO logo" />\n\t\t\t\t\t<p class="home-hero__tagline">The All-in-One Solution Software</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".home-hero{height:100%;overflow-x:hidden}.home-hero__jumbotron{padding-bottom:0}.home-hero__container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding-left:1.5rem;padding-right:1.5rem}.home-hero__logo{width:100%;max-width:750px;height:auto;object-fit:contain}.home-hero__tagline{font-size:24px;font-style:italic}@media(max-width:767.98px){.home-hero__container{padding-left:1.25rem;padding-right:1.25rem}.home-hero__tagline{font-size:18px}}\n"]}]}],ctorParameters:()=>[{type:i1$1.ActivatedRoute},{type:AuthService},{type:ProviderService},{type:i4.HttpClient},{type:CoreService}]});class UserRoleComponent extends BaseComponent{_services;role;constructor(t){super(t),this._services=t}userInRole(){return this._services._account.isUserInView(this.role)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleComponent,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:UserRoleComponent,isStandalone:!1,selector:"user-role",inputs:{role:"role"},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"@if (userInRole()) {<ng-content></ng-content>}",isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"user-role",template:"@if (userInRole()) {<ng-content></ng-content>}",standalone:!1}]}],ctorParameters:()=>[{type:ProviderService}],propDecorators:{role:[{type:Input}]}});class UserRoleModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,declarations:[UserRoleComponent],imports:[CommonModule],exports:[UserRoleComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,imports:[CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,decorators:[{type:NgModule,args:[{imports:[CommonModule],exports:[UserRoleComponent],declarations:[UserRoleComponent]}]}]});class FormButtonModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,declarations:[FormButtonComponent],imports:[CommonModule,NgbTooltipModule],exports:[FormButtonComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,imports:[CommonModule,NgbTooltipModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,decorators:[{type:NgModule,args:[{imports:[CommonModule,NgbTooltipModule],exports:[FormButtonComponent],declarations:[FormButtonComponent]}]}]});class ResponsiveButtonGroupModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,declarations:[ResponsiveButtonGroupComponent],imports:[CommonModule],exports:[ResponsiveButtonGroupComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,imports:[CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,decorators:[{type:NgModule,args:[{imports:[CommonModule],declarations:[ResponsiveButtonGroupComponent],exports:[ResponsiveButtonGroupComponent]}]}]});class CollapseTableModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,declarations:[CollapseTableComponent],imports:[FormsModule,CommonModule],exports:[CollapseTableComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,providers:[ResizeService],imports:[FormsModule,CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,decorators:[{type:NgModule,args:[{imports:[FormsModule,CommonModule],exports:[CollapseTableComponent],declarations:[CollapseTableComponent],providers:[ResizeService]}]}]});class PhonePipe{transform(t){if(!t)return"";let e,n,o;switch((t=(t=(t=(t=t.replace(new RegExp("-","g"),"")).replace(new RegExp(" ","g"),"")).replace("(","")).replace(")","")).length){case 10:e=1,n=t.slice(0,3),o=t.slice(3);break;case 11:e=t[0],n=t.slice(1,4),o=t.slice(4);break;case 12:e=t.slice(0,3),n=t.slice(3,5),o=t.slice(5);break;default:return t}return 1===e&&(e=""),o=o.slice(0,3)+"-"+o.slice(3),(e+" ("+n+") "+o).trim()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PhonePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:PhonePipe,isStandalone:!1,name:"phone"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PhonePipe,decorators:[{type:Pipe,args:[{name:"phone",standalone:!1}]}]});class ReversePipe{transform(t){return t.slice(0).reverse()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ReversePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:ReversePipe,isStandalone:!1,name:"reverse"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ReversePipe,decorators:[{type:Pipe,args:[{name:"reverse",standalone:!1}]}]});class MinusCurrencyPipe{transform(t,e){return"-"===t.charAt(0)?"("+t.substring(1,t.length)+")":t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:MinusCurrencyPipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:MinusCurrencyPipe,isStandalone:!1,name:"minusCurrency"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:MinusCurrencyPipe,decorators:[{type:Pipe,args:[{name:"minusCurrency",standalone:!1}]}]});class TitleCaseAndUnderscorePipe{transform(t){let e=t.replace("_"," ").toLowerCase().split(" ");for(let t=0;t<e.length;t++)e[t]=e[t].charAt(0).toUpperCase()+e[t].slice(1);return e.join(" ")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TitleCaseAndUnderscorePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:TitleCaseAndUnderscorePipe,isStandalone:!1,name:"titleCase",pure:!1})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TitleCaseAndUnderscorePipe,decorators:[{type:Pipe,args:[{name:"titleCase",pure:!1,standalone:!1}]}]});class JsonParsePipe{transform(t){let e=null,n=!1;try{e=JSON.parse(t,dateReviver)}catch(t){n=!0}return n?t:JSON.stringify(e,null,2)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:JsonParsePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:JsonParsePipe,isStandalone:!1,name:"jsonParse",pure:!1})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:JsonParsePipe,decorators:[{type:Pipe,args:[{name:"jsonParse",pure:!1,standalone:!1}]}]});class PipeModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PipeModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:PipeModule,declarations:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe],exports:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PipeModule})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PipeModule,decorators:[{type:NgModule,args:[{declarations:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe],exports:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe]}]}]});class SortTableDirective{element;sortables=new Map;_stateChanges=new Subject;active;start=1;disabled=!1;tableFixed=!1;headerFixed=!1;secondaryColor=!1;tertiaryColor=!1;get direction(){return this._direction}set direction(t){if(t&&-1!==t&&1!==t)throw Error(t+" is not a valid sort direction (0 or 1).");this._direction=t}_direction=0;_data=new BehaviorSubject([]);sortChange=new EventEmitter;constructor(t){this.element=t}register(t){if(!t.id)throw Error("CTSortHeader must be provided with a unique id");if(this.sortables.has(t.id))throw Error("Cannot have two CTSortables with the same id "+t.id);this.sortables.set(t.id,t)}deregister(t){this.sortables.delete(t.id)}sort(t){if(this.active!=t.id?(this.active=t.id,this.direction=t.start?t.start:this.start):this.direction*=-1,this.sortChange.emit({active:this.active,direction:this.direction}),this._data.value.length){let e=null;for(let n=0;n<this._data.value.length;n++)if(t.id.split(".").reduce((t,e)=>t[e],this._data.value[n])){e=t.id.split(".").reduce((t,e)=>t[e],this._data.value[n]);break}if(null!=e)if("string"==typeof e){let e=new RegExp(/^[\d.,$]+$/);this._data.value.filter(e=>t.id.split(".").reduce((t,e)=>t[e],e)).some(n=>!e.test(t.id.split(".").reduce((t,e)=>t[e],n)))?1===this.direction?this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],e)||"zzzzzz").localeCompare(t.id.split(".").reduce((t,e)=>t[e],n)||"zzzzzz"))):this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],n)||"AAAAAAA").localeCompare(t.id.split(".").reduce((t,e)=>t[e],e)||"AAAAAAA"))):1===this.direction?this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],e)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],e).replace(/\$/g,"").replace(",","")):999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],n)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],n).replace(/\$/g,"").replace(",","")):999999999999))):this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],n)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],n).replace(/\$/g,"").replace(",","")):-999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],e)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],e).replace(/\$/g,"").replace(",","")):-999999999999)))}else"number"==typeof e?1===this.direction?this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e):999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n):999999999999))):this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n):-999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e):-999999999999))):e instanceof Date?1===this.direction?this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e).getTime():0)-(t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n).getTime():0))):this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n).getTime():0)-(t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e).getTime():0))):"boolean"==typeof e?this._data.next(this._data.value.sort((e,n)=>t.id.split(".").reduce((t,e)=>t[e],e)===t.id.split(".").reduce((t,e)=>t[e],n)?0:t.id.split(".").reduce((t,e)=>t[e],e)?1===this.direction?-1:1:1===this.direction?1:-1)):this._data.next(this._data.value.sort((e,n)=>t.id.split(".").reduce((t,e)=>t[e],e)===t.id.split(".").reduce((t,e)=>t[e],n)?0:t.id.split(".").reduce((t,e)=>t[e],e)>t.id.split(".").reduce((t,e)=>t[e],n)?-1:1))}}getData(){return this._data.asObservable()}setData(t){this._data.next(t)}ngOnInit(){}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableDirective,deps:[{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:SortTableDirective,isStandalone:!1,selector:"[sortable]",inputs:{active:["sortActive","active"],start:["sortStart","start"],disabled:["sortDisabled","disabled"],tableFixed:"tableFixed",headerFixed:"headerFixed",secondaryColor:"secondaryColor",tertiaryColor:"tertiaryColor"},outputs:{sortChange:"sortChange"},usesOnChanges:!0,ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableDirective,decorators:[{type:Directive,args:[{selector:"[sortable]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef}],propDecorators:{active:[{type:Input,args:["sortActive"]}],start:[{type:Input,args:["sortStart"]}],disabled:[{type:Input,args:["sortDisabled"]}],tableFixed:[{type:Input}],headerFixed:[{type:Input}],secondaryColor:[{type:Input}],tertiaryColor:[{type:Input}],sortChange:[{type:Output,args:["sortChange"]}]}});class SortTableHeaderComponent{_sort;_arrowDirection=0;id;arrowPosition="after";start;_rerenderSubscription;disabled;constructor(t,e){if(this._sort=e,!e)throw Error("SortTableSortHeader must be placed within a parent element with the CTSortable directive.");this._rerenderSubscription=merge(e.sortChange,e._stateChanges).subscribe(()=>{this._isSorted()&&this._updateArrowDirection(),t.markForCheck()})}ngOnInit(){this._sort.register(this)}ngOnDestroy(){this._sort.deregister(this),this._rerenderSubscription.unsubscribe()}_isSorted(){return this._sort.active===this.id}_getSortDirection(){return this._sort.direction}_updateArrowDirection(){this._arrowDirection=this._isSorted()?this._sort.direction:this.start||this._sort.start}_isDisabled(){return this._sort.disabled||this.disabled}onClick(t){this._isDisabled()||this._sort.sort(this)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableHeaderComponent,deps:[{token:i0.ChangeDetectorRef},{token:SortTableDirective,optional:!0}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:SortTableHeaderComponent,isStandalone:!1,selector:"[sort-table-header]",inputs:{disabled:"disabled",id:["sort-table-header","id"],arrowPosition:"arrowPosition",start:"start"},ngImport:i0,template:'<div (click)="onClick($event)">\n\t<ng-content></ng-content>\n\t@if (_isSorted() && _getSortDirection() === -1) {\n\t\t<i class="fa fa-arrow-down" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n\t@if (_isSorted() && _getSortDirection() === 1) {\n\t\t<i class="fa fa-arrow-up" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n</div>\n',changeDetection:i0.ChangeDetectionStrategy.OnPush,encapsulation:i0.ViewEncapsulation.None})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableHeaderComponent,decorators:[{type:Component,args:[{selector:"[sort-table-header]",encapsulation:ViewEncapsulation.None,changeDetection:ChangeDetectionStrategy.OnPush,inputs:["disabled"],standalone:!1,template:'<div (click)="onClick($event)">\n\t<ng-content></ng-content>\n\t@if (_isSorted() && _getSortDirection() === -1) {\n\t\t<i class="fa fa-arrow-down" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n\t@if (_isSorted() && _getSortDirection() === 1) {\n\t\t<i class="fa fa-arrow-up" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n</div>\n'}]}],ctorParameters:()=>[{type:i0.ChangeDetectorRef},{type:SortTableDirective,decorators:[{type:Optional}]}],propDecorators:{id:[{type:Input,args:["sort-table-header"]}],arrowPosition:[{type:Input}],start:[{type:Input}],disabled:[{type:Input}]}});class SortTableNgForComponent{_sort;data=[];dataChanged=new EventEmitter;sortSub$=null;sortedData=[];constructor(t){if(this._sort=t,!t)throw Error("SortTableNgFor must be placed within a parent element with the CTSortable directive.")}ngOnInit(){this.sortSub$=this._sort.getData().subscribe(t=>{this.sortedData=t,this.dataChanged.emit(this.sortedData)})}ngOnChanges(){this._sort.setData(this.data)}ngOnDestroy(){this.sortSub$.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableNgForComponent,deps:[{token:SortTableDirective,optional:!0}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:SortTableNgForComponent,isStandalone:!1,selector:"[sort-table-ngfor]",inputs:{data:["sort-table-ngfor","data"]},outputs:{dataChanged:"dataChanged"},usesOnChanges:!0,ngImport:i0,template:"<ng-content></ng-content>",isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableNgForComponent,decorators:[{type:Component,args:[{selector:"[sort-table-ngfor]",template:"<ng-content></ng-content>",standalone:!1}]}],ctorParameters:()=>[{type:SortTableDirective,decorators:[{type:Optional}]}],propDecorators:{data:[{type:Input,args:["sort-table-ngfor"]}],dataChanged:[{type:Output}]}});class SortTableModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,declarations:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent],imports:[FormsModule,CommonModule],exports:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,imports:[FormsModule,CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,decorators:[{type:NgModule,args:[{imports:[FormsModule,CommonModule],exports:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent],declarations:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent]}]}]});class Sortable{container;options;dragItem;startIndex;listeners=[];direction;swapThreshold;constructor(t,e={}){this.container=t,this.options=e,this.direction=this.resolveDirection(),this.swapThreshold=this.resolveSwapThreshold(),this.bindListeners(),this.ensureDraggable()}static create(t,e={}){return new Sortable(t,e)}destroy(){this.listeners.forEach(t=>t()),this.listeners=[],this.dragItem=void 0,this.startIndex=void 0}bindListeners(){const t=(t,e)=>{this.container.addEventListener(t,e),this.listeners.push(()=>this.container.removeEventListener(t,e))};t("dragstart",this.handleDragStart),t("dragover",this.handleDragOver),t("drop",this.handleDrop),t("dragend",this.handleDragEnd)}handleDragStart=t=>{const e=this.getSortableElement(t.target);if(e&&this.hasValidHandle(t.target,e)&&(this.ensureDraggable(),this.dragItem=e,this.startIndex=this.getElementIndex(e),t.dataTransfer)){t.dataTransfer.effectAllowed="move";try{t.dataTransfer.setData("text/plain","")}catch{}}};handleDragOver=t=>{if(!this.dragItem)return;const e=this.getSortableElement(t.target);if(!e||e===this.dragItem)return;t.preventDefault();const n=e.getBoundingClientRect(),o=("horizontal"===this.direction?t.clientX-n.left>n.width*this.swapThreshold:t.clientY-n.top>n.height*this.swapThreshold)?e.nextElementSibling:e;o!==this.dragItem&&this.container.insertBefore(this.dragItem,o)};handleDrop=t=>{this.dragItem&&(t.preventDefault(),this.finish(t))};handleDragEnd=t=>{this.dragItem&&(t.preventDefault(),this.finish(t))};finish(t){if(!this.dragItem)return;const e=this.getElementIndex(this.dragItem),n={oldIndex:this.startIndex,newIndex:e,item:this.dragItem,from:this.container,to:this.container};this.options.onEnd&&this.options.onEnd(n),this.options.onUpdate&&void 0!==this.startIndex&&e!==this.startIndex&&this.options.onUpdate(n),this.dragItem=void 0,this.startIndex=void 0}ensureDraggable(){this.getItems().forEach(t=>{t.getAttribute("draggable")||t.setAttribute("draggable","true")})}getItems(){return(this.options.draggable?Array.from(this.container.querySelectorAll(this.options.draggable)):Array.from(this.container.children)).filter(t=>t.parentElement===this.container)}getSortableElement(t){if(!t)return null;let e=t;for(;e&&e!==this.container;){if(this.isSortableItem(e))return e;e=e.parentElement}return null}isSortableItem(t){return this.options.draggable?t.matches(this.options.draggable)&&t.parentElement===this.container:t.parentElement===this.container}hasValidHandle(t,e){if(!this.options.handle||!t)return!0;const n=t.closest(this.options.handle);return!!n&&e.contains(n)}getElementIndex(t){return this.getItems().indexOf(t)}resolveDirection(){if("horizontal"===this.options.direction||"vertical"===this.options.direction)return this.options.direction;const t=this.container.tagName.toLowerCase();if("tr"===t)return"horizontal";if("tbody"===t||"ul"===t||"ol"===t)return"vertical";const e=window.getComputedStyle(this.container),n="flex"===e.display&&e.flexDirection.startsWith("row"),o="grid"===e.display&&e.gridAutoFlow.includes("column");return n||o?"horizontal":"vertical"}resolveSwapThreshold(){const t="number"==typeof this.options.swapThreshold?this.options.swapThreshold:.45;return t>0&&t<1?t:.45}}const SORTABLEJS_DEFAULT_OPTIONS=new InjectionToken("SORTABLEJS_DEFAULT_OPTIONS");class SortablejsDirective{_el;defaultOptions;items;options;sortableInstance;constructor(t,e){this._el=t,this.defaultOptions=e}ngOnInit(){const t={animation:150,onEnd:t=>{this.updateOrder(t),this.options&&"function"==typeof this.options.onEnd&&this.options.onEnd(t),this.options&&"function"==typeof this.options.onUpdate&&t.oldIndex!==t.newIndex&&this.options.onUpdate(t)}},e=Object.assign({},t,this.defaultOptions||{},this.options||{});this.sortableInstance=Sortable.create(this._el.nativeElement,e)}ngOnDestroy(){this.sortableInstance&&this.sortableInstance.destroy()}updateOrder(t){if(this.items&&void 0!==t.oldIndex&&void 0!==t.newIndex&&t.oldIndex!==t.newIndex)if(this.isFormArray(this.items)){const e=this.items.at(t.oldIndex);this.items.removeAt(t.oldIndex),this.items.insert(t.newIndex,e)}else if(Array.isArray(this.items)){const e=this.items.splice(t.oldIndex,1)[0];this.items.splice(t.newIndex,0,e)}}isFormArray(t){return t&&"function"==typeof t.at&&"function"==typeof t.removeAt&&"function"==typeof t.insert}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsDirective,deps:[{token:i0.ElementRef},{token:SORTABLEJS_DEFAULT_OPTIONS,optional:!0}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:SortablejsDirective,isStandalone:!1,selector:"[sortablejs]",inputs:{items:["sortablejs","items"],options:["sortablejsOptions","options"]},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsDirective,decorators:[{type:Directive,args:[{selector:"[sortablejs]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:void 0,decorators:[{type:Optional},{type:Inject,args:[SORTABLEJS_DEFAULT_OPTIONS]}]}],propDecorators:{items:[{type:Input,args:["sortablejs"]}],options:[{type:Input,args:["sortablejsOptions"]}]}});class SortablejsModule{static forRoot(t){return{ngModule:SortablejsModule,providers:t?[{provide:SORTABLEJS_DEFAULT_OPTIONS,useValue:t}]:[]}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule,declarations:[SortablejsDirective],exports:[SortablejsDirective]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule,decorators:[{type:NgModule,args:[{declarations:[SortablejsDirective],exports:[SortablejsDirective]}]}]});class NgDragDropService{dragData;dragEffect=null;scope=null;onDragStart=new Subject;onDragEnd=new Subject;static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});class DomHelper{static addClass(t,e){const n=this.resolveElement(t);n&&(n.classList.contains(e)||n.classList.add(e))}static removeClass(t,e){const n=this.resolveElement(t);n&&n.classList.remove(e)}static matches(t,e){if(!t)return!1;const n=t.matches||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector;return!!n&&n.call(t,e)}static resolveElement(t){return t?t.nativeElement?t.nativeElement:t:null}}class Draggable{el;renderer;ng2DragDropService;zone;dragData;dragHandle;dragEffect="move";dragScope="default";dragHandleClass="drag-handle";dragClass="drag-border";dragTransitClass="drag-transit";onDragStart=new EventEmitter;onDrag=new EventEmitter;onDragEnd=new EventEmitter;mouseDownElement;_dragEnabled=!0;_dragImage;dragImageElement;unbindDragListener;constructor(t,e,n,o){this.el=t,this.renderer=e,this.ng2DragDropService=n,this.zone=o}get dragEnabled(){return this._dragEnabled}set dragEnabled(t){this._dragEnabled=t,this.applyDragHandleClass()}get dragImage(){return this._dragImage}set dragImage(t){this._dragImage=t,this.dragImageElement=new Image,this.dragImageElement.src=this._dragImage}ngOnInit(){this.applyDragHandleClass()}ngOnDestroy(){this.unbindDragListeners()}dragStart(t){if(this.allowDrag()){DomHelper.addClass(this.el,this.dragTransitClass),setTimeout(()=>{DomHelper.addClass(this.el,this.dragClass),DomHelper.removeClass(this.el,this.dragTransitClass)},10),this.ng2DragDropService.dragData=this.dragData,this.ng2DragDropService.scope=this.dragScope,this.ng2DragDropService.dragEffect=this.dragEffect;const e=this.getDragHandleElement();e&&this.updateCursor(e,"grabbing"),null!=t.dataTransfer&&(t.dataTransfer.effectAllowed=this.dragEffect,t.dataTransfer.dropEffect=this.dragEffect,t.dataTransfer.setData("text","")),this.dragImage&&t.dataTransfer&&t.dataTransfer.setDragImage(this.dragImageElement,0,0),t.stopPropagation(),this.onDragStart.emit(t),this.ng2DragDropService.onDragStart.next(),this.zone.runOutsideAngular(()=>{this.unbindDragListener=this.renderer.listen(this.el.nativeElement,"drag",t=>{this.drag(t)})})}else t.preventDefault()}drag(t){this.onDrag.emit(t)}dragEnd(t){this.unbindDragListeners(),DomHelper.removeClass(this.el,this.dragClass),this.ng2DragDropService.dragData=null,this.ng2DragDropService.dragEffect=null,this.ng2DragDropService.scope=null;const e=this.getDragHandleElement();e&&this.updateCursor(e,this.dragEnabled?"grab":null),this.ng2DragDropService.onDragEnd.next(),this.onDragEnd.emit(t),t.stopPropagation(),t.preventDefault()}mousedown(t){this.mouseDownElement=t.target}allowDrag(){return this.dragHandle?DomHelper.matches(this.mouseDownElement,this.dragHandle)&&this.dragEnabled:this.dragEnabled}applyDragHandleClass(){const t=this.getDragHandleElement();t&&(this.dragEnabled?DomHelper.addClass(t,this.dragHandleClass):DomHelper.removeClass(t,this.dragHandleClass),this.updateCursor(t,this.dragEnabled?"grab":null))}getDragHandleElement(){let t=this.el.nativeElement;return this.dragHandle&&(t=this.el.nativeElement.querySelector(this.dragHandle)),t}unbindDragListeners(){this.unbindDragListener&&this.unbindDragListener()}updateCursor(t,e){e?this.renderer.setStyle(t,"cursor",e):this.renderer.removeStyle(t,"cursor")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Draggable,deps:[{token:i0.ElementRef},{token:i0.Renderer2},{token:NgDragDropService},{token:i0.NgZone}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:Draggable,isStandalone:!1,selector:"[draggable]",inputs:{dragData:"dragData",dragHandle:"dragHandle",dragEffect:"dragEffect",dragScope:"dragScope",dragHandleClass:"dragHandleClass",dragClass:"dragClass",dragTransitClass:"dragTransitClass",dragEnabled:"dragEnabled",dragImage:"dragImage"},outputs:{onDragStart:"onDragStart",onDrag:"onDrag",onDragEnd:"onDragEnd"},host:{listeners:{dragstart:"dragStart($event)",dragend:"dragEnd($event)",mousedown:"mousedown($event)",touchstart:"mousedown($event)"},properties:{draggable:"this.dragEnabled"}},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Draggable,decorators:[{type:Directive,args:[{selector:"[draggable]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:i0.Renderer2},{type:NgDragDropService},{type:i0.NgZone}],propDecorators:{dragData:[{type:Input}],dragHandle:[{type:Input}],dragEffect:[{type:Input}],dragScope:[{type:Input}],dragHandleClass:[{type:Input}],dragClass:[{type:Input}],dragTransitClass:[{type:Input}],onDragStart:[{type:Output}],onDrag:[{type:Output}],onDragEnd:[{type:Output}],dragEnabled:[{type:Input},{type:HostBinding,args:["draggable"]}],dragImage:[{type:Input}],dragStart:[{type:HostListener,args:["dragstart",["$event"]]}],dragEnd:[{type:HostListener,args:["dragend",["$event"]]}],mousedown:[{type:HostListener,args:["mousedown",["$event"]]},{type:HostListener,args:["touchstart",["$event"]]}]}});class DropEvent{nativeEvent;dragData;constructor(t,e){this.nativeEvent=t,this.dragData=e}}class Droppable{el;renderer;ng2DragDropService;zone;onDragEnter=new EventEmitter;onDragOver=new EventEmitter;onDragLeave=new EventEmitter;onDrop=new EventEmitter;dragOverClass="drag-over-border";dragHintClass="drag-hint-border";dropScope="default";_dropEnabled=!0;_isDragActive=!1;_isServiceActive=!1;dragStartSubscription;dragEndSubscription;unbindDragEnterListener;unbindDragOverListener;unbindDragLeaveListener;constructor(t,e,n,o){this.el=t,this.renderer=e,this.ng2DragDropService=n,this.zone=o}get dropEnabled(){return this._dropEnabled}set dropEnabled(t){this._dropEnabled=t,!0===this._dropEnabled?this.subscribeService():this.unsubscribeService()}ngOnInit(){!0===this.dropEnabled&&this.subscribeService()}ngOnDestroy(){this.unsubscribeService(),this.unbindDragListeners()}drop(t){this.allowDrop().subscribe(e=>{e&&this._isDragActive&&(DomHelper.removeClass(this.el,this.dragOverClass),t.preventDefault(),t.stopPropagation(),this.ng2DragDropService.onDragEnd.next(),this.onDrop.emit(new DropEvent(t,this.ng2DragDropService.dragData)),this.ng2DragDropService.dragData=null,this.ng2DragDropService.dragEffect=null,this.ng2DragDropService.scope=null)})}dragEnter(t){t.preventDefault(),t.stopPropagation(),this.onDragEnter.emit(t)}dragOver(t,e){if(e){if(DomHelper.addClass(this.el,this.dragOverClass),t.dataTransfer){const e=this.ng2DragDropService.dragEffect??"move";t.dataTransfer.dropEffect=e}t.preventDefault(),this.onDragOver.emit(t)}}dragLeave(t){DomHelper.removeClass(this.el,this.dragOverClass),t.preventDefault(),this.onDragLeave.emit(t)}allowDrop(){let t=!1;if("string"==typeof this.dropScope)"string"==typeof this.ng2DragDropService.scope?t=this.ng2DragDropService.scope===this.dropScope:this.ng2DragDropService.scope instanceof Array&&(t=this.ng2DragDropService.scope.indexOf(this.dropScope)>-1);else if(this.dropScope instanceof Array)"string"==typeof this.ng2DragDropService.scope?t=this.dropScope.indexOf(this.ng2DragDropService.scope)>-1:this.ng2DragDropService.scope instanceof Array&&(t=this.dropScope.filter(t=>-1!==this.ng2DragDropService.scope.indexOf(t)).length>0);else if("function"==typeof this.dropScope&&(t=this.dropScope(this.ng2DragDropService.dragData),t instanceof Observable))return t.pipe(map(t=>t&&this.dropEnabled));return of(t&&this.dropEnabled)}subscribeService(){!0!==this._isServiceActive&&(this._isServiceActive=!0,this.dragStartSubscription=this.ng2DragDropService.onDragStart.subscribe(()=>{this._isDragActive=!0,this.allowDrop().subscribe(t=>{t&&this._isDragActive&&(DomHelper.addClass(this.el,this.dragHintClass),this.zone.runOutsideAngular(()=>{this.unbindDragEnterListener=this.renderer.listen(this.el.nativeElement,"dragenter",t=>{this.dragEnter(t)}),this.unbindDragOverListener=this.renderer.listen(this.el.nativeElement,"dragover",e=>{this.dragOver(e,t)}),this.unbindDragLeaveListener=this.renderer.listen(this.el.nativeElement,"dragleave",t=>{this.dragLeave(t)})}))})}),this.dragEndSubscription=this.ng2DragDropService.onDragEnd.subscribe(()=>{this._isDragActive=!1,DomHelper.removeClass(this.el,this.dragHintClass),this.unbindDragListeners()}))}unsubscribeService(){this._isServiceActive=!1,this.dragStartSubscription&&this.dragStartSubscription.unsubscribe(),this.dragEndSubscription&&this.dragEndSubscription.unsubscribe()}unbindDragListeners(){this.unbindDragEnterListener&&this.unbindDragEnterListener(),this.unbindDragOverListener&&this.unbindDragOverListener(),this.unbindDragLeaveListener&&this.unbindDragLeaveListener()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Droppable,deps:[{token:i0.ElementRef},{token:i0.Renderer2},{token:NgDragDropService},{token:i0.NgZone}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:Droppable,isStandalone:!1,selector:"[droppable]",inputs:{dragOverClass:"dragOverClass",dragHintClass:"dragHintClass",dropScope:"dropScope",dropEnabled:"dropEnabled"},outputs:{onDragEnter:"onDragEnter",onDragOver:"onDragOver",onDragLeave:"onDragLeave",onDrop:"onDrop"},host:{listeners:{drop:"drop($event)"}},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Droppable,decorators:[{type:Directive,args:[{selector:"[droppable]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:i0.Renderer2},{type:NgDragDropService},{type:i0.NgZone}],propDecorators:{onDragEnter:[{type:Output}],onDragOver:[{type:Output}],onDragLeave:[{type:Output}],onDrop:[{type:Output}],dragOverClass:[{type:Input}],dragHintClass:[{type:Input}],dropScope:[{type:Input}],dropEnabled:[{type:Input}],drop:[{type:HostListener,args:["drop",["$event"]]}]}});class NgDragDropModule{static forRoot(){return{ngModule:NgDragDropModule,providers:[NgDragDropService]}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule,declarations:[Draggable,Droppable],exports:[Draggable,Droppable]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule,decorators:[{type:NgModule,args:[{declarations:[Draggable,Droppable],exports:[Draggable,Droppable]}]}]});class SharedModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,imports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule],exports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,imports:[ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,decorators:[{type:NgModule,args:[{imports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule],exports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule]}]}]});class AiTerminalModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,declarations:[AiTerminalComponent],imports:[SharedModule],exports:[AiTerminalComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,decorators:[{type:NgModule,args:[{imports:[SharedModule],declarations:[AiTerminalComponent],exports:[AiTerminalComponent]}]}]});class FocusDirective{element;focus;constructor(t){this.element=t}ngOnChanges(){this.focus&&this.element.nativeElement.focus()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FocusDirective,deps:[{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:FocusDirective,isStandalone:!1,selector:"[focus]",inputs:{focus:"focus"},usesOnChanges:!0,ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FocusDirective,decorators:[{type:Directive,args:[{selector:"[focus]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef}],propDecorators:{focus:[{type:Input}]}});class RioSelectStickyAdapterService{_account;_socket;constructor(t,e){this._account=t,this._socket=e}get userChanges(){return this._account.user.asObservable()}getUser(){return this._account.getUser()}saveStickySelects(t,e="rio-select"){const n=this._account.getUser();if(!n)return;const o={...n.other||{},stickySelects:t},r={...n,other:o};return this._account.setUser(r),this._socket.call("saveUserStickySelects",t,n._id).then(e=>{const o=this._account.getUser();if(!o||o._id!==n._id)return;const r=e?.stickySelects||t,i={...o,__v:e?.__v??o.__v,other:{...o.other||{},stickySelects:r}};this._account.setUser(i)}).catch(()=>{})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioSelectStickyAdapterService,deps:[{token:AccountManagerService},{token:SocketManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioSelectStickyAdapterService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioSelectStickyAdapterService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:AccountManagerService},{type:SocketManagerService}]});class AuthGuard{_router;_auth;_ds;_account;_app;_offline;_aps;_alert;_featureGates;redirectUrl;constructor(t,e,n,o,r,i,a,s,l){this._router=t,this._auth=e,this._ds=n,this._account=o,this._app=r,this._offline=i,this._aps=a,this._alert=s,this._featureGates=l}canActivate(t,e){return new Promise(t=>{this._account.isInitCompleted().then(()=>{let n=this._account.getUser();if(n||(n=this._offline.getUser(),n&&this._account.setUser(n)),n)if(n.active){let o=e.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,""),r=o.replace(/([^\/]+\/?$)/,"");if(this.isLinkGateEnabled(o))if(n.roles.super_admin)t(!0);else{let e=!1;for(;!e&&o.split("/").length>2;){if(!this.isLinkFakeRoute(o))if(n.roles.groups.some(t=>t.views.some(t=>t===o)))e=!0,t(!0);else if(n.roles.groups.some(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))){let o=n.roles.groups.filter(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))[0].views.filter(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t))[0];e=!0,this._router.navigateByUrl(o),t(!1)}r=r.replace(/([^\/]+\/?$)/,""),o=o.replace(/(\/[^\/]+$)/,"")}e||(this._router.navigateByUrl("/home"),t(!1))}else this._router.navigateByUrl("/home"),t(!1)}else this._router.navigateByUrl("/home"),t(!1);else if(navigator.onLine)this._auth.loginUser().then(o=>{this._account.isLoginCompleted().then(()=>{if(n=this._account.getUser(),n.active){let o=e.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,""),r=o.replace(/([^\/]+\/?$)/,"");if(this.isLinkGateEnabled(o))if(n.roles.super_admin)t(!0);else{let e=!1;for(;!e&&o.split("/").length>2;){if(!this.isLinkFakeRoute(o))if(n.roles.groups.some(t=>t.views.some(t=>t===o)))e=!0,t(!0);else if(n.roles.groups.some(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))){let o=n.roles.groups.filter(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))[0].views.filter(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t))[0];e=!0,this._router.navigateByUrl(o),t(!1)}r=r.replace(/([^\/]+\/?$)/,""),o=o.replace(/(\/[^\/]+$)/,"")}e||(this._router.navigateByUrl("/home"),t(!1))}else this._router.navigateByUrl("/home"),t(!1)}else this._router.navigateByUrl("/home"),t(!1)})},()=>{this._router.navigateByUrl("/home"),t(!1)});else{let n=e.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,"");this.isLinkGateEnabled(n)?t(!0):(this._router.navigateByUrl("/home"),t(!1))}},()=>{})})}doesLinkHaveParameter(t){let e=this._aps.getAllModulePermissions();for(let n=0;n<e.length;n++){let o=e[n];for(let e=0;e<o.views.length;e++){let n=o.views[e];if(n.link===t)return!!n.has_parameter}}return!1}isLinkGateEnabled(t){const e=this._aps.getAllModulePermissions();return this._featureGates.isLinkEnabled(t,e)}isLinkFakeRoute(t){let e=this._aps.getAllModulePermissions();for(let n=0;n<e.length;n++){let o=e[n];for(let e=0;e<o.views.length;e++){let n=o.views[e];if(n.link===t)return!!n.fake_route}}return!0}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthGuard,deps:[{token:i1$1.Router},{token:AuthService},{token:DialogService},{token:AccountManagerService},{token:CoreService},{token:OfflineManagerService},{token:AuthPermissionService},{token:AlertService},{token:FeatureGateService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthGuard})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthGuard,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1$1.Router},{type:AuthService},{type:DialogService},{type:AccountManagerService},{type:CoreService},{type:OfflineManagerService},{type:AuthPermissionService},{type:AlertService},{type:FeatureGateService}]});class CanDeactivateGuard{canDeactivate(t){return!t.canDeactivate||t.canDeactivate()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CanDeactivateGuard,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CanDeactivateGuard})}function getWindow(){return window}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CanDeactivateGuard,decorators:[{type:Injectable}]});class WindowRefService{get nativeWindow(){return getWindow()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:WindowRefService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:WindowRefService})}function rioDatePickerConfigFactory(t,e){return{resolveFirstDayOfWeek:()=>{const e=t.getUser()?.other?.date_picker_day_start;if("M"===e||"S"===e)return e;if("string"==typeof e){const t=e.toUpperCase();if("M"===t||"S"===t)return t}return 1===e?"M":7===e||0===e?"S":null},resolveTimezone:()=>e.environment.value?.TZ_CLIENT||null}}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:WindowRefService,decorators:[{type:Injectable}]});class CoreServicesModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,imports:[BrowserAnimationsModule,i1.ToastrModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,providers:[CoreService,AuthService,AuthGuard,CanDeactivateGuard,DialogService,ValidationService,AwsService,AuthPermissionService,FeatureGateService,WindowRefService,AlertService,SocketService,SocketManagerService,TokenManagerService,AccountManagerService,OfflineManagerService,DeviceDetectorService,LocalStorageService,RioSelectStickyAdapterService,{provide:RIO_SELECT_STICKY_ADAPTER,useExisting:RioSelectStickyAdapterService},{provide:RIO_DATE_PICKER_CONFIG,useFactory:rioDatePickerConfigFactory,deps:[AccountManagerService,CoreService]},provideHttpClient(withInterceptorsFromDi())],imports:[BrowserAnimationsModule,ToastrModule.forRoot()]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,decorators:[{type:NgModule,args:[{imports:[BrowserAnimationsModule,ToastrModule.forRoot()],providers:[CoreService,AuthService,AuthGuard,CanDeactivateGuard,DialogService,ValidationService,AwsService,AuthPermissionService,FeatureGateService,WindowRefService,AlertService,SocketService,SocketManagerService,TokenManagerService,AccountManagerService,OfflineManagerService,DeviceDetectorService,LocalStorageService,RioSelectStickyAdapterService,{provide:RIO_SELECT_STICKY_ADAPTER,useExisting:RioSelectStickyAdapterService},{provide:RIO_DATE_PICKER_CONFIG,useFactory:rioDatePickerConfigFactory,deps:[AccountManagerService,CoreService]},provideHttpClient(withInterceptorsFromDi())]}]}]});class CoreShellModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,declarations:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective],imports:[CommonModule,RouterModule,PipeModule,NgbModalModule,AiTerminalModule,CoreServicesModule,TourAnchorDirective,CoreTourOverlayComponent],exports:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,providers:[TourService,{provide:UI_TOUR_OPTIONS,useValue:{}}],imports:[CommonModule,RouterModule,PipeModule,NgbModalModule,AiTerminalModule,CoreServicesModule,CoreTourOverlayComponent]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,decorators:[{type:NgModule,args:[{declarations:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective],imports:[CommonModule,RouterModule,PipeModule,NgbModalModule,AiTerminalModule,CoreServicesModule,TourAnchorDirective,CoreTourOverlayComponent],exports:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective],providers:[TourService,{provide:UI_TOUR_OPTIONS,useValue:{}}]}]}]});class ForgotPasswordComponent extends BaseComponent{_route;_services;_http;_ds;serverURL="";form;user;subscription$=[];token;disableFormButton=!1;constructor(t,e,n,o){super(e),this._route=t,this._services=e,this._http=n,this._ds=o}ngOnInit(){2!==this._route.snapshot.queryParamMap.keys.length?(this._ds.error("Invalid params"),this._services._router.navigateByUrl("/home")):(this.serverURL=this._route.snapshot.queryParamMap.keys[0],this.token=this._route.snapshot.queryParamMap.keys[1]),this.form=this._services._fb.group({password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]],confirm_password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]]},{validator:this._services._vs.matchPassword}),this._http.post(this.serverURL+"/userWithForgotPasswordToken",{forgotPasswordToken:this.token}).toPromise().then(t=>{t.error?(this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")):this.user=t.result.user},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")})}ngOnDestroy(){this.subscription$.forEach(t=>{t.unsubscribe()})}submit(){this.disableFormButton=!0,this._http.post(this.serverURL+"/setUserWithForgotPasswordToken",{forgotPasswordToken:this.token,password:this.form.value.password}).toPromise().then(t=>{t.error?(this._ds.error("Could not update user"),this._services._router.navigateByUrl("/home")):(this._services._alert.setAlert("success","User has been updated, please log in"),this._services._router.navigateByUrl("/home"))},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")}),this._services._router.navigateByUrl("/home")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ForgotPasswordComponent,deps:[{token:i1$1.ActivatedRoute},{token:ProviderService},{token:i4.HttpClient},{token:DialogService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:ForgotPasswordComponent,isStandalone:!1,selector:"resolveio-forgot-password",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && form.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n',styles:["input{width:100%}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ForgotPasswordComponent,decorators:[{type:Component,args:[{selector:"resolveio-forgot-password",providers:[ProviderService],standalone:!1,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && form.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n'}]}],ctorParameters:()=>[{type:i1$1.ActivatedRoute},{type:ProviderService},{type:i4.HttpClient},{type:DialogService}]});class EnrollComponent extends BaseComponent{_route;_services;_http;_ds;serverURL="";form;user;subscription$=[];token;disableFormButton=!1;constructor(t,e,n,o){super(e),this._route=t,this._services=e,this._http=n,this._ds=o}ngOnInit(){2!==this._route.snapshot.queryParamMap.keys.length?(this._ds.error("Invalid params"),this._services._router.navigateByUrl("/home")):(this.serverURL=this._route.snapshot.queryParamMap.keys[0],this.token=this._route.snapshot.queryParamMap.keys[1]),this.form=this._services._fb.group({password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]],confirm_password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]]},{validator:this._services._vs.matchPassword}),this._http.post(this.serverURL+"/userWithEnrollmentToken",{enrollmentToken:this.token}).toPromise().then(t=>{t.error?(this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")):this.user=t.result.user},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")})}ngOnDestroy(){this.subscription$.forEach(t=>{t.unsubscribe()})}submit(){this.disableFormButton=!0,this._http.post(this.serverURL+"/setUserWithEnrollmentToken",{enrollmentToken:this.token,password:this.form.value.password}).toPromise().then(t=>{t.error?(this._ds.error("Could not update user"),this._services._router.navigateByUrl("/home")):(this._services._alert.setAlert("success","User has been updated, please log in"),this._services._router.navigateByUrl("/home"))},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:EnrollComponent,deps:[{token:i1$1.ActivatedRoute},{token:ProviderService},{token:i4.HttpClient},{token:DialogService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:EnrollComponent,isStandalone:!1,selector:"resolveio-enroll",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n',styles:["input{width:100%}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:EnrollComponent,decorators:[{type:Component,args:[{selector:"resolveio-enroll",providers:[ProviderService],standalone:!1,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n'}]}],ctorParameters:()=>[{type:i1$1.ActivatedRoute},{type:ProviderService},{type:i4.HttpClient},{type:DialogService}]});class Auth365Component extends BaseComponent{_app;_route;_services;_http;_ds;_socket;token;constructor(t,e,n,o,r,i){super(n),this._app=t,this._route=e,this._services=n,this._http=o,this._ds=r,this._socket=i,this._app.environment.value.MS_id_token?this._services._account.logIn365(this._app.environment.value.MS_id_token).then(()=>{this._services._router.navigateByUrl("/home")},()=>{}):this._services._router.navigateByUrl("/home")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Auth365Component,deps:[{token:CoreService},{token:i1$1.ActivatedRoute},{token:ProviderService},{token:i4.HttpClient},{token:DialogService},{token:SocketManagerService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:Auth365Component,isStandalone:!1,selector:"resolveio-auth365",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"<router-outlet></router-outlet>",isInline:!0,dependencies:[{kind:"directive",type:i1$1.RouterOutlet,selector:"router-outlet",inputs:["name","routerOutletData"],outputs:["activate","deactivate","attach","detach"],exportAs:["outlet"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Auth365Component,decorators:[{type:Component,args:[{selector:"resolveio-auth365",providers:[ProviderService],template:"<router-outlet></router-outlet>",standalone:!1}]}],ctorParameters:()=>[{type:CoreService},{type:i1$1.ActivatedRoute},{type:ProviderService},{type:i4.HttpClient},{type:DialogService},{type:SocketManagerService}]});class CoreAuthModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,declarations:[ForgotPasswordComponent,EnrollComponent,Auth365Component],imports:[SharedModule],exports:[ForgotPasswordComponent,EnrollComponent,Auth365Component]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,decorators:[{type:NgModule,args:[{declarations:[ForgotPasswordComponent,EnrollComponent,Auth365Component],imports:[SharedModule],exports:[ForgotPasswordComponent,EnrollComponent,Auth365Component]}]}]});class CoreDialogModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,declarations:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent],imports:[SharedModule],exports:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,decorators:[{type:NgModule,args:[{declarations:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent],imports:[SharedModule],exports:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent]}]}]});class HtmlDiffViewerComponent{payloadStr="";leftTextarea;rightTextarea;diffContent;leftContent="";rightContent="";diffLines=[];visibleDiffLines=[];showFullDiff=!1;constructor(){}ngAfterViewInit(){if(this.payloadStr){let t=JSON.parse(this.payloadStr,dateReviver);t[0]&&t[2]&&(this.leftContent=JSON.stringify(t[0],null,2),this.rightContent=JSON.stringify(t[2],null,2),this.rightContent.includes("$")&&(this.rightContent=JSON.stringify(applyMongoUpdate(t[0],t[2]),null,2)),this.generateDiff())}}toggleDiffView(){this.showFullDiff=!this.showFullDiff,this.updateVisibleLines()}updateVisibleLines(){if(this.showFullDiff)return void(this.visibleDiffLines=[...this.diffLines.map((t,e)=>(t.leftNumber=e+1,t))]);const t=new Set,e=new Set;this.diffLines.forEach((e,n)=>{"added"!==e.type&&"removed"!==e.type&&"changed"!==e.type||t.add(n)});const n=new Set;t.forEach(t=>{let e=t,o=0;const r=[];for(;e>=0;){const t=this.diffLines[e],i=t.leftContent||t.rightContent||"";i.trim().endsWith("}")||i.trim().endsWith("]")?o++:(i.trim().endsWith("{")||i.trim().endsWith("["))&&(o>0?o--:(n.add(e),r.push(e))),e--}r.forEach(t=>{let e=t,o=1;for(;e<this.diffLines.length&&o>0;){e++;const t=this.diffLines[e];if(!t)break;const r=t.leftContent||t.rightContent||"";r.trim().endsWith("{")||r.trim().endsWith("[")?o++:(r.trim().endsWith("}")||r.trim().endsWith("]"))&&(o--,0===o&&n.add(e))}})});const o=new Set([...t,...n]);o.forEach(t=>{for(let n=Math.max(0,t-1);n<=Math.min(this.diffLines.length-1,t+1);n++)e.add(n)}),this.visibleDiffLines=this.diffLines.map((t,n)=>({...t,isContext:e.has(n)&&!o.has(n),hidden:!(o.has(n)||e.has(n))}))}generateDiff(){try{const t=JSON.parse(this.leftContent),e=JSON.parse(this.rightContent),n=this.normalizeValue(t),o=this.normalizeValue(e),r=this.compareValues(null,n,o,0);this.diffLines=this.assignLineNumbers(r),this.updateVisibleLines(),this.setupScrollSync()}catch(t){console.error("Error generating diff:",t),this.diffLines=[],this.visibleDiffLines=[]}}normalizeValue(t){if(Array.isArray(t)){if(0===t.length)return t;if("object"==typeof t[0]&&null!==t[0])return t.map(t=>this.normalizeValue(t));if("string"==typeof t[0]||"number"==typeof t[0]||"boolean"==typeof t[0]){const e=[...t];return e.sort((t,e)=>t<e?-1:t>e?1:0),e}return t}if(t&&"object"==typeof t){const e={};return Object.keys(t).sort().forEach(n=>{e[n]=this.normalizeValue(t[n])}),e}return t}compareValues(t,e,n,o){const r=[],i=this.getType(e),a=this.getType(n);if(void 0===e&&void 0!==n)return this.isComplexType(a)?(r.push(this.makeLine("added","",this.openingBrace(t,a,o))),r.push(...this.renderComplex(n,"added",o+1,!0)),r.push(this.makeLine("added","",this.closingBrace(a,o)))):r.push(this.makeLine("added","",this.renderPrimitive(t,n,o))),r;if(void 0!==e&&void 0===n)return this.isComplexType(i)?(r.push(this.makeLine("removed",this.openingBrace(t,i,o),"")),r.push(...this.renderComplex(e,"removed",o+1,!1)),r.push(this.makeLine("removed",this.closingBrace(i,o),""))):r.push(this.makeLine("removed",this.renderPrimitive(t,e,o),"")),r;if(i!==a||"object"!==i&&"array"!==i)this.isEqual(e,n)?r.push(this.makeLine("unchanged",this.renderPrimitive(t,e,o),this.renderPrimitive(t,n,o))):r.push(this.makeLine("changed",this.renderPrimitive(t,e,o),this.renderPrimitive(t,n,o)));else{if(r.push(this.makeLine("unchanged",this.openingBrace(t,i,o),this.openingBrace(t,a,o))),"object"===i){const t=new Set([...Object.keys(e),...Object.keys(n)]),i=Array.from(t).sort();for(const t of i){const i=e[t],a=n[t];r.push(...this.compareValues(t,i,a,o+1))}}else{const t=Math.max(e.length,n.length);let i=!1;for(let o=0;o<t;o++){const t=e[o],r=n[o];if(!this.isEqual(t,r)){i=!0;break}}if(i)for(let i=0;i<t;i++){const t=e[i],a=n[i];this.isEqual(t,a)||(void 0===t&&void 0!==a?this.isComplexType(this.getType(a))?(r.push(this.makeLine("added","",this.openingBrace(`[${i}]`,this.getType(a),o+1))),r.push(...this.renderComplex(a,"added",o+2,!0)),r.push(this.makeLine("added","",this.closingBrace(this.getType(a),o+1)))):r.push(this.makeLine("added","",this.renderPrimitive(`[${i}]`,a,o+1))):void 0!==t&&void 0===a?this.isComplexType(this.getType(t))?(r.push(this.makeLine("removed",this.openingBrace(`[${i}]`,this.getType(t),o+1),"")),r.push(...this.renderComplex(t,"removed",o+2,!1)),r.push(this.makeLine("removed",this.closingBrace(this.getType(t),o+1),""))):r.push(this.makeLine("removed",this.renderPrimitive(`[${i}]`,t,o+1),"")):r.push(...this.compareValues(`[${i}]`,t,a,o+1)))}else for(let t=0;t<e.length;t++)r.push(...this.compareValues(`[${t}]`,e[t],n[t],o+1))}r.push(this.makeLine("unchanged",this.closingBrace(i,o),this.closingBrace(a,o)))}return r}isComplexType(t){return"object"===t||"array"===t}renderComplex(t,e,n,o){const r=[],i=this.getType(t);if("object"===i){Object.keys(t).sort().forEach(i=>{const a=t[i],s=this.getType(a);this.isComplexType(s)?(r.push(this.makeLine(e,o?"":this.openingBrace(i,s,n),o?this.openingBrace(i,s,n):"")),r.push(...this.renderComplex(a,e,n+1,o)),r.push(this.makeLine(e,o?"":this.closingBrace(s,n),o?this.closingBrace(s,n):""))):r.push(this.makeLine(e,o?"":this.renderPrimitive(i,a,n),o?this.renderPrimitive(i,a,n):""))})}else if("array"===i)for(let i=0;i<t.length;i++){const a=t[i],s=this.getType(a);this.isComplexType(s)?(r.push(this.makeLine(e,o?"":this.openingBrace(`[${i}]`,s,n),o?this.openingBrace(`[${i}]`,s,n):"")),r.push(...this.renderComplex(a,e,n+1,o)),r.push(this.makeLine(e,o?"":this.closingBrace(s,n),o?this.closingBrace(s,n):""))):r.push(this.makeLine(e,o?"":this.renderPrimitive(`[${i}]`,a,n),o?this.renderPrimitive(`[${i}]`,a,n):""))}else r.push(this.makeLine(e,o?"":this.renderPrimitive(null,t,n),o?this.renderPrimitive(null,t,n):""));return r}getType(t){return null===t?"null":Array.isArray(t)?"array":"object"==typeof t?"object":"primitive"}isEqual(t,e){return JSON.stringify(t)===JSON.stringify(e)}makeLine(t,e,n){return{type:t,leftContent:e,rightContent:n}}openingBrace(t,e,n){const o=this.getIndentString(n),r="array"===e?"[":"{";return t?t.startsWith("[")?`${o}${t}: ${r}`:`${o}"${t}": ${r}`:`${o}${r}`}closingBrace(t,e){return`${this.getIndentString(e)}${"array"===t?"]":"}"}`}renderPrimitive(t,e,n){const o=this.getIndentString(n),r=JSON.stringify(e);return t?t.startsWith("[")?`${o}${t}: ${r}`:`${o}"${t}": ${r}`:`${o}${r}`}getIndentString(t){let e="";for(let n=0;n<t;n++)e+="\t";return e}assignLineNumbers(t){let e=1,n=1;return t.map(t=>{let o="",r="";return"removed"===t.type?(o=(e++).toString(),r=""):"added"===t.type?(o="",r=(n++).toString()):(o=(e++).toString(),r=(n++).toString()),{...t,leftNumber:o,rightNumber:r}})}setupScrollSync(){setTimeout(()=>{const t=this.diffContent.nativeElement,e=t.querySelectorAll(".left"),n=t.querySelectorAll(".right");if(e.length&&n.length){const t=e[0],o=n[0];t.addEventListener("scroll",()=>{o.scrollTop=t.scrollTop,o.scrollLeft=t.scrollLeft}),o.addEventListener("scroll",()=>{t.scrollTop=o.scrollTop,t.scrollLeft=o.scrollLeft})}})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HtmlDiffViewerComponent,deps:[],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:HtmlDiffViewerComponent,isStandalone:!1,selector:"html-diff-viewer",inputs:{payloadStr:"payloadStr"},viewQueries:[{propertyName:"leftTextarea",first:!0,predicate:["leftTextarea"],descendants:!0},{propertyName:"rightTextarea",first:!0,predicate:["rightTextarea"],descendants:!0},{propertyName:"diffContent",first:!0,predicate:["diffContent"],descendants:!0}],ngImport:i0,template:'\n\t\t<div class="diff-container">\n\t\t <div class="diff-controls">\n\t\t <button type="button" class="btn"\n\t\t [class.btn-primary]="!showFullDiff"\n\t\t [class.btn-secondary]="showFullDiff"\n\t\t (click)="toggleDiffView()">\n\t\t {{ showFullDiff ? \'Show Full Content\' : \'Show Changes Only\' }}\n\t\t </button>\n\t\t </div>\n\t\t <div class="diff-header">\n\t\t <div class="diff-header-left">Original</div>\n\t\t <div class="diff-header-right">Modified</div>\n\t\t </div>\n\t\t <div class="diff-content" #diffContent>\n\t\t <div class="diff-lines">\n\t\t @for (line of visibleDiffLines; track line) {\n\t\t <div class="diff-line"\n\t\t [class.context-line]="line.isContext"\n\t\t [class.hidden-line]="line.hidden">\n\t\t <div class="line-number left">{{ line.leftNumber }}</div>\n\t\t <div class="line-content left"\n\t\t [class.deleted]="line.type === \'removed\'"\n\t\t [class.changed-left]="line.type === \'changed\'">\n\t\t <span>{{ line.leftContent }}</span>\n\t\t </div>\n\t\t <div class="line-number right">{{ line.rightNumber }}</div>\n\t\t <div class="line-content right"\n\t\t [class.added]="line.type === \'added\'"\n\t\t [class.changed-right]="line.type === \'changed\'">\n\t\t <span>{{ line.rightContent }}</span>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="input-container">\n\t\t <textarea #leftTextarea [(ngModel)]="leftContent" placeholder="Left side content" rows="10"></textarea>\n\t\t <textarea #rightTextarea [(ngModel)]="rightContent" placeholder="Right side content" rows="10"></textarea>\n\t\t </div>\n\t\t</div>\n\t\t',isInline:!0,styles:[".diff-container{display:flex;flex-direction:column;font-family:monospace;font-size:12px;line-height:1.5}.diff-controls{margin-bottom:10px}.btn{padding:5px 10px;border-radius:4px;cursor:pointer;border:1px solid #ddd}.btn-primary{background-color:#0366d6;color:#fff}.btn-secondary{background-color:#f6f8fa;color:#24292e}.diff-header{display:flex;background:#f6f8fa;border:1px solid #e1e4e8;border-bottom:none;padding:8px 16px;font-weight:700}.diff-header-left,.diff-header-right{width:50%;box-sizing:border-box}.diff-content{border:1px solid #e1e4e8;overflow:auto;max-height:500px}.diff-lines{display:flex;flex-direction:column;width:100%}.diff-line{display:flex;width:100%}.context-line{background-color:#f1f8ff}.hidden-line{display:none}.line-number{width:40px!important;min-width:40px!important;padding:0 10px;text-align:right;color:#1b1f234d;background-color:#f6f8fa;border-right:1px solid #e1e4e8;-webkit-user-select:none;user-select:none}.line-content{flex:1;padding:0 10px;white-space:pre;min-width:0;overflow-x:auto}.left{width:50%;border-right:1px solid #e1e4e8}.right{width:50%}.added{background-color:#e6ffed}.deleted{background-color:#ffebe9}.changed-left{background-color:#fff3bf;text-decoration:line-through}.changed-right{background-color:#d4edda}.input-container{display:flex;margin-top:20px;gap:10px}textarea{width:50%;height:200px;font-family:monospace;padding:10px;border:1px solid #ddd;border-radius:4px;box-sizing:border-box}*{word-wrap:normal!important}\n"],dependencies:[{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HtmlDiffViewerComponent,decorators:[{type:Component,args:[{selector:"html-diff-viewer",template:'\n\t\t<div class="diff-container">\n\t\t <div class="diff-controls">\n\t\t <button type="button" class="btn"\n\t\t [class.btn-primary]="!showFullDiff"\n\t\t [class.btn-secondary]="showFullDiff"\n\t\t (click)="toggleDiffView()">\n\t\t {{ showFullDiff ? \'Show Full Content\' : \'Show Changes Only\' }}\n\t\t </button>\n\t\t </div>\n\t\t <div class="diff-header">\n\t\t <div class="diff-header-left">Original</div>\n\t\t <div class="diff-header-right">Modified</div>\n\t\t </div>\n\t\t <div class="diff-content" #diffContent>\n\t\t <div class="diff-lines">\n\t\t @for (line of visibleDiffLines; track line) {\n\t\t <div class="diff-line"\n\t\t [class.context-line]="line.isContext"\n\t\t [class.hidden-line]="line.hidden">\n\t\t <div class="line-number left">{{ line.leftNumber }}</div>\n\t\t <div class="line-content left"\n\t\t [class.deleted]="line.type === \'removed\'"\n\t\t [class.changed-left]="line.type === \'changed\'">\n\t\t <span>{{ line.leftContent }}</span>\n\t\t </div>\n\t\t <div class="line-number right">{{ line.rightNumber }}</div>\n\t\t <div class="line-content right"\n\t\t [class.added]="line.type === \'added\'"\n\t\t [class.changed-right]="line.type === \'changed\'">\n\t\t <span>{{ line.rightContent }}</span>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="input-container">\n\t\t <textarea #leftTextarea [(ngModel)]="leftContent" placeholder="Left side content" rows="10"></textarea>\n\t\t <textarea #rightTextarea [(ngModel)]="rightContent" placeholder="Right side content" rows="10"></textarea>\n\t\t </div>\n\t\t</div>\n\t\t',standalone:!1,styles:[".diff-container{display:flex;flex-direction:column;font-family:monospace;font-size:12px;line-height:1.5}.diff-controls{margin-bottom:10px}.btn{padding:5px 10px;border-radius:4px;cursor:pointer;border:1px solid #ddd}.btn-primary{background-color:#0366d6;color:#fff}.btn-secondary{background-color:#f6f8fa;color:#24292e}.diff-header{display:flex;background:#f6f8fa;border:1px solid #e1e4e8;border-bottom:none;padding:8px 16px;font-weight:700}.diff-header-left,.diff-header-right{width:50%;box-sizing:border-box}.diff-content{border:1px solid #e1e4e8;overflow:auto;max-height:500px}.diff-lines{display:flex;flex-direction:column;width:100%}.diff-line{display:flex;width:100%}.context-line{background-color:#f1f8ff}.hidden-line{display:none}.line-number{width:40px!important;min-width:40px!important;padding:0 10px;text-align:right;color:#1b1f234d;background-color:#f6f8fa;border-right:1px solid #e1e4e8;-webkit-user-select:none;user-select:none}.line-content{flex:1;padding:0 10px;white-space:pre;min-width:0;overflow-x:auto}.left{width:50%;border-right:1px solid #e1e4e8}.right{width:50%}.added{background-color:#e6ffed}.deleted{background-color:#ffebe9}.changed-left{background-color:#fff3bf;text-decoration:line-through}.changed-right{background-color:#d4edda}.input-container{display:flex;margin-top:20px;gap:10px}textarea{width:50%;height:200px;font-family:monospace;padding:10px;border:1px solid #ddd;border-radius:4px;box-sizing:border-box}*{word-wrap:normal!important}\n"]}]}],ctorParameters:()=>[],propDecorators:{payloadStr:[{type:Input}],leftTextarea:[{type:ViewChild,args:["leftTextarea"]}],rightTextarea:[{type:ViewChild,args:["rightTextarea"]}],diffContent:[{type:ViewChild,args:["diffContent"]}]}});class LoggerComponent extends BaseComponent{_services;_ds;_cd;subscription$=[];logs=[];entries_per_page=25;page_num=1;log_cnt=0;user=null;users=[];startDateTime;endDateTime;dateStart;dateEnd;selectedTypes=[];client=null;clients=[];collection="";method="";route="";id_document="";constructor(t,e,n){super(t),this._services=t,this._ds=e,this._cd=n}ngOnInit(){this._services._account.getUser().roles.super_admin||this._services._router.navigateByUrl("/home"),this.subscription$.push(this._services._socket.subscribe("activeClients").subscribe(t=>{this.clients=t,this._cd.detectChanges()})),this.subscription$.push(this._services._socket.subscribe("allUsers").subscribe(t=>{this.users=t,this._cd.detectChanges()}));let t=new Date;t.setHours(0,0,0,0);let e=new Date(moment$1(t).subtract(10,"days").toDate());this.startDateTime=this.createPickerValue(e,0);let n=new Date;n.setHours(23,59,59,999),this.endDateTime=this.createPickerValue(n,59),this.getLogData()}ngOnDestroy(){this.subscription$.forEach(t=>{t.unsubscribe()})}getLogData(){this.dateStart=this.toDate(this.startDateTime),this.dateEnd=this.toDate(this.endDateTime,!0);let t={$and:[{createdAt:{$gte:this.dateStart}},{createdAt:{$lte:this.dateEnd}}]};if(this.client)if(this.client.includes(",")){let e=this.client.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({client:{$in:e}}),this.client.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({client:{$ne:e.replace("!","")}})})}else this.client.startsWith("!")?t.$and.push({client:{$ne:this.client.replace("!","").trim()}}):t.$and.push({client:this.client.trim()});else t.$and.push({client:"ResolveIO"});if(this.selectedTypes.length){if(t.$and.push({type:{$in:this.selectedTypes}}),this.collection)if(this.collection.includes(",")){let e=this.collection.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({collection:{$in:e}}),this.collection.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({collection:{$ne:e.replace("!","")}})})}else this.collection.startsWith("!")?t.$and.push({collection:{$ne:this.collection.replace("!","").trim()}}):t.$and.push({collection:this.collection.trim()});if(this.method)if(this.method.includes(",")){let e=this.method.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({method:{$in:e}}),this.method.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({method:{$ne:e.replace("!","")}})})}else this.method.startsWith("!")?t.$and.push({method:{$ne:this.method.replace("!","").trim()}}):t.$and.push({method:this.method.trim()});if(this.route)if(this.route.includes(",")){let e=this.route.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({route:{$in:e}}),this.route.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({route:{$ne:e.replace("!","")}})})}else this.route.startsWith("!")?t.$and.push({route:{$ne:this.route.replace("!","").trim()}}):t.$and.push({route:this.route.trim()});if(this.id_document)if(this.id_document.includes(",")){let e=this.id_document.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({id_document:{$in:e}}),this.id_document.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({id_document:{$ne:e.replace("!","")}})})}else this.id_document.startsWith("!")?t.$and.push({id_document:{$ne:this.id_document.replace("!","").trim()}}):t.$and.push({id_document:this.id_document.trim()});this.user&&t.$and.push({user:this.user}),"string"==typeof this.entries_per_page&&(this.entries_per_page=parseInt(this.entries_per_page)),this._services._socket.call("findWithOptions","logs",t,{sort:{createdAt:-1},limit:this.entries_per_page,skip:this.entries_per_page*(this.page_num-1)},(t,e)=>{this.logs=e,this._cd.detectChanges()}),this._services._socket.call("countCollectionWithQuery","logs",t,(t,e)=>{this.log_cnt=e,this._cd.detectChanges()}),this._cd.detectChanges()}}selectType(t){"all"!==t?this.selectedTypes.includes(t)?this.selectedTypes.splice(this.selectedTypes.indexOf(t),1):this.selectedTypes.push(t):7===this.selectedTypes.length?this.selectedTypes=[]:this.selectedTypes=["error","document","query","queryResponse","client-request","client-response","callMethod"],this.logs=[],this.selectedTypes.length&&this.getLogData()}icon(t){return"error"===t?"danger":"document"===t?"info":"client-response"===t?"success":"client-request"===t?"primary":"secondary"}removeAllLogs(){this._ds.confirm("Are you sure you want to delete all logs?").then(()=>{this._services._socket.call("removeAllDocuments","logs")},()=>{})}toDate(t,e=!1){if(!t||!t.date)return new Date;let n=t.time||{hour:0,minute:0,second:0,ms:0},o=e?999:n.ms||0;return new Date(t.date.year,t.date.month-1,t.date.day,n.hour||0,n.minute||0,n.second||0,o)}createPickerValue(t,e=null){return{mode:"datetime",date:{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()},time:{hour:t.getHours(),minute:t.getMinutes(),second:null!==e?e:t.getSeconds(),ms:t.getMilliseconds()}}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LoggerComponent,deps:[{token:ProviderService},{token:DialogService},{token:i0.ChangeDetectorRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:LoggerComponent,isStandalone:!1,selector:"resolveio-logger",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<div class="row">\n\t<div class="col-lg-12">\n\t\t<div class="card">\n\t\t\t<div class="card-header"><b>Filters</b></div>\n\t\t\t<div class="card-body">\n\t\t\t\t<div class="row">\n\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') && selectedTypes.includes(\'document\') && selectedTypes.includes(\'query\') && selectedTypes.includes(\'client-request\') && selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'all\')">All</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'error\')">Errors</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'document\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'document\')">Document</button>\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'query\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'query\')">Query</button> --\x3e\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'queryResponse\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'queryResponse\')">Query Response</button> --\x3e\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-request\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-request\')">Client Requests</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-response\')">Client Responses</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'callMethod\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'callMethod\')">Call Method</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-danger" (click)="removeAllLogs()">REMOVE ALL LOGS</button>\n\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Client</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="client" (change)="getLogData()" placeholder="Select Client" [options]="clients" optionValueKey="name" optionLabelKey="name"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">User</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="user" (change)="getLogData()" placeholder="Select User" [options]="users" optionValueKey="fullname" optionLabelKey="fullname"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Collection</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="collection" (change)="getLogData()" placeholder="Input Colls Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Method</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="method" (change)="getLogData()" placeholder="Input Methods Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Route</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="route" (change)="getLogData()" placeholder="Input Routes Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Document</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="id_document" (change)="getLogData()" placeholder="Input Ids Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2 offset-lg-4">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time Start</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="startDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time End</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="endDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div ngbAccordion #acc="ngbAccordion" activeIds="">\n\t\t\t\t\t\t@for (log of logs; track log._id; let i = $index) {\n\t\t\t\t\t\t\t<div ngbAccordionItem [id]="\'log_\' + i">\n\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t<label class="label-accordion" style="width: 90%; height: 22px">\n\t\t\t\t\t\t\t\t\t\t\t<strong class="float-start">Type: {{ log.type }}{{ log.method ? \' - Method: \' + log.method : \'\' }}{{ log.collection ? \' - Collection: \' + log.collection : \'\' }}{{ log.user ? \' - User: \' + log.user : \'\' }}{{ log.route ? \' - Route: \' + log.route : \'\' }}{{ log.id_document ? \' - id_document: \' + log.id_document : \'\' }}{{ log.messageId ? \' - messageId: \' + log.messageId : \'\' }}{{ log.instance ? \' - instance: \' + log.instance : \'\' }}</strong>\n\t\t\t\t\t\t\t\t\t\t\t<p class="float-end mb-0">{{ log.createdAt | date: \'medium\' }}</p>\n\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t@if (log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method === \'replaceOne\' || log.method === \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordion #acc2="ngbAccordion" activeIds="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Diff</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<html-diff-viewer [payloadStr]="log.payload"></html-diff-viewer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="raw">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Raw</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method !== \'replaceOne\' && log.method !== \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t@if (!log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\tNo Data\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t\t<div class="col-lg-4">\n\t\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t\t\t<label class="form-control-label">Entries Per Page</label>\n\t\t\t\t\t\t\t\t\t<select class="form-control" [(ngModel)]="entries_per_page" (change)="getLogData()">\n\t\t\t\t\t\t\t\t\t\t<option value="10">10</option>\n\t\t\t\t\t\t\t\t\t\t<option value="25">25</option>\n\t\t\t\t\t\t\t\t\t\t<option value="50">50</option>\n\t\t\t\t\t\t\t\t\t\t<option value="100">100</option>\n\t\t\t\t\t\t\t\t\t\t<option value="250">250</option>\n\t\t\t\t\t\t\t\t\t\t<option value="500">500</option>\n\t\t\t\t\t\t\t\t\t\t<option value="1000">1000</option>\n\t\t\t\t\t\t\t\t\t\t<option value="5000">5000</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t<ngb-pagination class="float-end" boundaryLinks="true" [collectionSize]="log_cnt" directionLinks="true" ellipses="false" [(page)]="page_num" maxSize="6" [pageSize]="entries_per_page" rotate="true" (pageChange)="getLogData()"></ngb-pagination>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',dependencies:[{kind:"directive",type:i2.NgSelectOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.ɵNgSelectMultipleOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.SelectControlValueAccessor,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:["compareWith"]},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"directive",type:i1$2.NgbAccordionButton,selector:"button[ngbAccordionButton]"},{kind:"directive",type:i1$2.NgbAccordionDirective,selector:"[ngbAccordion]",inputs:["animation","closeOthers","destroyOnHide"],outputs:["show","shown","hide","hidden"],exportAs:["ngbAccordion"]},{kind:"directive",type:i1$2.NgbAccordionItem,selector:"[ngbAccordionItem]",inputs:["ngbAccordionItem","destroyOnHide","disabled","collapsed"],outputs:["show","shown","hide","hidden"],exportAs:["ngbAccordionItem"]},{kind:"directive",type:i1$2.NgbAccordionHeader,selector:"[ngbAccordionHeader]"},{kind:"component",type:i1$2.NgbAccordionBody,selector:"[ngbAccordionBody]"},{kind:"directive",type:i1$2.NgbAccordionCollapse,selector:"[ngbAccordionCollapse]",exportAs:["ngbAccordionCollapse"]},{kind:"component",type:i1$2.NgbPagination,selector:"ngb-pagination",inputs:["disabled","boundaryLinks","directionLinks","ellipses","rotate","collectionSize","maxSize","page","pageSize","size"],outputs:["pageChange"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"component",type:i7.RioDatePickerComponent,selector:"rio-date-picker",inputs:["enableDate","enableTime","selectionMode","firstDayOfWeek","toggleWeekFirstDay","timezone","minDate","maxDate","disabled","label","allowSeconds","minuteStep","panelWidth"],outputs:["change"]},{kind:"component",type:HtmlDiffViewerComponent,selector:"html-diff-viewer",inputs:["payloadStr"]},{kind:"pipe",type:JsonParsePipe,name:"jsonParse"},{kind:"pipe",type:i3.DatePipe,name:"date"}],changeDetection:i0.ChangeDetectionStrategy.OnPush})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LoggerComponent,decorators:[{type:Component,args:[{selector:"resolveio-logger",providers:[ProviderService],changeDetection:ChangeDetectionStrategy.OnPush,standalone:!1,template:'<div class="row">\n\t<div class="col-lg-12">\n\t\t<div class="card">\n\t\t\t<div class="card-header"><b>Filters</b></div>\n\t\t\t<div class="card-body">\n\t\t\t\t<div class="row">\n\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') && selectedTypes.includes(\'document\') && selectedTypes.includes(\'query\') && selectedTypes.includes(\'client-request\') && selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'all\')">All</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'error\')">Errors</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'document\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'document\')">Document</button>\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'query\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'query\')">Query</button> --\x3e\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'queryResponse\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'queryResponse\')">Query Response</button> --\x3e\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-request\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-request\')">Client Requests</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-response\')">Client Responses</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'callMethod\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'callMethod\')">Call Method</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-danger" (click)="removeAllLogs()">REMOVE ALL LOGS</button>\n\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Client</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="client" (change)="getLogData()" placeholder="Select Client" [options]="clients" optionValueKey="name" optionLabelKey="name"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">User</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="user" (change)="getLogData()" placeholder="Select User" [options]="users" optionValueKey="fullname" optionLabelKey="fullname"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Collection</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="collection" (change)="getLogData()" placeholder="Input Colls Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Method</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="method" (change)="getLogData()" placeholder="Input Methods Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Route</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="route" (change)="getLogData()" placeholder="Input Routes Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Document</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="id_document" (change)="getLogData()" placeholder="Input Ids Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2 offset-lg-4">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time Start</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="startDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time End</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="endDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div ngbAccordion #acc="ngbAccordion" activeIds="">\n\t\t\t\t\t\t@for (log of logs; track log._id; let i = $index) {\n\t\t\t\t\t\t\t<div ngbAccordionItem [id]="\'log_\' + i">\n\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t<label class="label-accordion" style="width: 90%; height: 22px">\n\t\t\t\t\t\t\t\t\t\t\t<strong class="float-start">Type: {{ log.type }}{{ log.method ? \' - Method: \' + log.method : \'\' }}{{ log.collection ? \' - Collection: \' + log.collection : \'\' }}{{ log.user ? \' - User: \' + log.user : \'\' }}{{ log.route ? \' - Route: \' + log.route : \'\' }}{{ log.id_document ? \' - id_document: \' + log.id_document : \'\' }}{{ log.messageId ? \' - messageId: \' + log.messageId : \'\' }}{{ log.instance ? \' - instance: \' + log.instance : \'\' }}</strong>\n\t\t\t\t\t\t\t\t\t\t\t<p class="float-end mb-0">{{ log.createdAt | date: \'medium\' }}</p>\n\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t@if (log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method === \'replaceOne\' || log.method === \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordion #acc2="ngbAccordion" activeIds="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Diff</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<html-diff-viewer [payloadStr]="log.payload"></html-diff-viewer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="raw">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Raw</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method !== \'replaceOne\' && log.method !== \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t@if (!log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\tNo Data\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t\t<div class="col-lg-4">\n\t\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t\t\t<label class="form-control-label">Entries Per Page</label>\n\t\t\t\t\t\t\t\t\t<select class="form-control" [(ngModel)]="entries_per_page" (change)="getLogData()">\n\t\t\t\t\t\t\t\t\t\t<option value="10">10</option>\n\t\t\t\t\t\t\t\t\t\t<option value="25">25</option>\n\t\t\t\t\t\t\t\t\t\t<option value="50">50</option>\n\t\t\t\t\t\t\t\t\t\t<option value="100">100</option>\n\t\t\t\t\t\t\t\t\t\t<option value="250">250</option>\n\t\t\t\t\t\t\t\t\t\t<option value="500">500</option>\n\t\t\t\t\t\t\t\t\t\t<option value="1000">1000</option>\n\t\t\t\t\t\t\t\t\t\t<option value="5000">5000</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t<ngb-pagination class="float-end" boundaryLinks="true" [collectionSize]="log_cnt" directionLinks="true" ellipses="false" [(page)]="page_num" maxSize="6" [pageSize]="entries_per_page" rotate="true" (pageChange)="getLogData()"></ngb-pagination>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}]}],ctorParameters:()=>[{type:ProviderService},{type:DialogService},{type:i0.ChangeDetectorRef}]});class CoreLoggerModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,declarations:[LoggerComponent,HtmlDiffViewerComponent],imports:[SharedModule],exports:[LoggerComponent,HtmlDiffViewerComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,decorators:[{type:NgModule,args:[{declarations:[LoggerComponent,HtmlDiffViewerComponent],imports:[SharedModule],exports:[LoggerComponent,HtmlDiffViewerComponent]}]}]});class UserSettingsService{selectedUser=new BehaviorSubject("0");constructor(){}setSelectedUser(t){this.selectedUser.next(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsService,decorators:[{type:Injectable}],ctorParameters:()=>[]});const UserSettingsModulePermission={name:"user-settings",views:[{link:"/user-settings/settings",label:"Settings"}],approval:{type:"user-settings"}};class UserSettingsComponent extends BaseComponent{_us;_services;selectedUserSettings$;menuData;constructor(t,e){super(e),this._us=t,this._services=e}ngOnInit(){this.selectedUserSettings$=this._us.selectedUser.subscribe(t=>this.selectedUserSettingsChanged(t))}ngOnDestroy(){this._us.setSelectedUser("0"),this.selectedUserSettings$.unsubscribe()}selectedUserSettingsChanged(t){this.setUserSettingsMenuData()}setUserSettingsMenuData(t,e){let n=[];UserSettingsModulePermission.views.forEach(t=>{if((this._services._account.isUserInView(t.link)||this._services._account.isUserSuperAdmin())&&"/user-settings/settings"===t.link)n.push({link:"/user-settings/settings",params:null,label:"Settings"})}),this.menuData={title:"User Settings",module:"User Settings",description_name:"User: ",description:e?e.fullname:"",tabs:n},this._services._app.setNavbarModuleData(this.menuData)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsComponent,deps:[{token:UserSettingsService},{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:UserSettingsComponent,isStandalone:!1,selector:"resolveio-user-settings",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"<router-outlet></router-outlet>",isInline:!0,dependencies:[{kind:"directive",type:i1$1.RouterOutlet,selector:"router-outlet",inputs:["name","routerOutletData"],outputs:["activate","deactivate","attach","detach"],exportAs:["outlet"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsComponent,decorators:[{type:Component,args:[{selector:"resolveio-user-settings",providers:[ProviderService],template:"<router-outlet></router-outlet>",standalone:!1}]}],ctorParameters:()=>[{type:UserSettingsService},{type:ProviderService}]});class UsersSettingsComponent extends BaseComponent{_aps;_us;_services;_ds;_tourManager;_stickyAdapter;subscription$=[];form;disableFormButton=!1;user;client="";views=[];stickySelects=[];stickySelections={};constructor(t,e,n,o,r,i){super(n),this._aps=t,this._us=e,this._services=n,this._ds=o,this._tourManager=r,this._stickyAdapter=i}ngOnInit(){this._us.setSelectedUser("0"),this.client=this._services._app.client.getValue(),this.form=this._services._fb.group({table_color:["#3b3ee3",[Validators.required]],table_font_color:["#ffffff",[Validators.required]],font_size:[12,[Validators.required,this._services._vs.wholeNumbersGreaterThanZero,this._services._vs.maxValue(18),this._services._vs.minValue(8)]],secondary_table_color:["#87ceeb",[Validators.required]],secondary_table_font_color:["#000000",[Validators.required]],tertiary_table_color:["#ff4500",[Validators.required]],tertiary_table_font_color:["#000000",[Validators.required]],collapsable_menu:[!0],entries_per_page:["25",[Validators.required]],warning_color:["#ffc107",[Validators.required]],warning_font_color:["#000000",[Validators.required]],warning_hover_color:["#e0a800",[Validators.required]],success_color:["#28a745",[Validators.required]],success_font_color:["#ffffff",[Validators.required]],success_hover_color:["#218838",[Validators.required]],danger_color:["#dc3545",[Validators.required]],danger_font_color:["#ffffff",[Validators.required]],danger_hover_color:["#c82333",[Validators.required]],info_color:["#17a2b8",[Validators.required]],info_font_color:["#ffffff",[Validators.required]],info_hover_color:["#138496",[Validators.required]],primary_color:["#007bff",[Validators.required]],primary_font_color:["#ffffff",[Validators.required]],primary_hover_color:["#0069d9",[Validators.required]],secondary_color:["#868e96",[Validators.required]],secondary_font_color:["#ffffff",[Validators.required]],secondary_hover_color:["#5a6268",[Validators.required]],date_picker_day_start:["S",[Validators.required]],routing_preference:[""],opening_route:["/home"],rio_select_search_mode:["exact",[Validators.required]]});const t=this._services._account.getUser();t&&t.settings&&(this.form.patchValue(t.settings),t.roles.groups.forEach(t=>{t.views.forEach(t=>{this.views.some(e=>e.value===t)||this.views.push({value:t,display:toTitleCase(t.replace("/","").replace(new RegExp("/","g")," - "))})})}));const e=this._normalizeDatePickerDayStart(t?.other?.date_picker_day_start);this.form.controls.date_picker_day_start.setValue(e),this._loadStickySelects(this._services._account.getUser()),document.documentElement.style.setProperty("--primary-table-color",this.form.controls.table_color.value),document.documentElement.style.setProperty("--primary-table-font-color",this.form.controls.table_font_color.value),document.documentElement.style.setProperty("--font-size",this.form.controls.font_size.value+"px"),document.documentElement.style.setProperty("--secondary-table-color",this.form.controls.secondary_table_color.value),document.documentElement.style.setProperty("--secondary-table-font-color",this.form.controls.secondary_table_font_color.value),document.documentElement.style.setProperty("--tertiary-table-color",this.form.controls.tertiary_table_color.value),document.documentElement.style.setProperty("--tertiary-table-font-color",this.form.controls.tertiary_table_font_color.value),document.documentElement.style.setProperty("--warning-color",this.form.controls.warning_color.value),document.documentElement.style.setProperty("--warning-font-color",this.form.controls.warning_font_color.value),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.warning_color.value,.5)),document.documentElement.style.setProperty("--warning-hover-color",this.form.controls.warning_hover_color.value),document.documentElement.style.setProperty("--success-color",this.form.controls.success_color.value),document.documentElement.style.setProperty("--success-font-color",this.form.controls.success_font_color.value),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.success_color.value,.5)),document.documentElement.style.setProperty("--success-hover-color",this.form.controls.success_hover_color.value),document.documentElement.style.setProperty("--danger-color",this.form.controls.danger_color.value),document.documentElement.style.setProperty("--danger-font-color",this.form.controls.danger_font_color.value),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.danger_color.value,.5)),document.documentElement.style.setProperty("--danger-hover-color",this.form.controls.danger_hover_color.value),document.documentElement.style.setProperty("--info-color",this.form.controls.info_color.value),document.documentElement.style.setProperty("--info-font-color",this.form.controls.info_font_color.value),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.info_color.value,.5)),document.documentElement.style.setProperty("--info-hover-color",this.form.controls.info_hover_color.value),document.documentElement.style.setProperty("--primary-color",this.form.controls.primary_color.value),document.documentElement.style.setProperty("--primary-font-color",this.form.controls.primary_font_color.value),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.primary_color.value,.5)),document.documentElement.style.setProperty("--primary-hover-color",this.form.controls.primary_hover_color.value),document.documentElement.style.setProperty("--secondary-color",this.form.controls.secondary_color.value),document.documentElement.style.setProperty("--secondary-font-color",this.form.controls.secondary_font_color.value),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.secondary_color.value,.5)),document.documentElement.style.setProperty("--secondary-hover-color",this.form.controls.secondary_hover_color.value),this.subscription$.push(this._services._account.user.subscribe(t=>{this.user=t,this._loadStickySelects(t)}))}ngOnDestroy(){const t=this._services._account.getUser();t&&!t.settings&&this.form&&this.form.valid&&this.submitForm(this.form),this.subscription$.forEach(t=>{t.unsubscribe()})}changePrimaryColor(){document.documentElement.style.setProperty("--primary-table-color",this.form.controls.table_color.value)}changePrimaryFontColor(){document.documentElement.style.setProperty("--primary-table-font-color",this.form.controls.table_font_color.value)}changePrimaryFontSize(){document.documentElement.style.setProperty("--font-size",this.form.controls.font_size.value+"px")}changeSecondaryColor(){document.documentElement.style.setProperty("--secondary-table-color",this.form.controls.secondary_table_color.value)}changeSecondaryFontColor(){document.documentElement.style.setProperty("--secondary-table-font-color",this.form.controls.secondary_table_font_color.value)}changeTertiaryColor(){document.documentElement.style.setProperty("--tertiary-table-color",this.form.controls.tertiary_table_color.value)}changeTertiaryFontColor(){document.documentElement.style.setProperty("--tertiary-table-font-color",this.form.controls.tertiary_table_font_color.value)}changeWarningColor(){document.documentElement.style.setProperty("--warning-color",this.form.controls.warning_color.value),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.warning_color.value,.5))}changeWarningHoverColor(){document.documentElement.style.setProperty("--warning-hover-color",this.form.controls.warning_hover_color.value)}changeWarningFontColor(){document.documentElement.style.setProperty("--warning-font-color",this.form.controls.warning_font_color.value)}changeSuccessColor(){document.documentElement.style.setProperty("--success-color",this.form.controls.success_color.value),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.success_color.value,.5))}changeSuccessHoverColor(){document.documentElement.style.setProperty("--success-hover-color",this.form.controls.success_hover_color.value)}changeSuccessFontColor(){document.documentElement.style.setProperty("--success-font-color",this.form.controls.success_font_color.value)}changeDangerColor(){document.documentElement.style.setProperty("--danger-color",this.form.controls.danger_color.value),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.danger_color.value,.5))}changeDangerHoverColor(){document.documentElement.style.setProperty("--danger-hover-color",this.form.controls.danger_hover_color.value)}changeDangerFontColor(){document.documentElement.style.setProperty("--danger-font-color",this.form.controls.danger_font_color.value)}changeInfoColor(){document.documentElement.style.setProperty("--info-color",this.form.controls.info_color.value),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.info_color.value,.5))}changeInfoHoverColor(){document.documentElement.style.setProperty("--info-hover-color",this.form.controls.info_hover_color.value)}changeInfoFontColor(){document.documentElement.style.setProperty("--info-font-color",this.form.controls.info_font_color.value)}changePrimaryButtonColor(){document.documentElement.style.setProperty("--primary-color",this.form.controls.primary_color.value),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.primary_color.value,.5))}changePrimaryButtonHoverColor(){document.documentElement.style.setProperty("--primary-hover-color",this.form.controls.primary_hover_color.value)}changePrimaryButtonFontColor(){document.documentElement.style.setProperty("--primary-font-color",this.form.controls.primary_font_color.value)}changeSecondaryButtonColor(){document.documentElement.style.setProperty("--secondary-color",this.form.controls.secondary_color.value),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.secondary_color.value,.5))}changeSecondaryHoverColor(){document.documentElement.style.setProperty("--secondary-hover-color",this.form.controls.secondary_hover_color.value)}changeSecondaryButtonFontColor(){document.documentElement.style.setProperty("--secondary-font-color",this.form.controls.secondary_font_color.value)}reset(){this.form.controls.table_color.setValue("#3b3ee3"),this.form.controls.table_font_color.setValue("#ffffff"),this.form.controls.font_size.setValue(12),this.form.controls.secondary_table_color.setValue("#87ceeb"),this.form.controls.secondary_table_font_color.setValue("#000000"),this.form.controls.tertiary_table_color.setValue("#ff4500"),this.form.controls.tertiary_table_font_color.setValue("#000000"),this.form.controls.collapsable_menu.setValue(!0),this.form.controls.entries_per_page.setValue("25"),this.form.controls.warning_color.setValue("#ffc107"),this.form.controls.warning_font_color.setValue("#000000"),this.form.controls.warning_hover_color.setValue("#e0a800"),this.form.controls.success_color.setValue("#28a745"),this.form.controls.success_font_color.setValue("#ffffff"),this.form.controls.success_hover_color.setValue("#218838"),this.form.controls.danger_color.setValue("#dc3545"),this.form.controls.danger_font_color.setValue("#ffffff"),this.form.controls.danger_hover_color.setValue("#c82333"),this.form.controls.info_color.setValue("#17a2b8"),this.form.controls.info_font_color.setValue("#ffffff"),this.form.controls.info_hover_color.setValue("#138496"),this.form.controls.primary_color.setValue("#007bff"),this.form.controls.primary_font_color.setValue("#ffffff"),this.form.controls.primary_hover_color.setValue("#0069d9"),this.form.controls.secondary_color.setValue("#868e96"),this.form.controls.secondary_font_color.setValue("#ffffff"),this.form.controls.secondary_hover_color.setValue("#5a6268"),this.form.controls.date_picker_day_start.setValue("S"),this.form.controls.rio_select_search_mode.setValue("exact"),document.documentElement.style.setProperty("--primary-table-color",this.form.controls.table_color.value),document.documentElement.style.setProperty("--primary-table-font-color",this.form.controls.table_font_color.value),document.documentElement.style.setProperty("--font-size",this.form.controls.font_size.value+"px"),document.documentElement.style.setProperty("--secondary-table-color",this.form.controls.secondary_table_color.value),document.documentElement.style.setProperty("--secondary-table-font-color",this.form.controls.secondary_table_font_color.value),document.documentElement.style.setProperty("--tertiary-table-color",this.form.controls.tertiary_table_color.value),document.documentElement.style.setProperty("--tertiary-table-font-color",this.form.controls.tertiary_table_font_color.value),document.documentElement.style.setProperty("--warning-color",this.form.controls.warning_color.value),document.documentElement.style.setProperty("--warning-font-color",this.form.controls.warning_font_color.value),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.warning_color.value,.5)),document.documentElement.style.setProperty("--warning-hover-color",this.form.controls.warning_hover_color.value),document.documentElement.style.setProperty("--success-color",this.form.controls.success_color.value),document.documentElement.style.setProperty("--success-font-color",this.form.controls.success_font_color.value),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.success_color.value,.5)),document.documentElement.style.setProperty("--success-hover-color",this.form.controls.success_hover_color.value),document.documentElement.style.setProperty("--danger-color",this.form.controls.danger_color.value),document.documentElement.style.setProperty("--danger-font-color",this.form.controls.danger_font_color.value),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.danger_color.value,.5)),document.documentElement.style.setProperty("--danger-hover-color",this.form.controls.danger_hover_color.value),document.documentElement.style.setProperty("--info-color",this.form.controls.info_color.value),document.documentElement.style.setProperty("--info-font-color",this.form.controls.info_font_color.value),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.info_color.value,.5)),document.documentElement.style.setProperty("--info-hover-color",this.form.controls.info_hover_color.value),document.documentElement.style.setProperty("--primary-color",this.form.controls.primary_color.value),document.documentElement.style.setProperty("--primary-font-color",this.form.controls.primary_font_color.value),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.primary_color.value,.5)),document.documentElement.style.setProperty("--primary-hover-color",this.form.controls.primary_hover_color.value),document.documentElement.style.setProperty("--secondary-color",this.form.controls.secondary_color.value),document.documentElement.style.setProperty("--secondary-font-color",this.form.controls.secondary_font_color.value),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.secondary_color.value,.5)),document.documentElement.style.setProperty("--secondary-hover-color",this.form.controls.secondary_hover_color.value)}updateStickyDefault(t,e){const n=this.stickySelects.findIndex(e=>e.key===t);if(-1===n)return;const o=this.stickySelects.map(t=>({...t,options:t.options||[]})),r={...o[n]};r.defaultValue=void 0===e?null:e,r.defaultLabel=this._resolveStickyLabel(r,e),r.updatedAt=(new Date).toISOString(),o[n]=r,this.stickySelects=o,this.stickySelections[t]=e,this._stickyAdapter&&this._stickyAdapter.saveStickySelects(o,"user-settings")}retakeTour(){this._tourManager.retake()}_loadStickySelects(t){const e=t||this._services._account.getUser();if(e&&e.other&&Array.isArray(e.other.stickySelects)){const t=[],n=new Set;e.other.stickySelects.forEach(e=>{e&&e.key&&!n.has(e.key)&&(n.add(e.key),t.push({...e,options:e.options||[]}))}),this.stickySelects=t}else this.stickySelects=[];this.stickySelections={},this.stickySelects.forEach(t=>{this.stickySelections[t.key]=void 0!==t.defaultValue?t.defaultValue:null})}_resolveStickyLabel(t,e){if(null==e)return"";const n=(t.options||[]).find(t=>JSON.stringify(t.value)===JSON.stringify(e));return n&&n.label?n.label:"string"==typeof e?e:JSON.stringify(e)}submitForm(t){const e=this._services._account.getUser(),n=this.form.value,o=this._normalizeDatePickerDayStart(n.date_picker_day_start),{date_picker_day_start:r,...i}=n,a={...e?.other||{},date_picker_day_start:o};this._services._socket.call("updateDocumentProps","users",e._id,[{prop:"settings",data:i},{prop:"other",data:a}],e.__v,(t,n)=>{if(n){if(this._services._alert.setAlert("success","Settings have been updated"),e){const t={...e,__v:n&&n.__v?n.__v:e.__v,settings:i,other:a};this._services._account.setUser(t)}}else this._ds.error("Could not update settings"),this._services._socket.call("insertErrorLog","user settings - update user",[this._services._account.getUser(),t])})}_normalizeDatePickerDayStart(t){return"M"===t||"m"===t||1===t||"1"===t?"M":"S"}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UsersSettingsComponent,deps:[{token:AuthPermissionService},{token:UserSettingsService},{token:ProviderService},{token:DialogService},{token:CoreTourService},{token:RIO_SELECT_STICKY_ADAPTER,optional:!0}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:UsersSettingsComponent,isStandalone:!1,selector:"resolveio-users-settings",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\t.sticky-section-card,\n\t.sticky-section-card * {\n\t\ttransform: none !important;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: #ffffff;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t.settings-shell {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t\tpadding: 12px 8px 32px;\n\t\tbackground: radial-gradient(circle at 15% 20%, rgba(111, 136, 255, 0.12), transparent 35%),\n\t\t\tradial-gradient(circle at 80% 0%, rgba(255, 130, 92, 0.12), transparent 32%),\n\t\t\tlinear-gradient(135deg, #f7f9ff 0%, #ffffff 60%, #f5f7fb 100%);\n\t}\n\n\t.aurora {\n\t\tposition: absolute;\n\t\twidth: 420px;\n\t\theight: 420px;\n\t\tborder-radius: 50%;\n\t\tfilter: blur(70px);\n\t\topacity: .55;\n\t\tmix-blend-mode: screen;\n\t\tanimation: drift 18s ease-in-out infinite alternate;\n\t\tz-index: 0;\n\t}\n\n\t.aurora.aurora-one {\n\t\tbackground: radial-gradient(circle, rgba(82, 163, 255, .7), rgba(134, 120, 255, .25));\n\t\ttop: -120px;\n\t\tleft: -70px;\n\t}\n\n\t.aurora.aurora-two {\n\t\tbackground: radial-gradient(circle, rgba(255, 147, 92, .6), rgba(255, 227, 187, .35));\n\t\tbottom: -140px;\n\t\tright: -40px;\n\t\tanimation-duration: 22s;\n\t}\n\n\t.settings-hero {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 16px;\n\t\talign-items: center;\n\t\tmargin-bottom: 18px;\n\t}\n\n\t.glass-card {\n\t\tposition: relative;\n\t\tbackground: rgba(255, 255, 255, .78);\n\t\tborder: 1px solid rgba(255, 255, 255, .55);\n\t\tbox-shadow: 0 10px 40px rgba(54, 74, 120, .14), inset 0 0 0 1px rgba(255, 255, 255, .32);\n\t\tborder-radius: 18px;\n\t\tpadding: 18px;\n\t\toverflow: hidden;\n\t}\n\n\t.glass-card::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\tinset: 0;\n\t\tborder-radius: inherit;\n\t\tpointer-events: none;\n\t\tz-index: 0;\n\t}\n\n\t.hero-main h2 {\n\t\tfont-weight: 800;\n\t\tfont-size: 26px;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #0f172a;\n\t}\n\n\t.hero-main p {\n\t\tcolor: #4b5563;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.hero-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 12px;\n\t\tborder-radius: 999px;\n\t\tfont-weight: 700;\n\t\tcolor: #1f2937;\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .1), rgba(16, 185, 129, .1), rgba(59, 130, 246, .12));\n\t\tborder: 1px solid rgba(99, 102, 241, .25);\n\t\tmargin-bottom: 10px;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: .04em;\n\t\tfont-size: 12px;\n\t}\n\n\t.hero-actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 12px;\n\t\talign-items: center;\n\t\tmargin-top: 12px;\n\t}\n\n\t.neon-btn {\n\t\tposition: relative;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .15), rgba(59, 130, 246, .08));\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tpadding: 10px 16px;\n\t\tborder-radius: 12px;\n\t\tbox-shadow: 0 10px 24px rgba(99, 102, 241, .15);\n\t\ttransition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;\n\t}\n\n\t.neon-btn:hover {\n\t\ttransform: translateY(-2px);\n\t\tborder-color: rgba(99, 102, 241, .45);\n\t\tbox-shadow: 0 14px 26px rgba(99, 102, 241, .22);\n\t}\n\n\t.save-button form-button ::ng-deep button {\n\t\tborder-radius: 12px;\n\t\tfont-weight: 800;\n\t\tletter-spacing: .01em;\n\t\tpadding: 11px 18px;\n\t\tbox-shadow: 0 10px 26px rgba(16, 185, 129, .24);\n\t}\n\n\t.hero-preview {\n\t\tposition: relative;\n\t}\n\n\t.preview-card {\n\t\tborder-radius: 16px;\n\t\tpadding: 16px;\n\t\tbackground: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .52));\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 12px 30px rgba(80, 110, 185, .16);\n\t\tborder: 1px solid rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-title {\n\t\tfont-weight: 800;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #111827;\n\t}\n\n\t.swatch-row {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(140px, 1fr));\n\t\tgap: 10px;\n\t}\n\n\t.swatch {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);\n\t\topacity: .98;\n\t}\n\n\t.swatch span {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: rgba(15, 23, 42, .85);\n\t}\n\n\t.preview-pulse {\n\t\tposition: absolute;\n\t\twidth: 120px;\n\t\theight: 120px;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(circle, rgba(16, 185, 129, .3), transparent 60%);\n\t\tbottom: -18px;\n\t\tright: -14px;\n\t\tfilter: blur(12px);\n\t\tanimation: pulse 2.4s ease-in-out infinite;\n\t}\n\n\t.hero-metrics {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-top: 14px;\n\t}\n\n\t.metric-pill {\n\t\tbackground: rgba(15, 23, 42, .06);\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 999px;\n\t\tpadding: 8px 12px;\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t}\n\n\t.section-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 14px;\n\t\tposition: relative;\n\t\tz-index: 1;\n\t}\n\n\t.section-card {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t}\n\n\t.section-heading {\n\t\tmargin-bottom: 12px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 10px;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.section-heading h3 {\n\t\tmargin: 0;\n\t\tfont-weight: 800;\n\t\tcolor: #0f172a;\n\t}\n\n\t.section-heading p {\n\t\tmargin: 0;\n\t\tcolor: #4b5563;\n\t}\n\n\t.field-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n\t\tgap: 12px;\n\t}\n\n\t.field-card {\n\t\tpadding: 12px;\n\t\tborder-radius: 14px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .85);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t\ttransition: transform .2s ease, box-shadow .2s ease;\n\t}\n\n\t.field-card:hover {\n\t\tbox-shadow: 0 8px 22px rgba(99, 102, 241, .12);\n\t}\n\n\t/* Avoid transforming the sticky select card so the fixed overlay positions correctly. */\n\t.sticky-select-card:hover {\n\t\ttransform: none;\n\t}\n\n\t.sticky-section-card {\n\t\tanimation: none;\n\t\ttransform: none;\n\t}\n\n\t.field-label {\n\t\tfont-weight: 700;\n\t\tcolor: #111827;\n\t\tmargin-bottom: 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 6px;\n\t}\n\n\t.field-hint {\n\t\tfont-size: 12px;\n\t\tcolor: #6b7280;\n\t\tmargin: 0;\n\t}\n\n\t.input-bevel {\n\t\tborder-radius: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: rgba(255, 255, 255, .92);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t\tpadding: 10px 12px;\n\t\twidth: 100%;\n\t}\n\n\t.toggle {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t}\n\n\t.toggle-input {\n\t\tdisplay: none;\n\t}\n\n\t.toggle-track {\n\t\twidth: 54px;\n\t\theight: 30px;\n\t\tborder-radius: 999px;\n\t\tbackground: linear-gradient(120deg, rgba(15, 23, 42, .08), rgba(15, 23, 42, .15));\n\t\tposition: relative;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t\tborder: 1px solid rgba(15, 23, 42, .12);\n\t\ttransition: background .2s ease;\n\t}\n\n\t.toggle-thumb {\n\t\tposition: absolute;\n\t\ttop: 3px;\n\t\tleft: 3px;\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tborder-radius: 50%;\n\t\tbackground: linear-gradient(135deg, #63a4ff, #83eaf1);\n\t\tbox-shadow: 0 8px 16px rgba(99, 102, 241, .35);\n\t\ttransition: transform .2s ease;\n\t}\n\n\t.toggle-input:checked + .toggle-track {\n\t\tbackground: linear-gradient(120deg, rgba(16, 185, 129, .15), rgba(52, 211, 153, .25));\n\t\tborder-color: rgba(16, 185, 129, .45);\n\t}\n\n\t.toggle-input:checked + .toggle-track .toggle-thumb {\n\t\ttransform: translateX(24px);\n\t\tbackground: linear-gradient(135deg, #10b981, #22d3ee);\n\t\tbox-shadow: 0 10px 18px rgba(16, 185, 129, .32);\n\t}\n\n\t.toggle-state {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(260px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-top: 10px;\n\t}\n\n\t.color-card {\n\t\tborder-radius: 14px;\n\t\tpadding: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .9);\n\t\tdisplay: grid;\n\t\tgrid-template-columns: 1fr 120px;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t}\n\n\t.color-chip {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 4px;\n\t}\n\n\t.color-name {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-preview {\n\t\tborder-radius: 12px;\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.color-input {\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 12px;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);\n\t\twidth: 100%;\n\t\tcursor: pointer;\n\t}\n\n\t.palette-preview {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-bottom: 8px;\n\t}\n\n\t.preview-table {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tbackground: linear-gradient(160deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .7));\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t}\n\n\t.preview-table .row-swatch {\n\t\tborder-radius: 10px;\n\t\tpadding: 10px;\n\t\tfont-weight: 700;\n\t\tmargin-bottom: 6px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-table .row-swatch:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.button-demo {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t}\n\n\t.btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\n\t.btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\n\t.btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t.btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\n\t.btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\n\t.btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t.btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\n\t.btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\n\t.btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t.btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\n\t.btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\n\t.btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t.btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\n\t.btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\n\t.btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t.btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\n\t.btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\n\t.btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t.rio-select .rio-select-container {\n\t\tborder-radius: 12px !important;\n\t\tmin-height: 42px !important;\n\t\tborder-color: rgba(15, 23, 42, .1) !important;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.sticky-empty {\n\t\tbackground: rgba(23, 162, 184, .12);\n\t\tcolor: #0f4c75;\n\t\tborder: 1px solid rgba(23, 162, 184, .2);\n\t\tborder-radius: 12px;\n\t\tpadding: 12px;\n\t}\n\n\t.animate-rise {\n\t\tanimation: rise .5s ease;\n\t}\n\n\t@keyframes drift {\n\t\tfrom {\n\t\t\ttransform: translateY(0) translateX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: translateY(-30px) translateX(20px);\n\t\t}\n\t}\n\n\t@keyframes pulse {\n\t\t0% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t\t50% {\n\t\t\ttransform: scale(1.08);\n\t\t\topacity: .9;\n\t\t}\n\t\t100% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t}\n\n\t@keyframes rise {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(12px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n</style>\n\n<div class="settings-shell">\n\t<div class="aurora aurora-one"></div>\n\t<div class="aurora aurora-two"></div>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submitForm(form)">\n\t\t<div class="settings-hero glass-card animate-rise">\n\t\t\t<div class="hero-main">\n\t\t\t\t<div class="hero-chip">User Settings</div>\n\t\t\t\t<h2>Welcome {{ user?.fullname || user?.username || user?.email || \'back\' }}!</h2>\n\t\t\t\t<p>Shape {{ client || \'your workspace\' }} into something joyful, colorful and uniquely you.</p>\n\t\t\t\t<div class="hero-actions">\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="reset()">Reset to defaults</button>\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="retakeTour()">Retake Tour</button>\n\t\t\t\t\t<div class="save-button">\n\t\t\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="hero-metrics">\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Entries / page</span>\n\t\t\t\t\t\t<strong>{{ form.controls.entries_per_page.value }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Font size</span>\n\t\t\t\t\t\t<strong>{{ form.controls.font_size.value }}px</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Week starts</span>\n\t\t\t\t\t\t<strong>{{ form.controls.date_picker_day_start.value === \'M\' ? \'Monday\' : \'Sunday\' }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="hero-preview">\n\t\t\t\t<div class="preview-card">\n\t\t\t\t\t<div class="preview-title">Live palette peek</div>\n\t\t\t\t\t<div class="swatch-row">\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.primary_color.value" [style.color]="form.controls.primary_font_color.value">\n\t\t\t\t\t\t\t<span>Primary buttons</span>\n\t\t\t\t\t\t\t{{ form.controls.primary_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\t<span>Success tone</span>\n\t\t\t\t\t\t\t{{ form.controls.success_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\t<span>Primary table</span>\n\t\t\t\t\t\t\t{{ form.controls.table_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="preview-pulse"></div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="section-grid">\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Experience preferences</h3>\n\t\t\t\t\t<p>Tune how the app greets you each day.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="field-grid">\n\t\t\t\t\t<label class="field-card">\n\t\t\t\t\t\t<div class="field-label">Collapsable menu</div>\n\t\t\t\t\t\t<p class="field-hint">Keep navigation cozy when you want focus.</p>\n\t\t\t\t\t\t<div class="toggle">\n\t\t\t\t\t\t\t<input class="toggle-input" type="checkbox" formControlName="collapsable_menu" />\n\t\t\t\t\t\t\t<span class="toggle-track">\n\t\t\t\t\t\t\t\t<span class="toggle-thumb"></span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class="toggle-state">\n\t\t\t\t\t\t\t\t@if (form.controls.collapsable_menu.value) {\n\t\t\t\t\t\t\t\t\tCompact\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\tOpen\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</label>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Default entries per page</div>\n\t\t\t\t\t\t<p class="field-hint">Pick your sweet spot for list density.</p>\n\t\t\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.entries_per_page.valid ? \'is-valid\' : \'is-invalid\']" formControlName="entries_per_page" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t\t\t<rio-option value="25">25</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="50">50</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="100">100</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="250">250</rio-option>\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (!form.controls.entries_per_page.valid) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Entries per page is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Select search style</div>\n\t\t\t\t\t\t<p class="field-hint">Decide if typing should be fuzzy or exact.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.rio_select_search_mode.valid ? \'is-valid\' : \'is-invalid\']" formControlName="rio_select_search_mode" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="fuzzy">Fuzzy (flexible matching)</rio-option>\n\t\t\t\t\t\t\t<rio-option value="exact">Exact (must contain the term)</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Font size</div>\n\t\t\t\t\t\t<p class="field-hint">We recommend between 11–14px for quick scanning.</p>\n\t\t\t\t\t\t<input class="input-bevel" [ngClass]="[form.controls.font_size.valid ? \'is-valid\' : \'is-invalid\']" type="number" formControlName="font_size" (keyup)="changePrimaryFontSize()" />\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'wholeNumbersGreaterThanZero\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is invalid</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'maxValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not exceed 18</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'minValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not be less than 8</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Week start (date picker)</div>\n\t\t\t\t\t\t<p class="field-hint">Pick where your planner begins.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.date_picker_day_start.valid ? \'is-valid\' : \'is-invalid\']" formControlName="date_picker_day_start" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option [value]="\'S\'">Sunday</rio-option>\n\t\t\t\t\t\t\t<rio-option [value]="\'M\'">Monday</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (form.controls.date_picker_day_start.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Week start is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Starting page</div>\n\t\t\t\t\t\t<p class="field-hint">Jump right into the view you love most.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.opening_route.valid ? \'is-valid\' : \'\']" formControlName="opening_route" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="/home">Home</rio-option>\n\t\t\t\t\t\t\t@for (view of views; track view.display) {\n\t\t\t\t\t\t\t\t<rio-option [value]="view.value">{{ view.display | titleCase }}</rio-option>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Routing preference</div>\n\t\t\t\t\t\t<p class="field-hint">Leave as default to follow company behavior, or override just for your account.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.routing_preference.valid ? \'is-valid\' : \'\']" formControlName="routing_preference" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="">Use App Default</rio-option>\n\t\t\t\t\t\t\t<rio-option value="alwaysAsk">Always Ask</rio-option>\n\t\t\t\t\t\t\t<rio-option value="sameTab">Same Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newTab">New Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newWindow">New Window</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Table palette</h3>\n\t\t\t\t\t<p>Pick vibrant layers for your data rows.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="palette-preview">\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\tPrimary header\n\t\t\t\t\t\t\t<span>{{ form.controls.table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.secondary_table_color.value" [style.color]="form.controls.secondary_table_font_color.value">\n\t\t\t\t\t\t\tSecondary header\n\t\t\t\t\t\t\t<span>{{ form.controls.secondary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.tertiary_table_color.value" [style.color]="form.controls.tertiary_table_font_color.value">\n\t\t\t\t\t\t\tTertiary header\n\t\t\t\t\t\t\t<span>{{ form.controls.tertiary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.warning_color.value" [style.color]="form.controls.warning_font_color.value">\n\t\t\t\t\t\t\tWarnings\n\t\t\t\t\t\t\t<span>{{ form.controls.warning_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\tSuccess\n\t\t\t\t\t\t\t<span>{{ form.controls.success_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.info_color.value" [style.color]="form.controls.info_font_color.value">\n\t\t\t\t\t\t\tInfo\n\t\t\t\t\t\t\t<span>{{ form.controls.info_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero row that anchors your data.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_color" (ngModelChange)="changePrimaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it crisp and readable.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_font_color" (ngModelChange)="changePrimaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for supporting sections.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_color" (ngModelChange)="changeSecondaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Match contrast with the new hue.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_font_color" (ngModelChange)="changeSecondaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">For extra callouts.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_color" (ngModelChange)="changeTertiaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Balance brightness for legibility.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_font_color" (ngModelChange)="changeTertiaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Button glow-up</h3>\n\t\t\t\t\t<p>Make clicks feel friendly and intentional.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="button-demo">\n\t\t\t\t\t<button type="button" class="btn btn-success">Success</button>\n\t\t\t\t\t<button type="button" class="btn btn-warning">Warning</button>\n\t\t\t\t\t<button type="button" class="btn btn-danger">Danger</button>\n\t\t\t\t\t<button type="button" class="btn btn-info">Info</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary">Primary</button>\n\t\t\t\t\t<button type="button" class="btn btn-secondary">Secondary</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Celebrate wins.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_color" (ngModelChange)="changeSuccessColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it sharp.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_font_color" (ngModelChange)="changeSuccessFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">How the button greets hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_hover_color" (ngModelChange)="changeSuccessHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle but visible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_color" (ngModelChange)="changeWarningColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning font</div>\n\t\t\t\t\t\t\t<div class="field-hint">High contrast copy.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_font_color" (ngModelChange)="changeWarningFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add motion to caution.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_hover_color" (ngModelChange)="changeWarningHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Clear stop signal.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_color" (ngModelChange)="changeDangerColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Stay readable on alert.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_font_color" (ngModelChange)="changeDangerFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Softer on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_hover_color" (ngModelChange)="changeDangerHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Highlight helpful hints.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_color" (ngModelChange)="changeInfoColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep tips legible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_font_color" (ngModelChange)="changeInfoFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle motion on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_hover_color" (ngModelChange)="changeInfoHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero action.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_color" (ngModelChange)="changePrimaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Strong contrast for CTA.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_font_color" (ngModelChange)="changePrimaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">A playful shift on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_hover_color" (ngModelChange)="changePrimaryButtonHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for subtle actions.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_color" (ngModelChange)="changeSecondaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it balanced.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_font_color" (ngModelChange)="changeSecondaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add a soft glow.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_hover_color" (ngModelChange)="changeSecondaryHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise sticky-section-card">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Sticky select defaults</h3>\n\t\t\t\t\t<p>Teach ResolveIO which choices you love.</p>\n\t\t\t\t</div>\n\t\t\t\t@if (!stickySelects.length) {\n\t\t\t\t\t<div class="sticky-empty">\n\t\t\t\t\t\tNo sticky selects saved yet. Add a stickyKey on a select to remember your favorite defaults.\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t@for (sticky of stickySelects; track sticky.key) {\n\t\t\t\t\t\t<div class="field-card sticky-select-card">\n\t\t\t\t\t\t\t<div class="field-label">{{ sticky.key }}</div>\n\t\t\t\t\t\t\t@if (sticky.options && sticky.options.length) {\n\t\t\t\t\t\t\t\t<rio-select\n\t\t\t\t\t\t\t\t\t[(ngModel)]="stickySelections[sticky.key]"\n\t\t\t\t\t\t\t\t\t[ngModelOptions]="{standalone: true}"\n\t\t\t\t\t\t\t\t\t[options]="sticky.options"\n\t\t\t\t\t\t\t\t\toptionValueKey="value"\n\t\t\t\t\t\t\t\t\toptionLabelKey="label"\n\t\t\t\t\t\t\t\t\t[searchable]="false"\n\t\t\t\t\t\t\t\t\tappendTo="body"\n\t\t\t\t\t\t\t\t\t[stickyAutoSave]="true"\n\t\t\t\t\t\t\t\t\t(ngModelChange)="updateStickyDefault(sticky.key, $event)">\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@if (!sticky.options || !sticky.options.length) {\n\t\t\t\t\t\t\t\t<div class="text-muted">No saved options yet.</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>\n',styles:['.sticky-section-card,.sticky-section-card *{transform:none!important}:host{display:block}::ng-deep :root{--primary-table-color: #3b3ee3;--primary-table-font-color: #ffffff;--font-size: 12px;--secondary-table-color: #87ceeb;--secondary-table-font-color: #000000;--tertiary-table-color: #ff4500;--tertiary-table-font-color: #000000;--warning-color: #ffc107;--warning-font-color: #000000;--warning-hover-color: #e0a800;--warning-shadow-color: 0 0 0 .2rem rgba(222, 170, 12, .5);--success-color: #28a745;--success-font-color: #ffffff;--success-hover-color: #218838;--success-shadow-color: 0 0 0 .2rem rgba(72, 180, 97, .5);--danger-color: #dc3545;--danger-font-color: #ffffff;--danger-hover-color: #c82333;--danger-shadow-color: 0 0 0 .2rem rgba(225, 83, 97, .5);--info-color: #17a2b8;--info-font-color: #ffffff;--info-hover-color: #138496;--info-shadow-color: 0 0 0 .2rem rgba(58, 176, 195, .5);--primary-color: #007bff;--primary-font-color: #ffffff;--primary-hover-color: #0069d9;--primary-shadow-color: 0 0 0 .2rem rgba(38, 143, 255, .5);--secondary-color: #868e96;--secondary-font-color: #ffffff;--secondary-hover-color: #5a6268;--secondary-shadow-color: 0 0 0 .2rem rgba(130, 138, 145, .5)}.settings-shell{position:relative;overflow:visible;padding:12px 8px 32px;background:radial-gradient(circle at 15% 20%,rgba(111,136,255,.12),transparent 35%),radial-gradient(circle at 80% 0%,rgba(255,130,92,.12),transparent 32%),linear-gradient(135deg,#f7f9ff,#fff 60%,#f5f7fb)}.aurora{position:absolute;width:420px;height:420px;border-radius:50%;filter:blur(70px);opacity:.55;mix-blend-mode:screen;animation:drift 18s ease-in-out infinite alternate;z-index:0}.aurora.aurora-one{background:radial-gradient(circle,#52a3ffb3,#8678ff40);top:-120px;left:-70px}.aurora.aurora-two{background:radial-gradient(circle,#ff935c99,#ffe3bb59);bottom:-140px;right:-40px;animation-duration:22s}.settings-hero{position:relative;z-index:1;display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;align-items:center;margin-bottom:18px}.glass-card{position:relative;background:#ffffffc7;border:1px solid rgba(255,255,255,.55);box-shadow:0 10px 40px #364a7824,inset 0 0 0 1px #ffffff52;border-radius:18px;padding:18px;overflow:hidden}.glass-card:before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:0}.hero-main h2{font-weight:800;font-size:26px;margin-bottom:8px;color:#0f172a}.hero-main p{color:#4b5563;margin-bottom:12px}.hero-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;font-weight:700;color:#1f2937;background:linear-gradient(120deg,#6366f11a,#10b9811a,#3b82f61f);border:1px solid rgba(99,102,241,.25);margin-bottom:10px;text-transform:uppercase;letter-spacing:.04em;font-size:12px}.hero-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:12px}.neon-btn{position:relative;border:1px solid rgba(15,23,42,.1);background:linear-gradient(120deg,#6366f126,#3b82f614);color:#0f172a;font-weight:700;padding:10px 16px;border-radius:12px;box-shadow:0 10px 24px #6366f126;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.neon-btn:hover{transform:translateY(-2px);border-color:#6366f173;box-shadow:0 14px 26px #6366f138}.save-button form-button ::ng-deep button{border-radius:12px;font-weight:800;letter-spacing:.01em;padding:11px 18px;box-shadow:0 10px 26px #10b9813d}.hero-preview{position:relative}.preview-card{border-radius:16px;padding:16px;background:radial-gradient(circle at 20% 20%,#ffffffb3,#ffffff85);box-shadow:inset 0 1px #fffc,0 12px 30px #506eb929;border:1px solid rgba(255,255,255,.6)}.preview-title{font-weight:800;margin-bottom:8px;color:#111827}.swatch-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}.swatch{border-radius:12px;padding:10px;color:#0f172a;font-weight:700;display:flex;align-items:center;justify-content:space-between;box-shadow:inset 0 1px #ffffff73;opacity:.98}.swatch span{font-size:12px;font-weight:600;color:#0f172ad9}.preview-pulse{position:absolute;width:120px;height:120px;border-radius:50%;background:radial-gradient(circle,rgba(16,185,129,.3),transparent 60%);bottom:-18px;right:-14px;filter:blur(12px);animation:pulse 2.4s ease-in-out infinite}.hero-metrics{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.metric-pill{background:#0f172a0f;border:1px solid rgba(15,23,42,.08);border-radius:999px;padding:8px 12px;font-weight:700;color:#0f172a;display:inline-flex;align-items:center;gap:6px}.section-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px;position:relative;z-index:1}.section-card{position:relative;overflow:visible}.section-heading{margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.section-heading h3{margin:0;font-weight:800;color:#0f172a}.section-heading p{margin:0;color:#4b5563}.field-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}.field-card{padding:12px;border-radius:14px;border:1px solid rgba(15,23,42,.06);background:#ffffffd9;box-shadow:inset 0 1px #ffffffb3;transition:transform .2s ease,box-shadow .2s ease}.field-card:hover{box-shadow:0 8px 22px #6366f11f}.sticky-select-card:hover{transform:none}.sticky-section-card{animation:none;transform:none}.field-label{font-weight:700;color:#111827;margin-bottom:4px;display:flex;align-items:center;justify-content:space-between;gap:6px}.field-hint{font-size:12px;color:#6b7280;margin:0}.input-bevel{border-radius:12px;border:1px solid rgba(15,23,42,.1);background:#ffffffeb;box-shadow:inset 0 1px #fffc;padding:10px 12px;width:100%}.toggle{display:flex;align-items:center;gap:8px}.toggle-input{display:none}.toggle-track{width:54px;height:30px;border-radius:999px;background:linear-gradient(120deg,#0f172a14,#0f172a26);position:relative;box-shadow:inset 0 1px #fff9;border:1px solid rgba(15,23,42,.12);transition:background .2s ease}.toggle-thumb{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:linear-gradient(135deg,#63a4ff,#83eaf1);box-shadow:0 8px 16px #6366f159;transition:transform .2s ease}.toggle-input:checked+.toggle-track{background:linear-gradient(120deg,#10b98126,#34d39940);border-color:#10b98173}.toggle-input:checked+.toggle-track .toggle-thumb{transform:translate(24px);background:linear-gradient(135deg,#10b981,#22d3ee);box-shadow:0 10px 18px #10b98152}.toggle-state{font-weight:700;color:#0f172a}.color-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px;margin-top:10px}.color-card{border-radius:14px;padding:12px;border:1px solid rgba(15,23,42,.06);background:#ffffffe6;display:grid;grid-template-columns:1fr 120px;gap:10px;align-items:center}.color-chip{display:flex;flex-direction:column;gap:4px}.color-name{font-weight:700;color:#0f172a}.color-preview{border-radius:12px;height:48px;border:1px solid rgba(15,23,42,.08);box-shadow:inset 0 1px #ffffffb3}.color-input{height:48px;border:1px solid rgba(15,23,42,.08);border-radius:12px;box-shadow:inset 0 1px #ffffffbf;width:100%;cursor:pointer}.palette-preview{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin-bottom:8px}.preview-table{border-radius:12px;padding:10px;background:linear-gradient(160deg,#ffffffd9,#ffffffb3);border:1px solid rgba(15,23,42,.08);box-shadow:inset 0 1px #fffc}.preview-table .row-swatch{border-radius:10px;padding:10px;font-weight:700;margin-bottom:6px;display:flex;align-items:center;justify-content:space-between;box-shadow:inset 0 1px #fff9}.preview-table .row-swatch:last-child{margin-bottom:0}.button-demo{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}.btn-warning{color:var(--warning-font-color);background-color:var(--warning-color);border-color:var(--warning-color)}.btn-warning:focus,.btn-warning.focus{box-shadow:var(--warning-shadow-color)}.btn-warning:hover{color:var(--warning-font-color);background-color:var(--warning-hover-color);border-color:var(--warning-hover-color)}.btn-success{color:var(--success-font-color);background-color:var(--success-color);border-color:var(--success-color)}.btn-success:focus,.btn-success.focus{box-shadow:var(--success-shadow-color)}.btn-success:hover{color:var(--success-font-color);background-color:var(--success-hover-color);border-color:var(--success-hover-color)}.btn-danger{color:var(--danger-font-color);background-color:var(--danger-color);border-color:var(--danger-color)}.btn-danger:focus,.btn-danger.focus{box-shadow:var(--danger-shadow-color)}.btn-danger:hover{color:var(--danger-font-color);background-color:var(--danger-hover-color);border-color:var(--danger-hover-color)}.btn-info{color:var(--info-font-color);background-color:var(--info-color);border-color:var(--info-color)}.btn-info:focus,.btn-info.focus{box-shadow:var(--info-shadow-color)}.btn-info:hover{color:var(--info-font-color);background-color:var(--info-hover-color);border-color:var(--info-hover-color)}.btn-primary{color:var(--primary-font-color);background-color:var(--primary-color);border-color:var(--primary-color)}.btn-primary:focus,.btn-primary.focus{box-shadow:var(--primary-shadow-color)}.btn-primary:hover{color:var(--primary-font-color);background-color:var(--primary-hover-color);border-color:var(--primary-hover-color)}.btn-secondary{color:var(--secondary-font-color);background-color:var(--secondary-color);border-color:var(--secondary-color)}.btn-secondary:focus,.btn-secondary.focus{box-shadow:var(--secondary-shadow-color)}.btn-secondary:hover{color:var(--secondary-font-color);background-color:var(--secondary-hover-color);border-color:var(--secondary-hover-color)}.rio-select .rio-select-container{border-radius:12px!important;min-height:42px!important;border-color:#0f172a1a!important;box-shadow:inset 0 1px #ffffffb3}.sticky-empty{background:#17a2b81f;color:#0f4c75;border:1px solid rgba(23,162,184,.2);border-radius:12px;padding:12px}.animate-rise{animation:rise .5s ease}@keyframes drift{0%{transform:translateY(0) translate(0)}to{transform:translateY(-30px) translate(20px)}}@keyframes pulse{0%{transform:scale(1);opacity:.6}50%{transform:scale(1.08);opacity:.9}to{transform:scale(1);opacity:.6}}@keyframes rise{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}\n'],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NumberValueAccessor,selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]"},{kind:"directive",type:i2.CheckboxControlValueAccessor,selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:i5.RioOptionComponent,selector:"rio-option",inputs:["value","disabled","label","id"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"pipe",type:TitleCaseAndUnderscorePipe,name:"titleCase"}]})}function hexToRGB(t,e){let n=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e?"rgba("+n+", "+o+", "+r+", "+e+")":"rgb("+n+", "+o+", "+r+")"}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UsersSettingsComponent,decorators:[{type:Component,args:[{selector:"resolveio-users-settings",providers:[ProviderService],standalone:!1,template:'<style>\n\t.sticky-section-card,\n\t.sticky-section-card * {\n\t\ttransform: none !important;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: #ffffff;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t.settings-shell {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t\tpadding: 12px 8px 32px;\n\t\tbackground: radial-gradient(circle at 15% 20%, rgba(111, 136, 255, 0.12), transparent 35%),\n\t\t\tradial-gradient(circle at 80% 0%, rgba(255, 130, 92, 0.12), transparent 32%),\n\t\t\tlinear-gradient(135deg, #f7f9ff 0%, #ffffff 60%, #f5f7fb 100%);\n\t}\n\n\t.aurora {\n\t\tposition: absolute;\n\t\twidth: 420px;\n\t\theight: 420px;\n\t\tborder-radius: 50%;\n\t\tfilter: blur(70px);\n\t\topacity: .55;\n\t\tmix-blend-mode: screen;\n\t\tanimation: drift 18s ease-in-out infinite alternate;\n\t\tz-index: 0;\n\t}\n\n\t.aurora.aurora-one {\n\t\tbackground: radial-gradient(circle, rgba(82, 163, 255, .7), rgba(134, 120, 255, .25));\n\t\ttop: -120px;\n\t\tleft: -70px;\n\t}\n\n\t.aurora.aurora-two {\n\t\tbackground: radial-gradient(circle, rgba(255, 147, 92, .6), rgba(255, 227, 187, .35));\n\t\tbottom: -140px;\n\t\tright: -40px;\n\t\tanimation-duration: 22s;\n\t}\n\n\t.settings-hero {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 16px;\n\t\talign-items: center;\n\t\tmargin-bottom: 18px;\n\t}\n\n\t.glass-card {\n\t\tposition: relative;\n\t\tbackground: rgba(255, 255, 255, .78);\n\t\tborder: 1px solid rgba(255, 255, 255, .55);\n\t\tbox-shadow: 0 10px 40px rgba(54, 74, 120, .14), inset 0 0 0 1px rgba(255, 255, 255, .32);\n\t\tborder-radius: 18px;\n\t\tpadding: 18px;\n\t\toverflow: hidden;\n\t}\n\n\t.glass-card::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\tinset: 0;\n\t\tborder-radius: inherit;\n\t\tpointer-events: none;\n\t\tz-index: 0;\n\t}\n\n\t.hero-main h2 {\n\t\tfont-weight: 800;\n\t\tfont-size: 26px;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #0f172a;\n\t}\n\n\t.hero-main p {\n\t\tcolor: #4b5563;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.hero-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 12px;\n\t\tborder-radius: 999px;\n\t\tfont-weight: 700;\n\t\tcolor: #1f2937;\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .1), rgba(16, 185, 129, .1), rgba(59, 130, 246, .12));\n\t\tborder: 1px solid rgba(99, 102, 241, .25);\n\t\tmargin-bottom: 10px;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: .04em;\n\t\tfont-size: 12px;\n\t}\n\n\t.hero-actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 12px;\n\t\talign-items: center;\n\t\tmargin-top: 12px;\n\t}\n\n\t.neon-btn {\n\t\tposition: relative;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .15), rgba(59, 130, 246, .08));\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tpadding: 10px 16px;\n\t\tborder-radius: 12px;\n\t\tbox-shadow: 0 10px 24px rgba(99, 102, 241, .15);\n\t\ttransition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;\n\t}\n\n\t.neon-btn:hover {\n\t\ttransform: translateY(-2px);\n\t\tborder-color: rgba(99, 102, 241, .45);\n\t\tbox-shadow: 0 14px 26px rgba(99, 102, 241, .22);\n\t}\n\n\t.save-button form-button ::ng-deep button {\n\t\tborder-radius: 12px;\n\t\tfont-weight: 800;\n\t\tletter-spacing: .01em;\n\t\tpadding: 11px 18px;\n\t\tbox-shadow: 0 10px 26px rgba(16, 185, 129, .24);\n\t}\n\n\t.hero-preview {\n\t\tposition: relative;\n\t}\n\n\t.preview-card {\n\t\tborder-radius: 16px;\n\t\tpadding: 16px;\n\t\tbackground: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .52));\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 12px 30px rgba(80, 110, 185, .16);\n\t\tborder: 1px solid rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-title {\n\t\tfont-weight: 800;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #111827;\n\t}\n\n\t.swatch-row {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(140px, 1fr));\n\t\tgap: 10px;\n\t}\n\n\t.swatch {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);\n\t\topacity: .98;\n\t}\n\n\t.swatch span {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: rgba(15, 23, 42, .85);\n\t}\n\n\t.preview-pulse {\n\t\tposition: absolute;\n\t\twidth: 120px;\n\t\theight: 120px;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(circle, rgba(16, 185, 129, .3), transparent 60%);\n\t\tbottom: -18px;\n\t\tright: -14px;\n\t\tfilter: blur(12px);\n\t\tanimation: pulse 2.4s ease-in-out infinite;\n\t}\n\n\t.hero-metrics {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-top: 14px;\n\t}\n\n\t.metric-pill {\n\t\tbackground: rgba(15, 23, 42, .06);\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 999px;\n\t\tpadding: 8px 12px;\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t}\n\n\t.section-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 14px;\n\t\tposition: relative;\n\t\tz-index: 1;\n\t}\n\n\t.section-card {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t}\n\n\t.section-heading {\n\t\tmargin-bottom: 12px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 10px;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.section-heading h3 {\n\t\tmargin: 0;\n\t\tfont-weight: 800;\n\t\tcolor: #0f172a;\n\t}\n\n\t.section-heading p {\n\t\tmargin: 0;\n\t\tcolor: #4b5563;\n\t}\n\n\t.field-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n\t\tgap: 12px;\n\t}\n\n\t.field-card {\n\t\tpadding: 12px;\n\t\tborder-radius: 14px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .85);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t\ttransition: transform .2s ease, box-shadow .2s ease;\n\t}\n\n\t.field-card:hover {\n\t\tbox-shadow: 0 8px 22px rgba(99, 102, 241, .12);\n\t}\n\n\t/* Avoid transforming the sticky select card so the fixed overlay positions correctly. */\n\t.sticky-select-card:hover {\n\t\ttransform: none;\n\t}\n\n\t.sticky-section-card {\n\t\tanimation: none;\n\t\ttransform: none;\n\t}\n\n\t.field-label {\n\t\tfont-weight: 700;\n\t\tcolor: #111827;\n\t\tmargin-bottom: 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 6px;\n\t}\n\n\t.field-hint {\n\t\tfont-size: 12px;\n\t\tcolor: #6b7280;\n\t\tmargin: 0;\n\t}\n\n\t.input-bevel {\n\t\tborder-radius: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: rgba(255, 255, 255, .92);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t\tpadding: 10px 12px;\n\t\twidth: 100%;\n\t}\n\n\t.toggle {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t}\n\n\t.toggle-input {\n\t\tdisplay: none;\n\t}\n\n\t.toggle-track {\n\t\twidth: 54px;\n\t\theight: 30px;\n\t\tborder-radius: 999px;\n\t\tbackground: linear-gradient(120deg, rgba(15, 23, 42, .08), rgba(15, 23, 42, .15));\n\t\tposition: relative;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t\tborder: 1px solid rgba(15, 23, 42, .12);\n\t\ttransition: background .2s ease;\n\t}\n\n\t.toggle-thumb {\n\t\tposition: absolute;\n\t\ttop: 3px;\n\t\tleft: 3px;\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tborder-radius: 50%;\n\t\tbackground: linear-gradient(135deg, #63a4ff, #83eaf1);\n\t\tbox-shadow: 0 8px 16px rgba(99, 102, 241, .35);\n\t\ttransition: transform .2s ease;\n\t}\n\n\t.toggle-input:checked + .toggle-track {\n\t\tbackground: linear-gradient(120deg, rgba(16, 185, 129, .15), rgba(52, 211, 153, .25));\n\t\tborder-color: rgba(16, 185, 129, .45);\n\t}\n\n\t.toggle-input:checked + .toggle-track .toggle-thumb {\n\t\ttransform: translateX(24px);\n\t\tbackground: linear-gradient(135deg, #10b981, #22d3ee);\n\t\tbox-shadow: 0 10px 18px rgba(16, 185, 129, .32);\n\t}\n\n\t.toggle-state {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(260px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-top: 10px;\n\t}\n\n\t.color-card {\n\t\tborder-radius: 14px;\n\t\tpadding: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .9);\n\t\tdisplay: grid;\n\t\tgrid-template-columns: 1fr 120px;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t}\n\n\t.color-chip {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 4px;\n\t}\n\n\t.color-name {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-preview {\n\t\tborder-radius: 12px;\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.color-input {\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 12px;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);\n\t\twidth: 100%;\n\t\tcursor: pointer;\n\t}\n\n\t.palette-preview {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-bottom: 8px;\n\t}\n\n\t.preview-table {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tbackground: linear-gradient(160deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .7));\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t}\n\n\t.preview-table .row-swatch {\n\t\tborder-radius: 10px;\n\t\tpadding: 10px;\n\t\tfont-weight: 700;\n\t\tmargin-bottom: 6px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-table .row-swatch:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.button-demo {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t}\n\n\t.btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\n\t.btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\n\t.btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t.btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\n\t.btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\n\t.btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t.btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\n\t.btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\n\t.btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t.btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\n\t.btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\n\t.btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t.btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\n\t.btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\n\t.btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t.btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\n\t.btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\n\t.btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t.rio-select .rio-select-container {\n\t\tborder-radius: 12px !important;\n\t\tmin-height: 42px !important;\n\t\tborder-color: rgba(15, 23, 42, .1) !important;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.sticky-empty {\n\t\tbackground: rgba(23, 162, 184, .12);\n\t\tcolor: #0f4c75;\n\t\tborder: 1px solid rgba(23, 162, 184, .2);\n\t\tborder-radius: 12px;\n\t\tpadding: 12px;\n\t}\n\n\t.animate-rise {\n\t\tanimation: rise .5s ease;\n\t}\n\n\t@keyframes drift {\n\t\tfrom {\n\t\t\ttransform: translateY(0) translateX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: translateY(-30px) translateX(20px);\n\t\t}\n\t}\n\n\t@keyframes pulse {\n\t\t0% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t\t50% {\n\t\t\ttransform: scale(1.08);\n\t\t\topacity: .9;\n\t\t}\n\t\t100% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t}\n\n\t@keyframes rise {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(12px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n</style>\n\n<div class="settings-shell">\n\t<div class="aurora aurora-one"></div>\n\t<div class="aurora aurora-two"></div>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submitForm(form)">\n\t\t<div class="settings-hero glass-card animate-rise">\n\t\t\t<div class="hero-main">\n\t\t\t\t<div class="hero-chip">User Settings</div>\n\t\t\t\t<h2>Welcome {{ user?.fullname || user?.username || user?.email || \'back\' }}!</h2>\n\t\t\t\t<p>Shape {{ client || \'your workspace\' }} into something joyful, colorful and uniquely you.</p>\n\t\t\t\t<div class="hero-actions">\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="reset()">Reset to defaults</button>\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="retakeTour()">Retake Tour</button>\n\t\t\t\t\t<div class="save-button">\n\t\t\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="hero-metrics">\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Entries / page</span>\n\t\t\t\t\t\t<strong>{{ form.controls.entries_per_page.value }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Font size</span>\n\t\t\t\t\t\t<strong>{{ form.controls.font_size.value }}px</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Week starts</span>\n\t\t\t\t\t\t<strong>{{ form.controls.date_picker_day_start.value === \'M\' ? \'Monday\' : \'Sunday\' }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="hero-preview">\n\t\t\t\t<div class="preview-card">\n\t\t\t\t\t<div class="preview-title">Live palette peek</div>\n\t\t\t\t\t<div class="swatch-row">\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.primary_color.value" [style.color]="form.controls.primary_font_color.value">\n\t\t\t\t\t\t\t<span>Primary buttons</span>\n\t\t\t\t\t\t\t{{ form.controls.primary_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\t<span>Success tone</span>\n\t\t\t\t\t\t\t{{ form.controls.success_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\t<span>Primary table</span>\n\t\t\t\t\t\t\t{{ form.controls.table_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="preview-pulse"></div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="section-grid">\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Experience preferences</h3>\n\t\t\t\t\t<p>Tune how the app greets you each day.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="field-grid">\n\t\t\t\t\t<label class="field-card">\n\t\t\t\t\t\t<div class="field-label">Collapsable menu</div>\n\t\t\t\t\t\t<p class="field-hint">Keep navigation cozy when you want focus.</p>\n\t\t\t\t\t\t<div class="toggle">\n\t\t\t\t\t\t\t<input class="toggle-input" type="checkbox" formControlName="collapsable_menu" />\n\t\t\t\t\t\t\t<span class="toggle-track">\n\t\t\t\t\t\t\t\t<span class="toggle-thumb"></span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class="toggle-state">\n\t\t\t\t\t\t\t\t@if (form.controls.collapsable_menu.value) {\n\t\t\t\t\t\t\t\t\tCompact\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\tOpen\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</label>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Default entries per page</div>\n\t\t\t\t\t\t<p class="field-hint">Pick your sweet spot for list density.</p>\n\t\t\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.entries_per_page.valid ? \'is-valid\' : \'is-invalid\']" formControlName="entries_per_page" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t\t\t<rio-option value="25">25</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="50">50</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="100">100</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="250">250</rio-option>\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (!form.controls.entries_per_page.valid) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Entries per page is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Select search style</div>\n\t\t\t\t\t\t<p class="field-hint">Decide if typing should be fuzzy or exact.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.rio_select_search_mode.valid ? \'is-valid\' : \'is-invalid\']" formControlName="rio_select_search_mode" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="fuzzy">Fuzzy (flexible matching)</rio-option>\n\t\t\t\t\t\t\t<rio-option value="exact">Exact (must contain the term)</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Font size</div>\n\t\t\t\t\t\t<p class="field-hint">We recommend between 11–14px for quick scanning.</p>\n\t\t\t\t\t\t<input class="input-bevel" [ngClass]="[form.controls.font_size.valid ? \'is-valid\' : \'is-invalid\']" type="number" formControlName="font_size" (keyup)="changePrimaryFontSize()" />\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'wholeNumbersGreaterThanZero\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is invalid</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'maxValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not exceed 18</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'minValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not be less than 8</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Week start (date picker)</div>\n\t\t\t\t\t\t<p class="field-hint">Pick where your planner begins.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.date_picker_day_start.valid ? \'is-valid\' : \'is-invalid\']" formControlName="date_picker_day_start" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option [value]="\'S\'">Sunday</rio-option>\n\t\t\t\t\t\t\t<rio-option [value]="\'M\'">Monday</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (form.controls.date_picker_day_start.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Week start is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Starting page</div>\n\t\t\t\t\t\t<p class="field-hint">Jump right into the view you love most.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.opening_route.valid ? \'is-valid\' : \'\']" formControlName="opening_route" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="/home">Home</rio-option>\n\t\t\t\t\t\t\t@for (view of views; track view.display) {\n\t\t\t\t\t\t\t\t<rio-option [value]="view.value">{{ view.display | titleCase }}</rio-option>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Routing preference</div>\n\t\t\t\t\t\t<p class="field-hint">Leave as default to follow company behavior, or override just for your account.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.routing_preference.valid ? \'is-valid\' : \'\']" formControlName="routing_preference" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="">Use App Default</rio-option>\n\t\t\t\t\t\t\t<rio-option value="alwaysAsk">Always Ask</rio-option>\n\t\t\t\t\t\t\t<rio-option value="sameTab">Same Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newTab">New Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newWindow">New Window</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Table palette</h3>\n\t\t\t\t\t<p>Pick vibrant layers for your data rows.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="palette-preview">\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\tPrimary header\n\t\t\t\t\t\t\t<span>{{ form.controls.table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.secondary_table_color.value" [style.color]="form.controls.secondary_table_font_color.value">\n\t\t\t\t\t\t\tSecondary header\n\t\t\t\t\t\t\t<span>{{ form.controls.secondary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.tertiary_table_color.value" [style.color]="form.controls.tertiary_table_font_color.value">\n\t\t\t\t\t\t\tTertiary header\n\t\t\t\t\t\t\t<span>{{ form.controls.tertiary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.warning_color.value" [style.color]="form.controls.warning_font_color.value">\n\t\t\t\t\t\t\tWarnings\n\t\t\t\t\t\t\t<span>{{ form.controls.warning_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\tSuccess\n\t\t\t\t\t\t\t<span>{{ form.controls.success_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.info_color.value" [style.color]="form.controls.info_font_color.value">\n\t\t\t\t\t\t\tInfo\n\t\t\t\t\t\t\t<span>{{ form.controls.info_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero row that anchors your data.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_color" (ngModelChange)="changePrimaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it crisp and readable.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_font_color" (ngModelChange)="changePrimaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for supporting sections.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_color" (ngModelChange)="changeSecondaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Match contrast with the new hue.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_font_color" (ngModelChange)="changeSecondaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">For extra callouts.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_color" (ngModelChange)="changeTertiaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Balance brightness for legibility.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_font_color" (ngModelChange)="changeTertiaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Button glow-up</h3>\n\t\t\t\t\t<p>Make clicks feel friendly and intentional.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="button-demo">\n\t\t\t\t\t<button type="button" class="btn btn-success">Success</button>\n\t\t\t\t\t<button type="button" class="btn btn-warning">Warning</button>\n\t\t\t\t\t<button type="button" class="btn btn-danger">Danger</button>\n\t\t\t\t\t<button type="button" class="btn btn-info">Info</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary">Primary</button>\n\t\t\t\t\t<button type="button" class="btn btn-secondary">Secondary</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Celebrate wins.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_color" (ngModelChange)="changeSuccessColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it sharp.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_font_color" (ngModelChange)="changeSuccessFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">How the button greets hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_hover_color" (ngModelChange)="changeSuccessHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle but visible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_color" (ngModelChange)="changeWarningColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning font</div>\n\t\t\t\t\t\t\t<div class="field-hint">High contrast copy.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_font_color" (ngModelChange)="changeWarningFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add motion to caution.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_hover_color" (ngModelChange)="changeWarningHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Clear stop signal.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_color" (ngModelChange)="changeDangerColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Stay readable on alert.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_font_color" (ngModelChange)="changeDangerFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Softer on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_hover_color" (ngModelChange)="changeDangerHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Highlight helpful hints.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_color" (ngModelChange)="changeInfoColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep tips legible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_font_color" (ngModelChange)="changeInfoFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle motion on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_hover_color" (ngModelChange)="changeInfoHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero action.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_color" (ngModelChange)="changePrimaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Strong contrast for CTA.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_font_color" (ngModelChange)="changePrimaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">A playful shift on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_hover_color" (ngModelChange)="changePrimaryButtonHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for subtle actions.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_color" (ngModelChange)="changeSecondaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it balanced.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_font_color" (ngModelChange)="changeSecondaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add a soft glow.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_hover_color" (ngModelChange)="changeSecondaryHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise sticky-section-card">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Sticky select defaults</h3>\n\t\t\t\t\t<p>Teach ResolveIO which choices you love.</p>\n\t\t\t\t</div>\n\t\t\t\t@if (!stickySelects.length) {\n\t\t\t\t\t<div class="sticky-empty">\n\t\t\t\t\t\tNo sticky selects saved yet. Add a stickyKey on a select to remember your favorite defaults.\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t@for (sticky of stickySelects; track sticky.key) {\n\t\t\t\t\t\t<div class="field-card sticky-select-card">\n\t\t\t\t\t\t\t<div class="field-label">{{ sticky.key }}</div>\n\t\t\t\t\t\t\t@if (sticky.options && sticky.options.length) {\n\t\t\t\t\t\t\t\t<rio-select\n\t\t\t\t\t\t\t\t\t[(ngModel)]="stickySelections[sticky.key]"\n\t\t\t\t\t\t\t\t\t[ngModelOptions]="{standalone: true}"\n\t\t\t\t\t\t\t\t\t[options]="sticky.options"\n\t\t\t\t\t\t\t\t\toptionValueKey="value"\n\t\t\t\t\t\t\t\t\toptionLabelKey="label"\n\t\t\t\t\t\t\t\t\t[searchable]="false"\n\t\t\t\t\t\t\t\t\tappendTo="body"\n\t\t\t\t\t\t\t\t\t[stickyAutoSave]="true"\n\t\t\t\t\t\t\t\t\t(ngModelChange)="updateStickyDefault(sticky.key, $event)">\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@if (!sticky.options || !sticky.options.length) {\n\t\t\t\t\t\t\t\t<div class="text-muted">No saved options yet.</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>\n'}]}],ctorParameters:()=>[{type:AuthPermissionService},{type:UserSettingsService},{type:ProviderService},{type:DialogService},{type:CoreTourService},{type:void 0,decorators:[{type:Optional},{type:Inject,args:[RIO_SELECT_STICKY_ADAPTER]}]}]});const routes=[{path:"user-settings",component:UserSettingsComponent,children:[{path:"settings",component:UsersSettingsComponent},{path:"**",redirectTo:"settings"}]}],UserSettingsRouting=RouterModule.forChild(routes);class RioPaginationComponent{collectionSize=0;page=1;pageSize=25;maxSize=7;boundaryLinks=!0;directionLinks=!0;ellipses=!0;disabled=!1;pageChange=new EventEmitter;currentPage=1;totalPages=1;pageEntries=[1];ngOnChanges(){this.recalculate()}get canGoPrevious(){return!this.disabled&&this.currentPage>1}get canGoNext(){return!this.disabled&&this.currentPage<this.totalPages}goToFirst(t){this.goToPage(1,t)}goToPrevious(t){this.goToPage(this.currentPage-1,t)}goToNext(t){this.goToPage(this.currentPage+1,t)}goToLast(t){this.goToPage(this.totalPages,t)}goToPage(t,e){if(e?.preventDefault(),e?.stopPropagation(),this.disabled)return;const n=this.clampPage(t);n!==this.currentPage&&(this.currentPage=n,this.pageEntries=this.buildPageEntries(),this.pageChange.emit(this.currentPage))}isPageNumber(t){return"number"==typeof t}trackByEntry(t,e){return`${e}-${t}`}recalculate(){const t=this.toPositiveInt(this.pageSize,25),e=this.toNonNegativeInt(this.collectionSize,0);this.totalPages=Math.max(1,Math.ceil(e/t)),this.currentPage=this.clampPage(this.page),this.pageEntries=this.buildPageEntries()}buildPageEntries(){if(this.totalPages<=1)return[1];const t=Math.max(3,this.toPositiveInt(this.maxSize,7));if(this.totalPages<=t)return this.createRange(1,this.totalPages);if(!this.ellipses){let e=this.currentPage-Math.floor(t/2),n=e+t-1;return e<1&&(e=1,n=t),n>this.totalPages&&(n=this.totalPages,e=Math.max(1,n-t+1)),this.createRange(e,n)}const e=[1],n=Math.max(1,t-2);let o=this.currentPage-Math.floor(n/2),r=o+n-1;return o<2&&(o=2,r=o+n-1),r>this.totalPages-1&&(r=this.totalPages-1,o=Math.max(2,r-n+1)),o>2&&e.push("ellipsis-left"),e.push(...this.createRange(o,r)),r<this.totalPages-1&&e.push("ellipsis-right"),e.push(this.totalPages),e}createRange(t,e){const n=[];for(let o=t;o<=e;o++)n.push(o);return n}clampPage(t){const e=this.toPositiveInt(t,1);return Math.min(Math.max(1,e),this.totalPages)}toPositiveInt(t,e){const n="string"==typeof t?parseInt(t,10):t;return!Number.isFinite(n)||n<=0?e:Math.floor(n)}toNonNegativeInt(t,e){const n="string"==typeof t?parseInt(t,10):t;return!Number.isFinite(n)||n<0?e:Math.floor(n)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationComponent,deps:[],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:RioPaginationComponent,isStandalone:!1,selector:"rio-pagination",inputs:{collectionSize:"collectionSize",page:"page",pageSize:"pageSize",maxSize:"maxSize",boundaryLinks:"boundaryLinks",directionLinks:"directionLinks",ellipses:"ellipses",disabled:"disabled"},outputs:{pageChange:"pageChange"},usesOnChanges:!0,ngImport:i0,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.rio-pagination {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 6px;\n\t}\n\n\t.rio-page-btn {\n\t\tmin-width: 36px;\n\t\theight: 36px;\n\t\tpadding: 0 10px;\n\t\tborder: 1px solid rgba(106, 129, 165, 0.4);\n\t\tborder-radius: 10px;\n\t\tbackground: linear-gradient(180deg, #ffffff, #eff4ff);\n\t\tcolor: #2f4d75;\n\t\tfont-size: 12px;\n\t\tfont-weight: 700;\n\t\tline-height: 1;\n\t\tletter-spacing: 0.02em;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\ttransition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;\n\t}\n\n\t.rio-page-btn:hover:not(:disabled) {\n\t\tborder-color: rgba(63, 112, 201, 0.7);\n\t\tbox-shadow: 0 4px 12px rgba(25, 67, 137, 0.18);\n\t\ttransform: translateY(-1px);\n\t}\n\n\t.rio-page-btn:focus-visible {\n\t\toutline: none;\n\t\tbox-shadow: 0 0 0 3px rgba(41, 110, 235, 0.25);\n\t}\n\n\t.rio-page-btn:disabled {\n\t\topacity: 0.45;\n\t\tcursor: not-allowed;\n\t\ttransform: none;\n\t\tbox-shadow: none;\n\t}\n\n\t.rio-page-btn.is-active {\n\t\tborder-color: rgba(23, 78, 181, 0.92);\n\t\tbackground: linear-gradient(180deg, #2b78eb, #1f58ba);\n\t\tcolor: #ffffff;\n\t\tbox-shadow: 0 8px 18px rgba(31, 88, 186, 0.3);\n\t}\n\n\t.rio-page-btn.rio-page-nav {\n\t\tmin-width: 44px;\n\t}\n\n\t.rio-page-btn.rio-page-nav.rio-page-boundary {\n\t\tmin-width: 48px;\n\t}\n\n\t.rio-page-ellipsis {\n\t\tmin-width: 24px;\n\t\ttext-align: center;\n\t\tcolor: #738bab;\n\t\tfont-weight: 700;\n\t\tuser-select: none;\n\t}\n\n\t.rio-pagination.rio-pagination-disabled .rio-page-btn {\n\t\tpointer-events: none;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.rio-pagination {\n\t\t\tjustify-content: flex-start;\n\t\t}\n\n\t\t.rio-page-btn {\n\t\t\tmin-width: 34px;\n\t\t\theight: 34px;\n\t\t\tfont-size: 11px;\n\t\t}\n\t}\n</style>\n\n<nav class="rio-pagination" [class.rio-pagination-disabled]="disabled" aria-label="Pagination">\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoPrevious" (click)="goToFirst($event)" aria-label="First page">«</button>\n\t}\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoPrevious" (click)="goToPrevious($event)" aria-label="Previous page">‹</button>\n\t}\n\n\t@for (entry of pageEntries; track trackByEntry($index, entry)) {\n\t\t@if (isPageNumber(entry)) {\n\t\t\t<button\n\t\t\t\ttype="button"\n\t\t\t\tclass="rio-page-btn"\n\t\t\t\t[class.is-active]="entry === currentPage"\n\t\t\t\t[attr.aria-current]="entry === currentPage ? \'page\' : null"\n\t\t\t\t[attr.aria-label]="\'Page \' + entry"\n\t\t\t\t[disabled]="disabled"\n\t\t\t\t(click)="goToPage(entry, $event)">\n\t\t\t\t{{ entry }}\n\t\t\t</button>\n\t\t}\n\t\t@else {\n\t\t\t<span class="rio-page-ellipsis" aria-hidden="true">…</span>\n\t\t}\n\t}\n\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoNext" (click)="goToNext($event)" aria-label="Next page">›</button>\n\t}\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoNext" (click)="goToLast($event)" aria-label="Last page">»</button>\n\t}\n</nav>\n',styles:[":host{display:block}.rio-pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px}.rio-page-btn{min-width:36px;height:36px;padding:0 10px;border:1px solid rgba(106,129,165,.4);border-radius:10px;background:linear-gradient(180deg,#fff,#eff4ff);color:#2f4d75;font-size:12px;font-weight:700;line-height:1;letter-spacing:.02em;display:inline-flex;align-items:center;justify-content:center;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background-color .16s ease}.rio-page-btn:hover:not(:disabled){border-color:#3f70c9b3;box-shadow:0 4px 12px #1943892e;transform:translateY(-1px)}.rio-page-btn:focus-visible{outline:none;box-shadow:0 0 0 3px #296eeb40}.rio-page-btn:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}.rio-page-btn.is-active{border-color:#174eb5eb;background:linear-gradient(180deg,#2b78eb,#1f58ba);color:#fff;box-shadow:0 8px 18px #1f58ba4d}.rio-page-btn.rio-page-nav{min-width:44px}.rio-page-btn.rio-page-nav.rio-page-boundary{min-width:48px}.rio-page-ellipsis{min-width:24px;text-align:center;color:#738bab;font-weight:700;-webkit-user-select:none;user-select:none}.rio-pagination.rio-pagination-disabled .rio-page-btn{pointer-events:none}@media(max-width:768px){.rio-pagination{justify-content:flex-start}.rio-page-btn{min-width:34px;height:34px;font-size:11px}}\n"]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationComponent,decorators:[{type:Component,args:[{selector:"rio-pagination",standalone:!1,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.rio-pagination {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 6px;\n\t}\n\n\t.rio-page-btn {\n\t\tmin-width: 36px;\n\t\theight: 36px;\n\t\tpadding: 0 10px;\n\t\tborder: 1px solid rgba(106, 129, 165, 0.4);\n\t\tborder-radius: 10px;\n\t\tbackground: linear-gradient(180deg, #ffffff, #eff4ff);\n\t\tcolor: #2f4d75;\n\t\tfont-size: 12px;\n\t\tfont-weight: 700;\n\t\tline-height: 1;\n\t\tletter-spacing: 0.02em;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\ttransition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;\n\t}\n\n\t.rio-page-btn:hover:not(:disabled) {\n\t\tborder-color: rgba(63, 112, 201, 0.7);\n\t\tbox-shadow: 0 4px 12px rgba(25, 67, 137, 0.18);\n\t\ttransform: translateY(-1px);\n\t}\n\n\t.rio-page-btn:focus-visible {\n\t\toutline: none;\n\t\tbox-shadow: 0 0 0 3px rgba(41, 110, 235, 0.25);\n\t}\n\n\t.rio-page-btn:disabled {\n\t\topacity: 0.45;\n\t\tcursor: not-allowed;\n\t\ttransform: none;\n\t\tbox-shadow: none;\n\t}\n\n\t.rio-page-btn.is-active {\n\t\tborder-color: rgba(23, 78, 181, 0.92);\n\t\tbackground: linear-gradient(180deg, #2b78eb, #1f58ba);\n\t\tcolor: #ffffff;\n\t\tbox-shadow: 0 8px 18px rgba(31, 88, 186, 0.3);\n\t}\n\n\t.rio-page-btn.rio-page-nav {\n\t\tmin-width: 44px;\n\t}\n\n\t.rio-page-btn.rio-page-nav.rio-page-boundary {\n\t\tmin-width: 48px;\n\t}\n\n\t.rio-page-ellipsis {\n\t\tmin-width: 24px;\n\t\ttext-align: center;\n\t\tcolor: #738bab;\n\t\tfont-weight: 700;\n\t\tuser-select: none;\n\t}\n\n\t.rio-pagination.rio-pagination-disabled .rio-page-btn {\n\t\tpointer-events: none;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.rio-pagination {\n\t\t\tjustify-content: flex-start;\n\t\t}\n\n\t\t.rio-page-btn {\n\t\t\tmin-width: 34px;\n\t\t\theight: 34px;\n\t\t\tfont-size: 11px;\n\t\t}\n\t}\n</style>\n\n<nav class="rio-pagination" [class.rio-pagination-disabled]="disabled" aria-label="Pagination">\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoPrevious" (click)="goToFirst($event)" aria-label="First page">«</button>\n\t}\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoPrevious" (click)="goToPrevious($event)" aria-label="Previous page">‹</button>\n\t}\n\n\t@for (entry of pageEntries; track trackByEntry($index, entry)) {\n\t\t@if (isPageNumber(entry)) {\n\t\t\t<button\n\t\t\t\ttype="button"\n\t\t\t\tclass="rio-page-btn"\n\t\t\t\t[class.is-active]="entry === currentPage"\n\t\t\t\t[attr.aria-current]="entry === currentPage ? \'page\' : null"\n\t\t\t\t[attr.aria-label]="\'Page \' + entry"\n\t\t\t\t[disabled]="disabled"\n\t\t\t\t(click)="goToPage(entry, $event)">\n\t\t\t\t{{ entry }}\n\t\t\t</button>\n\t\t}\n\t\t@else {\n\t\t\t<span class="rio-page-ellipsis" aria-hidden="true">…</span>\n\t\t}\n\t}\n\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoNext" (click)="goToNext($event)" aria-label="Next page">›</button>\n\t}\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoNext" (click)="goToLast($event)" aria-label="Last page">»</button>\n\t}\n</nav>\n'}]}],propDecorators:{collectionSize:[{type:Input}],page:[{type:Input}],pageSize:[{type:Input}],maxSize:[{type:Input}],boundaryLinks:[{type:Input}],directionLinks:[{type:Input}],ellipses:[{type:Input}],disabled:[{type:Input}],pageChange:[{type:Output}]}});class RioPaginationModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,declarations:[RioPaginationComponent],imports:[CommonModule],exports:[RioPaginationComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,imports:[CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,decorators:[{type:NgModule,args:[{imports:[CommonModule],declarations:[RioPaginationComponent],exports:[RioPaginationComponent]}]}]});class DatatableCellTemplateDirective{templateRef;key;constructor(t){this.templateRef=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableCellTemplateDirective,deps:[{token:i0.TemplateRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:DatatableCellTemplateDirective,isStandalone:!1,selector:"ng-template[dataTableCell]",inputs:{key:["dataTableCell","key"]},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableCellTemplateDirective,decorators:[{type:Directive,args:[{selector:"ng-template[dataTableCell]",standalone:!1}]}],ctorParameters:()=>[{type:i0.TemplateRef}],propDecorators:{key:[{type:Input,args:["dataTableCell"]}]}});const DATATABLE_DEFAULT_CONFIG=new InjectionToken("DATATABLE_DEFAULT_CONFIG");function provideDatatableDefaultConfig(t){return{provide:DATATABLE_DEFAULT_CONFIG,useValue:t}}class DatatableComponent extends BaseComponent{_services;_dialog;locale;datatableDefaultConfig;datatableDefaultConfigLegacy;jsonPipe;upperCasePipe;lowerCasePipe;titleCasePipe;urlClick="";columns=[];data=[];collapseSize=990;searchTitle="Search...";totalItems=1e3;entriesPerPageOptions=[25,50,100,250];searchBarAutoSearch=!0;searchDebounceMs=350;searchMinLength=2;searchDistinct=!0;IronBatchAssign=!1;tableFixed=!1;headerFixed=!1;stickyHeaders=!0;users=[];rowIdKey="_id";rowNavigationMode;returnIdUrls=["yardDashboard","acctManagerDashboard","fieldDashboard","salesDashboard"];showSearch=!0;showPaging=!0;showToolbar=!0;showEntriesControl=!0;showResultsSummary=!0;hideSearch=!1;hideFooter=!1;onChangeTableData=new EventEmitter;tableDataChange=new EventEmitter;cellAction=new EventEmitter;rowClick=new EventEmitter;rowSelected=new EventEmitter;returnId=new EventEmitter;onChangeRequested=new EventEmitter;onChangeTankLevels=new EventEmitter;onChangeCurrentRate=new EventEmitter;onChangeTankHistory=new EventEmitter;tableData;cellTemplateDirectives;cellTemplates=new Map;normalizedColumns=[];displayData=[];entriesPerPageSelectOptions=[];activeHeaderMenuKey=null;headerMenuStep="root";searchDebounceHandle=null;lastAutoSearchValue="";templateChangesSubscription=null;constructor(t,e,n,o,r,i,a,s,l){super(t),this._services=t,this._dialog=e,this.locale=n,this.datatableDefaultConfig=o,this.datatableDefaultConfigLegacy=r,this.jsonPipe=i,this.upperCasePipe=a,this.lowerCasePipe=s,this.titleCasePipe=l}ngOnChanges(t){this.applyLegacyVisibilityAliases(),this.refreshEntriesPerPageOptions(),!t.tableData&&this.tableData||this.initializeTableData(),t.entriesPerPageOptions&&this.tableData&&(this.tableData.entriesPerPage=this.normalizeEntriesPerPage(this.tableData.entriesPerPage)),t.columns&&(this.refreshColumns(),this.activeHeaderMenuKey&&!this.normalizedColumns.some(t=>this.getSortKey(t)===this.activeHeaderMenuKey)&&this.closeHeaderMenu()),(t.data||t.tableData||t.columns)&&this.refreshDisplayData()}ngAfterContentInit(){this.applyLegacyVisibilityAliases(),this.refreshColumns(),this.refreshTemplateMap(),this.cellTemplateDirectives&&(this.templateChangesSubscription=this.cellTemplateDirectives.changes.subscribe(()=>this.refreshTemplateMap()))}applyLegacyVisibilityAliases(){this.hideSearch&&(this.showSearch=!1,this.showResultsSummary=!1,this.showToolbar=!1),this.hideFooter&&(this.showPaging=!1)}ngOnDestroy(){this.searchDebounceHandle&&(clearTimeout(this.searchDebounceHandle),this.searchDebounceHandle=null),this.templateChangesSubscription&&(this.templateChangesSubscription.unsubscribe(),this.templateChangesSubscription=null)}initializeTableData(){const t=this.tableData||{searchString:"",entriesPerPage:this.entriesPerPageOptions[0],pageNum:1,sortColumn:"",sortOrder:"desc",filters:{}};t.searchString=t.searchString||"",t.entriesPerPage=this.normalizeEntriesPerPage(t.entriesPerPage),t.pageNum=this.normalizePageNum(t.pageNum),t.sortColumn=t.sortColumn||"",t.sortOrder=t.sortOrder||"desc",t.filters=t.filters||{},this.isObjectMap(t.columnFilters)&&Object.keys(t.columnFilters).length||delete t.columnFilters,this.tableData=t}refreshDisplayData(){const t=Array.isArray(this.data)?this.data:[];this.displayData=this.applyColumnFilters(t)}refreshColumns(){const t=[];(this.columns||[]).forEach(e=>{Array.isArray(e)?e.forEach(e=>{e&&e.data&&t.push(e)}):e&&e.data&&t.push(e)}),this.normalizedColumns=t}refreshTemplateMap(){this.cellTemplates.clear(),this.cellTemplateDirectives&&this.cellTemplateDirectives.forEach(t=>{t&&t.key&&this.cellTemplates.set(t.key,t.templateRef)})}refreshEntriesPerPageOptions(){const t=(this.entriesPerPageOptions||[]).map(t=>{const e="string"==typeof t?parseInt(t,10):t;return{label:`${t}`,value:Number.isFinite(e)&&e>0?e:t}});this.entriesPerPageSelectOptions=t.length?t:[{label:"25",value:25}]}normalizeEntriesPerPage(t){if(null==t||""===t)return this.entriesPerPageOptions[0];const e="string"==typeof t?parseInt(t,10):t;return Number.isFinite(e)&&e>0?e:this.entriesPerPageOptions[0]}normalizePageNum(t){return!t||t<1?1:t}emitTableDataChange(){this.tableData.entriesPerPage=this.normalizeEntriesPerPage(this.tableData.entriesPerPage),this.tableData.pageNum=this.normalizePageNum(this.tableData.pageNum),this.sanitizeColumnFiltersState();const t={...this.tableData};this.isObjectMap(t.columnFilters)&&Object.keys(t.columnFilters).length||delete t.columnFilters,this.tableDataChange.emit(t),this.onChangeTableData.emit(t)}sanitizeColumnFiltersState(){this.tableData&&(this.isObjectMap(this.tableData.columnFilters)&&Object.keys(this.tableData.columnFilters).length||delete this.tableData.columnFilters)}isObjectMap(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}changeTableData(){this.emitTableDataChange()}onSearchSubmit(){this.searchDebounceHandle&&(clearTimeout(this.searchDebounceHandle),this.searchDebounceHandle=null),this.lastAutoSearchValue=this.getSearchValue(),this.tableData.pageNum=1,this.changeTableData()}onSearchChange(){if(!this.searchBarAutoSearch)return;this.searchDebounceHandle&&(clearTimeout(this.searchDebounceHandle),this.searchDebounceHandle=null);const t=this.getSearchValue(),e=this.normalizeSearchMinLength(this.searchMinLength),n=t.trim().length;e>0&&n>0&&n<e||this.searchDistinct&&this.lastAutoSearchValue===t||(this.searchDebounceHandle=setTimeout(()=>{this.searchDebounceHandle=null;const t=this.getSearchValue(),n=t.trim().length;e>0&&n>0&&n<e||this.searchDistinct&&this.lastAutoSearchValue===t||(this.lastAutoSearchValue=t,this.tableData.pageNum=1,this.changeTableData())},Math.max(0,this.searchDebounceMs)))}getSearchValue(){const t=this.tableData?.searchString;return null==t?"":"string"==typeof t?t:String(t)}normalizeSearchMinLength(t){const e="string"==typeof t?parseInt(t,10):t;return Number.isFinite(e)?Math.max(0,e):0}onEntriesPerPageChange(t){void 0!==t&&(this.tableData.entriesPerPage=t),this.tableData.entriesPerPage=this.normalizeEntriesPerPage(this.tableData.entriesPerPage),this.tableData.pageNum=1,this.emitTableDataChange()}onPageChange(t){Number.isFinite(t)&&(this.tableData.pageNum=Math.max(1,t)),this.emitTableDataChange()}sortColumn(t,e){const n=this.getSortKey(t,e);n&&(this.tableData.sortColumn===n?"desc"===this.tableData.sortOrder?this.tableData.sortOrder="asc":this.tableData.sortOrder="desc":(this.tableData.sortOrder="asc",this.tableData.sortColumn=n),this.changeTableData())}sortColumnWithOrder(t,e,n){const o=this.getSortKey(t,n);o&&(this.tableData.sortColumn=o,this.tableData.sortOrder=e,this.tableData.pageNum=1,this.changeTableData())}hasHeaderMenuActions(t){return!!t&&(!1!==t.sortable||this.isFilterableColumn(t))}isHeaderMenuOpen(t){return!!t&&this.activeHeaderMenuKey===this.getSortKey(t)}onHeaderClick(t,e){if(!this.hasHeaderMenuActions(t))return;e.preventDefault(),e.stopPropagation();const n=this.getSortKey(t);n&&(this.activeHeaderMenuKey!==n?(this.activeHeaderMenuKey=n,this.headerMenuStep="root"):this.closeHeaderMenu())}showSortMenu(t){t.preventDefault(),t.stopPropagation(),this.headerMenuStep="sort"}showRootHeaderMenu(t){t.preventDefault(),t.stopPropagation(),this.headerMenuStep="root"}sortFromHeaderMenu(t,e,n){n.preventDefault(),n.stopPropagation(),!1!==t.sortable&&(this.closeHeaderMenu(),this.sortColumnWithOrder(t,e))}openFilterFromHeaderMenu(t,e){e.preventDefault(),e.stopPropagation(),this.closeHeaderMenu(),this.openColumnFilterDialog(t)}closeHeaderMenu(){this.activeHeaderMenuKey=null,this.headerMenuStep="root"}onDocumentClick(t){if(!this.activeHeaderMenuKey)return;const e=t.target;e&&(e.closest(".dt-header-menu")||e.closest(".dt-header-cell"))||this.closeHeaderMenu()}onDocumentEscape(){this.closeHeaderMenu()}getSortKey(t,e){if("string"==typeof t){const n=t.trim(),o=(e||"").trim();return o?`${n}.${o}`:n}const n=(t.data||"").trim(),o=(t.subData||"").trim();return o?`${n}.${o}`:n}isSortedColumn(t){return this.tableData.sortColumn===this.getSortKey(t)}getSortIcon(t){return this.isSortedColumn(t)?"asc"===this.tableData.sortOrder?"fa-caret-up":"fa-caret-down":""}isFilterableColumn(t){return!(!t||!t.data)&&(!(t.templateKey||t.button||t.buttons&&t.buttons.length||t.select||t.input||t.progress)&&("template"!==t.type&&"button"!==t.type&&"buttons"!==t.type&&"select"!==t.type&&"input"!==t.type&&"progress"!==t.type&&("file_key"!==t.data&&"files"!==t.data&&"button_deleted"!==t.data&&"actions"!==t.data)))}hasColumnFilter(t){if(!t)return!1;const e=this.getColumnFilterKey(t),n=this.tableData?.columnFilters?.[e];return!!this.normalizeColumnFilter(n,this.getColumnFilterType(t))}getColumnFilterSummary(t){const e=this.getColumnFilterKey(t),n=this.getColumnFilterType(t),o=this.normalizeColumnFilter(this.tableData?.columnFilters?.[e],n);if(!o)return`Filter ${t.name}`;const r=this.getFilterOperatorLabel(o.operator),i=this.getColumnFilterValueLabel(o,!0),a=this.getColumnFilterValueLabel(o,!1);return"between"===o.operator?`${t.name}: ${r} ${i} and ${a}`:"isEmpty"===o.operator||"isNotEmpty"===o.operator?`${t.name}: ${r}`:`${t.name}: ${r} ${i}`}getActiveColumnFilters(){if(!this.isObjectMap(this.tableData?.columnFilters))return[];const t=[];return Object.keys(this.tableData.columnFilters||{}).forEach(e=>{const n=this.normalizedColumns.find(t=>this.getColumnFilterKey(t)===e);n&&this.hasColumnFilter(n)&&t.push({key:e,columnName:n.name,summary:this.getColumnFilterSummary(n)})}),t}getActiveColumnFilterCount(){return this.getActiveColumnFilters().length}onColumnFilterClick(t,e){e&&(e.preventDefault(),e.stopPropagation()),this.openColumnFilterDialog(t)}openColumnFilterDialog(t){if(!this.isFilterableColumn(t))return;const e=this.getColumnFilterType(t),n=this.getColumnFilterKey(t),o=this.normalizeColumnFilter(this.tableData?.columnFilters?.[n],e),r=this.getFilterOperatorOptions(e),i=this.buildColumnFilterDialogFields(e,r,o);this._dialog.input(`Filter ${t.name}`,i).then(t=>{const o=this.parseColumnFilterDialogResult(e,t);"invalid"!==o&&(null!==o?this.applyColumnFilter(n,o):this.clearColumnFilterByKey(n))},()=>{})}clearAllColumnFilters(t){t&&(t.preventDefault(),t.stopPropagation()),this.closeHeaderMenu(),this.isObjectMap(this.tableData?.columnFilters)&&Object.keys(this.tableData.columnFilters).length&&(delete this.tableData.columnFilters,this.tableData.pageNum=1,this.refreshDisplayData(),this.changeTableData())}clearColumnFilterByKey(t){this.isObjectMap(this.tableData?.columnFilters)&&this.tableData.columnFilters[t]&&(delete this.tableData.columnFilters[t],Object.keys(this.tableData.columnFilters).length||delete this.tableData.columnFilters,this.tableData.pageNum=1,this.refreshDisplayData(),this.changeTableData())}applyColumnFilter(t,e){this.tableData||this.initializeTableData(),this.isObjectMap(this.tableData.columnFilters)||(this.tableData.columnFilters={}),this.tableData.columnFilters[t]=e,this.tableData.pageNum=1,this.refreshDisplayData(),this.changeTableData()}buildColumnFilterDialogFields(t,e,n){const o=n?.operator||this.getDefaultFilterOperator(t),r=void 0!==n?.value?n.value:"",i=void 0!==n?.valueTo?n.valueTo:"",a=this.getColumnFilterDialogValueFieldType(t),s=[{label:"Operator",form:"operator",data:o,validators:[],validatorErrors:[],validatorMsg:[],required:!1,type:"select",options:e}];return"boolean"===t?(s.push({label:"Value",form:"value",data:!0===r?"true":!1===r?"false":"",validators:[],validatorErrors:[],validatorMsg:[],required:!1,type:"select",options:[{value:"",text:"Select value"},{value:"true",text:"True"},{value:"false",text:"False"}]}),s):(s.push({label:"date"===t?"Value (date)":"Value",form:"value",data:r,validators:[],validatorErrors:[],validatorMsg:[],required:!1,type:a}),s.push({label:"Second value (for Between)",form:"value_to",data:i,validators:[],validatorErrors:[],validatorMsg:[],required:!1,type:a}),s)}parseColumnFilterDialogResult(t,e){const n=e?.operator?.value,o=e?.value?.value,r=e?.value_to?.value;if(!n||"none"===n)return null;const i=this.parseFilterInputValue(o,t),a=this.parseFilterInputValue(r,t);if("isEmpty"!==n&&"isNotEmpty"!==n&&this.isFilterValueMissing(i,t))return this._services._alert.setAlert("warning","Filter value is required"),"invalid";if("between"===n&&this.isFilterValueMissing(a,t))return this._services._alert.setAlert("warning",'A second value is required for "Between"'),"invalid";if("between"===n&&"text"!==t){const e=this.toComparableValue(i,t),n=this.toComparableValue(a,t);if(null!==e&&null!==n&&e>n)return this._services._alert.setAlert("warning","Between filter requires the first value to be less than or equal to the second value"),"invalid"}const s={type:t,operator:n};return"isEmpty"!==n&&"isNotEmpty"!==n&&(s.value="in"===n?this.parseInFilterValues(i,t):i),"between"===n&&(s.valueTo=a),s}parseInFilterValues(t,e){if(Array.isArray(t))return t;const n=(null==t?"":String(t)).split(",").map(t=>t.trim()).filter(t=>""!==t);return"number"===e?n.map(t=>Number(t)).filter(t=>Number.isFinite(t)):n}parseFilterInputValue(t,e){if(null==t)return"";if("number"===e){if("number"==typeof t&&Number.isFinite(t))return t;const e=Number(t);return Number.isFinite(e)?e:""}return"boolean"===e?!0===t||"true"===t||"1"===t||1===t||!1!==t&&"false"!==t&&"0"!==t&&0!==t&&"":"date"===e?this.normalizeDateInput(t):String(t).trim()}normalizeDateInput(t){if(!t)return"";if("string"==typeof t){const e=t.trim();return e||""}if(t instanceof Date)return t.toISOString();const e=t?.date?t.date:t;if(e&&void 0!==e.year&&void 0!==e.month&&void 0!==e.day){const t=Number(e.year),n=Number(e.month),o=Number(e.day);if(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(o))return`${t.toString().padStart(4,"0")}-${n.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}`}return""}isFilterValueMissing(t,e){return"boolean"===e?!0!==t&&!1!==t:"number"===e?""===t||null==t||!Number.isFinite(Number(t)):""===t||null==t}getColumnFilterType(t){return"boolean"===t.type?"boolean":"number"===t.type||"currency"===t.type||"percent"===t.type||"progress"===t.type?"number":"date"===t.type||"datetime"===t.type||"dateShort"===t.type||this.isLikelyDateColumn(t.data)?"date":"text"}getDefaultFilterOperator(t){return"text"===t?"contains":"equals"}getColumnFilterDialogValueFieldType(t){return"number"===t?"number":"date"===t?"date":"text"}getColumnFilterKey(t){return this.getSortKey(t)}getFilterOperatorOptions(t){const e=[{value:"none",text:"No Filter"}];return"text"===t?e.concat([{value:"contains",text:"Contains"},{value:"equals",text:"Equals"},{value:"notEquals",text:"Not Equal"},{value:"startsWith",text:"Starts With"},{value:"endsWith",text:"Ends With"},{value:"in",text:"In (comma separated)"},{value:"isEmpty",text:"Is Empty"},{value:"isNotEmpty",text:"Is Not Empty"}]):"number"===t||"date"===t?e.concat([{value:"equals",text:"Equals"},{value:"notEquals",text:"Not Equal"},{value:"gt",text:"Greater Than"},{value:"gte",text:"Greater Than or Equal"},{value:"lt",text:"Less Than"},{value:"lte",text:"Less Than or Equal"},{value:"between",text:"Between"},{value:"isEmpty",text:"Is Empty"},{value:"isNotEmpty",text:"Is Not Empty"}]):e.concat([{value:"equals",text:"Equals"},{value:"notEquals",text:"Not Equal"},{value:"isEmpty",text:"Is Empty"},{value:"isNotEmpty",text:"Is Not Empty"}])}getFilterOperatorLabel(t){switch(t){case"equals":return"Equals";case"notEquals":return"Not Equal";case"contains":return"Contains";case"startsWith":return"Starts With";case"endsWith":return"Ends With";case"in":return"In";case"gt":return"Greater Than";case"gte":return"Greater Than or Equal";case"lt":return"Less Than";case"lte":return"Less Than or Equal";case"between":return"Between";case"isEmpty":return"Is Empty";case"isNotEmpty":return"Is Not Empty";default:return t}}getColumnFilterValueLabel(t,e){const n=e?t.value:t.valueTo;if(null==n||""===n)return"";if("date"===t.type){const t=new Date(n);if(!Number.isNaN(t.getTime()))return formatDate(t,"shortDate",this.locale)}return Array.isArray(n)?n.join(", "):String(n)}normalizeColumnFilter(t,e){if(null==t||""===t)return null;if("object"!=typeof t)return{type:e,operator:"equals",value:t};const n=t.operator;return n?{type:t.type||e,operator:n,value:t.value,valueTo:t.valueTo}:null}applyColumnFilters(t){if(!t.length)return t;const e=this.getNormalizedActiveColumnFilters();return e.length?t.filter(t=>e.every(e=>this.rowMatchesColumnFilter(t,e.key,e.filter))):t}getNormalizedActiveColumnFilters(){if(!this.isObjectMap(this.tableData?.columnFilters))return[];const t=this.tableData.columnFilters,e=Object.keys(t),n=[];return e.forEach(e=>{const o=this.normalizedColumns.find(t=>this.getColumnFilterKey(t)===e),r=o?this.getColumnFilterType(o):"text",i=this.normalizeColumnFilter(t[e],r);i&&n.push({key:e,filter:i})}),n}rowMatchesColumnFilter(t,e,n){const o=this.resolvePath(t,e);return"isEmpty"===n.operator?this.isEmptyValue(o):"isNotEmpty"===n.operator?!this.isEmptyValue(o):"text"===n.type?this.matchTextFilter(o,n):"boolean"===n.type?this.matchBooleanFilter(o,n):this.matchComparableFilter(o,n)}isEmptyValue(t){return null==t||("string"==typeof t?""===t.trim():!!Array.isArray(t)&&0===t.length)}matchTextFilter(t,e){const n=this.valueToString(t).toLowerCase(),o=this.valueToString(e.value).toLowerCase();if("contains"===e.operator)return n.indexOf(o)>=0;if("equals"===e.operator)return n===o;if("notEquals"===e.operator)return n!==o;if("startsWith"===e.operator)return n.startsWith(o);if("endsWith"===e.operator)return n.endsWith(o);if("in"===e.operator){return(Array.isArray(e.value)?e.value:this.parseInFilterValues(e.value,"text")).map(t=>this.valueToString(t).toLowerCase()).indexOf(n)>=0}if("between"===e.operator){const t=this.valueToString(e.valueTo).toLowerCase();return n>=o&&n<=t}return!0}matchBooleanFilter(t,e){const n=this.toBoolean(t),o=this.toBoolean(e.value);return null!==n&&null!==o&&("equals"===e.operator?n===o:"notEquals"!==e.operator||n!==o)}matchComparableFilter(t,e){const n=this.toComparableValue(t,e.type),o=this.toComparableValue(e.value,e.type),r=this.toComparableValue(e.valueTo,e.type);return null!==n&&null!==o&&("equals"===e.operator?n===o:"notEquals"===e.operator?n!==o:"gt"===e.operator?n>o:"gte"===e.operator?n>=o:"lt"===e.operator?n<o:"lte"===e.operator?n<=o:"between"!==e.operator||null!==r&&(n>=o&&n<=r))}toComparableValue(t,e){if(null==t||""===t)return null;if("number"===e){const e="object"==typeof t&&t&&void 0!==t.number?t.number:t,n=Number(e);return Number.isFinite(n)?n:null}if("date"===e){return this.toDateTimestamp(t)}return null}toDateTimestamp(t){if(null==t||""===t)return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.getTime();if("object"==typeof t&&t?.date)return this.toDateTimestamp(t.date);if("object"==typeof t&&void 0!==t.year&&void 0!==t.month&&void 0!==t.day){const e=Number(t.year),n=Number(t.month),o=Number(t.day),r=new Date(e,n-1,o);return Number.isNaN(r.getTime())?null:r.getTime()}const e=new Date(t);return Number.isNaN(e.getTime())?null:e.getTime()}toBoolean(t){return!0===t||"true"===t||1===t||"1"===t||!1!==t&&"false"!==t&&0!==t&&"0"!==t&&null}getPageSize(){const t="string"==typeof this.tableData.entriesPerPage?parseInt(this.tableData.entriesPerPage,10):this.tableData.entriesPerPage;return!Number.isFinite(t)||t<=0?25:t}getRowId(t,e){return t&&(t[this.rowIdKey]||t.loc_id||t._id||t.id)||e}onCellClick(t,e,n,o=0){if(e.stopRowClick)return;const r=this.getCellMode(e,t);if("button"===r||"buttons"===r||"select"===r||"input"===r||"files"===r)return;const i=this.getRowId(t,o),a=this.getCellValue(t,e);this.rowClick.emit({row:t,column:e,value:a}),this.rowSelected.emit({id:i,column:e.data,item:t}),this.urlClick&&i&&"file_key"!==e.data&&(this.urlClick&&this.returnIdUrls&&this.returnIdUrls.indexOf(this.urlClick)>=0?this.returnId.emit(i):this._services._router.url.startsWith("/certificate/list")&&t.link&&t.id_asset?this.navigateToUrl(t.link+t.id_asset):"/job/detail/"!==this.urlClick||!t.is_ct&&!t.isCT?this.navigateToUrl(this.urlClick+i):this.navigateToUrl("/job-ct/detail/"+i))}navigateToUrl(t){const e=this.resolveRowNavigationMode();"newTab"!==e?"newWindow"!==e?"settingsOrAsk"!==e?this._services._router.navigateByUrl(t):this._dialog.selectWithButtonsURL(t):window.open(t,"_blank","toolbar=1,location=1,menubar=1"):window.open(t,"_blank")}resolveRowNavigationMode(){const t=this.toNavigationMode(this.rowNavigationMode);if(t)return t;const e=this.toNavigationMode(this._services._account.getUser()?.settings?.routing_preference);if(e)return e;const n=this.toNavigationMode(this.datatableDefaultConfig?.rowNavigationMode||this.datatableDefaultConfigLegacy?.rowNavigationMode);return n||"sameTab"}toNavigationMode(t){return"sameTab"===t||"newTab"===t||"newWindow"===t||"settingsOrAsk"===t?t:"alwaysAsk"===t?"settingsOrAsk":null}openFile(t){this._services._socket.call("getSignedUrl",t,900,(e,n)=>{n?window.open(n):this._services._socket.call("insertErrorLog","Widgets-datatable - getsignedurl",[t,e])})}getCellValue(t,e){const n=this.resolvePath(t,e.data);if(null==n&&"est_qty_fill"===e.data){const e=Number(this.resolvePath(t,"tank_size")),n=Number(this.resolvePath(t,"estimated_quantity"));if(Number.isFinite(e))return e-(Number.isFinite(n)&&n>=0?n:0)}return e.subData?this.resolvePath(n,e.subData):n}setCellValue(t,e,n){t&&e&&e.data&&(e.subData?(t[e.data]&&"object"==typeof t[e.data]||(t[e.data]={}),t[e.data][e.subData]=n):t[e.data]=n)}resolvePath(t,e){if(!e)return t;const n=e.trim();return n?n.indexOf(".")<0?t?t[n]:void 0:n.split(".").reduce((t,e)=>null==t?void 0:t[e],t):t}getCellTemplate(t){return t?t.templateKey&&this.cellTemplates.has(t.templateKey)?this.cellTemplates.get(t.templateKey):this.cellTemplates.has(t.data)?this.cellTemplates.get(t.data):null:null}getCellMode(t,e){if(this.getCellTemplate(t))return"template";if(t.buttons&&t.buttons.length)return"buttons";if(t.button)return"button";if(t.select)return"select";if(t.input)return"input";if(this.getSelectConfig(t))return"select";if(this.getInputConfig(t)){if("gallons_requested"===t.data&&e?.consignment)return"text";if("current_rate"===t.data){const t=null!=e?.estimated_quantity,n=!!e?.estimated_percent?.on_plan,o=Array.isArray(e?.locations)&&1===e.locations.length;if(!t||!n||!o)return"text"}return"input"}if(t.progress||"progress"===t.type)return"progress";if("pre"===t.type)return"pre";if("boolean"===t.type)return"boolean";if("button"===t.type)return"button";if("buttons"===t.type)return"buttons";if("select"===t.type)return"select";if("input"===t.type)return"input";if("files"===t.data){const n=this.getCellValue(e,t);return Array.isArray(n)&&n.length?"files":"text"}return"button_deleted"===t.data?e?.deleted?"button":"text":"file_key"===t.data?"button":"wells"===t.data?"pre":this.isLegacyProgressColumn(t)?"progress":"boolean"==typeof this.getCellValue(e,t)?"boolean":"text"}isLegacyProgressColumn(t){return["estimated_percent","usage_progress","dated_progress","progress","total_progress","progress_percentage","estimated_percent_remaining","progressive"].indexOf(t.data)>=0}getCellClasses(t){const e=["dt-cell"];return t.cellClassName&&e.push(t.cellClassName),t.align&&e.push(`dt-align-${t.align}`),e}getHeaderClasses(t){const e=["dt-header-cell"];return t.headerClassName&&e.push(t.headerClassName),t.align&&e.push(`dt-align-${t.align}`),!1===t.sortable&&e.push("dt-no-sort"),this.hasHeaderMenuActions(t)||e.push("dt-no-menu"),this.hasColumnFilter(t)&&e.push("dt-has-filter"),e}getRowClasses(t){return{"dt-row-alert":!!t?.color_red}}getDisplayValue(t,e){const n=this.getCellValue(t,e),o=this.formatValueWithPipe(n,e);return null==o||""===o?e.emptyText||"":o}formatValueWithPipe(t,e){if(null==t)return"";const n=this.resolvePipeConfig(e);if("raw"===n.name)return this.valueToString(t);try{switch(n.name){case"currency":{const e=n.args?.[0]||"USD",o=n.args?.[1],r=n.args?.[2]||"1.2-2",i=this.resolveCurrencySymbol(e,o);return formatCurrency(Number(t)||0,this.locale,i,e,r)}case"number":{const e=n.args?.[0]||"1.0-2";return formatNumber(Number(t)||0,this.locale,e)}case"percent":{const e=n.args?.[0]||"1.0-2";return formatPercent(Number(t)||0,this.locale,e)}case"date":{const e=n.args?.[0]||"short",o=n.args?.length&&"string"==typeof n.args[1]?n.args[1]:void 0;return formatDate(t,e,this.locale,o)}case"uppercase":return this.upperCasePipe.transform(this.valueToString(t));case"lowercase":return this.lowerCasePipe.transform(this.valueToString(t));case"titlecase":return this.titleCasePipe.transform(this.valueToString(t));case"json":return this.jsonPipe.transform(t)||"";default:return this.valueToString(t)}}catch(e){return this.valueToString(t)}}resolvePipeConfig(t){return"string"==typeof t.pipe?{name:t.pipe,args:t.pipeArgs||[]}:t.pipe&&"object"==typeof t.pipe?{name:t.pipe.name,args:t.pipe.args||[]}:"currency"===t.type?{name:"currency",args:t.pipeArgs||["USD","symbol","1.2-2"]}:"number"===t.type?{name:"number",args:t.pipeArgs||["1.0-2"]}:"percent"===t.type?{name:"percent",args:t.pipeArgs||["1.0-2"]}:"date"===t.type?{name:"date",args:t.pipeArgs||["shortDate"]}:"datetime"===t.type?{name:"date",args:t.pipeArgs||["short"]}:"dateShort"===t.type?{name:"date",args:t.pipeArgs||["shortDate"]}:!this.isLikelyDateColumn(t.data)||t.type||t.pipe?!this.isLikelyCurrencyColumn(t.data)||t.type||t.pipe?!this.isLikelyNumberColumn(t.data)||t.type||t.pipe?{name:"raw",args:[]}:{name:"number",args:["1.0-2"]}:{name:"currency",args:["USD","symbol","1.2-2"]}:{name:"date",args:["short"]}}isLikelyDateColumn(t){return/(^date$|date_|_date$|createdAt$|updatedAt$|date$)/i.test(t)}isLikelyCurrencyColumn(t){return/(cost|price|subtotal|sub_total|grand_total|total_sales|tax|amount|payout|balance|quote|value|paid_total)/i.test(t)}isLikelyNumberColumn(t){return/(quantity|quantity_pounds|min_stock|max_stock|projectedQuantity|current_rate|amount_out|est_qty_fill|percent_remaining)/i.test(t)}valueToString(t){return null==t?"":"object"==typeof t?Array.isArray(t)?t.map(t=>this.valueToString(t)).join(", "):void 0!==t.number&&null!==t.number?String(t.number):this.jsonPipe.transform(t)||"":String(t)}resolveCurrencySymbol(t,e){return null==e||"symbol"===e||!0===e?getCurrencySymbol(t,"wide"):"symbol-narrow"===e?getCurrencySymbol(t,"narrow"):"code"===e||!1===e?t:"string"==typeof e?e:getCurrencySymbol(t,"wide")}getButtons(t,e){return t.buttons&&t.buttons.length?t.buttons:t.button?[t.button]:"file_key"===t.data?[{action:"openFile",label:"Open File",className:"btn-secondary"}]:"button_deleted"===t.data&&e?.deleted?[{action:"showDeletedReason",label:"View Deleted Reason",className:"btn-warning"}]:[]}isButtonDisabled(t,e){return!!t.disabled||!!t.disabledPath&&!!this.resolvePath(e,t.disabledPath)}onButtonAction(t,e,n,o){if(o.stopPropagation(),!this.isButtonDisabled(t,e)&&(!t.confirmMessage||window.confirm(t.confirmMessage))){if("openFile"===t.action){const t=this.getCellValue(e,n);t&&this.openFile(t)}else"showDeletedReason"===t.action&&this.showDeletedReason(e);this.emitAction(t.action,e,n,this.getCellValue(e,n))}}showDeletedReason(t){const e=t?.deleted&&"object"==typeof t.deleted?t.deleted:null,n=e?.reason||t?.deleted_reason||"Not provided",o=e?.user||t?.deleted_user||t?.user_deleted||"Unknown",r=e?.date||t?.deleted_date||"",i=`Deleted by: ${o}. Reason: ${n}${r?`. Date: ${r}`:""}`;this._services._alert.setAlert("warning",i)}getFileButtons(t,e){const n=this.getCellValue(t,e);return Array.isArray(n)?n.map((t,e)=>"string"==typeof t?{label:`Open File ${e+1}`,id:null,key:t}:{label:t?.name||t?.title||`Open File ${e+1}`,id:t?._id||t?.id_file||null,key:t?.key||t?.file_key||null}):[]}openFileById(t){this._services._socket.call("getSignedUrlWithId",t,900,(e,n)=>{n?window.open(n):this._services._socket.call("insertErrorLog","Widgets-datatable - getSignedUrlWithId",[t,e])})}onFileButtonClick(t,e){e.stopPropagation(),t.id?this.openFileById(t.id):t.key&&this.openFile(t.key)}getSelectConfig(t){return t.select?t.select:null}getSelectOptions(t,e){const n=this.getSelectConfig(t);if(!n)return[];if(n.options&&n.options.length)return n.options;const o=n.optionsPath?this.resolvePath(e,n.optionsPath):null,r=Array.isArray(o)?o:[],i=n.optionLabelKey||"label",a=n.optionValueKey||"value";return r.map(t=>({label:t[i],value:t[a],disabled:!!t.disabled}))}onSelectAction(t,e,n){this.setCellValue(e,n,t);const o=this.getSelectConfig(n);this.emitAction(o?.action||"select",e,n,t)}getInputConfig(t){return t.input?t.input:"gallons_requested"===t.data?{action:"adjustQtyRequested",type:"number",placeholder:"Gallons Requested",updateOn:"keyup"}:"tank_level"===t.data?{action:"adjustTankLevel",type:"number",placeholder:"Tank Level",updateOn:"keyup"}:"current_rate"===t.data?{action:"adjustCurrentRate",type:"number",placeholder:"Current Rate",updateOn:"change"}:"currentQuantity"===t.data?{action:"onChangeTankHistory",type:"number",placeholder:"Input Current Qty",updateOn:"change"}:null}onInputModelChange(t,e,n){this.setCellValue(e,n,t);const o=this.getInputConfig(n);"keyup"===o?.updateOn&&this.emitAction(o.action,e,n,t)}onInputChange(t,e,n){this.setCellValue(e,n,t);const o=this.getInputConfig(n);o&&"change"===o.updateOn&&this.emitAction(o.action,e,n,t)}getProgressConfig(t){return t.progress||{}}getProgressValue(t,e){const n=this.getProgressConfig(e),o=n.valuePath?this.resolvePath(t,n.valuePath):this.getCellValue(t,e);if("progressive"===e.data&&o?.steps&&Array.isArray(o.steps)&&o.steps.length){const t=o.steps.length>1?o.steps.length-1:o.steps.length,e=o.steps.some(t=>!t?.date)?o.steps.findIndex(t=>!t?.date):t;return t?round(e/t*100,2):0}if(o&&"object"==typeof o&&void 0!==o.number){const t=Number(o.number);return Number.isFinite(t)?t>=0&&t<=1?100*t:t:0}const r=Number(o);return Number.isFinite(r)?"progress_percentage"===e.data&&r>100?r-100:r>=0&&r<=1?100*r:r:0}getProgressType(t,e){const n=this.getProgressConfig(e);if(n.type)return n.type;const o=this.getProgressValue(t,e);if("progress_percentage"===e.data){return Number(this.getCellValue(t,e))<=100?"success":"danger"}return o<30?"danger":o<70?"warning":"success"}getProgressStriped(t){const e=this.getProgressConfig(t);return void 0!==e.striped&&e.striped}getProgressAnimated(t){const e=this.getProgressConfig(t);return void 0!==e.animated&&e.animated}getProgressShowValue(t){const e=this.getProgressConfig(t);return void 0===e.showValue||e.showValue}emitAction(t,e,n,o){const r={action:t,row:e,column:n,value:o};this.cellAction.emit(r),"adjustQtyRequested"===t?this.onChangeRequested.emit(e):"adjustTankLevel"===t?this.onChangeTankLevels.emit(e):"adjustCurrentRate"===t?this.onChangeCurrentRate.emit(e):"viewTankHistory"!==t&&"onChangeTankHistory"!==t||this.onChangeTankHistory.emit(e)}getSearchButtonLabel(){return this.IronBatchAssign?"Scan":"Search"}typeOf(t){return typeof t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableComponent,deps:[{token:ProviderService},{token:DialogService},{token:LOCALE_ID},{token:DATATABLE_DEFAULT_CONFIG,optional:!0},{token:"DATATABLE_DEFAULT_CONFIG",optional:!0},{token:i3.JsonPipe},{token:i3.UpperCasePipe},{token:i3.LowerCasePipe},{token:i3.TitleCasePipe}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DatatableComponent,isStandalone:!1,selector:"data-table",inputs:{urlClick:"urlClick",columns:"columns",data:"data",collapseSize:"collapseSize",searchTitle:"searchTitle",totalItems:"totalItems",entriesPerPageOptions:"entriesPerPageOptions",searchBarAutoSearch:"searchBarAutoSearch",searchDebounceMs:"searchDebounceMs",searchMinLength:"searchMinLength",searchDistinct:"searchDistinct",IronBatchAssign:"IronBatchAssign",tableFixed:"tableFixed",headerFixed:"headerFixed",stickyHeaders:"stickyHeaders",users:"users",rowIdKey:"rowIdKey",rowNavigationMode:"rowNavigationMode",returnIdUrls:"returnIdUrls",showSearch:"showSearch",showPaging:"showPaging",showToolbar:"showToolbar",showEntriesControl:"showEntriesControl",showResultsSummary:"showResultsSummary",hideSearch:"hideSearch",hideFooter:"hideFooter",tableData:"tableData"},outputs:{onChangeTableData:"onChangeTableData",tableDataChange:"tableDataChange",cellAction:"cellAction",rowClick:"rowClick",rowSelected:"rowSelected",returnId:"returnId",onChangeRequested:"onChangeRequested",onChangeTankLevels:"onChangeTankLevels",onChangeCurrentRate:"onChangeCurrentRate",onChangeTankHistory:"onChangeTankHistory"},host:{listeners:{"document:click":"onDocumentClick($event)","document:keydown.escape":"onDocumentEscape()"}},providers:[ProviderService,JsonPipe,UpperCasePipe,LowerCasePipe,TitleCasePipe],queries:[{propertyName:"cellTemplateDirectives",predicate:DatatableCellTemplateDirective}],usesInheritance:!0,usesOnChanges:!0,ngImport:i0,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.dt-shell {\n\t\tbackground: linear-gradient(180deg, rgba(248, 250, 255, 0.95), rgba(240, 245, 255, 0.92));\n\t\tborder: 1px solid rgba(107, 132, 174, 0.25);\n\t\tborder-radius: 14px;\n\t\tpadding: 14px;\n\t\tbox-shadow: 0 10px 28px rgba(26, 49, 84, 0.08);\n\t}\n\n\t.dt-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.dt-search-wrap {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tflex: 1 1 460px;\n\t\tmin-width: 280px;\n\t}\n\n\t.dt-search-button {\n\t\tmin-width: 88px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-search-input {\n\t\tmin-height: 40px;\n\t\tborder-radius: 10px;\n\t\tborder-color: rgba(117, 137, 170, 0.45);\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: inset 0 1px 2px rgba(17, 38, 62, 0.08);\n\t}\n\n\t.dt-summary {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #385981;\n\t\tletter-spacing: 0.02em;\n\t\twhite-space: nowrap;\n\t}\n\n\t.dt-table-wrap {\n\t\twidth: 100%;\n\t}\n\n\t.dt-table-wrap collapse-table .collapseTable,\n\t.dt-table-wrap collapse-table .collapseTable-sec,\n\t.dt-table-wrap collapse-table .collapseTable-tert {\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t}\n\n\t.dt-header-cell {\n\t\tuser-select: none;\n\t\tposition: relative;\n\t}\n\n\t.dt-header-cell {\n\t\tcursor: pointer;\n\t}\n\n\t.dt-header-cell.dt-no-menu {\n\t\tcursor: default;\n\t}\n\n\t.dt-header-cell .dt-header-inner {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-dot {\n\t\twidth: 7px;\n\t\theight: 7px;\n\t\tborder-radius: 999px;\n\t\tbackground: #0b5ed7;\n\t\tbox-shadow: 0 0 0 2px rgba(11, 94, 215, 0.18);\n\t}\n\n\t.dt-header-menu {\n\t\tposition: absolute;\n\t\ttop: calc(100% + 6px);\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\tz-index: 50;\n\t\tmin-width: 168px;\n\t\tpadding: 6px;\n\t\tborder-radius: 10px;\n\t\tborder: 1px solid rgba(63, 92, 135, 0.22);\n\t\tbackground: rgba(255, 255, 255, 0.98);\n\t\tbox-shadow: 0 12px 24px rgba(16, 33, 56, 0.18);\n\t\tanimation: dtMenuIn 0.14s ease-out;\n\t}\n\n\t.dt-header-menu-btn {\n\t\twidth: 100%;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\ttext-align: left;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 8px;\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #2c4d72;\n\t\ttransition: background-color 0.12s ease, color 0.12s ease;\n\t}\n\n\t.dt-header-menu-btn:hover {\n\t\tbackground: rgba(18, 90, 184, 0.1);\n\t\tcolor: #113b66;\n\t}\n\n\t.dt-header-menu-divider {\n\t\theight: 1px;\n\t\tmargin: 6px 4px;\n\t\tbackground: rgba(77, 108, 148, 0.18);\n\t}\n\n\t@keyframes dtMenuIn {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateX(-50%) translateY(-4px) scale(0.98);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateX(-50%) translateY(0) scale(1);\n\t\t}\n\t}\n\n\t.dt-filter-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t\tpadding: 8px 10px;\n\t\tborder: 1px solid rgba(117, 137, 170, 0.3);\n\t\tborder-radius: 10px;\n\t\tbackground: rgba(255, 255, 255, 0.7);\n\t}\n\n\t.dt-filter-chip-wrap {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tpadding: 3px 8px;\n\t\tborder-radius: 999px;\n\t\tbackground-color: rgba(11, 94, 215, 0.12);\n\t\tcolor: #0b5ed7;\n\t\tfont-size: 11px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-filter-clear {\n\t\tmin-width: 88px;\n\t}\n\n\t.dt-cell {\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t.dt-cell .dt-value {\n\t\twhite-space: pre-line;\n\t\tword-break: normal;\n\t\toverflow-wrap: normal;\n\t\thyphens: none;\n\t}\n\n\t.dt-align-left {\n\t\ttext-align: left !important;\n\t}\n\n\t.dt-align-center {\n\t\ttext-align: center !important;\n\t}\n\n\t.dt-align-right {\n\t\ttext-align: right !important;\n\t}\n\n\t.dt-row-alert td {\n\t\tbackground-color: rgba(255, 136, 84, 0.18) !important;\n\t}\n\n\t.dt-pre {\n\t\tmargin: 0;\n\t\twhite-space: pre-wrap;\n\t\tmax-height: 180px;\n\t\toverflow-y: auto;\n\t\ttext-align: left;\n\t}\n\n\t.dt-buttons {\n\t\tdisplay: inline-flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t\tjustify-content: center;\n\t}\n\n\t.dt-inline-input,\n\t.dt-inline-select {\n\t\tmin-width: 120px;\n\t}\n\n\t.dt-empty {\n\t\tpadding: 26px 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #5c7392;\n\t}\n\n\t.dt-footer {\n\t\tmargin-top: 12px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: flex-end;\n\t\tjustify-content: space-between;\n\t\tgap: 12px;\n\t}\n\n\t.dt-entries {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 6px;\n\t}\n\n\t.dt-entries label {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #35557f;\n\t\tmargin: 0;\n\t}\n\n\t.dt-page-size {\n\t\tmin-width: 120px;\n\t\twidth: 120px;\n\t}\n\n\t.dt-page-size rio-select {\n\t\twidth: 100%;\n\t}\n\n\t.dt-pagination-wrap {\n\t\tmargin-left: auto;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.dt-shell {\n\t\t\tpadding: 10px;\n\t\t\tborder-radius: 12px;\n\t\t}\n\n\t\t.dt-search-wrap {\n\t\t\tflex: 1 1 100%;\n\t\t}\n\n\t\t.dt-search-button {\n\t\t\tmin-width: 74px;\n\t\t}\n\n\t\t.dt-footer {\n\t\t\talign-items: stretch;\n\t\t}\n\n\t\t.dt-pagination-wrap {\n\t\t\tmargin-left: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n</style>\n\n<section class="dt-shell">\n\t@if (showToolbar) {\n\t\t<div class="dt-toolbar">\n\t\t\t@if (showSearch) {\n\t\t\t\t<div class="dt-search-wrap">\n\t\t\t\t\t<button class="btn btn-primary dt-search-button" type="button" (click)="onSearchSubmit()">{{ getSearchButtonLabel() }}</button>\n\t\t\t\t\t<input type="search" class="form-control dt-search-input" [placeholder]="searchTitle" [(ngModel)]="tableData.searchString" (keyup.enter)="onSearchSubmit()" (ngModelChange)="onSearchChange()" />\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showResultsSummary) {\n\t\t\t\t<div class="dt-summary">Showing {{ displayData?.length || 0 }} of {{ totalItems | number }} records</div>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (getActiveColumnFilterCount()) {\n\t\t<div class="dt-filter-toolbar">\n\t\t\t<div class="dt-filter-chip-wrap">\n\t\t\t\t@for (activeFilter of getActiveColumnFilters(); track activeFilter.key) {\n\t\t\t\t\t<span class="dt-filter-chip" [title]="activeFilter.summary">{{ activeFilter.columnName }}</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary dt-filter-clear" (click)="clearAllColumnFilters($event)">Clear Filters</button>\n\t\t</div>\n\t}\n\n\t<div class="dt-table-wrap">\n\t\t<collapse-table [collapseSize]="collapseSize" [headerFixed]="headerFixed" [stickyHeaders]="stickyHeaders" [tableFixed]="tableFixed">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t<th [ngClass]="getHeaderClasses(column)" [style.width]="column.width || null" (click)="onHeaderClick(column, $event)">\n\t\t\t\t\t\t\t<span class="dt-header-inner">\n\t\t\t\t\t\t\t\t{{ column.name }}\n\t\t\t\t\t\t\t\t@if (column.sortable !== false && isSortedColumn(column)) {\n\t\t\t\t\t\t\t\t\t<i class="fa" [ngClass]="getSortIcon(column)"></i>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@if (hasColumnFilter(column)) {\n\t\t\t\t\t\t\t\t\t<span class="dt-filter-dot" [title]="getColumnFilterSummary(column)"></span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t@if (isHeaderMenuOpen(column)) {\n\t\t\t\t\t\t\t\t<div class="dt-header-menu" (click)="$event.stopPropagation()">\n\t\t\t\t\t\t\t\t\t@if (headerMenuStep === \'root\') {\n\t\t\t\t\t\t\t\t\t\t@if (column.sortable !== false) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="showSortMenu($event)">Sort</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@if (isFilterableColumn(column)) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="openFilterFromHeaderMenu(column, $event)">Filter</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="sortFromHeaderMenu(column, \'asc\', $event)">Sort Ascending</button>\n\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="sortFromHeaderMenu(column, \'desc\', $event)">Sort Descending</button>\n\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-divider"></div>\n\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="showRootHeaderMenu($event)">Back</button>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t}\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t@if (displayData && displayData.length) {\n\t\t\t\t\t@for (item of displayData; track getRowId(item, $index); let rowIndex = $index) {\n\t\t\t\t\t\t<tr [ngClass]="getRowClasses(item)">\n\t\t\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t\t\t@let mode = getCellMode(column, item);\n\t\t\t\t\t\t\t\t<td [attr.data-label]="column.name" [ngClass]="getCellClasses(column)" [style.width]="column.width || null" (click)="onCellClick(item, column, $event, rowIndex)">\n\t\t\t\t\t\t\t\t\t@if (mode === \'template\') {\n\t\t\t\t\t\t\t\t\t\t<ng-container [ngTemplateOutlet]="getCellTemplate(column)" [ngTemplateOutletContext]="{ $implicit: item, row: item, column: column, value: getCellValue(item, column) }"></ng-container>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'buttons\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (button of getButtons(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'button\') {\n\t\t\t\t\t\t\t\t\t\t@let button = getButtons(column, item)[0];\n\t\t\t\t\t\t\t\t\t\t@if (button) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'select\') {\n\t\t\t\t\t\t\t\t\t\t@let selectConfig = getSelectConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (selectConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<select class="form-select form-select-sm dt-inline-select" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onSelectAction($event, item, column)">\n\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="null">{{ selectConfig.placeholder || \'Select...\' }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t@for (option of getSelectOptions(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="option.value" [disabled]="option.disabled">{{ option.label }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'input\') {\n\t\t\t\t\t\t\t\t\t\t@let inputConfig = getInputConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (inputConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<input class="form-control form-control-sm dt-inline-input" [type]="inputConfig.type || \'text\'" [attr.placeholder]="inputConfig.placeholder || null" [attr.min]="inputConfig.min ?? null" [attr.max]="inputConfig.max ?? null" [attr.step]="inputConfig.step ?? null" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onInputModelChange($event, item, column)" (change)="onInputChange(getCellValue(item, column), item, column)" />\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'progress\') {\n\t\t\t\t\t\t\t\t\t\t<ngb-progressbar [showValue]="getProgressShowValue(column)" [type]="getProgressType(item, column)" [value]="getProgressValue(item, column)" [striped]="getProgressStriped(column)" [animated]="getProgressAnimated(column)"></ngb-progressbar>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'files\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (fileRef of getFileButtons(item, column); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-secondary" (click)="onFileButtonClick(fileRef, $event)">{{ fileRef.label }}</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'pre\') {\n\t\t\t\t\t\t\t\t\t\t<pre class="dt-pre">{{ getDisplayValue(item, column) }}</pre>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'boolean\') {\n\t\t\t\t\t\t\t\t\t\t@if (getCellValue(item, column)) {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-check" style="color: green; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-times" style="color: red; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t<span class="dt-value" [title]="getDisplayValue(item, column)">{{ getDisplayValue(item, column) }}</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td [attr.colspan]="normalizedColumns?.length || 1">\n\t\t\t\t\t\t\t<div class="dt-empty">No results found.</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t}\n\t\t\t</tbody>\n\t\t</collapse-table>\n\t</div>\n\n\t@if (showPaging) {\n\t\t<div class="dt-footer">\n\t\t\t@if (showEntriesControl) {\n\t\t\t\t<div class="dt-entries">\n\t\t\t\t\t<label>Entries Per Page</label>\n\t\t\t\t\t<div class="dt-page-size">\n\t\t\t\t\t\t<rio-select [options]="entriesPerPageSelectOptions" optionLabelKey="label" optionValueKey="value" [clearable]="false" [searchable]="false" [ngModel]="tableData.entriesPerPage" (ngModelChange)="onEntriesPerPageChange($event)"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<div class="dt-pagination-wrap">\n\t\t\t\t<rio-pagination [collectionSize]="totalItems" [page]="tableData.pageNum" [pageSize]="getPageSize()" [maxSize]="6" [boundaryLinks]="true" [directionLinks]="true" [ellipses]="true" (pageChange)="onPageChange($event)"></rio-pagination>\n\t\t\t</div>\n\t\t</div>\n\t}\n</section>\n',styles:[":host{display:block}.dt-shell{background:linear-gradient(180deg,#f8fafff2,#f0f5ffeb);border:1px solid rgba(107,132,174,.25);border-radius:14px;padding:14px;box-shadow:0 10px 28px #1a315414}.dt-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-bottom:12px}.dt-search-wrap{display:flex;align-items:center;gap:8px;flex:1 1 460px;min-width:280px}.dt-search-button{min-width:88px;font-weight:600}.dt-search-input{min-height:40px;border-radius:10px;border-color:#7589aa73;background-color:#fff;box-shadow:inset 0 1px 2px #11263e14}.dt-summary{font-size:12px;font-weight:600;color:#385981;letter-spacing:.02em;white-space:nowrap}.dt-table-wrap{width:100%}.dt-table-wrap collapse-table .collapseTable,.dt-table-wrap collapse-table .collapseTable-sec,.dt-table-wrap collapse-table .collapseTable-tert{width:100%;max-width:100%}.dt-header-cell{-webkit-user-select:none;user-select:none;position:relative}.dt-header-cell{cursor:pointer}.dt-header-cell.dt-no-menu{cursor:default}.dt-header-cell .dt-header-inner{display:flex;align-items:center;justify-content:center;gap:6px}.dt-filter-dot{width:7px;height:7px;border-radius:999px;background:#0b5ed7;box-shadow:0 0 0 2px #0b5ed72e}.dt-header-menu{position:absolute;top:calc(100% + 6px);left:50%;transform:translate(-50%);z-index:50;min-width:168px;padding:6px;border-radius:10px;border:1px solid rgba(63,92,135,.22);background:#fffffffa;box-shadow:0 12px 24px #1021382e;animation:dtMenuIn .14s ease-out}.dt-header-menu-btn{width:100%;border:0;background:transparent;text-align:left;padding:8px 10px;border-radius:8px;font-size:12px;font-weight:600;color:#2c4d72;transition:background-color .12s ease,color .12s ease}.dt-header-menu-btn:hover{background:#125ab81a;color:#113b66}.dt-header-menu-divider{height:1px;margin:6px 4px;background:#4d6c942e}@keyframes dtMenuIn{0%{opacity:0;transform:translate(-50%) translateY(-4px) scale(.98)}to{opacity:1;transform:translate(-50%) translateY(0) scale(1)}}.dt-filter-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;padding:8px 10px;border:1px solid rgba(117,137,170,.3);border-radius:10px;background:#ffffffb3}.dt-filter-chip-wrap{display:flex;flex-wrap:wrap;gap:6px}.dt-filter-chip{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background-color:#0b5ed71f;color:#0b5ed7;font-size:11px;font-weight:600}.dt-filter-clear{min-width:88px}.dt-cell{transition:background-color .16s ease}.dt-cell .dt-value{white-space:pre-line;word-break:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.dt-align-left{text-align:left!important}.dt-align-center{text-align:center!important}.dt-align-right{text-align:right!important}.dt-row-alert td{background-color:#ff88542e!important}.dt-pre{margin:0;white-space:pre-wrap;max-height:180px;overflow-y:auto;text-align:left}.dt-buttons{display:inline-flex;flex-wrap:wrap;gap:6px;justify-content:center}.dt-inline-input,.dt-inline-select{min-width:120px}.dt-empty{padding:26px 12px;font-weight:600;color:#5c7392}.dt-footer{margin-top:12px;display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px}.dt-entries{display:flex;flex-direction:column;gap:6px}.dt-entries label{font-size:12px;font-weight:600;color:#35557f;margin:0}.dt-page-size{min-width:120px;width:120px}.dt-page-size rio-select{width:100%}.dt-pagination-wrap{margin-left:auto}@media(max-width:768px){.dt-shell{padding:10px;border-radius:12px}.dt-search-wrap{flex:1 1 100%}.dt-search-button{min-width:74px}.dt-footer{align-items:stretch}.dt-pagination-wrap{margin-left:0;width:100%}}\n"],dependencies:[{kind:"component",type:i1$2.NgbProgressbar,selector:"ngb-progressbar",inputs:["max","animated","ariaLabel","striped","showValue","textType","type","value","height"]},{kind:"directive",type:i2.NgSelectOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.ɵNgSelectMultipleOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.SelectControlValueAccessor,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:["compareWith"]},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i3.NgTemplateOutlet,selector:"[ngTemplateOutlet]",inputs:["ngTemplateOutletContext","ngTemplateOutlet","ngTemplateOutletInjector"]},{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:RioPaginationComponent,selector:"rio-pagination",inputs:["collectionSize","page","pageSize","maxSize","boundaryLinks","directionLinks","ellipses","disabled"],outputs:["pageChange"]},{kind:"pipe",type:i3.DecimalPipe,name:"number"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableComponent,decorators:[{type:Component,args:[{providers:[ProviderService,JsonPipe,UpperCasePipe,LowerCasePipe,TitleCasePipe],selector:"data-table",standalone:!1,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.dt-shell {\n\t\tbackground: linear-gradient(180deg, rgba(248, 250, 255, 0.95), rgba(240, 245, 255, 0.92));\n\t\tborder: 1px solid rgba(107, 132, 174, 0.25);\n\t\tborder-radius: 14px;\n\t\tpadding: 14px;\n\t\tbox-shadow: 0 10px 28px rgba(26, 49, 84, 0.08);\n\t}\n\n\t.dt-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.dt-search-wrap {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tflex: 1 1 460px;\n\t\tmin-width: 280px;\n\t}\n\n\t.dt-search-button {\n\t\tmin-width: 88px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-search-input {\n\t\tmin-height: 40px;\n\t\tborder-radius: 10px;\n\t\tborder-color: rgba(117, 137, 170, 0.45);\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: inset 0 1px 2px rgba(17, 38, 62, 0.08);\n\t}\n\n\t.dt-summary {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #385981;\n\t\tletter-spacing: 0.02em;\n\t\twhite-space: nowrap;\n\t}\n\n\t.dt-table-wrap {\n\t\twidth: 100%;\n\t}\n\n\t.dt-table-wrap collapse-table .collapseTable,\n\t.dt-table-wrap collapse-table .collapseTable-sec,\n\t.dt-table-wrap collapse-table .collapseTable-tert {\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t}\n\n\t.dt-header-cell {\n\t\tuser-select: none;\n\t\tposition: relative;\n\t}\n\n\t.dt-header-cell {\n\t\tcursor: pointer;\n\t}\n\n\t.dt-header-cell.dt-no-menu {\n\t\tcursor: default;\n\t}\n\n\t.dt-header-cell .dt-header-inner {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-dot {\n\t\twidth: 7px;\n\t\theight: 7px;\n\t\tborder-radius: 999px;\n\t\tbackground: #0b5ed7;\n\t\tbox-shadow: 0 0 0 2px rgba(11, 94, 215, 0.18);\n\t}\n\n\t.dt-header-menu {\n\t\tposition: absolute;\n\t\ttop: calc(100% + 6px);\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\tz-index: 50;\n\t\tmin-width: 168px;\n\t\tpadding: 6px;\n\t\tborder-radius: 10px;\n\t\tborder: 1px solid rgba(63, 92, 135, 0.22);\n\t\tbackground: rgba(255, 255, 255, 0.98);\n\t\tbox-shadow: 0 12px 24px rgba(16, 33, 56, 0.18);\n\t\tanimation: dtMenuIn 0.14s ease-out;\n\t}\n\n\t.dt-header-menu-btn {\n\t\twidth: 100%;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t\ttext-align: left;\n\t\tpadding: 8px 10px;\n\t\tborder-radius: 8px;\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #2c4d72;\n\t\ttransition: background-color 0.12s ease, color 0.12s ease;\n\t}\n\n\t.dt-header-menu-btn:hover {\n\t\tbackground: rgba(18, 90, 184, 0.1);\n\t\tcolor: #113b66;\n\t}\n\n\t.dt-header-menu-divider {\n\t\theight: 1px;\n\t\tmargin: 6px 4px;\n\t\tbackground: rgba(77, 108, 148, 0.18);\n\t}\n\n\t@keyframes dtMenuIn {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateX(-50%) translateY(-4px) scale(0.98);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateX(-50%) translateY(0) scale(1);\n\t\t}\n\t}\n\n\t.dt-filter-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t\tpadding: 8px 10px;\n\t\tborder: 1px solid rgba(117, 137, 170, 0.3);\n\t\tborder-radius: 10px;\n\t\tbackground: rgba(255, 255, 255, 0.7);\n\t}\n\n\t.dt-filter-chip-wrap {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tpadding: 3px 8px;\n\t\tborder-radius: 999px;\n\t\tbackground-color: rgba(11, 94, 215, 0.12);\n\t\tcolor: #0b5ed7;\n\t\tfont-size: 11px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-filter-clear {\n\t\tmin-width: 88px;\n\t}\n\n\t.dt-cell {\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t.dt-cell .dt-value {\n\t\twhite-space: pre-line;\n\t\tword-break: normal;\n\t\toverflow-wrap: normal;\n\t\thyphens: none;\n\t}\n\n\t.dt-align-left {\n\t\ttext-align: left !important;\n\t}\n\n\t.dt-align-center {\n\t\ttext-align: center !important;\n\t}\n\n\t.dt-align-right {\n\t\ttext-align: right !important;\n\t}\n\n\t.dt-row-alert td {\n\t\tbackground-color: rgba(255, 136, 84, 0.18) !important;\n\t}\n\n\t.dt-pre {\n\t\tmargin: 0;\n\t\twhite-space: pre-wrap;\n\t\tmax-height: 180px;\n\t\toverflow-y: auto;\n\t\ttext-align: left;\n\t}\n\n\t.dt-buttons {\n\t\tdisplay: inline-flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t\tjustify-content: center;\n\t}\n\n\t.dt-inline-input,\n\t.dt-inline-select {\n\t\tmin-width: 120px;\n\t}\n\n\t.dt-empty {\n\t\tpadding: 26px 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #5c7392;\n\t}\n\n\t.dt-footer {\n\t\tmargin-top: 12px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: flex-end;\n\t\tjustify-content: space-between;\n\t\tgap: 12px;\n\t}\n\n\t.dt-entries {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 6px;\n\t}\n\n\t.dt-entries label {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #35557f;\n\t\tmargin: 0;\n\t}\n\n\t.dt-page-size {\n\t\tmin-width: 120px;\n\t\twidth: 120px;\n\t}\n\n\t.dt-page-size rio-select {\n\t\twidth: 100%;\n\t}\n\n\t.dt-pagination-wrap {\n\t\tmargin-left: auto;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.dt-shell {\n\t\t\tpadding: 10px;\n\t\t\tborder-radius: 12px;\n\t\t}\n\n\t\t.dt-search-wrap {\n\t\t\tflex: 1 1 100%;\n\t\t}\n\n\t\t.dt-search-button {\n\t\t\tmin-width: 74px;\n\t\t}\n\n\t\t.dt-footer {\n\t\t\talign-items: stretch;\n\t\t}\n\n\t\t.dt-pagination-wrap {\n\t\t\tmargin-left: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n</style>\n\n<section class="dt-shell">\n\t@if (showToolbar) {\n\t\t<div class="dt-toolbar">\n\t\t\t@if (showSearch) {\n\t\t\t\t<div class="dt-search-wrap">\n\t\t\t\t\t<button class="btn btn-primary dt-search-button" type="button" (click)="onSearchSubmit()">{{ getSearchButtonLabel() }}</button>\n\t\t\t\t\t<input type="search" class="form-control dt-search-input" [placeholder]="searchTitle" [(ngModel)]="tableData.searchString" (keyup.enter)="onSearchSubmit()" (ngModelChange)="onSearchChange()" />\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showResultsSummary) {\n\t\t\t\t<div class="dt-summary">Showing {{ displayData?.length || 0 }} of {{ totalItems | number }} records</div>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (getActiveColumnFilterCount()) {\n\t\t<div class="dt-filter-toolbar">\n\t\t\t<div class="dt-filter-chip-wrap">\n\t\t\t\t@for (activeFilter of getActiveColumnFilters(); track activeFilter.key) {\n\t\t\t\t\t<span class="dt-filter-chip" [title]="activeFilter.summary">{{ activeFilter.columnName }}</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary dt-filter-clear" (click)="clearAllColumnFilters($event)">Clear Filters</button>\n\t\t</div>\n\t}\n\n\t<div class="dt-table-wrap">\n\t\t<collapse-table [collapseSize]="collapseSize" [headerFixed]="headerFixed" [stickyHeaders]="stickyHeaders" [tableFixed]="tableFixed">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t<th [ngClass]="getHeaderClasses(column)" [style.width]="column.width || null" (click)="onHeaderClick(column, $event)">\n\t\t\t\t\t\t\t<span class="dt-header-inner">\n\t\t\t\t\t\t\t\t{{ column.name }}\n\t\t\t\t\t\t\t\t@if (column.sortable !== false && isSortedColumn(column)) {\n\t\t\t\t\t\t\t\t\t<i class="fa" [ngClass]="getSortIcon(column)"></i>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@if (hasColumnFilter(column)) {\n\t\t\t\t\t\t\t\t\t<span class="dt-filter-dot" [title]="getColumnFilterSummary(column)"></span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t@if (isHeaderMenuOpen(column)) {\n\t\t\t\t\t\t\t\t<div class="dt-header-menu" (click)="$event.stopPropagation()">\n\t\t\t\t\t\t\t\t\t@if (headerMenuStep === \'root\') {\n\t\t\t\t\t\t\t\t\t\t@if (column.sortable !== false) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="showSortMenu($event)">Sort</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@if (isFilterableColumn(column)) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="openFilterFromHeaderMenu(column, $event)">Filter</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="sortFromHeaderMenu(column, \'asc\', $event)">Sort Ascending</button>\n\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="sortFromHeaderMenu(column, \'desc\', $event)">Sort Descending</button>\n\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-divider"></div>\n\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-btn" (click)="showRootHeaderMenu($event)">Back</button>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</th>\n\t\t\t\t\t}\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t@if (displayData && displayData.length) {\n\t\t\t\t\t@for (item of displayData; track getRowId(item, $index); let rowIndex = $index) {\n\t\t\t\t\t\t<tr [ngClass]="getRowClasses(item)">\n\t\t\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t\t\t@let mode = getCellMode(column, item);\n\t\t\t\t\t\t\t\t<td [attr.data-label]="column.name" [ngClass]="getCellClasses(column)" [style.width]="column.width || null" (click)="onCellClick(item, column, $event, rowIndex)">\n\t\t\t\t\t\t\t\t\t@if (mode === \'template\') {\n\t\t\t\t\t\t\t\t\t\t<ng-container [ngTemplateOutlet]="getCellTemplate(column)" [ngTemplateOutletContext]="{ $implicit: item, row: item, column: column, value: getCellValue(item, column) }"></ng-container>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'buttons\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (button of getButtons(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'button\') {\n\t\t\t\t\t\t\t\t\t\t@let button = getButtons(column, item)[0];\n\t\t\t\t\t\t\t\t\t\t@if (button) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'select\') {\n\t\t\t\t\t\t\t\t\t\t@let selectConfig = getSelectConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (selectConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<select class="form-select form-select-sm dt-inline-select" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onSelectAction($event, item, column)">\n\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="null">{{ selectConfig.placeholder || \'Select...\' }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t@for (option of getSelectOptions(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="option.value" [disabled]="option.disabled">{{ option.label }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'input\') {\n\t\t\t\t\t\t\t\t\t\t@let inputConfig = getInputConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (inputConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<input class="form-control form-control-sm dt-inline-input" [type]="inputConfig.type || \'text\'" [attr.placeholder]="inputConfig.placeholder || null" [attr.min]="inputConfig.min ?? null" [attr.max]="inputConfig.max ?? null" [attr.step]="inputConfig.step ?? null" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onInputModelChange($event, item, column)" (change)="onInputChange(getCellValue(item, column), item, column)" />\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'progress\') {\n\t\t\t\t\t\t\t\t\t\t<ngb-progressbar [showValue]="getProgressShowValue(column)" [type]="getProgressType(item, column)" [value]="getProgressValue(item, column)" [striped]="getProgressStriped(column)" [animated]="getProgressAnimated(column)"></ngb-progressbar>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'files\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (fileRef of getFileButtons(item, column); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-secondary" (click)="onFileButtonClick(fileRef, $event)">{{ fileRef.label }}</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'pre\') {\n\t\t\t\t\t\t\t\t\t\t<pre class="dt-pre">{{ getDisplayValue(item, column) }}</pre>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'boolean\') {\n\t\t\t\t\t\t\t\t\t\t@if (getCellValue(item, column)) {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-check" style="color: green; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-times" style="color: red; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t<span class="dt-value" [title]="getDisplayValue(item, column)">{{ getDisplayValue(item, column) }}</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td [attr.colspan]="normalizedColumns?.length || 1">\n\t\t\t\t\t\t\t<div class="dt-empty">No results found.</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t}\n\t\t\t</tbody>\n\t\t</collapse-table>\n\t</div>\n\n\t@if (showPaging) {\n\t\t<div class="dt-footer">\n\t\t\t@if (showEntriesControl) {\n\t\t\t\t<div class="dt-entries">\n\t\t\t\t\t<label>Entries Per Page</label>\n\t\t\t\t\t<div class="dt-page-size">\n\t\t\t\t\t\t<rio-select [options]="entriesPerPageSelectOptions" optionLabelKey="label" optionValueKey="value" [clearable]="false" [searchable]="false" [ngModel]="tableData.entriesPerPage" (ngModelChange)="onEntriesPerPageChange($event)"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<div class="dt-pagination-wrap">\n\t\t\t\t<rio-pagination [collectionSize]="totalItems" [page]="tableData.pageNum" [pageSize]="getPageSize()" [maxSize]="6" [boundaryLinks]="true" [directionLinks]="true" [ellipses]="true" (pageChange)="onPageChange($event)"></rio-pagination>\n\t\t\t</div>\n\t\t</div>\n\t}\n</section>\n'}]}],ctorParameters:()=>[{type:ProviderService},{type:DialogService},{type:void 0,decorators:[{type:Inject,args:[LOCALE_ID]}]},{type:void 0,decorators:[{type:Optional},{type:Inject,args:[DATATABLE_DEFAULT_CONFIG]}]},{type:void 0,decorators:[{type:Optional},{type:Inject,args:["DATATABLE_DEFAULT_CONFIG"]}]},{type:i3.JsonPipe},{type:i3.UpperCasePipe},{type:i3.LowerCasePipe},{type:i3.TitleCasePipe}],propDecorators:{urlClick:[{type:Input}],columns:[{type:Input}],data:[{type:Input}],collapseSize:[{type:Input}],searchTitle:[{type:Input}],totalItems:[{type:Input}],entriesPerPageOptions:[{type:Input}],searchBarAutoSearch:[{type:Input}],searchDebounceMs:[{type:Input}],searchMinLength:[{type:Input}],searchDistinct:[{type:Input}],IronBatchAssign:[{type:Input}],tableFixed:[{type:Input}],headerFixed:[{type:Input}],stickyHeaders:[{type:Input}],users:[{type:Input}],rowIdKey:[{type:Input}],rowNavigationMode:[{type:Input}],returnIdUrls:[{type:Input}],showSearch:[{type:Input}],showPaging:[{type:Input}],showToolbar:[{type:Input}],showEntriesControl:[{type:Input}],showResultsSummary:[{type:Input}],hideSearch:[{type:Input}],hideFooter:[{type:Input}],onChangeTableData:[{type:Output}],tableDataChange:[{type:Output}],cellAction:[{type:Output}],rowClick:[{type:Output}],rowSelected:[{type:Output}],returnId:[{type:Output}],onChangeRequested:[{type:Output}],onChangeTankLevels:[{type:Output}],onChangeCurrentRate:[{type:Output}],onChangeTankHistory:[{type:Output}],tableData:[{type:Input}],cellTemplateDirectives:[{type:ContentChildren,args:[DatatableCellTemplateDirective]}],onDocumentClick:[{type:HostListener,args:["document:click",["$event"]]}],onDocumentEscape:[{type:HostListener,args:["document:keydown.escape"]}]}});class DatatableModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,declarations:[DatatableComponent,DatatableCellTemplateDirective],imports:[NgbModule,FormsModule,CommonModule,RouterModule,CollapseTableModule,RioSelectModule,RioPaginationModule],exports:[DatatableComponent,DatatableCellTemplateDirective]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,imports:[NgbModule,FormsModule,CommonModule,RouterModule,CollapseTableModule,RioSelectModule,RioPaginationModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,decorators:[{type:NgModule,args:[{imports:[NgbModule,FormsModule,CommonModule,RouterModule,CollapseTableModule,RioSelectModule,RioPaginationModule],exports:[DatatableComponent,DatatableCellTemplateDirective],declarations:[DatatableComponent,DatatableCellTemplateDirective],providers:[]}]}]});class FileUploadComponent extends BaseComponent{_resize;_services;_ds;_http;constructor(t,e,n,o){super(e),this._resize=t,this._services=e,this._ds=n,this._http=o}files=[];allowDelete=!1;allowReplace=!1;showFileUpload=!0;filesChanged=new EventEmitter;fileAdded=new EventEmitter;fileRemoved=new EventEmitter;fileType;download_link;supportedFileTypes=["application/pdf","text/plain","image/gif","image/png","image/jpeg","image/bmp"];pdfSrc="";replaceFileIndex=0;isUploading=!1;progressMsg="";windowSize$;windowSize=0;ngOnInit(){this.windowSize$=this._resize.onResize$.subscribe(t=>{this.windowSize=t?t.innerWidth:window.innerWidth})}ngOnDestroy(){this.windowSize$.unsubscribe()}dragFileAccepted(t){this.supportedFileTypes.indexOf(t.type)>=0?this.uploadWithEmit(t,"misc").then(()=>{},t=>{this._ds.error("Could not upload file, incorrect type")}):this._ds.error("Invalid format, the supported file types are: "+this.supportedFileTypes)}upload(t,e,n,o,r){return new Promise((i,a)=>{this.progressMsg="Uploading "+(o||t.name),this._services._aws.uploadFile(t,e,n,o).then(a=>{const s={_id:a._id,name:o||t.name,size:t.size,status:r||"Uploaded",key:a.key,order:n||-1,type:e};this.isUploading=!1,this.files.push(s),this.files=this.files.sort((t,e)=>t.order-e.order),i(s)},t=>{this._ds.error("Could not upload file. "+t),a(t)}),this.isUploading=!0})}uploadWithEmit(t,e,n,o,r){return new Promise((i,a)=>{this.progressMsg="Uploading "+(o||t.name),this._services._aws.uploadFile(t,e,n,o).then(a=>{const s={_id:a._id,name:o||t.name,size:t.size,status:r||"Uploaded",key:a.key,order:n||-1,type:e};this.isUploading=!1,this.files=this.files.sort((t,e)=>t.order-e.order),this.fileAdded.emit(s),i(s)},t=>{this._ds.error("Could not upload file. "+t),a(t)}),this.isUploading=!0})}delete(t,e=!0){this.pdfSrc="",e?this._ds.confirm("Are you sure you want to delete this file?").then(e=>{this._services._aws.deleteFile(this.files[t].key,(e,n)=>{e&&(this._ds.error("Could not delete file"),this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e]))}),this.files.splice(t,1)},t=>{}):(this._services._aws.deleteFile(this.files[t].key,(e,n)=>{e&&this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e])}),this.files.splice(t,1))}deleteWithEmit(t,e=!0){this.pdfSrc="";let n=Object.assign({},this.files[t]);e?this._ds.confirm("Are you sure you want to delete this file?").then(e=>{this._services._aws.deleteFile(this.files[t].key,(e,o)=>{e&&(this._ds.error("Could not delete file"),this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e])),this.fileRemoved.emit(n)})},t=>{}):this._services._aws.deleteFile(this.files[t].key,(e,o)=>{e&&this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e]),this.fileRemoved.emit(n)})}deleteFileWithId(t){this.delete(this.files.map(t=>t._id).indexOf(t),!1)}open(t){this._services._socket.call("getSignedUrl",t.key,900,(e,n)=>{n?window.open(n):this._services._socket.call("insertErrorLog","Widgets-file - getsignedurl",[t.key,e])})}setPDFViewerSrc(t){this._services._socket.call("getSignedUrl",t.key,900,(e,n)=>{n?this.pdfSrc=n:(this._ds.error("Could not get signed url for file"),this._services._socket.call("insertErrorLog","Widgets-file - getsignedurl pdfviewer",[t.key,e]))})}onFileSelect(t){this.uploadWithEmit(t.target.files[0],this.fileType?this.fileType:"misc").then(()=>{},()=>{}),t.srcElement.value=""}onFileSelectReplace(t){if(t.target.files[0]){this.files[this.replaceFileIndex]._id;let e=this.files[this.replaceFileIndex].type,n=this.files[this.replaceFileIndex].order,o=this.files[this.replaceFileIndex].name.replace(/\.[^\.]+$/,"")+"."+t.target.files[0].name.split(".")[t.target.files[0].name.split(".").length-1],r=this.files[this.replaceFileIndex].status;this.deleteWithEmit(this.replaceFileIndex,!1),"Unsigned"===r?this._ds.confirm("Are you replacing this file with a signed copy?").then(r=>{this.uploadWithEmit(t.target.files[0],e,n,o,"Signed").then(t=>{t.key,t._id},t=>{})},r=>{this.uploadWithEmit(t.target.files[0],e,n,o).then(t=>{t.key,t._id},t=>{})}):this.uploadWithEmit(t.target.files[0],e,n,o).then(t=>{t.key,t._id},t=>{})}}userIsInRole(t){return this._services._account.isUserInView(t)}isMobile(){}downloadResource(t){return this._http.get(t,{responseType:"blob"}).toPromise()}download(t){this._services._socket.call("getSignedUrl",t.key,900,async(e,n)=>{if(n){const e=await this.downloadResource(n),o=window.URL.createObjectURL(e),r=this.download_link.nativeElement;r.href=o,r.download=t.name,r.click(),window.URL.revokeObjectURL(o)}else this._services._socket.call("insertErrorLog","Widgets-file - update bol",[e])})}email(t){this._ds.input("Email file to which address?",[{label:"Email Address",form:"email",data:"",validators:[Validators.required,this._services._vs.email],validatorErrors:["required","email"],validatorMsg:["Email is required","Email is invalid"],required:!0}]).then(e=>{this._services._socket.call("emailFile",t._id,e.email.value,(t,e)=>{t?this._ds.error("Could not send email: "+t):this._services._alert.setAlert("success","Email has been sent")})},t=>{})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileUploadComponent,deps:[{token:ResizeService},{token:ProviderService},{token:DialogService},{token:i4.HttpClient}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:FileUploadComponent,isStandalone:!1,selector:"file-upload",inputs:{files:"files",allowDelete:"allowDelete",allowReplace:"allowReplace",showFileUpload:"showFileUpload",fileType:"fileType"},outputs:{filesChanged:"filesChanged",fileAdded:"fileAdded",fileRemoved:"fileRemoved"},viewQueries:[{propertyName:"download_link",first:!0,predicate:["download_link"],descendants:!0,static:!0}],usesInheritance:!0,ngImport:i0,template:'<style>\n\thtml,\n\tbody {\n\t\theight: 100%;\n\t}\n\n\tcollapse-table tr:hover {\n\t\tbackground-color: lightblue;\n\t\tcursor: pointer;\n\t}\n\n\tcollapse-table {\n\t\twidth: 100%;\n\t}\n\n\t/* Label container: */\n\t.file {\n\t\tdisplay: inline-block;\n\t\tpadding: 0 0 0 0.5em;\n\t\tcursor: pointer;\n\t\tposition: relative;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t}\n\n\t/* The pseudo input field: */\n\t.file::before {\n\t\tcontent: \'\';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tz-index: -1;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #fff;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t\t-webkit-box-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t\tbox-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t}\n\n\t/* The pseudo button: */\n\t.file::after {\n\t\tcontent: \'Browse\';\n\t\tdisplay: inline-block;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #eee;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0 0.25rem 0.25rem 0;\n\t\tpadding: 0.5rem 1rem;\n\t\tline-height: 1.5;\n\t\tcolor: #555;\n\t}\n\n\t.file input[type=\'file\'] {\n\t\tcursor: pointer;\n\t\tborder: 0 none;\n\t\twidth: 12em;\n\t}\n\n\t/* -webkit hide the button: */\n\t.file input[type=\'file\']::-webkit-file-upload-button {\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\twidth: 0;\n\t\tbackground: transparent;\n\t}\n\n\t/* IE10+ hide the button: */\n\t.file input[type=\'file\']::-ms-browse {\n\t\tpadding: 0;\n\t\tmargin: -1px;\n\t\twidth: 0;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t}\n\n\t.file input[type=\'file\']::-ms-value {\n\t\tbackground: #fff;\n\t\tborder: 0;\n\t}\n\n\tcard {\n\t\twidth: 100%;\n\t}\n</style>\n\n<a style="display: none" #download_link></a>\n<input hidden type="file" #fileInputReplace (change)="onFileSelectReplace($event)" />\n\n<div class="card">\n\t<div class="card-header">\n\t\t<strong class="pull-left">Files</strong>\n\t</div>\n\t<div class="card-block">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (showFileUpload) {\n\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t<div class="container">\n\t\t\t\t\t\t\t\t<div style="margin: 10px 0px; font-weight: bold">Upload File</div>\n\t\t\t\t\t\t\t\t<label class="file">\n\t\t\t\t\t\t\t\t\t<input type="file" #fileInput (change)="onFileSelect($event)" />\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<ngx-file-drop dropZoneLabel="Drop files here" style="width: 223px; height: 112px; border: 1px black dashed; border-radius: 5px; justify-content: center" class="vertical-align" (onFileDrop)="dragFileAccepted($event)"></ngx-file-drop>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t@if (isUploading) {\n\t\t\t\t\t\t\t\t<b>{{ progressMsg || \'N/A\' }}</b>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t@if (windowSize > 980) {\n\t\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t\t@if (pdfSrc) {\n\t\t\t\t\t\t\t\t<div style="text-align: center">\n\t\t\t\t\t\t\t\t\t<resolveio-client-lib-pdf-viewer [pdfSrc]="pdfSrc"></resolveio-client-lib-pdf-viewer>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (files && files.length) {\n\t\t\t\t\t<b>Uploaded Files</b>\n\t\t\t\t\t<div [style.max-height]="windowSize > 900 ? \'300px\' : \'\'" [style.overflow-y]="windowSize > 900 ? \'auto\' : \'\'">\n\t\t\t\t\t\t<collapse-table collapseSize="900">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th>File Name</th>\n\t\t\t\t\t\t\t\t\t<th>Size</th>\n\t\t\t\t\t\t\t\t\t<th>Type</th>\n\t\t\t\t\t\t\t\t\t<th>Actions</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t@for (file of files; track file._id; let i = $index) {\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td data-label="File Name" (click)="setPDFViewerSrc(file)">{{ file.name }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Size" (click)="setPDFViewerSrc(file)">{{ file.size / 1024 / 1024 | number: \'.2\' }} MB</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Type" (click)="setPDFViewerSrc(file)">{{ file.type }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Actions">\n\t\t\t\t\t\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-success" (click)="open(file)">Open</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="download(file)">Download</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="deleteWithEmit(i)">Delete</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="fileInputReplace.click(); replaceFileIndex = i">Replace</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-warning" (click)="email(file)">Email</button>\n\t\t\t\t\t\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!files || !files.length) {\n\t\t\t\t\t<b>No Uploaded Files</b>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',styles:['html,body{height:100%}collapse-table tr:hover{background-color:#add8e6;cursor:pointer}collapse-table{width:100%}.file{display:inline-block;padding:0 0 0 .5em;cursor:pointer;position:relative;border:.075rem solid #ddd;border-radius:.25rem}.file:before{content:"";display:block;position:absolute;inset:0;z-index:-1;background-color:#fff;border:.075rem solid #ddd;border-radius:.25rem;-webkit-box-shadow:inset 0 .2rem .4rem rgba(0,0,0,.05);box-shadow:inset 0 .2rem .4rem #0000000d}.file:after{content:"Browse";display:inline-block;background-color:#eee;border:.075rem solid #ddd;border-radius:0 .25rem .25rem 0;padding:.5rem 1rem;line-height:1.5;color:#555}.file input[type=file]{cursor:pointer;border:0 none;width:12em}.file input[type=file]::-webkit-file-upload-button{border:0;padding:0;margin:0;width:0;background:transparent}.file input[type=file]::-ms-browse{padding:0;margin:-1px;width:0;border:0;background:transparent}.file input[type=file]::-ms-value{background:#fff;border:0}card{width:100%}\n'],dependencies:[{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"component",type:i7$1.NgxFileDropComponent,selector:"ngx-file-drop",inputs:["accept","directory","multiple","dropZoneLabel","dropZoneClassName","useDragEnter","contentClassName","showBrowseBtn","browseBtnClassName","browseBtnLabel","disabled"],outputs:["onFileDrop","onFileOver","onFileLeave"]},{kind:"component",type:i8.PdfViewerComponent,selector:"resolveio-client-lib-pdf-viewer",inputs:["pdfSrc","fileName"]},{kind:"pipe",type:i3.DecimalPipe,name:"number"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileUploadComponent,decorators:[{type:Component,args:[{selector:"file-upload",standalone:!1,template:'<style>\n\thtml,\n\tbody {\n\t\theight: 100%;\n\t}\n\n\tcollapse-table tr:hover {\n\t\tbackground-color: lightblue;\n\t\tcursor: pointer;\n\t}\n\n\tcollapse-table {\n\t\twidth: 100%;\n\t}\n\n\t/* Label container: */\n\t.file {\n\t\tdisplay: inline-block;\n\t\tpadding: 0 0 0 0.5em;\n\t\tcursor: pointer;\n\t\tposition: relative;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t}\n\n\t/* The pseudo input field: */\n\t.file::before {\n\t\tcontent: \'\';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tz-index: -1;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #fff;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t\t-webkit-box-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t\tbox-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t}\n\n\t/* The pseudo button: */\n\t.file::after {\n\t\tcontent: \'Browse\';\n\t\tdisplay: inline-block;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #eee;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0 0.25rem 0.25rem 0;\n\t\tpadding: 0.5rem 1rem;\n\t\tline-height: 1.5;\n\t\tcolor: #555;\n\t}\n\n\t.file input[type=\'file\'] {\n\t\tcursor: pointer;\n\t\tborder: 0 none;\n\t\twidth: 12em;\n\t}\n\n\t/* -webkit hide the button: */\n\t.file input[type=\'file\']::-webkit-file-upload-button {\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\twidth: 0;\n\t\tbackground: transparent;\n\t}\n\n\t/* IE10+ hide the button: */\n\t.file input[type=\'file\']::-ms-browse {\n\t\tpadding: 0;\n\t\tmargin: -1px;\n\t\twidth: 0;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t}\n\n\t.file input[type=\'file\']::-ms-value {\n\t\tbackground: #fff;\n\t\tborder: 0;\n\t}\n\n\tcard {\n\t\twidth: 100%;\n\t}\n</style>\n\n<a style="display: none" #download_link></a>\n<input hidden type="file" #fileInputReplace (change)="onFileSelectReplace($event)" />\n\n<div class="card">\n\t<div class="card-header">\n\t\t<strong class="pull-left">Files</strong>\n\t</div>\n\t<div class="card-block">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (showFileUpload) {\n\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t<div class="container">\n\t\t\t\t\t\t\t\t<div style="margin: 10px 0px; font-weight: bold">Upload File</div>\n\t\t\t\t\t\t\t\t<label class="file">\n\t\t\t\t\t\t\t\t\t<input type="file" #fileInput (change)="onFileSelect($event)" />\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<ngx-file-drop dropZoneLabel="Drop files here" style="width: 223px; height: 112px; border: 1px black dashed; border-radius: 5px; justify-content: center" class="vertical-align" (onFileDrop)="dragFileAccepted($event)"></ngx-file-drop>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t@if (isUploading) {\n\t\t\t\t\t\t\t\t<b>{{ progressMsg || \'N/A\' }}</b>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t@if (windowSize > 980) {\n\t\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t\t@if (pdfSrc) {\n\t\t\t\t\t\t\t\t<div style="text-align: center">\n\t\t\t\t\t\t\t\t\t<resolveio-client-lib-pdf-viewer [pdfSrc]="pdfSrc"></resolveio-client-lib-pdf-viewer>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (files && files.length) {\n\t\t\t\t\t<b>Uploaded Files</b>\n\t\t\t\t\t<div [style.max-height]="windowSize > 900 ? \'300px\' : \'\'" [style.overflow-y]="windowSize > 900 ? \'auto\' : \'\'">\n\t\t\t\t\t\t<collapse-table collapseSize="900">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th>File Name</th>\n\t\t\t\t\t\t\t\t\t<th>Size</th>\n\t\t\t\t\t\t\t\t\t<th>Type</th>\n\t\t\t\t\t\t\t\t\t<th>Actions</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t@for (file of files; track file._id; let i = $index) {\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td data-label="File Name" (click)="setPDFViewerSrc(file)">{{ file.name }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Size" (click)="setPDFViewerSrc(file)">{{ file.size / 1024 / 1024 | number: \'.2\' }} MB</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Type" (click)="setPDFViewerSrc(file)">{{ file.type }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Actions">\n\t\t\t\t\t\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-success" (click)="open(file)">Open</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="download(file)">Download</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="deleteWithEmit(i)">Delete</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="fileInputReplace.click(); replaceFileIndex = i">Replace</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-warning" (click)="email(file)">Email</button>\n\t\t\t\t\t\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!files || !files.length) {\n\t\t\t\t\t<b>No Uploaded Files</b>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}]}],ctorParameters:()=>[{type:ResizeService},{type:ProviderService},{type:DialogService},{type:i4.HttpClient}],propDecorators:{files:[{type:Input}],allowDelete:[{type:Input}],allowReplace:[{type:Input}],showFileUpload:[{type:Input}],filesChanged:[{type:Output}],fileAdded:[{type:Output}],fileRemoved:[{type:Output}],fileType:[{type:Input}],download_link:[{type:ViewChild,args:["download_link",{static:!0}]}]}});class FileModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FileModule,declarations:[FileUploadComponent],imports:[CommonModule,FormsModule,CollapseTableModule,NgbModule,ResponsiveButtonGroupModule,NgxFileDropModule,PdfViewerModule],exports:[FileUploadComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileModule,imports:[CommonModule,FormsModule,CollapseTableModule,NgbModule,ResponsiveButtonGroupModule,NgxFileDropModule,PdfViewerModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileModule,decorators:[{type:NgModule,args:[{imports:[CommonModule,FormsModule,CollapseTableModule,NgbModule,ResponsiveButtonGroupModule,NgxFileDropModule,PdfViewerModule],declarations:[FileUploadComponent],exports:[FileUploadComponent]}]}]});class UserSettingsModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,declarations:[UserSettingsComponent,UsersSettingsComponent],imports:[SharedModule,i1$1.RouterModule,DatatableModule,FileModule,NgbAccordionModule,NgbModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,providers:[UserSettingsService],imports:[SharedModule,UserSettingsRouting,DatatableModule,FileModule,NgbAccordionModule,NgbModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,decorators:[{type:NgModule,args:[{imports:[SharedModule,UserSettingsRouting,DatatableModule,FileModule,NgbAccordionModule,NgbModule],declarations:[UserSettingsComponent,UsersSettingsComponent],providers:[UserSettingsService]}]}]});class CoreModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,imports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule,UserSettingsModule,CollapseTableModule],exports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,imports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule,UserSettingsModule,CollapseTableModule,CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,decorators:[{type:NgModule,args:[{imports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule,UserSettingsModule,CollapseTableModule],exports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule]}]}]});let typeCache={};function type(t){if(typeCache[t])throw new Error(`Action type "${t}" is not unqiue"`);return typeCache[t]=!0,t}class DateShortcutComponent extends BaseComponent{_services;_cd;startDateObj;endDateObj;startDateObjForm;endDateObjForm;startDateObjChange=new EventEmitter;endDateObjChange=new EventEmitter;startDateObjFormChange=new EventEmitter;endDateObjFormChange=new EventEmitter;datesChanged=new EventEmitter;shortcutValue=null;shortcutValueChange=new EventEmitter;constructor(t,e){super(t),this._services=t,this._cd=e}ngOnInit(){this.onSelectShortcut()}reset(){this.shortcutValue=null,this.shortcutValueChange.emit(this.shortcutValue),this._cd.detectChanges()}onSelectShortcut(){if(this.shortcutValue){const t=this._services._app.environment.value?.TZ_CLIENT,e=momentTz(t);if(this.startDateObj&&this.endDateObj){let n=dateOnlyStartOfDayTz({year:this.startDateObj.year,month:this.startDateObj.month,day:this.startDateObj.day},t),o=dateOnlyStartOfDayTz({year:this.endDateObj.year,month:this.endDateObj.month,day:this.endDateObj.day},t);"Q1"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().startOf("year").quarter(2).subtract(1,"days").toDate()):"Q2"===this.shortcutValue?(n=e.clone().startOf("year").quarter(2).toDate(),o=e.clone().startOf("year").quarter(3).subtract(1,"days").toDate()):"Q3"===this.shortcutValue?(n=e.clone().startOf("year").quarter(3).toDate(),o=e.clone().startOf("year").quarter(4).subtract(1,"days").toDate()):"Q4"===this.shortcutValue?(n=e.clone().startOf("year").quarter(4).toDate(),o=e.clone().endOf("year").toDate()):"Last Q1"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(2).subtract(1,"days").toDate()):"Last Q2"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(2).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(3).subtract(1,"days").toDate()):"Last Q3"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(3).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(4).subtract(1,"days").toDate()):"Last Q4"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(4).toDate(),o=e.clone().endOf("year").subtract(1,"year").toDate()):"Today"===this.shortcutValue?(n=e.clone().startOf("day").toDate(),o=e.clone().toDate()):"Yesterday"===this.shortcutValue?(n=e.clone().subtract(1,"days").startOf("day").toDate(),o=e.clone().subtract(1,"days").endOf("day").toDate()):"Week"===this.shortcutValue?(n=e.clone().startOf("isoWeek").toDate(),o=e.clone().toDate()):"Last Week"===this.shortcutValue?(o=e.clone().startOf("isoWeek").subtract(1,"days").toDate(),n=momentTz(t,o).startOf("isoWeek").toDate()):"Month"===this.shortcutValue?(n=e.clone().startOf("month").toDate(),o=e.clone().toDate()):"Last Month"===this.shortcutValue?(o=e.clone().startOf("month").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("month").toDate()):"Last 30 Days"===this.shortcutValue?(o=e.clone().toDate(),n=e.clone().subtract(30,"days").startOf("day").toDate()):"Quarter"===this.shortcutValue?(n=e.clone().startOf("year").quarter(e.quarter()).toDate(),o=e.clone().toDate()):"Last Quarter"===this.shortcutValue?(o=e.clone().startOf("year").quarter(e.quarter()).subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("quarter").toDate()):"Year"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().toDate()):"Last Year"===this.shortcutValue?(o=e.clone().startOf("year").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("year").toDate()):"All"===this.shortcutValue&&(n=new Date(2017,0,1,0,0,0,0),o=e.clone().toDate()),this.startDateObj={year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()},this.endDateObj={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},this.startDateObjChange.emit(this.startDateObj),this.endDateObjChange.emit(this.endDateObj),this.datesChanged.emit([this.startDateObj,this.endDateObj])}else if(this.startDateObjForm&&this.endDateObjForm){let n=dateOnlyStartOfDayTz({year:this.startDateObjForm.value.year,month:this.startDateObjForm.value.month,day:this.startDateObjForm.value.day},t),o=dateOnlyStartOfDayTz({year:this.endDateObjForm.value.year,month:this.endDateObjForm.value.month,day:this.endDateObjForm.value.day},t);"Q1"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().startOf("year").quarter(2).subtract(1,"days").toDate()):"Q2"===this.shortcutValue?(n=e.clone().startOf("year").quarter(2).toDate(),o=e.clone().startOf("year").quarter(3).subtract(1,"days").toDate()):"Q3"===this.shortcutValue?(n=e.clone().startOf("year").quarter(3).toDate(),o=e.clone().startOf("year").quarter(4).subtract(1,"days").toDate()):"Q4"===this.shortcutValue?(n=e.clone().startOf("year").quarter(4).toDate(),o=e.clone().endOf("year").toDate()):"Last Q1"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(2).subtract(1,"days").toDate()):"Last Q2"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(2).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(3).subtract(1,"days").toDate()):"Last Q3"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(3).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(4).subtract(1,"days").toDate()):"Last Q4"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(4).toDate(),o=e.clone().endOf("year").subtract(1,"year").toDate()):"Today"===this.shortcutValue?(n=e.clone().startOf("day").toDate(),o=e.clone().toDate()):"Yesterday"===this.shortcutValue?(n=e.clone().subtract(1,"days").startOf("day").toDate(),o=e.clone().subtract(1,"days").endOf("day").toDate()):"Week"===this.shortcutValue?(n=e.clone().startOf("isoWeek").toDate(),o=e.clone().toDate()):"Last Week"===this.shortcutValue?(o=e.clone().startOf("isoWeek").subtract(1,"days").toDate(),n=momentTz(t,o).startOf("isoWeek").toDate()):"Month"===this.shortcutValue?(n=e.clone().startOf("month").toDate(),o=e.clone().toDate()):"Last Month"===this.shortcutValue?(o=e.clone().startOf("month").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("month").toDate()):"Last 30 Days"===this.shortcutValue?(o=e.clone().toDate(),n=e.clone().subtract(30,"days").startOf("day").toDate()):"Quarter"===this.shortcutValue?(n=e.clone().startOf("year").quarter(e.quarter()).toDate(),o=e.clone().toDate()):"Last Quarter"===this.shortcutValue?(o=e.clone().startOf("year").quarter(e.quarter()).subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("quarter").toDate()):"Year"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().toDate()):"Last Year"===this.shortcutValue?(o=e.clone().startOf("year").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("year").toDate()):"All"===this.shortcutValue&&(n=new Date(2017,0,1,0,0,0,0),o=e.clone().toDate()),this.startDateObjForm.setValue({year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()}),this.endDateObjForm.setValue({year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()}),this.startDateObjFormChange.emit(this.startDateObjForm),this.endDateObjFormChange.emit(this.endDateObjForm),this.datesChanged.emit([this.startDateObjForm,this.endDateObjForm])}this.shortcutValueChange.emit(this.shortcutValue)}this._cd.detectChanges()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutComponent,deps:[{token:ProviderService},{token:i0.ChangeDetectorRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DateShortcutComponent,isStandalone:!1,selector:"date-shortcut",inputs:{startDateObj:"startDateObj",endDateObj:"endDateObj",startDateObjForm:"startDateObjForm",endDateObjForm:"endDateObjForm",shortcutValue:"shortcutValue"},outputs:{startDateObjChange:"startDateObjChange",endDateObjChange:"endDateObjChange",startDateObjFormChange:"startDateObjFormChange",endDateObjFormChange:"endDateObjFormChange",datesChanged:"datesChanged",shortcutValueChange:"shortcutValueChange"},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'\n\t\t<label class="form-control-label">Date Shortcuts</label>\n\t\t<rio-select [(ngModel)]="shortcutValue" (change)="onSelectShortcut()" placeholder="Select Shortcut" [clearable]="false">\n\t\t\t<rio-option value="Today">Today</rio-option>\n\t\t\t<rio-option value="Yesterday">Yesterday</rio-option>\n\t\t\t<rio-option value="Week">This Week</rio-option>\n\t\t\t<rio-option value="Last Week">Last Week</rio-option>\n\t\t\t<rio-option value="Month">This Month</rio-option>\n\t\t\t<rio-option value="Last Month">Last Month</rio-option>\n\t\t\t<rio-option value="Last 30 Days">Last 30 Days</rio-option>\n\t\t\t<rio-option value="Quarter">This Quarter</rio-option>\n\t\t\t<rio-option value="Last Quarter">Last Quarter</rio-option>\n\t\t\t<rio-option value="Year">This Year</rio-option>\n\t\t\t<rio-option value="Last Year">Last Year</rio-option>\n\t\t\t<rio-option value="Q1">Q1</rio-option>\n\t\t\t<rio-option value="Q2">Q2</rio-option>\n\t\t\t<rio-option value="Q3">Q3</rio-option>\n\t\t\t<rio-option value="Q4">Q4</rio-option>\n\t\t\t<rio-option value="Last Q1">Last Q1</rio-option>\n\t\t\t<rio-option value="Last Q2">Last Q2</rio-option>\n\t\t\t<rio-option value="Last Q3">Last Q3</rio-option>\n\t\t\t<rio-option value="Last Q4">Last Q4</rio-option>\n\t\t\t<rio-option value="All">All</rio-option>\n\t\t</rio-select>\n\t',isInline:!0,dependencies:[{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:i5.RioOptionComponent,selector:"rio-option",inputs:["value","disabled","label","id"]}],changeDetection:i0.ChangeDetectionStrategy.OnPush})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"date-shortcut",template:'\n\t\t<label class="form-control-label">Date Shortcuts</label>\n\t\t<rio-select [(ngModel)]="shortcutValue" (change)="onSelectShortcut()" placeholder="Select Shortcut" [clearable]="false">\n\t\t\t<rio-option value="Today">Today</rio-option>\n\t\t\t<rio-option value="Yesterday">Yesterday</rio-option>\n\t\t\t<rio-option value="Week">This Week</rio-option>\n\t\t\t<rio-option value="Last Week">Last Week</rio-option>\n\t\t\t<rio-option value="Month">This Month</rio-option>\n\t\t\t<rio-option value="Last Month">Last Month</rio-option>\n\t\t\t<rio-option value="Last 30 Days">Last 30 Days</rio-option>\n\t\t\t<rio-option value="Quarter">This Quarter</rio-option>\n\t\t\t<rio-option value="Last Quarter">Last Quarter</rio-option>\n\t\t\t<rio-option value="Year">This Year</rio-option>\n\t\t\t<rio-option value="Last Year">Last Year</rio-option>\n\t\t\t<rio-option value="Q1">Q1</rio-option>\n\t\t\t<rio-option value="Q2">Q2</rio-option>\n\t\t\t<rio-option value="Q3">Q3</rio-option>\n\t\t\t<rio-option value="Q4">Q4</rio-option>\n\t\t\t<rio-option value="Last Q1">Last Q1</rio-option>\n\t\t\t<rio-option value="Last Q2">Last Q2</rio-option>\n\t\t\t<rio-option value="Last Q3">Last Q3</rio-option>\n\t\t\t<rio-option value="Last Q4">Last Q4</rio-option>\n\t\t\t<rio-option value="All">All</rio-option>\n\t\t</rio-select>\n\t',changeDetection:ChangeDetectionStrategy.OnPush,standalone:!1}]}],ctorParameters:()=>[{type:ProviderService},{type:i0.ChangeDetectorRef}],propDecorators:{startDateObj:[{type:Input}],endDateObj:[{type:Input}],startDateObjForm:[{type:Input}],endDateObjForm:[{type:Input}],startDateObjChange:[{type:Output}],endDateObjChange:[{type:Output}],startDateObjFormChange:[{type:Output}],endDateObjFormChange:[{type:Output}],datesChanged:[{type:Output}],shortcutValue:[{type:Input}],shortcutValueChange:[{type:Output}]}});class DateShortcutModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,declarations:[DateShortcutComponent],imports:[FormsModule,CommonModule,RioSelectModule],exports:[DateShortcutComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,imports:[FormsModule,CommonModule,RioSelectModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,decorators:[{type:NgModule,args:[{imports:[FormsModule,CommonModule,RioSelectModule],exports:[DateShortcutComponent],declarations:[DateShortcutComponent]}]}]});class SchedulerComponent extends BaseComponent{_services;today=new Date;over_forward=!1;over_backwards=!1;mouseDown=!1;mouseLastEvent=null;timer_sub=null;months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];size_svg={width:0,height:0};size_cell={width:30,height:30};svgChart;constructor(t){super(t),this._services=t}ngAfterViewInit(){this.size_svg.width=this.svgChart.nativeElement.clientWidth,this.size_svg.height=this.svgChart.nativeElement.clientHeight}ngOnDestroy(){this.timer_sub&&clearInterval(this.timer_sub)}onMouseup(){this.mouseDown=!1}onMousedown(t){this.mouseDown=!0,this.mouseLastEvent=t}onMousemove(t){if(this.mouseDown){let e=0;this.mouseLastEvent.clientX-t.clientX>1?e=Math.floor((this.mouseLastEvent.clientX-t.clientX)/15)>0?Math.floor((this.mouseLastEvent.clientX-t.clientX+5*(30-this.size_cell.width))/20):1:this.mouseLastEvent.clientX-t.clientX<-1&&(e=Math.floor((this.mouseLastEvent.clientX-t.clientX)/15)<0?Math.floor((this.mouseLastEvent.clientX-t.clientX-5*(30-this.size_cell.width))/20):-1),this.today=moment$1(this.today).add(e,"days").toDate(),this.mouseLastEvent=t}}onMouseLeave(t){this.mouseDown&&(this.mouseDown=!1)}buildDays(){let t=[];for(let e=0;e<Math.floor(this.size_svg.width/this.size_cell.width);e++)t.push({index:e,day:moment$1(this.today).add(e,"days").toDate().getDate()});return t}buildMonths(){let t=[{index_start:0,index_end:null,month:this.months[this.today.getMonth()]}];for(let e=1;e<Math.floor(this.size_svg.width/this.size_cell.width);e++)moment$1(this.today).add(e,"days").toDate().getMonth()!==moment$1(this.today).add(e-1,"days").toDate().getMonth()&&(t[t.length-1].index_end=e,t.push({index_start:e,index_end:null,month:this.months[moment$1(this.today).add(e,"days").toDate().getMonth()]}));return t[t.length-1].index_end=Math.floor(this.size_svg.width/this.size_cell.width),t}buildYears(){let t=[{index_start:0,index_end:null,year:this.today.getFullYear()}];for(let e=1;e<Math.floor(this.size_svg.width/this.size_cell.width);e++)moment$1(this.today).add(e,"days").toDate().getFullYear()!==moment$1(this.today).add(e-1,"days").toDate().getFullYear()&&(t[t.length-1].index_end=e,t.push({index_start:e,index_end:null,year:moment$1(this.today).add(e,"days").toDate().getFullYear()}));return t[t.length-1].index_end=Math.floor(this.size_svg.width/this.size_cell.width),t}decrementToday(){this.today=moment$1(this.today).subtract(1,"days").toDate()}incrementToday(){this.today=moment$1(this.today).add(1,"days").toDate()}overForward(){this.timer_sub=setInterval(()=>{this.incrementToday()},50)}leftForward(){clearInterval(this.timer_sub)}overBackwards(){this.timer_sub=setInterval(()=>{this.decrementToday()},50)}leftBackwards(){clearInterval(this.timer_sub)}zoomOut(){this.size_cell.width>10&&(this.size_cell.width-=10)}zoomIn(){this.size_cell.width+=10}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerComponent,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:SchedulerComponent,isStandalone:!1,selector:"scheduler",host:{listeners:{mouseup:"onMouseup()",mousedown:"onMousedown($event)",mousemove:"onMousemove($event)",mouseleave:"onMouseLeave($event)"}},providers:[ProviderService],viewQueries:[{propertyName:"svgChart",first:!0,predicate:["svgChart"],descendants:!0,static:!0}],usesInheritance:!0,ngImport:i0,template:'<style>\n\t.bar {\n\t\tfill: red; /* changes the background */\n\t\theight: 21px;\n\t\ttransition: fill 0.3s ease;\n\t\tcursor: pointer;\n\t\tfont-family: Helvetica, sans-serif;\n\t}\n\n\t.bar text {\n\t\tcolor: black;\n\t}\n\n\t.bar:hover,\n\t.bar:focus {\n\t\tfill: black;\n\t}\n\n\t.bar:hover text,\n\t.bar:focus text {\n\t\tfill: red;\n\t}\n\n\t.year {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.month {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.day {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.smallText {\n\t\tfont-size: 4px;\n\t}\n</style>\n\n<div class="scheduler">\n\t<button class="btn btn-warning" type="button" (mouseenter)="overBackwards()" (mouseleave)="leftBackwards()">Go Backwards</button>\n\t<button class="btn btn-success" type="button" (mouseenter)="overForward()" (mouseleave)="leftForward()">Go Forward</button>\n\n\t<button style="margin-left: 20px" class="btn btn-warning" type="button" (click)="zoomOut()">Zoom Out</button>\n\t<button class="btn btn-success" type="button" (click)="zoomIn()">Zoom In</button>\n\n\t<svg class="chart" width="100%" height="100%" aria-labelledby="title desc" role="img" #svgChart>\n\t\t<title id="title">Scheduler</title>\n\t\t<desc id="desc">Scheduler</desc>\n\n\t\t<g class="year">\n\t\t\t@for (year of buildYears(); track year;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width"></rect>\n\t\t\t\t\t<svg [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ year.year }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="month">\n\t\t\t@for (month of buildMonths(); track month;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height"></rect>\n\t\t\t\t\t<svg [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ month.month }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="day">\n\t\t\t@for (day of buildDays(); track day;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2"></rect>\n\t\t\t\t\t<svg [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" [style.font-size.px]="[size_cell.width > 10 ? 12 : 6]">{{ day.day }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\n\t\t\x3c!-- <g class="bar">\n\t<rect width="40" height="19"></rect>\n\t<text x="45" y="9.5" dy=".35em">4 apples</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="80" height="19" y="20"></rect>\n\t<text x="85" y="28" dy=".35em">8 bananas</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="150" height="19" y="40"></rect>\n\t<text x="150" y="48" dy=".35em">15 kiwis</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="160" height="19" y="60"></rect>\n\t<text x="161" y="68" dy=".35em">16 oranges</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="230" height="19" y="80"></rect>\n\t<text x="235" y="88" dy=".35em">23 lemons</text>\n\t</g> --\x3e\n\t</svg>\n</div>\n',styles:[".bar{fill:red;height:21px;transition:fill .3s ease;cursor:pointer;font-family:Helvetica,sans-serif}.bar text{color:#000}.bar:hover,.bar:focus{fill:#000}.bar:hover text,.bar:focus text{fill:red}.year,.month,.day{stroke:#000;fill:#fff}.smallText{font-size:4px}\n"]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"scheduler",standalone:!1,template:'<style>\n\t.bar {\n\t\tfill: red; /* changes the background */\n\t\theight: 21px;\n\t\ttransition: fill 0.3s ease;\n\t\tcursor: pointer;\n\t\tfont-family: Helvetica, sans-serif;\n\t}\n\n\t.bar text {\n\t\tcolor: black;\n\t}\n\n\t.bar:hover,\n\t.bar:focus {\n\t\tfill: black;\n\t}\n\n\t.bar:hover text,\n\t.bar:focus text {\n\t\tfill: red;\n\t}\n\n\t.year {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.month {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.day {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.smallText {\n\t\tfont-size: 4px;\n\t}\n</style>\n\n<div class="scheduler">\n\t<button class="btn btn-warning" type="button" (mouseenter)="overBackwards()" (mouseleave)="leftBackwards()">Go Backwards</button>\n\t<button class="btn btn-success" type="button" (mouseenter)="overForward()" (mouseleave)="leftForward()">Go Forward</button>\n\n\t<button style="margin-left: 20px" class="btn btn-warning" type="button" (click)="zoomOut()">Zoom Out</button>\n\t<button class="btn btn-success" type="button" (click)="zoomIn()">Zoom In</button>\n\n\t<svg class="chart" width="100%" height="100%" aria-labelledby="title desc" role="img" #svgChart>\n\t\t<title id="title">Scheduler</title>\n\t\t<desc id="desc">Scheduler</desc>\n\n\t\t<g class="year">\n\t\t\t@for (year of buildYears(); track year;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width"></rect>\n\t\t\t\t\t<svg [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ year.year }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="month">\n\t\t\t@for (month of buildMonths(); track month;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height"></rect>\n\t\t\t\t\t<svg [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ month.month }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="day">\n\t\t\t@for (day of buildDays(); track day;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2"></rect>\n\t\t\t\t\t<svg [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" [style.font-size.px]="[size_cell.width > 10 ? 12 : 6]">{{ day.day }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\n\t\t\x3c!-- <g class="bar">\n\t<rect width="40" height="19"></rect>\n\t<text x="45" y="9.5" dy=".35em">4 apples</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="80" height="19" y="20"></rect>\n\t<text x="85" y="28" dy=".35em">8 bananas</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="150" height="19" y="40"></rect>\n\t<text x="150" y="48" dy=".35em">15 kiwis</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="160" height="19" y="60"></rect>\n\t<text x="161" y="68" dy=".35em">16 oranges</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="230" height="19" y="80"></rect>\n\t<text x="235" y="88" dy=".35em">23 lemons</text>\n\t</g> --\x3e\n\t</svg>\n</div>\n'}]}],ctorParameters:()=>[{type:ProviderService}],propDecorators:{svgChart:[{type:ViewChild,args:["svgChart",{static:!0}]}],onMouseup:[{type:HostListener,args:["mouseup"]}],onMousedown:[{type:HostListener,args:["mousedown",["$event"]]}],onMousemove:[{type:HostListener,args:["mousemove",["$event"]]}],onMouseLeave:[{type:HostListener,args:["mouseleave",["$event"]]}]}});class SchedulerModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,declarations:[SchedulerComponent],imports:[NgbModule,FormsModule,CommonModule,RouterModule],exports:[SchedulerComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,imports:[NgbModule,FormsModule,CommonModule,RouterModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,decorators:[{type:NgModule,args:[{imports:[NgbModule,FormsModule,CommonModule,RouterModule],exports:[SchedulerComponent],declarations:[SchedulerComponent],providers:[]}]}]});const ReportBuilderModulePermission={name:"report-builder",gate:"report-builder",views:[{link:"/report-builder/list",label:"List"},{link:"/report-builder/new",label:"New"},{link:"/report-builder/scheduled-job",label:"Scheduled Job"},{link:"/report-builder/dashboard-builder",label:"Dashboard Builder"},{link:"/report-builder/detail",label:"Detail",has_parameter:!0},{link:"/report-builder/edit",label:"Edit",has_parameter:!0},{link:"/report-builder/delete",label:"Delete",has_parameter:!0}]},MongoExplorerModulePermission={name:"mongo-explorer",gate:"mongo-explorer",views:[{link:"/super-admin/mongo-explorer",label:"Mongo Explorer"}]},SuperAdminModulePermission={name:"super-admin",views:[{link:"/super-admin/dashboard",label:"Dashboard"},{link:"/super-admin/apm",label:"APM"},{link:"/super-admin/mongo",label:"Mongo"},{link:"/super-admin/mongo-explorer",label:"Mongo Explorer",gate:"mongo-explorer"},{link:"/super-admin/monitor",label:"Monitor"}]};export{AccountManagerService,AiAssistantComponent,AiFormAutoRegisterDirective,AiFormRegistryService,AiPageFormAdapterService,AiPageRouterService,AiTerminalComponent,AiTerminalModule,AiTerminalService,AlertService,Auth365Component,AuthGuard,AuthPermissionService,AuthService,AwsService,BaseComponent,CanDeactivateGuard,CollapseTableComponent,CollapseTableModule,CoreAuthModule,CoreComponent,CoreDialogModule,CoreLoggerModule,CoreModule,CoreService,CoreServicesModule,CoreShellModule,CoreTourService,DATATABLE_DEFAULT_CONFIG,DatatableCellTemplateDirective,DatatableComponent,DatatableModule,DateShortcutComponent,DateShortcutModule,DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogLoginContent,DialogNotifyContent,DialogRegisterContent,DialogSelectArrayContent,DialogSelectArrayObjsContent,DialogSelectDataLabelsContent,DialogSelectDateTimeContent,DialogSelectWithButtonsURLContent,DialogService,DomSanitizorPipe,Draggable,DropEvent,Droppable,EnrollComponent,FeatureGateService,FileModule,FileUploadComponent,FilterEqualPipe,FilterNotEqualPipe,FocusDirective,ForgotPasswordComponent,FormButtonComponent,FormButtonModule,HomeComponent,HtmlDiffViewerComponent,JsonParsePipe,LoggerComponent,MinusCurrencyPipe,MongoExplorerModulePermission,NavbarMainComponent,NavbarModuleComponent,NgDragDropModule,NgDragDropService,OfflineManagerService,PhonePipe,PipeModule,ProviderService,ReportBuilderModulePermission,ResizeService,ResponsiveButtonGroupComponent,ResponsiveButtonGroupModule,ReversePipe,RioPaginationComponent,RioPaginationModule,SchedulerComponent,SchedulerModule,ScrollDirective,SharedModule,SocketManagerService,SocketService,SortTableDirective,SortTableHeaderComponent,SortTableModule,SortTableNgForComponent,Sortable as SortableJs,SortablejsDirective,SortablejsModule,StorageDB,SuperAdminModulePermission,TitleCaseAndUnderscorePipe,TokenManagerService,TourAnchorDirective,UserRoleComponent,UserRoleModule,ValidationService,WindowRefService,applyMongoUpdate,b64toBlobURL,blobToFile,dateOnlyEndOfDayTz,dateOnlyStartOfDayTz,dateReviver,deepCopy,deepDiffDetails,exportCsv,generateCronStringFromDate,isUpperCase,mergeDeep,momentTz,pad,provideDatatableDefaultConfig,rioDatePickerConfigFactory,round,s2ab,toDataURL,toTitleCase,type};
|
|
1
|
+
import*as i0 from"@angular/core";import{Injectable,HostListener,Input,Component,Directive,ViewChild,ChangeDetectionStrategy,Pipe,LOCALE_ID,Inject,EventEmitter,Output,ViewChildren,ElementRef,NgModule,Optional,ViewEncapsulation,InjectionToken,HostBinding,ContentChildren}from"@angular/core";import{BehaviorSubject,Subject,fromEvent,ReplaySubject,merge,Observable,of}from"rxjs";import*as i1$5 from"ngx-device-detector";import{DeviceDetectorService}from"ngx-device-detector";import{debounceTime,finalize,map}from"rxjs/operators";import*as i2 from"@angular/forms";import{UntypedFormControl,Validators,FormGroup,FormArray,FormsModule,ReactiveFormsModule}from"@angular/forms";import*as i1 from"ngx-toastr";import{ToastrModule}from"ngx-toastr";import moment from"moment-timezone";import{unpack,pack}from"msgpackr";import{detailedDiff}from"deep-object-diff";import*as CryptoJS from"crypto-js";import*as i1$1 from"@angular/router";import{RouterModule}from"@angular/router";import*as i4 from"@angular/common/http";import{HttpHeaders,provideHttpClient,withInterceptorsFromDi}from"@angular/common/http";import*as i1$2 from"@ng-bootstrap/ng-bootstrap";import{NgbTooltipModule,NgbModule,NgbAccordionModule,NgbModalModule}from"@ng-bootstrap/ng-bootstrap";import*as i3 from"@angular/common";import{CommonModule,getCurrencySymbol,formatDate,formatPercent,formatCurrency,formatNumber,JsonPipe,UpperCasePipe,LowerCasePipe,TitleCasePipe}from"@angular/common";import*as i5 from"@resolveio/client-lib-rio-select";import{RioSelectModule,RIO_SELECT_STICKY_ADAPTER}from"@resolveio/client-lib-rio-select";import*as i7 from"@resolveio/client-lib-date-picker";import{RioDatePickerModule,RIO_DATE_PICKER_CONFIG}from"@resolveio/client-lib-date-picker";import{UserAgentApplication}from"msal";import*as i1$3 from"ngx-ui-tour-core";import{TourState,TourService,UI_TOUR_OPTIONS}from"ngx-ui-tour-core";import*as i1$4 from"@angular/platform-browser";import{BrowserAnimationsModule}from"@angular/platform-browser/animations";import moment$1 from"moment";import*as i7$1 from"ngx-file-drop";import{NgxFileDropModule}from"ngx-file-drop";import*as i8 from"@resolveio/client-lib-pdf-viewer";import{PdfViewerModule}from"@resolveio/client-lib-pdf-viewer";class CoreService{isDevice=new BehaviorSubject(!1);fullScreen=new BehaviorSubject(!1);fsActivated=new BehaviorSubject(!1);hasConnected=new BehaviorSubject(!1);navbarModuleData=new BehaviorSubject({title:"",module:"",description:"",description_name:"",tabs:[]});hasStatusMessage=new BehaviorSubject(!1);alertData=new BehaviorSubject({type:"",message:"",timer:0,showing:!1});isInvalidSW=new BehaviorSubject(!1);environment=new BehaviorSubject(null);client=new BehaviorSubject("");publicProgram=new BehaviorSubject(!1);navTabs=new BehaviorSubject([]);tourStops=new BehaviorSubject([]);tourStarted=new BehaviorSubject(!1);isDemo=new BehaviorSubject(!1);isLoggingOut=new BehaviorSubject(!1);constructor(){}setFullScreen(t){this.fullScreen.next(t)}setFsActivated(t){this.fsActivated.next(t)}setHasConnected(t){this.hasConnected.next(t)}setNavbarModuleData(t){const e=t.tabs.filter(t=>null===t.params).concat(t.tabs.filter(t=>null!==t.params)),n={...t,tabs:e};Promise.resolve().then(()=>this.navbarModuleData.next(n))}setHasStatusMessage(t){this.hasStatusMessage.next(t)}setIsDevice(t){this.isDevice.next(t)}setIsInvalidSW(t){this.isInvalidSW.next(t)}setEnvironment(t){this.environment.next(t)}setClient(t){this.client.next(t)}setPublicProgram(t){this.publicProgram.next(t)}setNavTabs(t){const e=Array.isArray(t)?t.slice():t;Promise.resolve().then(()=>this.navTabs.next(e))}setTourStops(t){this.tourStops.next(Array.isArray(t)?t:[])}setTourStarted(t){this.tourStarted.next(t)}setDemo(t){this.isDemo.next(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:()=>[]});class ResizeService{get onResize$(){return this.resizeSubject.asObservable()}resizeSubject;subscription;constructor(){this.resizeSubject=new Subject,"undefined"!=typeof window&&(this.subscription=fromEvent(window,"resize").pipe(debounceTime(150)).subscribe(t=>this.onResize(t)))}onResize(t){this.resizeSubject.next(t.target)}ngOnDestroy(){this.subscription&&this.subscription.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResizeService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResizeService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResizeService,decorators:[{type:Injectable}],ctorParameters:()=>[]});class AlertService{_toastr;constructor(t){this._toastr=t}clearAlert(t){t?this._toastr.clear(t):this._toastr.clear()}registerTapToClear(t){return t&&t.onTap&&t.onTap.subscribe(()=>this._toastr.clear(t.toastId)),t}titleForType(t){return"success"===t?"Success":"info"===t?"Info":"warning"===t?"Warning":"error"===t?"Error":"update"===t?"Update":"Info"}updateAlert(t,e,n="info",o=0){const r=t?.toastRef?.componentInstance;return r?(r.message=e,void 0!==r.title&&(r.title=this.titleForType(n)),t):(t?.toastId&&this._toastr.clear(t.toastId),this.setAlert(n,e,o))}setAlert(t,e,n=5e3){return"success"===t?n?this.registerTapToClear(this._toastr.success(e,"Success",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.success(e,"Success",{disableTimeOut:!0,tapToDismiss:!0})):"info"===t?n?this.registerTapToClear(this._toastr.info(e,"Info",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.info(e,"Info",{disableTimeOut:!0,tapToDismiss:!0})):"warning"===t?n?this.registerTapToClear(this._toastr.warning(e,"Warning",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.warning(e,"Warning",{disableTimeOut:!0,tapToDismiss:!0})):"error"===t?n?this.registerTapToClear(this._toastr.error(e,"Error",{timeOut:n,tapToDismiss:!0})):this.registerTapToClear(this._toastr.error(e,"Error",{disableTimeOut:!0,tapToDismiss:!0})):"update"===t?this.registerTapToClear(this._toastr.show(e,"Update",{disableTimeOut:!0,tapToDismiss:!0,toastClass:"ngx-toastr toast-secondary"})):void 0}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AlertService,deps:[{token:i1.ToastrService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AlertService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AlertService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1.ToastrService}]});class LocalStorageService{get(t){return"undefined"==typeof localStorage?null:localStorage.getItem(t)}set(t,e){"undefined"!=typeof localStorage&&localStorage.setItem(t,e)}remove(t){"undefined"!=typeof localStorage&&localStorage.removeItem(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LocalStorageService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LocalStorageService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LocalStorageService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});class SocketService{_storage;debug=!1;reconnectInterval=1e3;timeoutInterval=5e3;timeout=null;readyState;readyState$=new BehaviorSubject(0);protocols=[];ws=null;url;timezone;pingInterval=null;pongTimeout=null;pingIntervalTime=15e3;pongTimeoutTime=12e3;lastActivity=Date.now();missedPongs=0;maxMissedPongs=3;wakeReconnectThreshold=3e5;focusReconnectDebounce=null;onopen=t=>{};onclose=t=>{};onconnecting=()=>{};onmessage=t=>{};onerror=t=>{};constructor(t){this._storage=t,"undefined"!=typeof document&&document.addEventListener("visibilitychange",this.handleVisibilityChange),"undefined"!=typeof window&&window.addEventListener("focus",this.handleWindowFocus)}openSocket(t,e){this.url=t.WS_URL,this.protocols=e,this.timezone=t.TZ_CLIENT,this.connect()}onOpenHandler=t=>{this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.log(new Date,"WS","onopen",this.url),this.readyState=WebSocket.OPEN,this.readyState$.next(this.readyState),this.recordActivity(),this.onopen(t),this.startPinging()};onCloseHandler=t=>{this.ws&&this.readyState!==WebSocket.CLOSED&&(this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.ws.removeEventListener("open",this.onOpenHandler),this.ws.removeEventListener("close",this.onCloseHandler),this.ws.removeEventListener("message",this.onMessageHandler),this.ws.removeEventListener("error",this.onErrorHandler),this.ws=null,this.readyState=WebSocket.CLOSED,this.readyState$.next(this.readyState),this.log(new Date,"WS","onclose",this.url),this.onclose(t),setTimeout(()=>this.connect(),this.reconnectInterval),this.stopPinging())};onMessageHandler=t=>{if(this.recordActivity(),"pong"===t.data)return void this.log(new Date,"WS","pong received");if("ping"===t.data)return this.log(new Date,"WS","ping received"),void this.send("pong");const e=(t,e=0,n)=>{const o=void 0!==n?new Uint8Array(t,e,n):new Uint8Array(t,e);try{let t=unpack(o);t=this.convertUTCDateToLocalDate(t),this.onmessage(t)}catch(t){this.log(new Date,"WS","failed to unpack payload",t);try{const t=(new TextDecoder).decode(o),e=JSON.parse(t),n=this.convertUTCDateToLocalDate(e);this.onmessage(n)}catch(t){this.log(new Date,"WS","unable to fallback decode payload",t)}}};if(t.data instanceof ArrayBuffer)e(t.data);else if(ArrayBuffer.isView(t.data)){const n=t.data;e(n.buffer,n.byteOffset,n.byteLength)}else if(t.data instanceof Blob)t.data.arrayBuffer().then(t=>e(t)).catch(t=>this.log(new Date,"WS","failed to decode blob payload",t));else if("string"==typeof t.data)try{const e=JSON.parse(t.data),n=this.convertUTCDateToLocalDate(e);this.onmessage(n)}catch(e){this.log(new Date,"WS","failed to parse text payload",e),this.onmessage(this.convertUTCDateToLocalDate(t.data))}else this.log(new Date,"WS","unsupported message type",typeof t.data,t.data)};onErrorHandler=t=>{this.log(new Date,"WS","onerror",this,t),this.onerror(t),this.reconnect()};connect(){!this.ws&&this.readyState!==WebSocket.CONNECTING&&this._storage.get("accessToken")&&(this.readyState=WebSocket.CONNECTING,this.readyState$.next(this.readyState),this.timeout&&clearTimeout(this.timeout),this.ws=new WebSocket(this.url,this.protocols),this.ws.binaryType="arraybuffer",this.onconnecting(),this.log(new Date,"WS","attempt-connect",this.url),this.timeout=setTimeout(()=>{this.log(new Date,"WS","connection-timeout",this.url),this.close()},this.timeoutInterval),this.ws.onopen=this.onOpenHandler,this.ws.onclose=this.onCloseHandler,this.ws.onmessage=this.onMessageHandler,this.ws.onerror=this.onErrorHandler)}convertUTCDateToLocalDate(t){if(Array.isArray(t))return t.map(t=>this.convertUTCDateToLocalDate(t));if(t&&"object"==typeof t)return Object.keys(t).reduce((e,n)=>(e[n]=this.convertUTCDateToLocalDate(t[n]),e),t);if("string"==typeof t){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/.test(t))return new Date(t)}return t}clearPongTimeout(){this.pongTimeout&&(clearTimeout(this.pongTimeout),this.pongTimeout=null)}recordActivity(){this.lastActivity=Date.now(),this.missedPongs=0,this.clearPongTimeout()}schedulePongTimeout(){this.clearPongTimeout(),this.pongTimeout=setTimeout(()=>{this.handleMissedPong()},this.pongTimeoutTime)}handleMissedPong(){this.pongTimeout=null,this.missedPongs++,this.log(new Date,"WS","pong not received",this.missedPongs,"/",this.maxMissedPongs),this.missedPongs>=this.maxMissedPongs&&(this.log(new Date,"WS","max missed pongs reached, closing connection"),this.reconnect())}startPinging(){this.stopPinging(),this.pingInterval=setInterval(()=>{if(!this.isWebSocketActive())return void this.reconnect();Date.now()-this.lastActivity<this.pingIntervalTime||this.pongTimeout||this.send("ping")&&this.schedulePongTimeout()},this.pingIntervalTime)}stopPinging(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null),this.clearPongTimeout(),this.missedPongs=0}convertDatesToUTC(t,e=new WeakSet){"object"!=typeof t||null===t||e.has(t)||(e.add(t),Object.keys(t).forEach(n=>{if(t[n]instanceof Date){let e=t[n];this.timezone&&this.isLocalMidnight(e)&&(e=moment.tz({year:e.getFullYear(),month:e.getMonth(),date:e.getDate()},this.timezone).startOf("day").toDate()),t[n]=moment(e).utc().toDate()}else"object"==typeof t[n]&&null!==t[n]&&this.convertDatesToUTC(t[n],e)}))}isLocalMidnight(t){return 0===t.getHours()&&0===t.getMinutes()&&0===t.getSeconds()&&0===t.getMilliseconds()}send(...t){if(!this.isWebSocketActive())return this.log(new Date,"WS","send error",this.readyState),this.reconnect(),!1;t.forEach(t=>this.convertDatesToUTC(t));const e=1===t.length?t[0]:t;if("string"==typeof e)this.ws.send(e);else{const t=pack(e);this.ws.send(t)}return!0}close(){return!!this.ws&&(this.log(new Date,"WS","closing socket"),this.readyState=WebSocket.CLOSING,this.readyState$.next(this.readyState),this.ws.close(),!0)}reconnect(){this.log(new Date,"WS","reconnect",this.readyState),this.readyState!==WebSocket.CONNECTING&&this.close()}getBufferAmount(){return this.ws?this.ws.bufferedAmount:20480}log(...t){this.debug&&console.log(...t)}handleVisibilityChange=()=>{"visible"===document.visibilityState&&this.handleWindowFocus()};handleWindowFocus=()=>{this.focusReconnectDebounce&&clearTimeout(this.focusReconnectDebounce),this.focusReconnectDebounce=setTimeout(()=>{if(this.focusReconnectDebounce=null,!this.isWebSocketActive())return void this.reconnect();Date.now()-this.lastActivity>this.wakeReconnectThreshold?this.reconnect():this.send("ping")},200)};isWebSocketActive(){return!!this.ws&&this.ws.readyState===WebSocket.OPEN}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketService,deps:[{token:LocalStorageService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:LocalStorageService}]});const isObject$1=t=>t instanceof Object&&"Object"===t.constructor.name;function round(t,e=0){const n=Math.pow(10,e);return Math.round(t*n+1e-6)/n}function toTitleCase(t){return t.replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()})}function isUpperCase(t){return/^[A-Z]*$/.test(t)}function pad(t,e){let n=t+"";for(;n.length<e;)n="0"+n;return n}function deepCopy(t){return JSON.parse(JSON.stringify(t),dateReviver)}function dateReviver(t,e){if("string"==typeof e){let t=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(e);if(t)return new Date(Date.UTC(+t[1],+t[2]-1,+t[3],+t[4],+t[5],+t[6].split(".")[0],+t[6].split(".")[1]))}return e}function momentTz(t,e){return t?null!=e?moment(e).tz(t):moment.tz(t):null!=e?moment(e):moment()}function dateOnlyStartOfDayTz(t,e){return t?e?t instanceof Date?moment.tz({year:t.getFullYear(),month:t.getMonth(),date:t.getDate()},e).startOf("day").toDate():"object"==typeof t&&t.year&&t.month&&t.day?moment.tz({year:t.year,month:t.month-1,date:t.day},e).startOf("day").toDate():momentTz(e,t).startOf("day").toDate():moment(t).startOf("day").toDate():null}function dateOnlyEndOfDayTz(t,e){return t?e?t instanceof Date?moment.tz({year:t.getFullYear(),month:t.getMonth(),date:t.getDate()},e).endOf("day").toDate():"object"==typeof t&&t.year&&t.month&&t.day?moment.tz({year:t.year,month:t.month-1,date:t.day},e).endOf("day").toDate():momentTz(e,t).endOf("day").toDate():moment(t).endOf("day").toDate():null}function b64toBlobURL(t,e,n){t=t.replace("data:application/pdf;base64,",""),e=e||"",n=n||512;let o=atob(t),r=[];for(let t=0;t<o.length;t+=n){let e=o.slice(t,t+n),i=new Array(e.length);for(let t=0;t<e.length;t++)i[t]=e.charCodeAt(t);let a=new Uint8Array(i);r.push(a)}let i=new Blob(r,{type:e});return URL.createObjectURL(i)}function blobToFile(t,e){return t.lastModifiedDate=new Date,t.name=e,t}function toDataURL(t,e){let n=new XMLHttpRequest;n.onload=function(){let t=new FileReader;t.onloadend=function(){e(t.result)},t.readAsDataURL(n.response)},n.open("GET",t),n.responseType="blob",n.send()}function deepDiffDetails(t,e){let n=deepCopy(t),o=deepCopy(e),r=detailedDiff(n,o),i="";const a=t=>t instanceof Date?moment(t).format("llll"):"object"==typeof t&&null!==t?(Object.keys(t).filter(t=>t.startsWith("_id")||t.startsWith("id_")).forEach(e=>{delete t[e]}),JSON.stringify(t)):"string"==typeof t?`"${t}"`:String(t),s=(t,e)=>null===t||null===e||"object"!=typeof t||"object"!=typeof e?`from: ${a(t)} to: ${a(e)}`:Array.isArray(t)||Array.isArray(e)?((t,e)=>{let n=[];const o=Math.max(t.length,e.length);for(let r=0;r<o;r++)t[r]&&!e[r]?n.push(`Removed at index ${r}: ${a(t[r])}`):!t[r]&&e[r]?n.push(`Added at index ${r}: ${a(e[r])}`):t[r]&&e[r]&&JSON.stringify(t[r])!==JSON.stringify(e[r])&&n.push(`Changed at index ${r}: {${s(t[r],e[r])}}`);return n.join(", ")})(Array.isArray(t)?t:[],Array.isArray(e)?e:[]):Object.keys({...t,...e}).filter(t=>!t.startsWith("_id")&&!t.startsWith("id_")).map(n=>{const o=t?t[n]:void 0,r=e?e[n]:void 0;return`${toTitleCase(n)}: ${s(o,r)}`}).join(", ");return["added","deleted","updated"].forEach(t=>{if(Object.keys(r[t]).length>0){const e=Object.keys(r[t]).filter(e=>"added"===t||("deleted"===t?!r.added[e]:!r.added[e]&&!r.deleted[e])).filter(t=>!t.startsWith("_id")&&!t.startsWith("id_")).map(t=>`\n${toTitleCase(t)}: ${s(n[t],o[t])}`).join(",");i+=e?`${e}`:""}}),i}function generateCronStringFromDate(t){return t.getSeconds()+" "+t.getMinutes()+" "+t.getHours()+" "+t.getDate()+" "+(t.getMonth()+1)+" "+t.getDay()}function s2ab(t){let e=new ArrayBuffer(t.length),n=new Uint8Array(e);for(let e=0;e!==t.length;++e)n[e]=255&t.charCodeAt(e);return e}function mergeDeep(t,...e){if(!e.length)return t;const n=e.shift();if(isObject$1(t)&&isObject$1(n))for(const e in n)isObject$1(n[e])?(t[e]||Object.assign(t,{[e]:{}}),mergeDeep(t[e],n[e])):Object.assign(t,{[e]:n[e]});return mergeDeep(t,...e)}function applyMongoUpdate(t,e){const n=deepCopy(t);return e&&(e.$rename&&handleRename(t,e.$rename),e.$set&&handleSet(t,e.$set),e.$inc&&handleInc(t,e.$inc),e.$unset&&handleUnset(t,e.$unset),e.$pull&&handlePull(t,n,e.$pull),e.$push&&handlePush(t,e.$push)),t}function handleRename(t,e){for(const n in e){const o=e[n],[r,i]=resolve(t,n),[a,s]=resolve(t,o);r&&1===i.length?a&&1===s.length?(a[s[0]]=r[i[0]],delete r[i[0]]):logError(a,s,t,o):logError(r,i,t,n)}}function handleSet(t,e){for(const n in e){const o=e[n],[r,i]=resolve(t,n,{force:!0});r&&1===i.length?r[i[0]]=o:logError(r,i,t,n)}}function handleInc(t,e){for(const n in e){const o=e[n],[r,i]=resolve(t,n,{force:!0});r&&1===i.length?r[i[0]]=(r[i[0]]||0)+o:logError(r,i,t,n)}}function handleUnset(t,e){for(const n in e){const[e,o]=resolve(t,n);e&&1===o.length?delete e[o[0]]:logError(e,o,t,n)}}function handlePull(t,e,n){for(const o in n){const r=n[o];for(let n of r){const[r,i]=resolve(t,o),[a,s]=resolve(e,o);r&&1===i.length?r[i[0]].splice(a[s[0]].findIndex(t=>JSON.stringify(t)===JSON.stringify(n)),1):logError(r,i,t,o)}}}function handlePush(t,e){for(const n in e){const o=e[n];for(let e of o){const[o,r]=resolve(t,n);o&&1===r.length?o[r[0]].push(e):logError(o,r,t,n)}}}function logError(t,e,n,o){console.log("Error",t+"/"+e+" - couldn't resolve for "+JSON.stringify(n)+" "+o)}function resolve(t,e,n={}){const o=arrize(e);let r=[];o.length>0&&r.unshift(o.pop());let i=t;for(;o.length>0;){const t=o.shift();if(void 0!==i[t])i=i[t];else{if(!n.force){r.unshift(t),r=o.concat(r);break}const e="number"==typeof o[0],a=0===o.length&&"number"==typeof r[0];i[t]=e||a?[]:{},i=i[t]}}return[i,r]}function arrize(t,e="."){return Array.isArray(t)?t.slice():null==t||!1===t||""===t?[]:t.toString().split(e).map(t=>[void 0,null,!1,""].includes(t)?null:t.toString()).filter(t=>null!==t)}class StorageDB{storage=null;database=null;primaryKey=null;secretKey=null;sep="";constructor(t){t=t||{},this.storage=t.storage||window&&window.localStorage,this.database=t.database||"db",this.primaryKey=t.primaryKey||"_id",this.sep=t.sep||":",this.secretKey=t.secretKey||"",isSupported(this.storage)||(this.storage=null)}encryptData(t){const e=JSON.stringify(t);return CryptoJS.AES.encrypt(e,this.secretKey).toString()}decryptData(t){const e=CryptoJS.AES.decrypt(t,this.secretKey);try{const t=e.toString(CryptoJS.enc.Utf8);return JSON.parse(t,dateReviver)}catch(t){return null}}get(t,e){return new Collection(this,t,e)}getCollections(){let t=[];return Object.keys(this.storage).filter(t=>t.split(":").length>2).forEach(e=>{t.some(t=>t===e.split(":")[1])||t.push(e.split(":")[1])}),t}collection(t,e){return this.get(t,e)}}class Collection{name="";storage=null;path="";primaryKey="";cache={};cacheable=!1;db=null;constructor(t,e,n){n=n||{},this.name=e,this.storage=t.storage||new MockStorage,this.path=t.database+t.sep+e+t.sep,this.primaryKey=n.primaryKey||t.primaryKey,this.cache={},this.cacheable=!t.storage,this.db=t}_isQuotaExceeded(t){return!!t&&("QuotaExceededError"===t.name||(22===t.code||1014===t.code||"string"==typeof t.message&&t.message.includes("exceeded the quota")))}_safeSetItem(t,e){try{return this.storage.setItem(t,e),!0}catch(t){if(this._isQuotaExceeded(t))return!1;throw t}}_initCache(){let t={},e=new RegExp("^"+this.path);for(let n of Object.keys(this.storage))if(e.test(n)){const e=this.storage.getItem(n);t[n]=this.db.decryptData(e)}this.cache=t,this.cacheable=!0}_filter(t,e){e.type=e.type||"data",e.multi=e.multi||!1,this.cacheable||this._initCache();let n,o=[],r="id"===e.type;if("string"==typeof t)t=new RegExp(t);else if("function"==typeof t)n=!0;else if(!t){let t=r?Object.keys(this.cache):Object.values(this.cache);return e.multi?t:t[0]||null}for(let i of Object.keys(this.cache)){let a=this.cache[i];if(n){if(t(i,a.data)){let t=r?i:a;if(!e.multi)return t;o.push(t)}}else if(t.test(i)){let t=r?i:a;if(!e.multi)return t;o.push(t)}}return e.multi?o:null}insert(t,e,n){let o=t instanceof Array;if(o){if(0===t.length)return[]}else t=[t];let r=this.primaryKey,i=this.cacheable;for(let n of t){if(!isObject(n))throw new Error("TypeError: insert data must be an object or an object array");void 0===n[r]&&(n[r]=(new ID).toString());let t=new Date,o={offlineDate:t,offlineDateExpires:e||new Date(t.getTime()+6048e5),data:n};const a=this.db.encryptData(o),s=this.path+n[r],l=this._safeSetItem(s,a);i&&l&&(this.cache[s]=o)}return o?t.map(t=>t._id):t[0]._id}find(t,e,n){let o;t=t||{},(e=e||{}).skip=e.skip||0,e.limit=e.limit,e.sort=e.sort;let r=isObject(t)?null:t instanceof Array?t:[t],i={type:e._filterType||"data",multi:!0};if(r){let t=new RegExp("^"+this.path+"("+r.join("|")+")$");o=this._filter(t,i)}else o=Object.keys(t).length?this._filter((e,n)=>queryMatch(t,n),i):this._filter(null,i);return n||(o=o.map(t=>t.data)),e.sort&&o.sort((t,n)=>sortCompare(e.sort,t,n)),e.limit?o=o.slice(e.skip,e.skip+e.limit):e.skip&&(o=o.slice(e.skip)),o}findOne(t,e){let n;e=e||{};let o=isObject(t=t||{})?null:t,r=isObject(t)?Object.keys(t):[],i=!1,a=!!e.sort,s={type:e._filterType||"data",multi:!1};if(r.length&&r.includes(this.primaryKey)&&(o=t[this.primaryKey],i=!0),o){if(n=this.storage.getItem(this.path+o),n=n?this.db.decryptData(n).data:null,n&&i&&!queryMatch(t,n))return null}else r.length?a?n=this.find(t,e):(n=this._filter((e,n)=>queryMatch(t,n),s),Array.isArray(n)?n=n.map(t=>t.data):n&&(n=n.data)):n=a?this.find(t,e):this._filter(null,s);return!o&&a&&n&&(n=n[0].data||null),n&&"id"===s.type&&(n=this.path+n[this.primaryKey]),n}remove(t,e){if(!t)throw new Error("remove needs a query");(e=e||{}).multi=void 0===e.multi||e.multi;let n=e.multi?"find":"findOne",o=null;o="find"===n?this[n](t,{_filterType:"id"},!0):this[n](t,{_filterType:"id"});let r=this.cacheable;if(e.multi&&!o.length||!e.multi&&!o)return 0;e.multi||(o=[o]);for(let t of o)r&&delete this.cache[t],this.storage.removeItem(t);return o.length}update(t,e,n){if(!t)throw new Error("update needs a query");if(!e||!isObject(e))throw new Error("update needs an object");(n=n||{}).multi=void 0!==n.multi&&n.multi;let o=this[n.multi?"find":"findOne"](t,{_filterType:"id"}),r=this.primaryKey,i=this.cacheable;if(n.multi&&!o.length||!n.multi&&!o)return 0;if(n.multi){if(delete e[r],!Object.keys(e).length)return 0;let t=0;for(let n of o){let o=i?this.cache[n]:this.db.decryptData(this.storage.getItem(n)),r=Object.assign({},o.data,e),a={offlineDate:o.offlineDate,offlineDateExpires:o.offlineDateExpires,data:r};const s=this.db.encryptData(a);this._safeSetItem(n,s)&&(i&&(this.cache[n]=a),t+=1)}return t}{let t=o,n=i?this.cache[t]:this.db.decryptData(this.storage.getItem(t)),a=e[r]&&e[r]!==n.data[r],s=a?this.path+e[r]:t;if(a&&this.findOne(e[r]))throw new Error("Duplicate value '"+e[r]+"' for unique field '"+r+"'");let l=Object.assign({},n.data,e),c={offlineDate:n.offlineDate,offlineDateExpires:n.offlineDateExpires,data:l};const d=this.db.encryptData(c);return this._safeSetItem(s,d)?(i&&(this.cache[s]=c,a&&delete this.cache[t]),a&&this.storage.removeItem(t),l):n.data}}drop(){return this.remove({}),!0}}class ID{constructor(){}toString(){return((new Date).getTime()/1e3).toString(16).substr(-4)+Math.random().toString(16).substr(2,12)}}class MockStorage{length=0;constructor(){this.length=0}key(){}setItem(){}getItem(){}removeItem(){}}const isSupported=t=>{if(!(t&&t instanceof Object))return!1;try{return t.setItem("_supported","1"),t.removeItem("_supported"),!0}catch(t){return!1}},isObject=t=>t instanceof Object&&"Object"===t.constructor.name,queryMatch=(t,e)=>{if(!t||!Object.keys(t).length)return!0;for(let n of Object.keys(t)){let o=t[n];if("$or"===n&&Array.isArray(o))return o.some(t=>queryMatch(t,e));if("$and"===n&&Array.isArray(o))return o.every(t=>queryMatch(t,e));if("$in"===n&&Array.isArray(o))return o.includes(e);if("$nin"===n&&Array.isArray(o))return!o.includes(e);if("$exists"===n&&"boolean"==typeof o)return o?void 0!==e:void 0===e;let r=e[n];if(r||n.split(".").forEach(t=>{r=r?r[t]:e[t]}),o instanceof RegExp){if(!o.test(r))return!1}else if(isObject(o)){for(let t of Object.keys(o))if(Operator._checkExist(t)&&!Operator[t](o[t],r))return!1}else if(o!==r)return!1}return!0},sortCompare=(t,e,n,o,r)=>{o=o||0;let i=(r=r||Object.keys(t))[o];return i?e[i]===n[i]?(o++,sortCompare(t,e,n,o,r)):1===t[i]?e[i]-n[i]:-1===t[i]?n[i]-e[i]:void 0:0},ops=["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin"],isNotNumber=t=>"number"!=typeof t;class Operator{static $eq(t,e){return e===t}static $gt(t,e){if(isNotNumber(t))throw new Error("'$gt' value must be a number");return e>t}static $gte(t,e){if(isNotNumber(t))throw new Error("'$gte' value must be a number");return e>=t}static $lt(t,e){if(isNotNumber(t))throw new Error("'$lt' value must be a number");return e<t}static $lte(t,e){if(isNotNumber(t))throw new Error("'$lte' value must be a number");return e<=t}static $ne(t,e){return e!==t}static $in(t,e){if(!(t instanceof Array))throw new Error("'$in' value must be an array");return t.includes(e)}static $nin(t,e){if(!(t instanceof Array))throw new Error("'$nin' value must be an array");return!t.includes(e)}static $exists(t,e){return t?void 0!==e:void 0===e}static $regex(t,e){if(!(t instanceof RegExp))throw new Error("'$regex' value must be a RegExp");return t.test(e)}static _checkExist(t){if(["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin","$exists","$regex"].includes(t))return!0;throw new Error("unknown operator: '"+t+"'")}}class OfflineManagerService{_storage;storageInitialized=new BehaviorSubject(!1);offlineMode=new BehaviorSubject(!0);_offlineDB;constructor(t){this._storage=t}initStorage(t){this._offlineDB=new StorageDB({storage:window.localStorage,database:"offlineDB",primaryKey:"_id",secretKey:t}),this._offlineDB.getCollections().forEach(t=>{let e=this.find(t,{},{},!0);e.some(t=>!t)?this.dropCollection(t):e.forEach(e=>{e&&e.offlineDateExpires&&"function"==typeof e.offlineDateExpires.getTime&&Date.now()>=e.offlineDateExpires.getTime()&&this.removeDocument(t,e.data._id)})});let e=this._storage.get("user");if(e){if(null===this._offlineDB.decryptData(e)){const t=this._offlineDB.encryptData(e);this._storage.set("user",t)}}let n=this._storage.get("lastURL");if(n){if(null===this._offlineDB.decryptData(n)){const t=this._offlineDB.encryptData(n);this._storage.set("lastURL",t)}}let o=this._storage.get("accessToken");if(o){if(null===this._offlineDB.decryptData(o)){const t=this._offlineDB.encryptData(o);this._storage.set("accessToken",t)}}let r=this._storage.get("refreshToken");if(r){if(null===this._offlineDB.decryptData(r)){const t=this._offlineDB.encryptData(r);this._storage.set("refreshToken",t)}}this.storageInitialized.next(!0)}getStorage(){return this._offlineDB}setOffline(t){this.offlineMode.next(t)}saveUser(t){return this._storage.set("user",this._offlineDB.encryptData(t))}getUser(){return this._storage.get("user")?this._offlineDB.decryptData(this._storage.get("user")):null}removeUser(){this._storage.remove("user")}find(t,e,n={},o=!1){const r=this._offlineDB.get(t);return r?r.find(e,n,o):[]}findOne(t,e){const n=this._offlineDB.get(t);return n?n.findOne(e):null}insertDocument(t,e,n){const o=this._offlineDB.get(t);let r="";return o&&e&&(!Array.isArray(e)||e.length)&&(r=o.insert(e,n)),r}updateDocument(t,e){const n=this._offlineDB.get(t);if(n){if(n.findOne({_id:e._id}))return e.__v+=1,n.update(e._id,e),1}return 0}updateDocumentProps(t,e,n,o){const r=this._offlineDB.get(t);if(r){let t=r.findOne({_id:e});if(t)return n.forEach(e=>{t[e.prop]=e.data}),t.__v+=1,r.update({_id:e},t),1}return 0}removeDocument(t,e){const n=this._offlineDB.get(t);n&&n.remove(e)}dropCollection(t){this._offlineDB.get(t).drop()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:OfflineManagerService,deps:[{token:LocalStorageService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:OfflineManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:OfflineManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:LocalStorageService}]});class TokenManagerService{_storage;_offline;constructor(t,e){this._storage=t,this._offline=e}getToken(t){let e=this._storage.get(t);if(e){const t=this._offline.getStorage();if(!t||"function"!=typeof t.decryptData)return e;const n=t.decryptData(e);return null===n?e:n}return null}setToken(t,e){const n=this._offline.getStorage();n&&"function"==typeof n.encryptData?this._storage.set(t,n.encryptData(e)):this._storage.set(t,e)}removeToken(t){null!==this.getToken(t)&&this._storage.remove(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TokenManagerService,deps:[{token:LocalStorageService},{token:OfflineManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TokenManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TokenManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:LocalStorageService},{type:OfflineManagerService}]});class SocketManagerService{_socket;_offline;_alert;_router;_token;socketStatus;messageId=0;_cbMap=new Map;_subMap=new Map;_subKeyMap=new Map;_offlineUpdates=[];_pendingMessages=[];_sendTimeout=null;_currentLockId="";_chunkAssemblies=new Map;_chunkProgressThresholdBytes=5242880;_chunkTextDecoder=new TextDecoder;_connectionDelayTimeout=null;onerror=function(){};constructor(t,e,n,o,r){this._socket=t,this._offline=e,this._alert=n,this._router=o,this._token=r}getSubArray(){return Array.from(this._subMap.values())}initSocketManager(){this._socket.readyState$.subscribe(t=>{this.socketStatus=t}),this._socket.onmessage=t=>{this.handleMessage(t)},this._socket.onopen=t=>{this._connectionDelayTimeout=setTimeout(async()=>{if(this._connectionDelayTimeout=null,this._offline.setOffline(!1),this._subMap.forEach(t=>{this.send(t.messageRoute,new Date,t.messageId,"subscription","sub",t.subscription,...t.parameters)}),!await this.acquireLock("processingOfflineUpdates"))return;let t=this._offline.find("collectionOffline",{}).sort((t,e)=>t.date.getTime()-e.date.getTime()),e=this._offline.find("methodOffline",{}).sort((t,e)=>t.date.getTime()-e.date.getTime());t.length||e.length?(t.forEach(t=>{let e=this.messageId++;this._offlineUpdates.push({id_offline_doc:t._id,messageId:e,type:"collectionOffline"}),t.data[2]=e,"updateDocument"===t.type?(t.data[4]="updateDocumentOffline",t.data[0]="Offline - "+t.data[0]):"updateDocumentProps"===t.type?(t.data[4]="updateDocumentPropsOffline",t.data[0]="Offline - "+t.data[0]):t.data[0]="Offline - "+t.data[0]}),e.forEach(t=>{let e=this.messageId++;this._offlineUpdates.push({id_offline_doc:t._id,messageId:e,type:"methodOffline"}),t.data[2]=e,t.data[0]="Offline - "+t.data[0]}),this.send("Offline Updates",new Date,this.messageId++,"offline",t.concat(e).sort((t,e)=>t.date.getTime()-e.date.getTime()))):this.releaseLock("processingOfflineUpdates")},100)},this._socket.onerror=t=>{this._connectionDelayTimeout&&clearTimeout(this._connectionDelayTimeout),console.log(new Date,"SOCKET ERROR",t),this.onerror()},this._socket.onclose=t=>{this._connectionDelayTimeout&&clearTimeout(this._connectionDelayTimeout),this._chunkAssemblies.forEach(t=>this.dismissChunkAlert(t)),this._chunkAssemblies.clear()}}handleMessage(t){for(let e of t)this.processReceivedMessage(e)}async acquireLock(t,e=6e4,n=100){let o=Date.now(),r=this.generateUniqueId(),i=JSON.stringify({lockId:r,timestamp:o}),a=this._token.getToken(t);if(a){let{lockId:n,timestamp:r}=JSON.parse(a);if(!(o>r+e))return!1;this._token.setToken(t,i)}else this._token.setToken(t,i);await this.sleep(n);let s=this._token.getToken(t);if(s){let{lockId:t,timestamp:n}=JSON.parse(s);if(t===r&&o<=n+e)return this._currentLockId=r,!0}return!1}sleep(t){return new Promise(e=>setTimeout(e,t))}releaseLock(t){let e=this._token.getToken(t);if(e){let{lockId:n}=JSON.parse(e);n===this._currentLockId&&this._token.removeToken(t)}}generateUniqueId(){return`${Date.now()}-${Math.random().toString(36).substr(2,9)}`}processReceivedMessage(t){if(this.handleChunkedPayload(t))return;let e=this._offlineUpdates.findIndex(e=>e.messageId===t.messageId);if(e>=0&&(this._offline.removeDocument(this._offlineUpdates[e].type,this._offlineUpdates[e].id_offline_doc),this._offlineUpdates.splice(e,1),this._offlineUpdates.length||this.releaseLock("processingOfflineUpdates")),"ACK"!==t.data&&"NACK"!==t.data){const e=this._cbMap.get(t.messageId);if(e)return e.cb?(e.cb(t.hasError?t.data:null,t.hasError?null:t.data),e.resolveFn(t.hasError?t.data:null)):t.hasError?e.rejectFn(t.data):e.resolveFn(t.data),void this._cbMap.delete(t.messageId);const n=this._subMap.get(t.messageId);n&&n.subject.next(t.data)}}handleChunkedPayload(t){const e=t&&t.data;if(!e||"object"!=typeof e||!e.__chunked)return!1;const n=e.chunkId;if(!n)return!0;if("start"===e.chunkStatus)return this._chunkAssemblies.set(n,this.createChunkAssembly(n,t,e)),!0;const o=this._chunkAssemblies.get(n);if(!o)return!0;if("chunk"===e.chunkStatus)return this.appendChunkPayload(o,e),this.emitChunkProgress(o),!0;if("end"===e.chunkStatus){if(o.totalChunks&&o.receivedChunks!==o.totalChunks)return this.handleChunkFailure(o,"Incomplete chunk sequence"),this._chunkAssemblies.delete(n),!0;const e=this.tryDecodeChunkBuffer(o,!0);return void 0===e?(this.handleChunkFailure(o,"Failed to decode chunk payload"),this._chunkAssemblies.delete(n),!0):(t.data=e,this.dismissChunkAlert(o),this._chunkAssemblies.delete(n),!1)}return!0}createChunkAssembly(t,e,n){const o=n.totalBytes||0,r={chunkId:t,messageId:e.messageId,hasError:!!e.hasError,encoding:"msgpack"===n.encoding?"msgpack":"json",totalChunks:n.totalChunks||0,totalBytes:o,buffer:o?new Uint8Array(o):new Uint8Array(0),filledBytes:0,receivedChunks:0,targetType:null,showProgress:!1,lastPercent:-1},i=this._subMap.get(e.messageId);if(i)r.targetType="subscription",r.subscription=i;else{const t=this._cbMap.get(e.messageId);t&&(r.targetType="callback",r.callback=t)}return this.initializeChunkProgress(r),r}initializeChunkProgress(t){this.shouldShowChunkProgress(t)&&(t.showProgress=!0,t.lastPercent=-1,this.updateChunkProgress(t,!0))}shouldShowChunkProgress(t){return t.totalBytes?t.totalBytes>=this._chunkProgressThresholdBytes:t.totalChunks>1}appendChunkPayload(t,e){const n=this.extractChunkBytes(e,t.encoding);if(n&&n.byteLength){if(t.buffer&&t.buffer.byteLength>=t.filledBytes+n.byteLength)t.buffer.set(n,t.filledBytes);else if(t.buffer&&t.buffer.byteLength){const e=new Uint8Array(t.filledBytes+n.byteLength);e.set(t.buffer.subarray(0,t.filledBytes),0),e.set(n,t.filledBytes),t.buffer=e,t.totalBytes=t.buffer.byteLength}else t.buffer=new Uint8Array(n),t.totalBytes=t.buffer.byteLength;t.filledBytes+=n.byteLength,t.receivedChunks++,this.updateChunkProgress(t)}}updateChunkProgress(t,e=!1){if(!t.showProgress&&!e)return;if(!t.showProgress&&this.shouldShowChunkProgress(t))t.showProgress=!0;else if(!t.showProgress)return;const n=this.getChunkProgressPercent(t);if(null===n)return;if(!e){if(t.lastPercent>=n)return;if(t.lastPercent>=0&&n<100&&n-t.lastPercent<5)return}t.lastPercent=n;const o=this.buildChunkProgressMessage(t,n);t.alertToast?this.updateChunkAlertMessage(t.alertToast,o):(t.alertToast=this._alert.setAlert("update",o,0),this.configureChunkAlert(t.alertToast))}emitChunkProgress(t){if("subscription"!==t.targetType||!t.subscription)return;if(t.totalChunks&&t.receivedChunks>=t.totalChunks)return;const e=this.tryDecodeChunkBuffer(t,!1);void 0!==e&&t.subscription.subject.next(e)}handleChunkFailure(t,e){const n={chunkId:t.chunkId,message:e};if(console.error(new Date,"WEBSOCKET CHUNK",e,t.chunkId),this.dismissChunkAlert(t),"subscription"===t.targetType&&t.subscription)return void t.subscription.subject.error(n);const o=this._cbMap.get(t.messageId);o&&(o.cb&&o.cb(n,null),o.rejectFn?o.rejectFn(n):o.resolveFn&&o.resolveFn(n),this._cbMap.delete(t.messageId))}tryDecodeChunkBuffer(t,e){if(t.buffer&&t.filledBytes)try{const e=t.filledBytes===t.buffer.byteLength?t.buffer:t.buffer.subarray(0,t.filledBytes);if("msgpack"===t.encoding)return unpack(e);const n=this._chunkTextDecoder.decode(e);return JSON.parse(n,dateReviver)}catch(n){return void(e&&console.error(new Date,"WEBSOCKET CHUNK","Failed to decode chunk payload",t.chunkId,n))}}extractChunkBytes(t,e){return"msgpack"===e?this.ensureUint8Array(t.payload):"string"==typeof t.payload?this.base64ToUint8Array(t.payload):null}ensureUint8Array(t){return t?t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)?new Uint8Array(t):"string"==typeof t?this.base64ToUint8Array(t):null:null}base64ToUint8Array(t){const e=atob(t),n=new Uint8Array(e.length);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}dismissChunkAlert(t){t.alertToast&&(this._alert.clearAlert(t.alertToast.toastId),t.alertToast=void 0),t.showProgress=!1,t.lastPercent=-1}getChunkProgressPercent(t){if(t.totalBytes){const e=Math.min(t.filledBytes,t.totalBytes);return Math.min(100,Math.floor(e/t.totalBytes*100))}if(t.totalChunks){const e=Math.min(t.receivedChunks,t.totalChunks);return Math.min(100,Math.floor(e/t.totalChunks*100))}return null}buildChunkProgressMessage(t,e){const n=t.totalBytes,o=n?Math.min(t.filledBytes,n):0;if(n)return`Downloading data (${e}% • ${this.formatBytes(o)} of ${this.formatBytes(n)})`;if(t.totalChunks){return`Downloading data (${e}% • chunk ${Math.min(t.receivedChunks,t.totalChunks)} of ${t.totalChunks})`}return`Downloading data (${e}%)`}formatBytes(t){if(!t)return"0 B";const e=["B","KB","MB","GB","TB"],n=Math.min(e.length-1,Math.floor(Math.log(t)/Math.log(1024))),o=t/Math.pow(1024,n);return`${o>=10?o.toFixed(0):o.toFixed(1)} ${e[n]}`}configureChunkAlert(t){t&&(t.message=t.message||"",t.portal?.instance&&(t.portal.instance.options.disableTimeOut=!0,t.portal.instance.options.tapToDismiss=!0,t.portal.instance.options.closeButton=!1,t.portal.instance.message=t.message),t.toastRef?.componentInstance&&(t.toastRef.componentInstance.options.disableTimeOut=!0,t.toastRef.componentInstance.options.tapToDismiss=!0,t.toastRef.componentInstance.options.closeButton=!1,t.toastRef.componentInstance.message=t.message))}updateChunkAlertMessage(t,e){t.message=e,t.portal?.instance&&(t.portal.instance.message=e),t.toastRef?.componentInstance&&(t.toastRef.componentInstance.message=e)}openSocket(t,e){this._socket.openSocket(t,e)}closeSocket(){this._token.removeToken("accessToken"),this._socket.close()}resolveCurrentRoute(){const t=this._router?.url||"";return t.includes("?")?t.substring(0,t.indexOf("?")):t}buildSubscriptionKey(t,e,n){let o="";try{o=JSON.stringify(n??[])}catch{o=String(n??"")}return`${t}::${e}::${o}`}sendUnsubscribe(t,e,n,o){this.send(t,new Date,e,"subscription","unsub",n,...o)}releaseSharedSubscription(t){const e=this._subKeyMap.get(t);e&&(e.refCount-=1,e.refCount>0||(this._subKeyMap.delete(t),this.sendUnsubscribe(e.messageRoute,e.messageId,e.subscription,e.parameters),this._subMap.delete(e.messageId)))}call(t,...e){let n=null,o=null,r=new Promise((t,e)=>{n=t,o=e}),i=this.messageId++;const a=e[e.length-1]&&"function"==typeof e[e.length-1]?e.pop():null;this._cbMap.set(i,{messageId:i,cb:a,resolveFn:n,rejectFn:o,retryCnt:0});let s=e.length;for(;(void 0===e[e.length-1]||null===e[e.length-1])&&s>0;)e.pop(),s=e.length;return this.send(this._router.url.includes("?")?this._router.url.substring(0,this._router.url.indexOf("?")):this._router.url,new Date,i,"method",t,...e),r}subscribe(t,...e){const n=deepCopy(e),o=this.resolveCurrentRoute(),r=this.buildSubscriptionKey(o,t,n),i=this._subKeyMap.get(r);if(i)return i.refCount+=1,i.subject.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));const a=new ReplaySubject(1),s=this.messageId++,l={key:r,messageId:s,messageRoute:o,subscription:t,parameters:n,subject:a,refCount:1};this._subMap.set(s,l),this._subKeyMap.set(r,l);const c=a.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));return this.send(o,new Date,s,"subscription","sub",t,...n),c}subscribeBypassRoute(t,...e){const n=deepCopy(e),o="Bypass",r=this.buildSubscriptionKey(o,t,n),i=this._subKeyMap.get(r);if(i)return i.refCount+=1,i.subject.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));const a=new ReplaySubject(1),s=this.messageId++,l={key:r,messageId:s,messageRoute:o,subscription:t,parameters:n,subject:a,refCount:1};this._subMap.set(s,l),this._subKeyMap.set(r,l);const c=a.pipe(finalize(()=>{this.releaseSharedSubscription(r)}));return this.send("Bypass",new Date,s,"subscription","sub",t,...n),c}unsubscribe(t,e,...n){this.send(this.resolveCurrentRoute(),new Date,t,"subscription","unsub",e,...n)}send(...t){this.socketStatus===WebSocket.OPEN?(this._pendingMessages.push(t),this._sendTimeout||(this._sendTimeout=setTimeout(()=>{this._sendTimeout=null;const t=[...this._pendingMessages];this._pendingMessages=[],this._socket.send(t)},25))):"method"===t[3]&&this.handleOfflineMethod(t)}handleOfflineMethod(t){if("insertDocument"===t[4]){if("driver-gps"===t[5])return;this._alert.setAlert("warning","This insert command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"insert",data:t,date:new Date});let e=this._offline.insertDocument(t[5],t[6]),n=this._cbMap.get(t[2]);n&&n.cb&&(n.cb(null,e),this._cbMap.delete(t[2]))}else if("updateDocument"===t[4]){this._alert.setAlert("warning","This update command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"updateDocument",data:t,date:new Date}),this._offline.findOne(t[5],{_id:t[6]._id})?this._offline.updateDocument(t[5],t[6]):console.log("Could not find Offline data",t[5],t[6]);let e=this._cbMap.get(t[2]);e&&e.cb&&(e.cb(null,1),this._cbMap.delete(t[2]))}else if("updateDocumentProps"===t[4]){this._alert.setAlert("warning","This update command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"updateDocumentProps",data:t,date:new Date}),this._offline.findOne(t[5],{_id:t[6]})?this._offline.updateDocumentProps(t[5],t[6],t[7],t[8]):console.log("Could not find Offline data",t[5],t[6]);let e=this._cbMap.get(t[2]);e&&e.cb&&(e.cb(null,1),this._cbMap.delete(t[2]))}else if("removeDocument"===t[4]){this._alert.setAlert("warning","This remove command has not taken place on the server yet because you are offline. It will automatically sync up next time you are online as long as you do not clear your cache!"),this._offline.insertDocument("collectionOffline",{type:"removeDocument",data:t,date:new Date}),this._offline.findOne(t[5],{_id:t[6]})?this._offline.removeDocument(t[5],t[6]):console.log("Could not find Offline data",t[5],t[6]);let e=this._cbMap.get(t[2]);e&&e.cb&&(e.cb(null,1),this._cbMap.delete(t[2]))}else t[0].includes("/dashboard/driver/")&&this._offline.insertDocument("methodOffline",{type:t[4],data:t,date:new Date})}getStatus(){return this._socket.readyState$}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketManagerService,deps:[{token:SocketService},{token:OfflineManagerService},{token:AlertService},{token:i1$1.Router},{token:TokenManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SocketManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:SocketService},{type:OfflineManagerService},{type:AlertService},{type:i1$1.Router},{type:TokenManagerService}]});class AccountManagerService{_router;_socket;_token;_http;_alert;_offline;user=new BehaviorSubject(null);initCompleted=new BehaviorSubject(!1);loginCompleted=new BehaviorSubject(!1);publicClient=new BehaviorSubject(null);user$;environment=null;publicTokenKey="publicToken";publicActivityKey="publicTokenActivity";publicSessionMaxIdleMs=36e5;publicActivityThrottleMs=15e3;publicActivityListenerBound=!1;publicActivityInterval=null;lastPublicActivityWrite=0;constructor(t,e,n,o,r,i){this._router=t,this._socket=e,this._token=n,this._http=o,this._alert=r,this._offline=i}normalizeUser(t){if(!t)return null;const e=t.roles||{},n={...e,super_admin:!!e.super_admin,approvals:Array.isArray(e.approvals)?e.approvals:[],groups:Array.isArray(e.groups)?e.groups:[],notifications:Array.isArray(e.notifications)?e.notifications:[],miscs:Array.isArray(e.miscs)?e.miscs:[]},o=t.other&&"object"==typeof t.other?t.other:{};return{...t,roles:n,other:o}}initLoginManager(t){this.environment=t,this._offline.storageInitialized.subscribe(t=>{this._socket.initSocketManager(),this.initPublicSessionTracking();let e=this._token.getToken("refreshToken");e?(this.initLogin(e),setInterval(()=>{e=this._token.getToken("refreshToken"),this.initLogin(e)},3e3)):this.initCompleted.next(!0)})}initPublicSessionTracking(t={}){if("number"==typeof t.maxIdleMs&&t.maxIdleMs>0&&(this.publicSessionMaxIdleMs=t.maxIdleMs),"number"==typeof t.throttleMs&&t.throttleMs>0&&(this.publicActivityThrottleMs=t.throttleMs),!this.publicActivityListenerBound&&"undefined"!=typeof window){const t=()=>this.touchPublicSession();window.addEventListener("click",t,{passive:!0}),window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("keydown",t,{passive:!0}),window.addEventListener("scroll",t,{passive:!0}),window.addEventListener("touchstart",t,{passive:!0}),this.publicActivityListenerBound=!0}this.publicActivityInterval&&clearInterval(this.publicActivityInterval);const e="number"==typeof t.checkIntervalMs&&t.checkIntervalMs>0?t.checkIntervalMs:6e4;this.publicActivityInterval=setInterval(()=>this.enforcePublicSession(),e),this.restorePublicSession()}initLogin(t){if(navigator.onLine)this._offline.offlineMode.getValue()&&(this._offline.setOffline(!1),this.getAccessToken(t));else if(!this._offline.offlineMode.getValue()||!this.initCompleted.getValue()){this.closeSocket(),this._offline.setOffline(!0);let t=this._offline.getUser();t&&this.setUser(t),this.initCompleted.getValue()||this.initCompleted.next(!0)}}getAccessToken(t){t&&this._http.post(this.environment.SERVER_URL+"/accessToken",{refreshToken:t}).toPromise().then(t=>{t.error?this.initCompleted.next(!0):(this._token.setToken("accessToken",t.result.token),this.setUser(t.result.user),this.openSocket(t.result.token),this.user$&&this.user$.unsubscribe(),this.user$=this._socket.subscribeBypassRoute("userWithId",t.result.user._id).subscribe(t=>{t&&(this.user.getValue()&&this.user.getValue()._id!==t._id?this._socket.call("incorrectUser",this.user.getValue(),t,this._socket.getSubArray()):(this.setUser(t),this.loginCompleted.next(!0),this.initCompleted.next(!0),this._offline.saveUser(t)))}))},t=>{this.initCompleted.next(!0)})}logIn(t,e){return new Promise((n,o)=>{this._http.post(this.environment.SERVER_URL+"/login",{username:t,password:e}).toPromise().then(t=>{t.error?(this._alert.setAlert("error",t.result),o(t.result)):(this._token.setToken("refreshToken",t.result.token),this.getAccessToken(t.result.token),n(t.result.token))},t=>{})})}publicLogIn(t,e){return new Promise((n,o)=>{this._http.post(this.environment.SERVER_URL+"/public/login",{email:t,password:e}).toPromise().then(t=>{t?.error?(this._alert.setAlert("error",t.result||"Unable to sign in"),o(t.result||"Unable to sign in")):(t?.result?.token&&(this._token.setToken(this.publicTokenKey,t.result.token),this.touchPublicSession(!0)),t?.result?.client&&this.publicClient.next(t.result.client),n(t.result))},()=>{this._alert.setAlert("error","Unable to sign in"),o("Unable to sign in")})})}publicRegister(t){return new Promise((e,n)=>{this._http.post(this.environment.SERVER_URL+"/public/register",t).toPromise().then(t=>{t?.error?(this._alert.setAlert("error",t.result||"Unable to create account"),n(t.result||"Unable to create account")):(t?.result?.token&&(this._token.setToken(this.publicTokenKey,t.result.token),this.touchPublicSession(!0)),t?.result?.client&&this.publicClient.next(t.result.client),e(t.result))},()=>{this._alert.setAlert("error","Unable to create account"),n("Unable to create account")})})}publicFetchMe(){return new Promise((t,e)=>{if(this.isPublicSessionExpired())return this.publicLogOut(),void e("No session");const n=this._token.getToken(this.publicTokenKey);if(!n)return this.publicClient.next(null),void e("No session");const o=new HttpHeaders({Authorization:`Bearer ${n}`});this._http.get(this.environment.SERVER_URL+"/public/me",{headers:o}).toPromise().then(n=>{n?.error?(this.publicClient.next(null),e(n.result||"Unable to load session")):(this.publicClient.next(n.result?.client||null),this.touchPublicSession(),t(n.result))},()=>{e("Unable to load session")})})}publicFetchDashboard(){return new Promise((t,e)=>{if(this.isPublicSessionExpired())return this.publicLogOut(),void e("No session");const n=this._token.getToken(this.publicTokenKey);if(!n)return void e("No session");const o=new HttpHeaders({Authorization:`Bearer ${n}`});this._http.get(this.environment.SERVER_URL+"/public/dashboard",{headers:o}).toPromise().then(n=>{n?.error?e(n.result||"Unable to load dashboard"):(this.touchPublicSession(),t(n.result))},()=>{e("Unable to load dashboard")})})}publicLogOut(){this._token.removeToken(this.publicTokenKey),this._token.removeToken(this.publicActivityKey),this.publicClient.next(null)}restorePublicSession(){if(this.publicClient.getValue())return;this._token.getToken(this.publicTokenKey)&&(this.isPublicSessionExpired()?this.publicLogOut():(this.touchPublicSession(!0),this.publicFetchMe().catch(()=>{})))}enforcePublicSession(){this.isPublicSessionExpired()&&this.publicLogOut()}isPublicSessionExpired(){if(!this._token.getToken(this.publicTokenKey))return!1;const t=this.getPublicActivityTimestamp();return!!t&&Date.now()-t>this.publicSessionMaxIdleMs}getPublicActivityTimestamp(){const t=this._token.getToken(this.publicActivityKey);if(!t)return 0;const e=Number(t);return Number.isFinite(e)?e:0}touchPublicSession(t=!1){if(!this._token.getToken(this.publicTokenKey))return;const e=Date.now();!t&&e-this.lastPublicActivityWrite<this.publicActivityThrottleMs||(this.lastPublicActivityWrite=e,this._token.setToken(this.publicActivityKey,String(e)))}logIn365(t){return new Promise((e,n)=>{this._http.post(this.environment.SERVER_URL+"/login365",{id_token:t}).toPromise().then(t=>{t.error?(this._alert.setAlert("error",t.result),n(t.result)):(this._token.setToken("refreshToken",t.result.token),this.getAccessToken(t.result.token),e(t.result.token))},t=>{})})}resetUserPassword(t){return new Promise((e,n)=>{this._http.post(this.environment.SERVER_URL+"/resetPassword",{username:t}).toPromise().then(t=>{e(!0)},t=>{})})}logOut(){return new Promise((t,e)=>{this._router.navigateByUrl("/home"),setTimeout(()=>{this.setUser(null),this._token.removeToken("refreshToken"),this._offline.removeUser(),this.closeSocket(),t(!0)},500)})}openSocket(t){this._socket.openSocket(this.environment,[t])}closeSocket(){this._socket.closeSocket()}setUser(t){this.user.next(this.normalizeUser(t))}getUser(){return this.user.getValue()}getSocketStatus(){return this._socket.getStatus()}isUserInView(t){let e=!1;if(this.isUserSuperAdmin())return!0;let n=this.user.getValue();if(n&&n.roles){const o=Array.isArray(n.roles.groups)?n.roles.groups:[],r=Array.isArray(n.roles.miscs)?n.roles.miscs:[];o.forEach(n=>{n.views.filter(e=>e.startsWith(t)).length&&(e=!0)}),r.filter(e=>e.startsWith(t)).length&&(e=!0),o.filter(e=>e.name===t).length&&(e=!0)}return e}isUserSuperAdmin(){const t=this.user.getValue();return!!(t&&t.roles&&t.roles.super_admin)}isInitCompleted(){return new Promise((t,e)=>{if(this.initCompleted.value)t(!0);else{let e=this.initCompleted.subscribe(n=>{n&&(e.unsubscribe(),t(!0))},()=>{})}})}isLoginCompleted(){return new Promise((t,e)=>{if(this.loginCompleted.value)t(!0);else{let e=this.loginCompleted.subscribe(n=>{n&&(e.unsubscribe(),t(!0))})}})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AccountManagerService,deps:[{token:i1$1.Router},{token:SocketManagerService},{token:TokenManagerService},{token:i4.HttpClient},{token:AlertService},{token:OfflineManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AccountManagerService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AccountManagerService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1$1.Router},{type:SocketManagerService},{type:TokenManagerService},{type:i4.HttpClient},{type:AlertService},{type:OfflineManagerService}]});class ValidationService{constructor(){}wholeNumbersAllowNegative(t){return""===t.value||null===t.value||/^[\-]?\d+$/.test(t.value)?null:{wholeNumbersAllowNegative:{valid:!1}}}wholeNumbersWithZero(t){return""===t.value||null===t.value||/^[0-9]*$/.test(t.value)?null:{wholeNumbersWithZero:{valid:!1}}}wholeNumbersGreaterThanZero(t){return""===t.value||null===t.value||/^[1-9]+[0-9]*$/.test(t.value)?null:{wholeNumbersGreaterThanZero:{valid:!1}}}decimalWithZero(t){return""===t.value||null===t.value||/^\d*\.?\d*$/.test(t.value)?null:{decimalWithZero:{valid:!1}}}decimalGreaterThanZero(t){return""===t.value||null===t.value||/^\s*(?=.*[1-9])\d*(?:\.\d{1,10})?\s*$/.test(t.value)?null:{decimalGreaterThanZero:{valid:!1}}}currency(t){return""===t.value||null===t.value||/^[0-9]\d*(\.\d+)?$/.test(t.value)?null:{currency:{valid:!1}}}currencyGreaterThanZero(t){return""===t.value||null===t.value||/^[0-9]\d*(\.\d+)?$/.test(t.value)&&t.value>0?null:{currency:{valid:!1}}}currencyAllowNegative(t){return""===t.value||null===t.value||/^[\-]?[0-9]\d*(\.\d+)?$/.test(t.value)?null:{currency:{valid:!1}}}phoneNumber(t){return""===t.value||null===t.value||/^1?([2-9])(\d{9})/.test(t.value)?null:{phoneNumber:{valid:!1}}}email(t){return""===t.value||null===t.value||/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t.value)?null:{email:{valid:!1}}}matchPassword(t){let e=t.controls.password,n=t.controls.confirm_password;return e.value&&n.value?e.value===n.value?null:{matchPassword:{isValid:!1}}:null}density(t){return""===t.value||null===t.value||/^[\-]?\d*\.?\d*$/.test(t.value)?null:{density:{valid:!1}}}maxValue(t){return e=>("string"==typeof e.value?parseFloat(e.value):e.value)>t?{maxValue:{max:t}}:null}minValue(t){return e=>("string"==typeof e.value?parseFloat(e.value):e.value)<t?{minValue:{min:t}}:null}multipleOf(t){return e=>("string"==typeof e.value?parseFloat(e.value):e.value)%t!==0?{multipleOf:{value:t}}:null}minLengthArray(t){return e=>e.value&&e.value.length>=t?null:{minLengthArray:{valid:!1}}}maxLengthArray(t){return e=>e.value&&e.value.length<=t?null:{maxLengthArray:{valid:!1}}}validIPAddress(t){return""===t.value||null===t.value||/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/.test(t.value)?null:{validIPAddress:{valid:!1}}}alphaNumericWithDashes(t){return""===t.value||null===t.value||/^[a-zA-Z0-9-_]+$/.test(t.value)?null:{alphaNumericWithDashes:{valid:!1}}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ValidationService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ValidationService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ValidationService,decorators:[{type:Injectable}],ctorParameters:()=>[]});class AwsService{_socket;constructor(t){this._socket=t}dataURItoFile(t,e){let n=atob(t.split(",")[1]),o=t.split(",")[0].split(":")[1].split(";")[0],r=new ArrayBuffer(n.length),i=new Uint8Array(r);for(let t=0;t<n.length;t++)i[t]=n.charCodeAt(t);let a=new Blob([r],{type:o});return a.lastModifiedDate=new Date,a.name=e,a}uploadFile(t,e,n,o){return new Promise((r,i)=>{t.size?this.getBase64(t).then(a=>{this._socket.call("uploadFileAndSave",o||t.name,a,t.size,n||-1,e,!0,(t,e)=>{e?r(e):i(t)})}):i("Invalid File")})}getFileWithKey(t,e){this._socket.call("getFile",t,e)}getFileWithId(t,e){this._socket.call("findOne","files",{_id:t},(t,n)=>{this.getFileWithKey(n.key,e)})}deleteFile(t,e){this._socket.call("deleteFile",t,e)}deleteFileWithId(t,e){this._socket.call("findOne","files",{_id:t},(t,n)=>{this.deleteFile(n.key,e)})}deleteFilesWithKeys(t,e){this._socket.call("deleteFiles",t,e)}getBase64(t){return new Promise((e,n)=>{const o=new FileReader;o.readAsDataURL(t),o.onload=()=>e(o.result),o.onerror=t=>n(t)})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AwsService,deps:[{token:SocketManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AwsService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AwsService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:SocketManagerService}]});class BaseComponent{providerService;constructor(t){this.providerService=t}}class ProviderService{_app;_router;_socket;_account;_alert;_vs;_aws;_fb;constructor(t,e,n,o,r,i,a,s){this._app=t,this._router=e,this._socket=n,this._account=o,this._alert=r,this._vs=i,this._aws=a,this._fb=s}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ProviderService,deps:[{token:CoreService},{token:i1$1.Router},{token:SocketManagerService},{token:AccountManagerService},{token:AlertService},{token:ValidationService},{token:AwsService},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ProviderService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ProviderService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:CoreService},{type:i1$1.Router},{type:SocketManagerService},{type:AccountManagerService},{type:AlertService},{type:ValidationService},{type:AwsService},{type:i2.FormBuilder}]});class DialogNotifyContent{activeModal;title;body;handleKeyboardEvent(t){13===t.keyCode&&this.activeModal.close()}constructor(t){this.activeModal=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogNotifyContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DialogNotifyContent,isStandalone:!1,selector:"resolveio-dialog.notify",inputs:{title:"title",body:"body"},host:{listeners:{"document:keypress":"handleKeyboardEvent($event)"}},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-info-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t \t \t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t \t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n ',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogNotifyContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.notify",template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-info-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t \t \t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t \t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n ',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],body:[{type:Input}],handleKeyboardEvent:[{type:HostListener,args:["document:keypress",["$event"]]}]}});class AiFormRegistryService{forms=[];counter=0;registerForm(t){if(!t?.form)return()=>{};const e={id:"ai-form-"+ ++this.counter,...t};return this.forms.push(e),()=>this.unregisterForm(e)}unregisterForm(t){const e="string"==typeof t?t:t?.id;e&&(this.forms=this.forms.filter(t=>t.id!==e))}getFormsForRoute(t){const e=this.normalizeRoute(t);return e?this.forms.filter(t=>this.normalizeRoute(t.route)===e):[...this.forms]}normalizeRoute(t){const e=String(t||"").trim();if(!e)return"";return e.split("?")[0].split("#")[0].trim()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormRegistryService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormRegistryService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormRegistryService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});class AiFormAutoRegisterDirective{formDirective;registry;router;elementRef;aiFormAutoRegister=!0;aiFormLabel="";aiFormIgnore=!1;unregister;constructor(t,e,n,o){this.formDirective=t,this.registry=e,this.router=n,this.elementRef=o}ngOnInit(){this.register()}ngOnDestroy(){this.unregister&&this.unregister()}register(){if(!this.aiFormAutoRegister||this.aiFormIgnore)return;const t=this.elementRef?.nativeElement;if("ignore"===t?.getAttribute("data-ai-form")||"true"===t?.getAttribute("data-ai-ignore"))return;const e=this.formDirective?.form;if(!e)return;const n=this.router?.url||"";this.unregister=this.registry.registerForm({form:e,route:n,element:t,label:(this.aiFormLabel||"").trim()||void 0})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormAutoRegisterDirective,deps:[{token:i2.FormGroupDirective},{token:AiFormRegistryService},{token:i1$1.Router},{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:AiFormAutoRegisterDirective,isStandalone:!0,selector:"form[formGroup]",inputs:{aiFormAutoRegister:"aiFormAutoRegister",aiFormLabel:"aiFormLabel",aiFormIgnore:"aiFormIgnore"},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiFormAutoRegisterDirective,decorators:[{type:Directive,args:[{selector:"form[formGroup]",standalone:!0}]}],ctorParameters:()=>[{type:i2.FormGroupDirective},{type:AiFormRegistryService},{type:i1$1.Router},{type:i0.ElementRef}],propDecorators:{aiFormAutoRegister:[{type:Input}],aiFormLabel:[{type:Input}],aiFormIgnore:[{type:Input}]}});class FormButtonComponent extends BaseComponent{_services;form;disabled=!1;type="submit";formButton;constructor(t){super(t),this._services=t}getTipErrors(){let t=[];if(this.form&&this.form.invalid&&"object"==typeof this.form.controls){Object.keys(this.form.controls).forEach(e=>{let n=this.form.controls[e];if(n.invalid&&(t.push(e.replace("_id","").replace("id_","").replace("_"," ").replace(/\b\S/g,function(t){return t.toUpperCase()})+" is invalid"),"object"==typeof n.value&&Array.isArray(n.value)&&n.controls))for(let e=0;e<n.controls.length;e++){let o=n.controls[e];if(o.controls){Object.keys(o.controls).forEach(n=>{o.controls[n].invalid&&t.push("["+e+"] -> "+n.replace("_id","").replace("id_","").replace("_"," ").replace(/\b\S/g,function(t){return t.toUpperCase()})+" is invalid")})}}})}return t}isSuperAdmin(){return!(!this._services._account.getUser()||!this._services._account.getUser().roles.super_admin)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonComponent,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:FormButtonComponent,isStandalone:!1,selector:"form-button",inputs:{form:"form",disabled:"disabled",type:"type"},providers:[ProviderService],viewQueries:[{propertyName:"formButton",first:!0,predicate:["formButton"],descendants:!0}],usesInheritance:!0,ngImport:i0,template:'\n\t\t<div style="position: relative; text-align: left; width: 100%">\n\t\t <ng-template #tipContent>\n\t\t <span style="font-weight: bold">Errors:<br></span>\n\t\t <ul>\n\t\t @for (error of getTipErrors(); track error) {\n\t\t <li>{{error}}</li>\n\t\t }\n\t\t </ul>\n\t\t </ng-template>\n\t\t <div [ngbTooltip]="(getTipErrors().length ? tipContent : \'\')" placement="top-left" #t>\n\t\t <button [type]="type" [ngClass]="[\'btn\', form && form.valid ? \'btn-success\' : \'btn-danger\']" [disabled]="!form || !form.valid || disabled" style="width: 200px" [autofocus]="true" #formButton>Submit</button>\n\t\t </div>\n\t\t</div>\n\t\t',isInline:!0,dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$2.NgbTooltip,selector:"[ngbTooltip]",inputs:["animation","autoClose","placement","popperOptions","triggers","positionTarget","container","disableTooltip","tooltipClass","tooltipContext","openDelay","closeDelay","ngbTooltip"],outputs:["shown","hidden"],exportAs:["ngbTooltip"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"form-button",template:'\n\t\t<div style="position: relative; text-align: left; width: 100%">\n\t\t <ng-template #tipContent>\n\t\t <span style="font-weight: bold">Errors:<br></span>\n\t\t <ul>\n\t\t @for (error of getTipErrors(); track error) {\n\t\t <li>{{error}}</li>\n\t\t }\n\t\t </ul>\n\t\t </ng-template>\n\t\t <div [ngbTooltip]="(getTipErrors().length ? tipContent : \'\')" placement="top-left" #t>\n\t\t <button [type]="type" [ngClass]="[\'btn\', form && form.valid ? \'btn-success\' : \'btn-danger\']" [disabled]="!form || !form.valid || disabled" style="width: 200px" [autofocus]="true" #formButton>Submit</button>\n\t\t </div>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:ProviderService}],propDecorators:{form:[{type:Input}],disabled:[{type:Input}],type:[{type:Input}],formButton:[{type:ViewChild,args:["formButton",{static:!1}]}]}});class DialogInputContent{_activeModal;_fb;title="";inputFields=[];formInput;states=["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"];constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.formInput=this._fb.group({});for(let t=0;t<this.inputFields.length;t++){let e=this.inputFields[t].data;"datetime"===this.inputFields[t].type&&(e=this.normalizeDateTimeValue(this.inputFields[t].data)),null===this.inputFields[t].validators?this.formInput.addControl(this.inputFields[t].form,new UntypedFormControl({value:e,disabled:this.inputFields[t].disabled})):this.formInput.addControl(this.inputFields[t].form,new UntypedFormControl({value:e,disabled:this.inputFields[t].disabled},this.inputFields[t].validators))}}normalizeDateTimeValue(t){if(!t)return null;if(Array.isArray(t))return this.mergeDateTimeParts(t[0],t[1]);if(t instanceof Date)return this.mergeDateTimeParts(t,t);if(t.date||t.time||this.isDateStruct(t)||this.isTimeStruct(t)){const e=this.toDateStruct(t.date?t.date:t),n=this.toTimeStruct(t.time?t.time:t);return this.mergeDateTimeParts(e,n||null,t.mode)}return t}mergeDateTimeParts(t,e,n="datetime"){const o={mode:n},r=this.toDateStruct(t),i=this.toTimeStruct(e);return r&&(o.date=r),i&&(o.time=i),o}isDateStruct(t){return t&&void 0!==t.year&&void 0!==t.month&&void 0!==t.day}isTimeStruct(t){return t&&void 0!==t.hour&&void 0!==t.minute}toDateStruct(t){return t?t instanceof Date?{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}:this.isDateStruct(t)?{year:t.year,month:t.month,day:t.day}:t.date?this.toDateStruct(t.date):null:null}toTimeStruct(t){return t?t instanceof Date?{hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),ms:t.getMilliseconds()}:this.isTimeStruct(t)?{hour:t.hour,minute:t.minute,second:t.second||0,ms:t.ms||0}:t.time?this.toTimeStruct(t.time):null:null}validateInput(t,e){if(t.disabled)return"";let n=!0;for(let o=0;o<t.validators.length;o++)e.controls[t.form].hasError([t.validatorErrors[o]])&&(n=!1);return n&&null!==e.controls[t.form].value?"is-valid":!t.validators.length||!t.required&&n?"":"is-invalid"}getErrorMessages(t,e){let n=[];for(let o=0;o<t.validators.length;o++)e.controls[t.form].hasError([t.validatorErrors[o]])&&n.push(t.validatorMsg[o]);return n}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogInputContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogInputContent,isStandalone:!1,selector:"resolveio-dialog.input",inputs:{title:"title",inputFields:"inputFields"},ngImport:i0,template:'\n\t\t<form [formGroup]="formInput" novalidate (ngSubmit)="_activeModal.close(this.formInput.controls)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-plus-circle" style="color: green; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t @for (inputField of inputFields; track inputField.label; let i = $index) {\n\t\t <div class="form-group">\n\t\t <label class="form-control-label">{{inputField.label}}</label>\n\t\t @if (formInput.controls[inputField.form].hasError(\'required\') && inputField.required) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].hasError(\'required\') && formInput.controls[inputField.form].invalid) {\n\t\t <em>- Invalid</em>\n\t\t }\n\t\t @if (inputField.type !== \'date\' && inputField.type !== \'datetime\' && inputField.type !== \'state\' && inputField.type !== \'textarea\' && inputField.type !== \'number\' && inputField.type !== \'select\' && inputField.type !== \'boolean\') {\n\t\t <input [autofocus]="i === 0 ? true : false" [focus]="i === 0 ? true : false" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" [type]="(inputField.type ? inputField.type : \'text\')">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'select\') {\n\t\t <rio-select [formControlName]="inputField.form" [ngClass]="[validateInput(inputField, formInput)]" [placeholder]="inputField.placeholder" [options]="inputField.options" optionValueKey="value" optionLabelKey="text"></rio-select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'state\') {\n\t\t <select [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t <option value="">Select State</option>\n\t\t @for (state of states; track state) {\n\t\t <option [value]="state">{{state}}</option>\n\t\t }\n\t\t </select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'textarea\') {\n\t\t <textarea rows="4" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]"></textarea>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'number\') {\n\t\t <input [formControlName]="inputField.form" type="number" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'date\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" placeholder="yyyy-mm-dd" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'datetime\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="datetime"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'boolean\') {\n\t\t <div (click)="formInput.controls[inputField.form].setValue(!formInput.controls[inputField.form].value)">\n\t\t @if (formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-check" style="color: green; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-times" style="color: red; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t <div class="modal-footer">\n\t\t <form-button [form]="formInput"></form-button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </div>\n\t\t</form>\n\t\t',isInline:!0,dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.NgSelectOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.ɵNgSelectMultipleOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NumberValueAccessor,selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]"},{kind:"directive",type:i2.SelectControlValueAccessor,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:["compareWith"]},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"component",type:i7.RioDatePickerComponent,selector:"rio-date-picker",inputs:["enableDate","enableTime","selectionMode","firstDayOfWeek","toggleWeekFirstDay","timezone","minDate","maxDate","disabled","label","allowSeconds","minuteStep","panelWidth"],outputs:["change"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogInputContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.input",template:'\n\t\t<form [formGroup]="formInput" novalidate (ngSubmit)="_activeModal.close(this.formInput.controls)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-plus-circle" style="color: green; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t @for (inputField of inputFields; track inputField.label; let i = $index) {\n\t\t <div class="form-group">\n\t\t <label class="form-control-label">{{inputField.label}}</label>\n\t\t @if (formInput.controls[inputField.form].hasError(\'required\') && inputField.required) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].hasError(\'required\') && formInput.controls[inputField.form].invalid) {\n\t\t <em>- Invalid</em>\n\t\t }\n\t\t @if (inputField.type !== \'date\' && inputField.type !== \'datetime\' && inputField.type !== \'state\' && inputField.type !== \'textarea\' && inputField.type !== \'number\' && inputField.type !== \'select\' && inputField.type !== \'boolean\') {\n\t\t <input [autofocus]="i === 0 ? true : false" [focus]="i === 0 ? true : false" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" [type]="(inputField.type ? inputField.type : \'text\')">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'select\') {\n\t\t <rio-select [formControlName]="inputField.form" [ngClass]="[validateInput(inputField, formInput)]" [placeholder]="inputField.placeholder" [options]="inputField.options" optionValueKey="value" optionLabelKey="text"></rio-select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'state\') {\n\t\t <select [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t <option value="">Select State</option>\n\t\t @for (state of states; track state) {\n\t\t <option [value]="state">{{state}}</option>\n\t\t }\n\t\t </select>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'textarea\') {\n\t\t <textarea rows="4" [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]"></textarea>\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'number\') {\n\t\t <input [formControlName]="inputField.form" type="number" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]">\n\t\t @for (errorMsg of getErrorMessages(inputField, formInput); track errorMsg) {\n\t\t <div class="invalid-feedback">{{errorMsg}}</div>\n\t\t }\n\t\t }\n\t\t @if (inputField.type === \'date\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" placeholder="yyyy-mm-dd" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'datetime\') {\n\t\t <div class="input-group">\n\t\t <rio-date-picker [formControlName]="inputField.form" [ngClass]="[\'form-control\', validateInput(inputField, formInput)]" selectionMode="datetime"></rio-date-picker>\n\t\t </div>\n\t\t }\n\t\t @if (inputField.type === \'boolean\') {\n\t\t <div (click)="formInput.controls[inputField.form].setValue(!formInput.controls[inputField.form].value)">\n\t\t @if (formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-check" style="color: green; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t @if (!formInput.controls[inputField.form].value) {\n\t\t <i class="fa fa-times" style="color: red; font-size: 24px;" aria-hidden="true"></i>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t <div class="modal-footer">\n\t\t <form-button [form]="formInput"></form-button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </div>\n\t\t</form>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{title:[{type:Input}],inputFields:[{type:Input}]}});class DialogErrorContent{activeModal;title;body;handleKeyboardEvent(t){13===t.keyCode&&this.activeModal.close()}constructor(t){this.activeModal=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogErrorContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DialogErrorContent,isStandalone:!1,selector:"resolveio-dialog.error",inputs:{title:"title",body:"body"},host:{listeners:{"document:keypress":"handleKeyboardEvent($event)"}},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-times-circle" style="color: red; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n \t',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogErrorContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.error",template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-times-circle" style="color: red; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-secondary" (click)="activeModal.close(\'Close click\')">Ok</button>\n\t\t</div>\n \t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],body:[{type:Input}],handleKeyboardEvent:[{type:HostListener,args:["document:keypress",["$event"]]}]}});class DialogConfirmContent{activeModal;title;body;html;handleKeyboardEvent(t){13===t.keyCode&&this.activeModal.close()}constructor(t){this.activeModal=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogConfirmContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DialogConfirmContent,isStandalone:!1,selector:"resolveio-dialog.confirm",inputs:{title:"title",body:"body",html:"html"},host:{listeners:{"document:keypress":"handleKeyboardEvent($event)"}},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t\t<div [innerHTML]="html"></div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-success" (click)="activeModal.close()">Yes</button>\n\t\t\t<button type="button" class="btn btn-danger" (click)="activeModal.dismiss()">No</button>\n\t\t</div>\n \t',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogConfirmContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.confirm",template:'\n\t\t<div class="modal-header">\n\t\t\t<h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t\t<button type="button" class="btn-close ms-auto" aria-label="Close" (click)="activeModal.dismiss(\'Cross click\')"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t\t<p>{{ body }}</p>\n\t\t\t<div [innerHTML]="html"></div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t\t<button type="button" class="btn btn-success" (click)="activeModal.close()">Yes</button>\n\t\t\t<button type="button" class="btn btn-danger" (click)="activeModal.dismiss()">No</button>\n\t\t</div>\n \t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],body:[{type:Input}],html:[{type:Input}],handleKeyboardEvent:[{type:HostListener,args:["document:keypress",["$event"]]}]}});class DialogSelectDateTimeContent{_activeModal;_fb;title="";date;showTime=!0;close;allElements;form;constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.date||(this.date=new Date),this.form=this._fb.group({time:[{hour:this.date.getHours(),minute:this.date.getMinutes(),second:0},[Validators.required]],date:[{year:this.date.getFullYear(),month:this.date.getMonth()+1,day:this.date.getDate()},[Validators.required]]})}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100)}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}submitForm(){this._activeModal.close(new Date(this.form.value.date.year,parseInt(this.form.value.date.month)-1,this.form.value.date.day,this.form.value.time.hour,this.form.value.time.minute,this.form.value.time.second,0))}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDateTimeContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectDateTimeContent,isStandalone:!1,selector:"resolveio-dialog.select-datetime",inputs:{title:"title",date:"date",showTime:"showTime"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t \t<style>\n\t \t table {\n\t \t width: 100%;\n\t \t table-layout: fixed;\n\t \t}\n\t \t\n\t \ttr {\n\t \twidth: 100%;\n\t \t}\n\t \t\n\t \ttd {\n\t \twidth: 100%;\n\t \ttext-align: center;\n\t \t}\n\t \t</style>\n\t \t<div #allElements>\n\t \t <form [formGroup]="form" novalidate (ngSubmit)="submitForm()">\n\t \t <div class="modal-header">\n\t \t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t \t </div>\n\t \t <div class="modal-body">\n\t \t <table>\n\t \t <tr>\n\t \t <td style="border: none;">\n\t \t <div class="input-group">\n\t \t <rio-date-picker class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="date" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t @if (showTime) {\n\t \t <td style="border: none;">\n\t \t <div class="offset-3">\n\t \t <rio-date-picker formControlName="time" selectionMode="time" [enableDate]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t }\n\t \t </tr>\n\t \t </table>\n\t \t </div>\n\t \t <div class="modal-footer">\n\t \t <form-button [form]="form"></form-button>\n\t \t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t \t </div>\n\t \t </form>\n\t \t</div>\n\t \t',isInline:!0,styles:["table{width:100%;table-layout:fixed}tr{width:100%}td{width:100%;text-align:center}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"component",type:i7.RioDatePickerComponent,selector:"rio-date-picker",inputs:["enableDate","enableTime","selectionMode","firstDayOfWeek","toggleWeekFirstDay","timezone","minDate","maxDate","disabled","label","allowSeconds","minuteStep","panelWidth"],outputs:["change"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDateTimeContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-datetime",template:'\n\t \t<style>\n\t \t table {\n\t \t width: 100%;\n\t \t table-layout: fixed;\n\t \t}\n\t \t\n\t \ttr {\n\t \twidth: 100%;\n\t \t}\n\t \t\n\t \ttd {\n\t \twidth: 100%;\n\t \ttext-align: center;\n\t \t}\n\t \t</style>\n\t \t<div #allElements>\n\t \t <form [formGroup]="form" novalidate (ngSubmit)="submitForm()">\n\t \t <div class="modal-header">\n\t \t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t \t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t \t </div>\n\t \t <div class="modal-body">\n\t \t <table>\n\t \t <tr>\n\t \t <td style="border: none;">\n\t \t <div class="input-group">\n\t \t <rio-date-picker class="form-control" placeholder="yyyy-mm-dd" name="dp" formControlName="date" selectionMode="date" [enableTime]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t @if (showTime) {\n\t \t <td style="border: none;">\n\t \t <div class="offset-3">\n\t \t <rio-date-picker formControlName="time" selectionMode="time" [enableDate]="false"></rio-date-picker>\n\t \t </div>\n\t \t </td>\n\t \t }\n\t \t </tr>\n\t \t </table>\n\t \t </div>\n\t \t <div class="modal-footer">\n\t \t <form-button [form]="form"></form-button>\n\t \t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t \t </div>\n\t \t </form>\n\t \t</div>\n\t \t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{title:[{type:Input}],date:[{type:Input}],showTime:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class DialogSelectDataLabelsContent{_activeModal;_fb;title="";subtitle="";data;showArraySubData;form;dialogData=[];constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.getKeys()}getKeys(){let t=Object.keys(this.data),e="";t.filter(t=>"_id"!==t&&!t.startsWith("id_")&&"__v"!==t&&"createdAt"!==t&&"updatedAt"!==t).forEach(t=>{if(e=typeof this.data[t],"object"===e)if(Array.isArray(this.data[t])){if(e="array",this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,selected:!0,type:e,subLabel:null,subData:null,subtype:null}),!0===this.showArraySubData){Object.keys(this.data[t][0]).filter(t=>"_id"!==t&&!t.startsWith("id_")).forEach(n=>{this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),subLabel:n.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,type:e,subData:n,selected:!0,subtype:typeof n})})}}else{let n=Object.keys(this.data[t]);n.length?n.filter(t=>"_id"!==t&&!t.startsWith("id_")).forEach(n=>{this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),subLabel:n.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,subData:n,subtype:null,selected:!0,type:e})}):this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,selected:!0,type:e,subData:null,subLabel:null,subtype:null})}else this.dialogData.push({label:t.replace(new RegExp("_","g")," ").replace("string","").replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1).toLowerCase()}),data:t,selected:!0,type:e,subData:null,subLabel:null,subtype:null})})}changeSelected(t){t.selected=!t.selected,"array"===t.type&&null===t.subtype&&this.dialogData.filter(e=>e.label===t.label).forEach(e=>{e.selected=t.selected})}submit(){return this.dialogData}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDataLabelsContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectDataLabelsContent,isStandalone:!1,selector:"resolveio-dialog.select-data-labels",inputs:{title:"title",subtitle:"subtitle",data:"data",showArraySubData:"showArraySubData"},ngImport:i0,template:'\n\t\t<div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.75em" aria-hidden="true"></i> {{ title }} - {{ subtitle }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-12">\n\t\t @for (label of dialogData; track label.label) {\n\t\t <div class="row">\n\t\t @if (label.subtype === null && label.type !== \'object\') {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel === null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(dialogData)">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t',isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectDataLabelsContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-data-labels",template:'\n\t\t<div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.75em" aria-hidden="true"></i> {{ title }} - {{ subtitle }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t</div>\n\t\t<div class="modal-body">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-12">\n\t\t @for (label of dialogData; track label.label) {\n\t\t <div class="row">\n\t\t @if (label.subtype === null && label.type !== \'object\') {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype === null && label.type === \'object\' && label.subLabel === null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.label }}\n\t\t </div>\n\t\t }\n\t\t @if (label.subtype !== null) {\n\t\t <div style="font-size: 12px;">\n\t\t <input type="checkbox" [checked]="label.selected" (click)="changeSelected(label)" style="height: 20px; width: auto;"> {{ label.subLabel }}\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(dialogData)">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{title:[{type:Input}],subtitle:[{type:Input}],data:[{type:Input}],showArraySubData:[{type:Input}]}});class DialogLoginContent{_activeModal;_fb;msAllowed=!1;showLoginText=!0;publicProgram=!1;usernameInput;form;publicForm;publicRegisterForm;publicMode="login";loginTab="customer";focusTimeout=null;constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.form=this._fb.group({username:["",[Validators.required]],password:["",[Validators.required]],forgotPassword:[!1]}),this.publicForm=this._fb.group({email:["",[Validators.required,Validators.email]],password:["",[Validators.required]]}),this.publicRegisterForm=this._fb.group({companyName:["",[Validators.required]],contactName:[""],email:["",[Validators.required,Validators.email]],password:["",[Validators.required]],confirmPassword:["",[Validators.required]],phone:[""]})}ngAfterViewInit(){this.queueUsernameFocus()}ngOnDestroy(){this.focusTimeout&&(clearTimeout(this.focusTimeout),this.focusTimeout=null)}queueUsernameFocus(){this.focusTimeout=setTimeout(()=>{this.focusTimeout=null,this.usernameInput?.nativeElement?.focus()})}setPublicMode(t){this.publicMode=t}setLoginTab(t){this.loginTab=t,"employee"===t&&this.queueUsernameFocus()}submitPublicLogin(){this.publicForm.invalid?this.publicForm.markAllAsTouched():this._activeModal.close({form:this.publicForm,type:"PUBLIC_LOGIN"})}submitPublicRegister(){this.publicRegisterForm.invalid?this.publicRegisterForm.markAllAsTouched():this.publicRegisterForm.value.password===this.publicRegisterForm.value.confirmPassword?this._activeModal.close({form:this.publicRegisterForm,type:"PUBLIC_REGISTER"}):this.publicRegisterForm.controls.confirmPassword.setErrors({mismatch:!0})}toggleForgotPassword(){this.form.controls.forgotPassword.setValue(!this.form.controls.forgotPassword.value),this.form.controls.forgotPassword.value?(this.form.controls.password.setValue(""),this.form.controls.password.clearValidators(),this.form.controls.password.disable()):(this.form.controls.password.setValidators([Validators.required]),this.form.controls.password.enable()),this.form.controls.password.updateValueAndValidity()}close(t){this._activeModal.close({form:this.form,type:t})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogLoginContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogLoginContent,isStandalone:!1,selector:"resolveio-dialog.login",inputs:{msAllowed:"msAllowed",showLoginText:"showLoginText",publicProgram:"publicProgram"},viewQueries:[{propertyName:"usernameInput",first:!0,predicate:["usernameInput"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t .login-modal {\n\t\t font-family: "Sora", "Space Grotesk", "Segoe UI", Arial, sans-serif;\n\t\t color: #0f172a;\n\t\t }\n\n\t\t .login-modal .modal-body {\n\t\t background: #ffffff;\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-body {\n\t\t position: relative;\n\t\t display: flex;\n\t\t justify-content: center;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body .row {\n\t\t --bs-gutter-x: 0;\n\t\t --bs-gutter-y: 0;\n\t\t margin: 0;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body [class^="col-"],\n\t\t .login-body [class*=" col-"] {\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-card {\n\t\t margin-bottom: 0;\n\t\t padding: 18px;\n\t\t border-radius: 16px;\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);\n\t\t width: 100%;\n\t\t position: relative;\n\t\t }\n\n\t\t .login-close {\n\t\t position: absolute;\n\t\t top: 12px;\n\t\t right: 12px;\n\t\t width: 44px;\n\t\t height: 44px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t border-radius: 12px;\n\t\t background: rgba(15, 23, 42, 0.04);\n\t\t color: #0f172a;\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t line-height: 1;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;\n\t\t }\n\n\t\t .login-close:hover {\n\t\t background: #0f172a;\n\t\t color: #ffffff;\n\t\t transform: translateY(-1px) scale(1.02);\n\t\t box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);\n\t\t }\n\n\t\t .login-close:active {\n\t\t transform: translateY(0) scale(0.98);\n\t\t box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);\n\t\t }\n\n\t\t .login-close:focus-visible {\n\t\t outline: none;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t }\n\n\t\t .login-header {\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t color: #0f172a;\n\t\t margin-bottom: 12px;\n\t\t text-align: center;\n\t\t background: linear-gradient(120deg, #0f172a, #2563eb);\n\t\t -webkit-background-clip: text;\n\t\t background-clip: text;\n\t\t -webkit-text-fill-color: transparent;\n\t\t }\n\n\t\t .login-toggle,\n\t\t .public-toggle {\n\t\t display: inline-flex;\n\t\t gap: 6px;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t padding: 6px;\n\t\t border-radius: 999px;\n\t\t background: #f1f5f9;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t margin: 0 auto 16px;\n\t\t }\n\n\t\t .login-tab-row {\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: space-between;\n\t\t gap: 12px;\n\t\t flex-wrap: wrap;\n\t\t margin-bottom: 12px;\n\t\t }\n\n\t\t .login-tab-row .login-header {\n\t\t margin-bottom: 0;\n\t\t text-align: center;\n\t\t flex: 1;\n\t\t }\n\n\t\t .login-subtoggle {\n\t\t display: flex;\n\t\t justify-content: flex-start;\n\t\t }\n\n\t\t .login-subtoggle .public-toggle {\n\t\t margin: 0 0 16px;\n\t\t }\n\n\t\t .login-toggle .btn,\n\t\t .public-toggle .btn {\n\t\t border-radius: 999px;\n\t\t font-weight: 600;\n\t\t padding: 6px 16px;\n\t\t border: 1px solid transparent;\n\t\t }\n\n\t\t .login-toggle .btn-outline-secondary,\n\t\t .public-toggle .btn-outline-secondary {\n\t\t color: #475569;\n\t\t border-color: rgba(71, 85, 105, 0.35);\n\t\t background: transparent;\n\t\t }\n\n\t\t .login-toggle .btn-primary,\n\t\t .public-toggle .btn-primary {\n\t\t background: linear-gradient(135deg, #2563eb, #38bdf8);\n\t\t border-color: transparent;\n\t\t box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .loginform {\n\t\t margin-top: 10px;\n\t\t }\n\n\t\t .loginform label,\n\t\t .third-party-login-section label {\n\t\t font-size: 13px;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.4px;\n\t\t text-transform: uppercase;\n\t\t color: #475569;\n\t\t }\n\n\t\t .login-modal .form-control {\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #0f172a;\n\t\t height: 48px;\n\t\t border-radius: 12px;\n\t\t padding: 0 14px;\n\t\t }\n\n\t\t .login-modal .form-control::placeholder {\n\t\t color: rgba(15, 23, 42, 0.5);\n\t\t }\n\n\t\t .login-modal .form-control:focus {\n\t\t border-color: #2563eb;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .login-modal .form-control.is-invalid {\n\t\t border-color: rgba(239, 68, 68, 0.8);\n\t\t box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);\n\t\t }\n\n\t\t .employee-login-btn,\n\t\t .third-party-login-btn {\n\t\t width: 100%;\n\t\t border-radius: 12px;\n\t\t height: 46px;\n\t\t border: none;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.3px;\n\t\t }\n\n\t\t .employee-login-btn {\n\t\t background: linear-gradient(135deg, #2563eb, #22d3ee);\n\t\t color: #ffffff;\n\t\t }\n\n\t\t .third-party-login-btn {\n\t\t background: linear-gradient(135deg, #22c55e, #16a34a);\n\t\t color: #ffffff;\n\t\t margin-top: 12px;\n\t\t }\n\n\t\t .disabled-btn {\n\t\t background: rgba(15, 23, 42, 0.05);\n\t\t color: rgba(15, 23, 42, 0.45);\n\t\t border: 1px dashed rgba(15, 23, 42, 0.2);\n\t\t cursor: not-allowed;\n\t\t }\n\n\t\t .third-party-login-section {\n\t\t background: #f8fafc;\n\t\t border-radius: 14px;\n\t\t padding: 16px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .employee-login-section,\n\t\t .third-party-login-section {\n\t\t text-align: center;\n\t\t }\n\n\t\t .public-section {\n\t\t padding: 8px;\n\t\t }\n\n\t\t .contactimg {\n\t\t position: relative;\n\t\t border-radius: 16px;\n\t\t overflow: hidden;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .contactimg::after {\n\t\t content: "";\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t background: linear-gradient(160deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.35));\n\t\t }\n\n\t\t .contactimg > img {\n\t\t width: 100%;\n\t\t display: block;\n\t\t filter: saturate(1.1);\n\t\t }\n\n\t\t .textbox {\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t text-align: center;\n\t\t color: #ffffff;\n\t\t padding: 30px;\n\t\t z-index: 1;\n\t\t }\n\n\t\t .login-logo {\n\t\t margin-bottom: 20px;\n\t\t }\n\n\t\t .form-check a {\n\t\t color: #2563eb;\n\t\t text-decoration: none;\n\t\t }\n\n\t\t .form-check a:hover {\n\t\t color: #1d4ed8;\n\t\t text-decoration: underline;\n\t\t }\n\n\t\t .login-modal .btn-secondary {\n\t\t background: transparent;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #475569;\n\t\t border-radius: 10px;\n\t\t }\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate class="login-modal">\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t @if (publicProgram) {\n\t\t <div class="login-body">\n\t\t <div class="row g-4">\n\t\t <div class="col-12">\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <div class="login-tab-row">\n\t\t <div class="login-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'customer\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'customer\')">Customer</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'employee\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'employee\')">Employee</button>\n\t\t </div>\n\t\t <h3 class="login-header">{{ loginTab === \'customer\' ? \'Customer Access\' : \'Employee Sign In\' }}</h3>\n\t\t </div>\n\t\t @if (loginTab === \'customer\') {\n\t\t <div class="login-subtoggle">\n\t\t <div class="public-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'login\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'login\')">Sign in</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'register\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'register\')">Create account</button>\n\t\t </div>\n\t\t </div>\n\t\t @if (publicMode === \'login\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicForm">\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Your password" autocomplete="current-password">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicLogin()">Sign in</button>\n\t\t <button type="button" class="btn third-party-login-btn disabled-btn" disabled>Google sign-in (coming soon)</button>\n\t\t </div>\n\t\t }\n\t\t @if (publicMode === \'register\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicRegisterForm">\n\t\t <div class="form-group">\n\t\t <label>Company name</label>\n\t\t @if (publicRegisterForm.controls.companyName.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" [ngClass]="[\'form-control\', publicRegisterForm.controls.companyName.valid ? \'is-valid\' : \'is-invalid\']" formControlName="companyName" placeholder="Your company name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Contact name</label>\n\t\t <input type="text" class="form-control" formControlName="contactName" placeholder="Your name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicRegisterForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicRegisterForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicRegisterForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Create a password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Confirm password</label>\n\t\t @if (publicRegisterForm.controls.confirmPassword.hasError(\'mismatch\')) {\n\t\t <em>- Passwords must match</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.confirmPassword.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirmPassword" placeholder="Confirm password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone (optional)</label>\n\t\t <input type="text" class="form-control" formControlName="phone" placeholder="Phone number">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicRegister()">Create account</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t @if (loginTab === \'employee\') {\n\t\t @if (msAllowed) {\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t }\n\t\t @if (!msAllowed) {\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @else {\n\t\t <div class="login-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t @if (showLoginText) {\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="loginform" style="margin: 0px;">\n\t\t @if (!msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee/Customer Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @if (msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee Login</h3>\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t </div>\n\t\t <div class="login-card">\n\t\t <h3 class="login-header">Third Party Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t</form>\n\t\t',isInline:!0,styles:['.login-modal{font-family:Sora,Space Grotesk,Segoe UI,Arial,sans-serif;color:#0f172a}.login-modal .modal-body{background:#fff;padding:0}.login-body{position:relative;display:flex;justify-content:center;width:100%}.login-body .row{--bs-gutter-x: 0;--bs-gutter-y: 0;margin:0;width:100%}.login-body [class^=col-],.login-body [class*=" col-"]{padding:0}.login-card{margin-bottom:0;padding:18px;border-radius:16px;background:#fff;border:1px solid rgba(15,23,42,.08);box-shadow:0 12px 28px #0f172a1a;width:100%;position:relative}.login-close{position:absolute;top:12px;right:12px;width:44px;height:44px;border:1px solid rgba(15,23,42,.08);border-radius:12px;background:#0f172a0a;color:#0f172a;font-size:22px;font-weight:600;line-height:1;display:flex;align-items:center;justify-content:center;box-shadow:0 6px 18px #0f172a1f;transition:transform .18s ease,box-shadow .18s ease,background .18s ease,color .18s ease}.login-close:hover{background:#0f172a;color:#fff;transform:translateY(-1px) scale(1.02);box-shadow:0 10px 22px #0f172a33}.login-close:active{transform:translateY(0) scale(.98);box-shadow:0 4px 12px #0f172a29}.login-close:focus-visible{outline:none;box-shadow:0 0 0 3px #2563eb59,0 6px 18px #0f172a1f}.login-header{font-size:22px;font-weight:600;color:#0f172a;margin-bottom:12px;text-align:center;background:linear-gradient(120deg,#0f172a,#2563eb);-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent}.login-toggle,.public-toggle{display:inline-flex;gap:6px;align-items:center;justify-content:center;padding:6px;border-radius:999px;background:#f1f5f9;border:1px solid rgba(15,23,42,.08);margin:0 auto 16px}.login-tab-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}.login-tab-row .login-header{margin-bottom:0;text-align:center;flex:1}.login-subtoggle{display:flex;justify-content:flex-start}.login-subtoggle .public-toggle{margin:0 0 16px}.login-toggle .btn,.public-toggle .btn{border-radius:999px;font-weight:600;padding:6px 16px;border:1px solid transparent}.login-toggle .btn-outline-secondary,.public-toggle .btn-outline-secondary{color:#475569;border-color:#47556959;background:transparent}.login-toggle .btn-primary,.public-toggle .btn-primary{background:linear-gradient(135deg,#2563eb,#38bdf8);border-color:transparent;box-shadow:0 10px 20px #2563eb33}.loginform{margin-top:10px}.loginform label,.third-party-login-section label{font-size:13px;font-weight:600;letter-spacing:.4px;text-transform:uppercase;color:#475569}.login-modal .form-control{background:#fff;border:1px solid rgba(71,85,105,.35);color:#0f172a;height:48px;border-radius:12px;padding:0 14px}.login-modal .form-control::placeholder{color:#0f172a80}.login-modal .form-control:focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb33}.login-modal .form-control.is-invalid{border-color:#ef4444cc;box-shadow:0 0 0 2px #ef444426}.employee-login-btn,.third-party-login-btn{width:100%;border-radius:12px;height:46px;border:none;font-weight:600;letter-spacing:.3px}.employee-login-btn{background:linear-gradient(135deg,#2563eb,#22d3ee);color:#fff}.third-party-login-btn{background:linear-gradient(135deg,#22c55e,#16a34a);color:#fff;margin-top:12px}.disabled-btn{background:#0f172a0d;color:#0f172a73;border:1px dashed rgba(15,23,42,.2);cursor:not-allowed}.third-party-login-section{background:#f8fafc;border-radius:14px;padding:16px;border:1px solid rgba(15,23,42,.08)}.employee-login-section,.third-party-login-section{text-align:center}.public-section{padding:8px}.contactimg{position:relative;border-radius:16px;overflow:hidden;border:1px solid rgba(15,23,42,.08)}.contactimg:after{content:"";position:absolute;inset:0;background:linear-gradient(160deg,#0f172a0d,#0f172a59)}.contactimg>img{width:100%;display:block;filter:saturate(1.1)}.textbox{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;color:#fff;padding:30px;z-index:1}.login-logo{margin-bottom:20px}.form-check a{color:#2563eb;text-decoration:none}.form-check a:hover{color:#1d4ed8;text-decoration:underline}.login-modal .btn-secondary{background:transparent;border:1px solid rgba(71,85,105,.35);color:#475569;border-radius:10px}\n'],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogLoginContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.login",template:'\n\t\t<style>\n\t\t .login-modal {\n\t\t font-family: "Sora", "Space Grotesk", "Segoe UI", Arial, sans-serif;\n\t\t color: #0f172a;\n\t\t }\n\n\t\t .login-modal .modal-body {\n\t\t background: #ffffff;\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-body {\n\t\t position: relative;\n\t\t display: flex;\n\t\t justify-content: center;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body .row {\n\t\t --bs-gutter-x: 0;\n\t\t --bs-gutter-y: 0;\n\t\t margin: 0;\n\t\t width: 100%;\n\t\t }\n\n\t\t .login-body [class^="col-"],\n\t\t .login-body [class*=" col-"] {\n\t\t padding: 0;\n\t\t }\n\n\t\t .login-card {\n\t\t margin-bottom: 0;\n\t\t padding: 18px;\n\t\t border-radius: 16px;\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);\n\t\t width: 100%;\n\t\t position: relative;\n\t\t }\n\n\t\t .login-close {\n\t\t position: absolute;\n\t\t top: 12px;\n\t\t right: 12px;\n\t\t width: 44px;\n\t\t height: 44px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t border-radius: 12px;\n\t\t background: rgba(15, 23, 42, 0.04);\n\t\t color: #0f172a;\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t line-height: 1;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;\n\t\t }\n\n\t\t .login-close:hover {\n\t\t background: #0f172a;\n\t\t color: #ffffff;\n\t\t transform: translateY(-1px) scale(1.02);\n\t\t box-shadow: 0 10px 22px rgba(15, 23, 42, 0.2);\n\t\t }\n\n\t\t .login-close:active {\n\t\t transform: translateY(0) scale(0.98);\n\t\t box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);\n\t\t }\n\n\t\t .login-close:focus-visible {\n\t\t outline: none;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 6px 18px rgba(15, 23, 42, 0.12);\n\t\t }\n\n\t\t .login-header {\n\t\t font-size: 22px;\n\t\t font-weight: 600;\n\t\t color: #0f172a;\n\t\t margin-bottom: 12px;\n\t\t text-align: center;\n\t\t background: linear-gradient(120deg, #0f172a, #2563eb);\n\t\t -webkit-background-clip: text;\n\t\t background-clip: text;\n\t\t -webkit-text-fill-color: transparent;\n\t\t }\n\n\t\t .login-toggle,\n\t\t .public-toggle {\n\t\t display: inline-flex;\n\t\t gap: 6px;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t padding: 6px;\n\t\t border-radius: 999px;\n\t\t background: #f1f5f9;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t margin: 0 auto 16px;\n\t\t }\n\n\t\t .login-tab-row {\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: space-between;\n\t\t gap: 12px;\n\t\t flex-wrap: wrap;\n\t\t margin-bottom: 12px;\n\t\t }\n\n\t\t .login-tab-row .login-header {\n\t\t margin-bottom: 0;\n\t\t text-align: center;\n\t\t flex: 1;\n\t\t }\n\n\t\t .login-subtoggle {\n\t\t display: flex;\n\t\t justify-content: flex-start;\n\t\t }\n\n\t\t .login-subtoggle .public-toggle {\n\t\t margin: 0 0 16px;\n\t\t }\n\n\t\t .login-toggle .btn,\n\t\t .public-toggle .btn {\n\t\t border-radius: 999px;\n\t\t font-weight: 600;\n\t\t padding: 6px 16px;\n\t\t border: 1px solid transparent;\n\t\t }\n\n\t\t .login-toggle .btn-outline-secondary,\n\t\t .public-toggle .btn-outline-secondary {\n\t\t color: #475569;\n\t\t border-color: rgba(71, 85, 105, 0.35);\n\t\t background: transparent;\n\t\t }\n\n\t\t .login-toggle .btn-primary,\n\t\t .public-toggle .btn-primary {\n\t\t background: linear-gradient(135deg, #2563eb, #38bdf8);\n\t\t border-color: transparent;\n\t\t box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .loginform {\n\t\t margin-top: 10px;\n\t\t }\n\n\t\t .loginform label,\n\t\t .third-party-login-section label {\n\t\t font-size: 13px;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.4px;\n\t\t text-transform: uppercase;\n\t\t color: #475569;\n\t\t }\n\n\t\t .login-modal .form-control {\n\t\t background: #ffffff;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #0f172a;\n\t\t height: 48px;\n\t\t border-radius: 12px;\n\t\t padding: 0 14px;\n\t\t }\n\n\t\t .login-modal .form-control::placeholder {\n\t\t color: rgba(15, 23, 42, 0.5);\n\t\t }\n\n\t\t .login-modal .form-control:focus {\n\t\t border-color: #2563eb;\n\t\t box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);\n\t\t }\n\n\t\t .login-modal .form-control.is-invalid {\n\t\t border-color: rgba(239, 68, 68, 0.8);\n\t\t box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);\n\t\t }\n\n\t\t .employee-login-btn,\n\t\t .third-party-login-btn {\n\t\t width: 100%;\n\t\t border-radius: 12px;\n\t\t height: 46px;\n\t\t border: none;\n\t\t font-weight: 600;\n\t\t letter-spacing: 0.3px;\n\t\t }\n\n\t\t .employee-login-btn {\n\t\t background: linear-gradient(135deg, #2563eb, #22d3ee);\n\t\t color: #ffffff;\n\t\t }\n\n\t\t .third-party-login-btn {\n\t\t background: linear-gradient(135deg, #22c55e, #16a34a);\n\t\t color: #ffffff;\n\t\t margin-top: 12px;\n\t\t }\n\n\t\t .disabled-btn {\n\t\t background: rgba(15, 23, 42, 0.05);\n\t\t color: rgba(15, 23, 42, 0.45);\n\t\t border: 1px dashed rgba(15, 23, 42, 0.2);\n\t\t cursor: not-allowed;\n\t\t }\n\n\t\t .third-party-login-section {\n\t\t background: #f8fafc;\n\t\t border-radius: 14px;\n\t\t padding: 16px;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .employee-login-section,\n\t\t .third-party-login-section {\n\t\t text-align: center;\n\t\t }\n\n\t\t .public-section {\n\t\t padding: 8px;\n\t\t }\n\n\t\t .contactimg {\n\t\t position: relative;\n\t\t border-radius: 16px;\n\t\t overflow: hidden;\n\t\t border: 1px solid rgba(15, 23, 42, 0.08);\n\t\t }\n\n\t\t .contactimg::after {\n\t\t content: "";\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t background: linear-gradient(160deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0.35));\n\t\t }\n\n\t\t .contactimg > img {\n\t\t width: 100%;\n\t\t display: block;\n\t\t filter: saturate(1.1);\n\t\t }\n\n\t\t .textbox {\n\t\t position: absolute;\n\t\t inset: 0;\n\t\t display: flex;\n\t\t align-items: center;\n\t\t justify-content: center;\n\t\t text-align: center;\n\t\t color: #ffffff;\n\t\t padding: 30px;\n\t\t z-index: 1;\n\t\t }\n\n\t\t .login-logo {\n\t\t margin-bottom: 20px;\n\t\t }\n\n\t\t .form-check a {\n\t\t color: #2563eb;\n\t\t text-decoration: none;\n\t\t }\n\n\t\t .form-check a:hover {\n\t\t color: #1d4ed8;\n\t\t text-decoration: underline;\n\t\t }\n\n\t\t .login-modal .btn-secondary {\n\t\t background: transparent;\n\t\t border: 1px solid rgba(71, 85, 105, 0.35);\n\t\t color: #475569;\n\t\t border-radius: 10px;\n\t\t }\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate class="login-modal">\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t @if (publicProgram) {\n\t\t <div class="login-body">\n\t\t <div class="row g-4">\n\t\t <div class="col-12">\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <div class="login-tab-row">\n\t\t <div class="login-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'customer\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'customer\')">Customer</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="loginTab === \'employee\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setLoginTab(\'employee\')">Employee</button>\n\t\t </div>\n\t\t <h3 class="login-header">{{ loginTab === \'customer\' ? \'Customer Access\' : \'Employee Sign In\' }}</h3>\n\t\t </div>\n\t\t @if (loginTab === \'customer\') {\n\t\t <div class="login-subtoggle">\n\t\t <div class="public-toggle">\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'login\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'login\')">Sign in</button>\n\t\t <button type="button" class="btn btn-sm" [ngClass]="publicMode === \'register\' ? \'btn-primary\' : \'btn-outline-secondary\'" (click)="setPublicMode(\'register\')">Create account</button>\n\t\t </div>\n\t\t </div>\n\t\t @if (publicMode === \'login\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicForm">\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Your password" autocomplete="current-password">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicLogin()">Sign in</button>\n\t\t <button type="button" class="btn third-party-login-btn disabled-btn" disabled>Google sign-in (coming soon)</button>\n\t\t </div>\n\t\t }\n\t\t @if (publicMode === \'register\') {\n\t\t <div class="third-party-login-section public-section" [formGroup]="publicRegisterForm">\n\t\t <div class="form-group">\n\t\t <label>Company name</label>\n\t\t @if (publicRegisterForm.controls.companyName.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" [ngClass]="[\'form-control\', publicRegisterForm.controls.companyName.valid ? \'is-valid\' : \'is-invalid\']" formControlName="companyName" placeholder="Your company name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Contact name</label>\n\t\t <input type="text" class="form-control" formControlName="contactName" placeholder="Your name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (publicRegisterForm.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" [ngClass]="[\'form-control\', publicRegisterForm.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="you@company.com" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (publicRegisterForm.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" placeholder="Create a password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Confirm password</label>\n\t\t @if (publicRegisterForm.controls.confirmPassword.hasError(\'mismatch\')) {\n\t\t <em>- Passwords must match</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', publicRegisterForm.controls.confirmPassword.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirmPassword" placeholder="Confirm password" autocomplete="new-password">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone (optional)</label>\n\t\t <input type="text" class="form-control" formControlName="phone" placeholder="Phone number">\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="submitPublicRegister()">Create account</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t @if (loginTab === \'employee\') {\n\t\t @if (msAllowed) {\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t }\n\t\t @if (!msAllowed) {\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t }\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @else {\n\t\t <div class="login-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t @if (showLoginText) {\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="loginform" style="margin: 0px;">\n\t\t @if (!msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee/Customer Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t @if (msAllowed) {\n\t\t <div class="login-card">\n\t\t <button type="button" class="login-close" aria-label="Close" (click)="_activeModal.dismiss()">×</button>\n\t\t <h3 class="login-header">Employee Login</h3>\n\t\t <div class="employee-login-section">\n\t\t <button type="submit" class="btn employee-login-btn" (click)="close(\'MS\')">Employee Login</button>\n\t\t </div>\n\t\t </div>\n\t\t <div class="login-card">\n\t\t <h3 class="login-header">Third Party Login</h3>\n\t\t <div class="third-party-login-section">\n\t\t <div class="form-group">\n\t\t <label>Username/Email</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input #usernameInput type="email" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" aria-describedby="emailHelp" placeholder="Your Username/Email" autocomplete="username">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Password</label>\n\t\t @if (form.controls.password.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="password" [ngClass]="[\'form-control\', form.controls.password.enabled ? (form.controls.password.valid ? \'is-valid\' : \'is-invalid\') : \'\']" formControlName="password" placeholder="Your Password" autocomplete="current-password">\n\t\t </div>\n\t\t <div class="form-check text-right">\n\t\t <label class="form-check-label"><a href="javascript:void(0)" (click)="toggleForgotPassword()"> {{!form.controls.forgotPassword.value ? \'Forgot Password?\' : \'Enter Password\'}} </a></label>\n\t\t </div>\n\t\t <button type="submit" class="btn third-party-login-btn" (click)="close(\'ResolveIO\')">{{!form.controls.forgotPassword.value ? \'Login\' : \'Submit\'}}</button>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t }\n\t\t</form>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}],propDecorators:{msAllowed:[{type:Input}],showLoginText:[{type:Input}],publicProgram:[{type:Input}],usernameInput:[{type:ViewChild,args:["usernameInput"]}]}});class ResponsiveButtonGroupComponent extends BaseComponent{_cdRef;_resizeService;_services;collapseSize=900;windowSize=window.innerWidth;windowSizeSubscription=null;constructor(t,e,n){super(n),this._cdRef=t,this._resizeService=e,this._services=n}ngOnInit(){this.windowSizeSubscription=this._resizeService.onResize$.subscribe(t=>{t&&(this.windowSize=t.innerWidth,this._cdRef.detectChanges())})}ngOnDestroy(){this.windowSizeSubscription.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupComponent,deps:[{token:i0.ChangeDetectorRef},{token:ResizeService},{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:ResponsiveButtonGroupComponent,isStandalone:!1,selector:"responsive-button-group",inputs:{collapseSize:"collapseSize"},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"<style>\n\t@media screen and (min-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: inline-flex !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup button {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup a {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\t}\n\n\t@media screen and (max-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: inherit !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup button {\n\t\t\tmargin-top: 5px !important;\n\t\t\twidth: 100% !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup a {\n\t\t\tmargin-top: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n</style>\n\n<div [ngClass]=\"windowSize <= collapseSize ? ['btn-group-vertical', 'xsBtnGroup'] : ['btn-group', 'lgBtnGroup']\">\n\t<ng-content></ng-content>\n</div>\n",styles:["@media screen and (min-width:900px){:host ::ng-deep .xsBtnGroup{display:none!important}:host ::ng-deep .lgBtnGroup{display:inline-flex!important}:host ::ng-deep .lgBtnGroup button{margin-left:5px!important}:host ::ng-deep .lgBtnGroup a{margin-left:5px!important}}@media screen and (max-width:900px){:host ::ng-deep .xsBtnGroup{display:inherit!important}:host ::ng-deep .xsBtnGroup button{margin-top:5px!important;width:100%!important}:host ::ng-deep .xsBtnGroup a{margin-top:5px!important}:host ::ng-deep .lgBtnGroup{display:none!important}}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"responsive-button-group",standalone:!1,template:"<style>\n\t@media screen and (min-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: inline-flex !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup button {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup a {\n\t\t\tmargin-left: 5px !important;\n\t\t}\n\t}\n\n\t@media screen and (max-width: 900px) {\n\t\t:host ::ng-deep .xsBtnGroup {\n\t\t\tdisplay: inherit !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup button {\n\t\t\tmargin-top: 5px !important;\n\t\t\twidth: 100% !important;\n\t\t}\n\n\t\t:host ::ng-deep .xsBtnGroup a {\n\t\t\tmargin-top: 5px !important;\n\t\t}\n\n\t\t:host ::ng-deep .lgBtnGroup {\n\t\t\tdisplay: none !important;\n\t\t}\n\t}\n</style>\n\n<div [ngClass]=\"windowSize <= collapseSize ? ['btn-group-vertical', 'xsBtnGroup'] : ['btn-group', 'lgBtnGroup']\">\n\t<ng-content></ng-content>\n</div>\n"}]}],ctorParameters:()=>[{type:i0.ChangeDetectorRef},{type:ResizeService},{type:ProviderService}],propDecorators:{collapseSize:[{type:Input}]}});class DialogRegisterContent{_activeModal;_fb;form;constructor(t,e){this._activeModal=t,this._fb=e}ngOnInit(){this.form=this._fb.group({username:["",[Validators.required]],name:["",[Validators.required]],phone:["",[Validators.required]],company:["",[Validators.required]],email:["",[Validators.required]]})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogRegisterContent,deps:[{token:i1$2.NgbActiveModal},{token:i2.FormBuilder}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogRegisterContent,isStandalone:!1,selector:"resolveio-dialog.register",ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table {\n\t\t width: 100%;\n\t\t}\n\t\t\n\t\t.navbar-light .navbar-nav .active>.nav-link, .navbar-light .navbar-nav .nav-link.active, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .show>.nav-link {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.navbar-light .navbar-nav .nav-link {\n\t\tcolor:#333;\n\t\t}\n\t\ta.nav-link.loginreg {\n\t\tbackground-color: #0b4499;\n\t\tcolor: #fff !important;\n\t\tborder-radius: 40px;\n\t\t}\n\t\ta.nav-link.loginreg:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t.nav-link {\n\t\tcolor: #333333;\n\t\tfont-size: 150%\n\t\t}\n\t\t.nav-item a.nav-link.active {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.contactimg>img{\n\t\twidth: 100%;\n\t\t}\n\t\t\n\t\t.log-box {\n\t\tpadding-top: 26px;\n\t\tpadding-bottom: 26px;\n\t\t}\n\t\t.loginform .form-control, .register-form .form-control {\n\t\tcolor: #000;\n\t\theight: 52px;\n\t\t}\n\t\t.loginform {\n\t\tmargin-top: 35px;\n\t\t}\n\t\t.loginform label {\n\t\tfont-size: 18px;\n\t\tfont-weight: 600;\n\t\t}\n\t\t\n\t\t.loginbtn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 44px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\t.contactimg {\n\t\tposition: relative;\n\t\t}\n\t\t.login-logo {\n\t\tmargin-bottom: 20px;\n\t\t}\n\t\t\n\t\t.textbox {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tcolor: #fff;\n\t\tpadding: 40px;\n\t\ttransform: translate(0%, -50%);\n\t\ttext-align: center;\n\t\t}\n\t\t.sign-btn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 14px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\tbutton.btn.sign-btn:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate (ngSubmit)="_activeModal.close(form)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> Register</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row bg-white">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="register-form">\n\t\t <div class="form-group">\n\t\t <label>User Name</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" [focus]="true" aria-describedby="emailHelp" placeholder="User Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Full Name</label>\n\t\t @if (form.controls.name.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.name.valid ? \'is-valid\' : \'is-invalid\']" formControlName="name" aria-describedby="emailHelp" placeholder="Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone Number</label>\n\t\t @if (form.controls.phone.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.phone.valid ? \'is-valid\' : \'is-invalid\']" formControlName="phone" placeholder="Phone Number">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Company</label>\n\t\t @if (form.controls.company.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.company.valid ? \'is-valid\' : \'is-invalid\']" formControlName="company" placeholder="Company Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (form.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" class="form-control" [ngClass]="[\'form-control\', form.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="Email">\n\t\t </div>\n\t\t <button type="submit" class="btn sign-btn">Signup</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t <div class="modal-footer">\n\t\t <responsive-button-group>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </responsive-button-group>\n\t\t </div>\n\t\t</form>\n\t\t',isInline:!0,styles:["collapse-table{width:100%}.navbar-light .navbar-nav .active>.nav-link,.navbar-light .navbar-nav .nav-link.active,.navbar-light .navbar-nav .nav-link.show,.navbar-light .navbar-nav .show>.nav-link{color:#0b4499}.navbar-light .navbar-nav .nav-link{color:#333}a.nav-link.loginreg{background-color:#0b4499;color:#fff!important;border-radius:40px}a.nav-link.loginreg:hover{background:#1668e2}.nav-link{color:#333;font-size:150%}.nav-item a.nav-link.active{color:#0b4499}.contactimg>img{width:100%}.log-box{padding-top:26px;padding-bottom:26px}.loginform .form-control,.register-form .form-control{color:#000;height:52px}.loginform{margin-top:35px}.loginform label{font-size:18px;font-weight:600}.loginbtn{background:#0b4499;width:100%;margin-top:44px;height:52px;font-size:22px;border-radius:2px;color:#fff!important}.contactimg{position:relative}.login-logo{margin-bottom:20px}.textbox{position:absolute;top:50%;color:#fff;padding:40px;transform:translateY(-50%);text-align:center}.sign-btn{background:#0b4499;width:100%;margin-top:14px;height:52px;font-size:22px;border-radius:2px;color:#fff!important}button.btn.sign-btn:hover{background:#1668e2}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogRegisterContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.register",template:'\n\t\t<style>\n\t\t collapse-table {\n\t\t width: 100%;\n\t\t}\n\t\t\n\t\t.navbar-light .navbar-nav .active>.nav-link, .navbar-light .navbar-nav .nav-link.active, .navbar-light .navbar-nav .nav-link.show, .navbar-light .navbar-nav .show>.nav-link {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.navbar-light .navbar-nav .nav-link {\n\t\tcolor:#333;\n\t\t}\n\t\ta.nav-link.loginreg {\n\t\tbackground-color: #0b4499;\n\t\tcolor: #fff !important;\n\t\tborder-radius: 40px;\n\t\t}\n\t\ta.nav-link.loginreg:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t.nav-link {\n\t\tcolor: #333333;\n\t\tfont-size: 150%\n\t\t}\n\t\t.nav-item a.nav-link.active {\n\t\tcolor: #0b4499;\n\t\t}\n\t\t.contactimg>img{\n\t\twidth: 100%;\n\t\t}\n\t\t\n\t\t.log-box {\n\t\tpadding-top: 26px;\n\t\tpadding-bottom: 26px;\n\t\t}\n\t\t.loginform .form-control, .register-form .form-control {\n\t\tcolor: #000;\n\t\theight: 52px;\n\t\t}\n\t\t.loginform {\n\t\tmargin-top: 35px;\n\t\t}\n\t\t.loginform label {\n\t\tfont-size: 18px;\n\t\tfont-weight: 600;\n\t\t}\n\t\t\n\t\t.loginbtn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 44px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\t.contactimg {\n\t\tposition: relative;\n\t\t}\n\t\t.login-logo {\n\t\tmargin-bottom: 20px;\n\t\t}\n\t\t\n\t\t.textbox {\n\t\tposition: absolute;\n\t\ttop: 50%;\n\t\tcolor: #fff;\n\t\tpadding: 40px;\n\t\ttransform: translate(0%, -50%);\n\t\ttext-align: center;\n\t\t}\n\t\t.sign-btn {\n\t\tbackground: #0b4499;\n\t\twidth: 100%;\n\t\tmargin-top: 14px;\n\t\theight: 52px;\n\t\tfont-size: 22px;\n\t\tborder-radius: 2px;\n\t\tcolor: #fff !important;\n\t\t}\n\t\t\n\t\tbutton.btn.sign-btn:hover {\n\t\tbackground: #1668e2;\n\t\t}\n\t\t</style>\n\t\t<form [formGroup]="form" novalidate (ngSubmit)="_activeModal.close(form)">\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> Register</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()"></button>\n\t\t </div>\n\t\t @if (form) {\n\t\t <div class="modal-body">\n\t\t <div class="row justify-content-md-center">\n\t\t <div class="col-lg-12">\n\t\t <div class="row bg-white">\n\t\t <div class="col-lg-6">\n\t\t <div class="contactimg">\n\t\t <img src="/assets/images/loginsignup/formimg.jpg" alt="images" class="img-fluid">\n\t\t <div class="textbox">\n\t\t <div class="login-logo"><img src="/assets/images/loginsignup/login-logo.png" alt="images"></div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t <div class="col-lg-6">\n\t\t <div class="log-box">\n\t\t <div class="register-form">\n\t\t <div class="form-group">\n\t\t <label>User Name</label>\n\t\t @if (form.controls.username.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.username.valid ? \'is-valid\' : \'is-invalid\']" formControlName="username" [autofocus]="true" [focus]="true" aria-describedby="emailHelp" placeholder="User Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Full Name</label>\n\t\t @if (form.controls.name.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.name.valid ? \'is-valid\' : \'is-invalid\']" formControlName="name" aria-describedby="emailHelp" placeholder="Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Phone Number</label>\n\t\t @if (form.controls.phone.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.phone.valid ? \'is-valid\' : \'is-invalid\']" formControlName="phone" placeholder="Phone Number">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Company</label>\n\t\t @if (form.controls.company.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="text" class="form-control" [ngClass]="[\'form-control\', form.controls.company.valid ? \'is-valid\' : \'is-invalid\']" formControlName="company" placeholder="Company Name">\n\t\t </div>\n\t\t <div class="form-group">\n\t\t <label>Email</label>\n\t\t @if (form.controls.email.hasError(\'required\')) {\n\t\t <em>- Required</em>\n\t\t }\n\t\t <input type="email" class="form-control" [ngClass]="[\'form-control\', form.controls.email.valid ? \'is-valid\' : \'is-invalid\']" formControlName="email" placeholder="Email">\n\t\t </div>\n\t\t <button type="submit" class="btn sign-btn">Signup</button>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t <div class="modal-footer">\n\t\t <responsive-button-group>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t </responsive-button-group>\n\t\t </div>\n\t\t</form>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i2.FormBuilder}]});class DialogSelectWithButtonsURLContent{_activeModal;_account;url="";close;allElements;title="Select Window Type";selectedType="";options=[{value:"same_tab",text:"Same Tab"},{value:"new_tab",text:"New Tab"},{value:"new_window",text:"New Window"}];constructor(t,e){this._activeModal=t,this._account=e}ngOnInit(){const t=this.resolveRoutingPreference();return"sameTab"===t?(window.open(this.url,"_self"),void this._activeModal.close()):"newTab"===t?(window.open(this.url,"_blank"),void this._activeModal.close()):void("newWindow"===t&&(window.open(this.url,"_blank","toolbar=1,location=1,menubar=1"),this._activeModal.close()))}resolveRoutingPreference(){const t=this._account.getUser()?.settings?.routing_preference;return"sameTab"===t||"newTab"===t||"newWindow"===t?t:"alwaysAsk"}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100)}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}onSelectType(t){this.selectedType=t,this.submit()}submit(){"same_tab"===this.selectedType&&window.open(this.url,"_self"),"new_tab"===this.selectedType&&window.open(this.url,"_blank"),"new_window"===this.selectedType&&window.open(this.url,"_blank","toolbar=1,location=1,menubar=1"),this._activeModal.close()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectWithButtonsURLContent,deps:[{token:i1$2.NgbActiveModal},{token:AccountManagerService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectWithButtonsURLContent,isStandalone:!1,selector:"resolveio-dialog.select-with-buttons-url",inputs:{url:"url"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div class="row">\n\t\t @for (option of options; track option.value) {\n\t\t <div class="col">\n\t\t <button style="width: 100%" type="button" [ngClass]="[\'btn\', selectedType === option.value ? \'btn-success\' : \'btn-warning\']" (click)="onSelectType(option.value)">{{option.text}}</button>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t',isInline:!0,styles:["collapse-table tr:hover{background-color:#add8e6;cursor:pointer}.selected{background-color:#add8e6}collapse-table{width:100%}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectWithButtonsURLContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-with-buttons-url",template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div class="row">\n\t\t @for (option of options; track option.value) {\n\t\t <div class="col">\n\t\t <button style="width: 100%" type="button" [ngClass]="[\'btn\', selectedType === option.value ? \'btn-success\' : \'btn-warning\']" (click)="onSelectType(option.value)">{{option.text}}</button>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:AccountManagerService}],propDecorators:{url:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class CollapseTableComponent{_resizeService;_account;_elementRef;collapseSize;tableFixed=!1;headerFixed=!1;stickyHeaders;secondaryColor=!1;tertiaryColor=!1;windowSize=window.innerWidth;windowSizeSubscription=null;mutationObserver=null;resizeObserver=null;constructor(t,e,n){this._resizeService=t,this._account=e,this._elementRef=n}ngOnInit(){this.windowSizeSubscription=this._resizeService.onResize$.subscribe(t=>{this.windowSize=t.innerWidth,this.updateStickyTopOffset()}),this._account.getUser()&&this._account.getUser().settings&&(document.documentElement.style.setProperty("--primary-table-color",this._account.getUser().settings.table_color),document.documentElement.style.setProperty("--primary-table-font-color",this._account.getUser().settings.table_font_color),document.documentElement.style.setProperty("--font-size",this._account.getUser().settings.font_size+"px"),document.documentElement.style.setProperty("--secondary-table-color",this._account.getUser().settings.secondary_table_color),document.documentElement.style.setProperty("--secondary-table-font-color",this._account.getUser().settings.secondary_table_font_color),document.documentElement.style.setProperty("--tertiary-table-color",this._account.getUser().settings.tertiary_table_color),document.documentElement.style.setProperty("--tertiary-table-font-color",this._account.getUser().settings.tertiary_table_font_color))}ngAfterViewInit(){setTimeout(()=>this.updateStickyTopOffset()),"undefined"!=typeof MutationObserver&&(this.mutationObserver=new MutationObserver(()=>this.updateStickyTopOffset()),this.mutationObserver.observe(this._elementRef.nativeElement,{childList:!0,subtree:!0})),"undefined"!=typeof ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.updateStickyTopOffset()),this.resizeObserver.observe(this._elementRef.nativeElement))}ngOnChanges(){this.updateStickyTopOffset()}ngOnDestroy(){this.windowSizeSubscription.unsubscribe(),this.mutationObserver?.disconnect(),this.resizeObserver?.disconnect()}onClick(t){}getCollapseClass(){let t=["table"];const e=this.isStickyHeadersEnabled();return this._elementRef.nativeElement.dataset.collapseTableStickyHeaders=e?"true":"false",this.secondaryColor?t.push("collapseTable-sec"):this.tertiaryColor?t.push("collapseTable-tert"):t.push("collapseTable"),this.tableFixed&&t.push("fixed"),this.headerFixed&&t.push("headerFixed"),e&&t.push("stickyHeaders"),t}getPrimaryColor(){return this._account.getUser()?this._account.getUser().settings.table_color:"#3b3ee3"}updateStickyTopOffset(){const t=this._elementRef.nativeElement,e=this.isStickyHeadersEnabled();let n=0,o=t.parentElement?.closest("collapse-table");for(t.dataset.collapseTableStickyHeaders=e?"true":"false";o;)n++,o=o.parentElement?.closest("collapse-table");t.style.setProperty("--collapse-table-sticky-z",`${Math.max(1,1030-n)}`),t.style.setProperty("--collapse-table-sticky-top","0px")}isStickyHeadersEnabled(){const t=this.toOptionalBoolean(this.stickyHeaders);if(null!==t)return t;const e=this._elementRef.nativeElement,n=e.parentElement?.closest("collapse-table");if(!n)return!0;const o=n.dataset.collapseTableStickyHeaders;if("true"===o)return!0;if("false"===o)return!1;const r=n.querySelector("table");return!r||r.classList.contains("stickyHeaders")}toOptionalBoolean(t){if(null==t)return null;if("boolean"==typeof t)return t;const e=t.trim().toLowerCase();return!e||"true"===e||"false"!==e}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableComponent,deps:[{token:ResizeService},{token:AccountManagerService},{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:CollapseTableComponent,isStandalone:!1,selector:"collapse-table",inputs:{collapseSize:"collapseSize",tableFixed:"tableFixed",headerFixed:"headerFixed",stickyHeaders:"stickyHeaders",secondaryColor:"secondaryColor",tertiaryColor:"tertiaryColor"},usesOnChanges:!0,ngImport:i0,template:'<style>\n\t:host ::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: white;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t}\n\n\t.table-responsive-xl {\n\t\t/* Sticky headers rely on page scroll; avoid creating a local scroll container. */\n\t\toverflow: visible !important;\n\t\tposition: relative;\n\t\tborder-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable,\n\t:host ::ng-deep .collapseTable-sec,\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--primary-table-color);\n\t\t--collapse-table-header-color: var(--primary-table-font-color);\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t\ttable-layout: auto;\n\t\toverflow: visible;\n\t\tposition: relative;\n\t\tborder-collapse: separate;\n\t\tborder-spacing: 0;\n\t\tborder: 1px solid rgba(83, 102, 132, 0.25);\n\t\tborder-radius: 12px;\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: 0 8px 24px rgba(18, 42, 74, 0.12);\n\t}\n\n\t:host ::ng-deep .collapseTable-sec {\n\t\t--collapse-table-header-bg: var(--secondary-table-color);\n\t\t--collapse-table-header-color: var(--secondary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--tertiary-table-color);\n\t\t--collapse-table-header-color: var(--tertiary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable tr,\n\t:host ::ng-deep .collapseTable-sec tr,\n\t:host ::ng-deep .collapseTable-tert tr {\n\t\tpadding: 0;\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr,\n\t:host ::ng-deep .collapseTable-sec tbody tr,\n\t:host ::ng-deep .collapseTable-tert tbody tr {\n\t\tbackground-color: #ffffff;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-sec tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-tert tbody tr:nth-child(even) {\n\t\tbackground-color: rgba(91, 114, 146, 0.04);\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:hover,\n\t:host ::ng-deep .collapseTable-sec tbody tr:hover,\n\t:host ::ng-deep .collapseTable-tert tbody tr:hover {\n\t\tbackground-color: rgba(40, 117, 230, 0.1);\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert th,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tpadding: 10px 12px;\n\t\ttext-align: center;\n\t\tvertical-align: middle;\n\t\tborder-bottom: 1px solid rgba(102, 123, 157, 0.22);\n\t\twhite-space: normal;\n\t\tword-break: normal;\n\t\toverflow-wrap: break-word;\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-tert th {\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tfont-weight: 700;\n\t\tfont-size: var(--font-size);\n\t\tbackground: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.08)), var(--collapse-table-header-bg);\n\t\tcolor: var(--collapse-table-header-color);\n\t\tbox-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);\n\t}\n\n\t:host ::ng-deep .stickyHeaders th {\n\t\tposition: sticky;\n\t\ttop: var(--collapse-table-sticky-top, 0px);\n\t\tz-index: var(--collapse-table-sticky-z, 10);\n\t}\n\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tcolor: #17365d;\n\t\tfont-size: var(--font-size);\n\t\tbackground-color: inherit;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-sec tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-tert tbody:last-of-type > tr:last-child > td {\n\t\tborder-bottom: none;\n\t}\n\n\t.fixed {\n\t\ttable-layout: fixed;\n\t}\n\n\t/* Keep native table flow for sticky headers. Forcing table/table-row display\n\t here can cause multi-row body rendering/sticky issues in some browsers. */\n\t:host ::ng-deep .headerFixed thead {\n\t\tdisplay: table-header-group !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody {\n\t\tdisplay: table-row-group !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody tr {\n\t\tdisplay: table-row !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:first-child {\n\t\tborder-top-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:last-child {\n\t\tborder-top-right-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:first-child {\n\t\tborder-bottom-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:last-child {\n\t\tborder-bottom-right-radius: 12px;\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar {\n\t\theight: 10px;\n\t\twidth: 10px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-thumb {\n\t\tbackground: rgba(85, 108, 143, 0.45);\n\t\tborder-radius: 999px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-track {\n\t\tbackground: rgba(164, 182, 212, 0.18);\n\t}\n\n\t@media screen and (max-width: 768px) {\n\t\t:host ::ng-deep .collapseTable th,\n\t\t:host ::ng-deep .collapseTable td,\n\t\t:host ::ng-deep .collapseTable-sec th,\n\t\t:host ::ng-deep .collapseTable-sec td,\n\t\t:host ::ng-deep .collapseTable-tert th,\n\t\t:host ::ng-deep .collapseTable-tert td {\n\t\t\tpadding: 8px;\n\t\t\tfont-size: calc(var(--font-size) - 1px);\n\t\t}\n\t}\n</style>\n\n<div class="table-responsive-xl">\n\t<table [ngClass]="getCollapseClass()" cellspacing="0" cellpadding="0">\n\t\t<ng-content></ng-content>\n\t</table>\n</div>\n',styles:[":host ::ng-deep :root{--primary-table-color: #3b3ee3;--primary-table-font-color: white;--font-size: 12px;--secondary-table-color: #87ceeb;--secondary-table-font-color: #000000;--tertiary-table-color: #ff4500;--tertiary-table-font-color: #000000}:host{display:block;width:100%}.table-responsive-xl{overflow:visible!important;position:relative;border-radius:12px}:host ::ng-deep .collapseTable,:host ::ng-deep .collapseTable-sec,:host ::ng-deep .collapseTable-tert{--collapse-table-header-bg: var(--primary-table-color);--collapse-table-header-color: var(--primary-table-font-color);margin:0;padding:0;width:100%;max-width:100%;table-layout:auto;overflow:visible;position:relative;border-collapse:separate;border-spacing:0;border:1px solid rgba(83,102,132,.25);border-radius:12px;background-color:#fff;box-shadow:0 8px 24px #122a4a1f}:host ::ng-deep .collapseTable-sec{--collapse-table-header-bg: var(--secondary-table-color);--collapse-table-header-color: var(--secondary-table-font-color)}:host ::ng-deep .collapseTable-tert{--collapse-table-header-bg: var(--tertiary-table-color);--collapse-table-header-color: var(--tertiary-table-font-color)}:host ::ng-deep .collapseTable tr,:host ::ng-deep .collapseTable-sec tr,:host ::ng-deep .collapseTable-tert tr{padding:0;transition:background-color .16s ease}:host ::ng-deep .collapseTable tbody tr,:host ::ng-deep .collapseTable-sec tbody tr,:host ::ng-deep .collapseTable-tert tbody tr{background-color:#fff}:host ::ng-deep .collapseTable tbody tr:nth-child(2n),:host ::ng-deep .collapseTable-sec tbody tr:nth-child(2n),:host ::ng-deep .collapseTable-tert tbody tr:nth-child(2n){background-color:#5b72920a}:host ::ng-deep .collapseTable tbody tr:hover,:host ::ng-deep .collapseTable-sec tbody tr:hover,:host ::ng-deep .collapseTable-tert tbody tr:hover{background-color:#2875e61a}:host ::ng-deep .collapseTable th,:host ::ng-deep .collapseTable td,:host ::ng-deep .collapseTable-sec th,:host ::ng-deep .collapseTable-sec td,:host ::ng-deep .collapseTable-tert th,:host ::ng-deep .collapseTable-tert td{padding:10px 12px;text-align:center;vertical-align:middle;border-bottom:1px solid rgba(102,123,157,.22);white-space:normal;word-break:normal;overflow-wrap:break-word}:host ::ng-deep .collapseTable th,:host ::ng-deep .collapseTable-sec th,:host ::ng-deep .collapseTable-tert th{letter-spacing:.08em;text-transform:uppercase;font-weight:700;font-size:var(--font-size);background:linear-gradient(180deg,#fff3,#00000014),var(--collapse-table-header-bg);color:var(--collapse-table-header-color);box-shadow:inset 0 -1px #00000024}:host ::ng-deep .stickyHeaders th{position:sticky;top:var(--collapse-table-sticky-top, 0px);z-index:var(--collapse-table-sticky-z, 10)}:host ::ng-deep .collapseTable td,:host ::ng-deep .collapseTable-sec td,:host ::ng-deep .collapseTable-tert td{color:#17365d;font-size:var(--font-size);background-color:inherit}:host ::ng-deep .collapseTable tbody:last-of-type>tr:last-child>td,:host ::ng-deep .collapseTable-sec tbody:last-of-type>tr:last-child>td,:host ::ng-deep .collapseTable-tert tbody:last-of-type>tr:last-child>td{border-bottom:none}.fixed{table-layout:fixed}:host ::ng-deep .headerFixed thead{display:table-header-group!important;width:auto!important;table-layout:auto!important}:host ::ng-deep .headerFixed tbody{display:table-row-group!important}:host ::ng-deep .headerFixed tbody tr{display:table-row!important;width:auto!important;table-layout:auto!important}:host ::ng-deep .collapseTable>thead:first-of-type>tr:first-child>th:first-child,:host ::ng-deep .collapseTable-sec>thead:first-of-type>tr:first-child>th:first-child,:host ::ng-deep .collapseTable-tert>thead:first-of-type>tr:first-child>th:first-child{border-top-left-radius:12px}:host ::ng-deep .collapseTable>thead:first-of-type>tr:first-child>th:last-child,:host ::ng-deep .collapseTable-sec>thead:first-of-type>tr:first-child>th:last-child,:host ::ng-deep .collapseTable-tert>thead:first-of-type>tr:first-child>th:last-child{border-top-right-radius:12px}:host ::ng-deep .collapseTable>tbody:last-of-type>tr:last-child>td:first-child,:host ::ng-deep .collapseTable-sec>tbody:last-of-type>tr:last-child>td:first-child,:host ::ng-deep .collapseTable-tert>tbody:last-of-type>tr:last-child>td:first-child{border-bottom-left-radius:12px}:host ::ng-deep .collapseTable>tbody:last-of-type>tr:last-child>td:last-child,:host ::ng-deep .collapseTable-sec>tbody:last-of-type>tr:last-child>td:last-child,:host ::ng-deep .collapseTable-tert>tbody:last-of-type>tr:last-child>td:last-child{border-bottom-right-radius:12px}.hide{display:none}.table-responsive-xl::-webkit-scrollbar{height:10px;width:10px}.table-responsive-xl::-webkit-scrollbar-thumb{background:#556c8f73;border-radius:999px}.table-responsive-xl::-webkit-scrollbar-track{background:#a4b6d42e}@media screen and (max-width:768px){:host ::ng-deep .collapseTable th,:host ::ng-deep .collapseTable td,:host ::ng-deep .collapseTable-sec th,:host ::ng-deep .collapseTable-sec td,:host ::ng-deep .collapseTable-tert th,:host ::ng-deep .collapseTable-tert td{padding:8px;font-size:calc(var(--font-size) - 1px)}}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableComponent,decorators:[{type:Component,args:[{selector:"collapse-table",standalone:!1,template:'<style>\n\t:host ::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: white;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t\twidth: 100%;\n\t}\n\n\t.table-responsive-xl {\n\t\t/* Sticky headers rely on page scroll; avoid creating a local scroll container. */\n\t\toverflow: visible !important;\n\t\tposition: relative;\n\t\tborder-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable,\n\t:host ::ng-deep .collapseTable-sec,\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--primary-table-color);\n\t\t--collapse-table-header-color: var(--primary-table-font-color);\n\t\tmargin: 0;\n\t\tpadding: 0;\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t\ttable-layout: auto;\n\t\toverflow: visible;\n\t\tposition: relative;\n\t\tborder-collapse: separate;\n\t\tborder-spacing: 0;\n\t\tborder: 1px solid rgba(83, 102, 132, 0.25);\n\t\tborder-radius: 12px;\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: 0 8px 24px rgba(18, 42, 74, 0.12);\n\t}\n\n\t:host ::ng-deep .collapseTable-sec {\n\t\t--collapse-table-header-bg: var(--secondary-table-color);\n\t\t--collapse-table-header-color: var(--secondary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable-tert {\n\t\t--collapse-table-header-bg: var(--tertiary-table-color);\n\t\t--collapse-table-header-color: var(--tertiary-table-font-color);\n\t}\n\n\t:host ::ng-deep .collapseTable tr,\n\t:host ::ng-deep .collapseTable-sec tr,\n\t:host ::ng-deep .collapseTable-tert tr {\n\t\tpadding: 0;\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr,\n\t:host ::ng-deep .collapseTable-sec tbody tr,\n\t:host ::ng-deep .collapseTable-tert tbody tr {\n\t\tbackground-color: #ffffff;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-sec tbody tr:nth-child(even),\n\t:host ::ng-deep .collapseTable-tert tbody tr:nth-child(even) {\n\t\tbackground-color: rgba(91, 114, 146, 0.04);\n\t}\n\n\t:host ::ng-deep .collapseTable tbody tr:hover,\n\t:host ::ng-deep .collapseTable-sec tbody tr:hover,\n\t:host ::ng-deep .collapseTable-tert tbody tr:hover {\n\t\tbackground-color: rgba(40, 117, 230, 0.1);\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert th,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tpadding: 10px 12px;\n\t\ttext-align: center;\n\t\tvertical-align: middle;\n\t\tborder-bottom: 1px solid rgba(102, 123, 157, 0.22);\n\t\twhite-space: normal;\n\t\tword-break: normal;\n\t\toverflow-wrap: break-word;\n\t}\n\n\t:host ::ng-deep .collapseTable th,\n\t:host ::ng-deep .collapseTable-sec th,\n\t:host ::ng-deep .collapseTable-tert th {\n\t\tletter-spacing: 0.08em;\n\t\ttext-transform: uppercase;\n\t\tfont-weight: 700;\n\t\tfont-size: var(--font-size);\n\t\tbackground: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 0.08)), var(--collapse-table-header-bg);\n\t\tcolor: var(--collapse-table-header-color);\n\t\tbox-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.14);\n\t}\n\n\t:host ::ng-deep .stickyHeaders th {\n\t\tposition: sticky;\n\t\ttop: var(--collapse-table-sticky-top, 0px);\n\t\tz-index: var(--collapse-table-sticky-z, 10);\n\t}\n\n\t:host ::ng-deep .collapseTable td,\n\t:host ::ng-deep .collapseTable-sec td,\n\t:host ::ng-deep .collapseTable-tert td {\n\t\tcolor: #17365d;\n\t\tfont-size: var(--font-size);\n\t\tbackground-color: inherit;\n\t}\n\n\t:host ::ng-deep .collapseTable tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-sec tbody:last-of-type > tr:last-child > td,\n\t:host ::ng-deep .collapseTable-tert tbody:last-of-type > tr:last-child > td {\n\t\tborder-bottom: none;\n\t}\n\n\t.fixed {\n\t\ttable-layout: fixed;\n\t}\n\n\t/* Keep native table flow for sticky headers. Forcing table/table-row display\n\t here can cause multi-row body rendering/sticky issues in some browsers. */\n\t:host ::ng-deep .headerFixed thead {\n\t\tdisplay: table-header-group !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody {\n\t\tdisplay: table-row-group !important;\n\t}\n\n\t:host ::ng-deep .headerFixed tbody tr {\n\t\tdisplay: table-row !important;\n\t\twidth: auto !important;\n\t\ttable-layout: auto !important;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:first-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:first-child {\n\t\tborder-top-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-sec > thead:first-of-type > tr:first-child > th:last-child,\n\t:host ::ng-deep .collapseTable-tert > thead:first-of-type > tr:first-child > th:last-child {\n\t\tborder-top-right-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:first-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:first-child {\n\t\tborder-bottom-left-radius: 12px;\n\t}\n\n\t:host ::ng-deep .collapseTable > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-sec > tbody:last-of-type > tr:last-child > td:last-child,\n\t:host ::ng-deep .collapseTable-tert > tbody:last-of-type > tr:last-child > td:last-child {\n\t\tborder-bottom-right-radius: 12px;\n\t}\n\n\t.hide {\n\t\tdisplay: none;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar {\n\t\theight: 10px;\n\t\twidth: 10px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-thumb {\n\t\tbackground: rgba(85, 108, 143, 0.45);\n\t\tborder-radius: 999px;\n\t}\n\n\t.table-responsive-xl::-webkit-scrollbar-track {\n\t\tbackground: rgba(164, 182, 212, 0.18);\n\t}\n\n\t@media screen and (max-width: 768px) {\n\t\t:host ::ng-deep .collapseTable th,\n\t\t:host ::ng-deep .collapseTable td,\n\t\t:host ::ng-deep .collapseTable-sec th,\n\t\t:host ::ng-deep .collapseTable-sec td,\n\t\t:host ::ng-deep .collapseTable-tert th,\n\t\t:host ::ng-deep .collapseTable-tert td {\n\t\t\tpadding: 8px;\n\t\t\tfont-size: calc(var(--font-size) - 1px);\n\t\t}\n\t}\n</style>\n\n<div class="table-responsive-xl">\n\t<table [ngClass]="getCollapseClass()" cellspacing="0" cellpadding="0">\n\t\t<ng-content></ng-content>\n\t</table>\n</div>\n'}]}],ctorParameters:()=>[{type:ResizeService},{type:AccountManagerService},{type:i0.ElementRef}],propDecorators:{collapseSize:[{type:Input}],tableFixed:[{type:Input}],headerFixed:[{type:Input}],stickyHeaders:[{type:Input}],secondaryColor:[{type:Input}],tertiaryColor:[{type:Input}]}});class DialogSelectArrayObjsContent{_activeModal;title="";objects=[];multiple=!1;allowNone=!1;close;allElements;selectedIndex=null;selectedItem=null;selectedIndexes=[];selectedItems=[];constructor(t){this._activeModal=t}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100),this.objects.forEach((t,e)=>{t.selected&&(this.selectedIndexes.push(e),this.selectedItems.push(t))})}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}onSelectItem(t){this.multiple?this.selectedItems.some(e=>e.value===this.objects[t].value)?(this.selectedIndexes.splice(this.selectedIndexes.indexOf(t),1),this.selectedItems.splice(this.selectedItems.map(t=>t.value).indexOf(this.objects[t].value),1)):(this.selectedIndexes.push(t),this.selectedItems.push(this.objects[t])):this.objects[t]===this.selectedItem?(this.selectedItem=null,this.selectedIndex=null):(this.selectedItem=this.objects[t],this.selectedIndex=t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayObjsContent,deps:[{token:i1$2.NgbActiveModal}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectArrayObjsContent,isStandalone:!1,selector:"resolveio-dialog.select-array-objs",inputs:{title:"title",objects:"objects",multiple:"multiple",allowNone:"allowNone"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div style="height: 60vh; overflow-y: auto">\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (object of objects; track object.text; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : i === selectedIndex || selectedIndexes.includes(i)}">\n\t\t <td>{{object.text}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t @if (!allowNone) {\n\t\t <button type="button" [ngClass]="[\'btn\', (selectedItem || selectedItems.length) ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedItem && !selectedItems.length" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t @if (allowNone) {\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',isInline:!0,styles:["collapse-table tr:hover{background-color:#add8e6;cursor:pointer}.selected{background-color:#add8e6}collapse-table{width:100%}\n"],dependencies:[{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayObjsContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-array-objs",template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body">\n\t\t <div style="height: 60vh; overflow-y: auto">\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (object of objects; track object.text; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : i === selectedIndex || selectedIndexes.includes(i)}">\n\t\t <td>{{object.text}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t </div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t @if (!allowNone) {\n\t\t <button type="button" [ngClass]="[\'btn\', (selectedItem || selectedItems.length) ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedItem && !selectedItems.length" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t @if (allowNone) {\n\t\t <button type="button" class="btn btn-success" (click)="_activeModal.close(selectedItem || selectedItems)">Submit</button>\n\t\t }\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal}],propDecorators:{title:[{type:Input}],objects:[{type:Input}],multiple:[{type:Input}],allowNone:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class DialogSelectArrayContent{_activeModal;_cdRef;title="";array=[];multiple;selectedIndexes=[];close;allElements;method="list";mappedArray=[];selectIndexes=[];constructor(t,e){this._activeModal=t,this._cdRef=e}ngOnInit(){this.mappedArray=this.array.map((t,e)=>({value:e,text:t})),this.selectedIndexes.forEach(t=>{this.selectIndexes.push(t)})}ngAfterViewInit(){setTimeout(()=>{let t=this.recursiveFindFirstElement(this.allElements.nativeElement);t?t.focus():(this.close.nativeElement.focus(),this.close.nativeElement.blur())},100)}recursiveFindFirstElement(t){let e=null,n=t.children;for(let t=0;t<Object.keys(n).length;t++){let o=n[Object.keys(n)[t]];if(o.children&&o.children.length)e=this.recursiveFindFirstElement(o);else{if("BUTTON"===o.tagName&&o.classList.contains("close"))return null;if(!("BUTTON"!==o.tagName&&"INPUT"!==o.tagName&&"SELECT"!==o.tagName&&"TEXTAREA"!==o.tagName||o.hidden||o.disabled))return o}if(e)break}return e}addDropDown(){let t=this.array.filter((t,e)=>!this.selectedIndexes.includes(e))[0],e=this.array.findIndex(e=>e===t);this.selectedIndexes.push(e),this.selectIndexes.push(e)}onSelectDropdown(t,e){this.onSelectItem(this.selectedIndexes[e]),this.onSelectItem(t)}availableAdd(){return!!this.array.filter((t,e)=>!this.selectedIndexes.includes(e))[0]}getFilteredArray(t){return this.mappedArray.filter(e=>e.value===t||!this.selectedIndexes.includes(e.value))}isInSelectedIndex(t){return!!this.selectedIndexes.includes(t)}onSelectItem(t){this.multiple?this.selectedIndexes.includes(t)?(this.selectedIndexes.splice(this.selectedIndexes.indexOf(t),1),this.selectIndexes.splice(this.selectIndexes.indexOf(t),1)):(this.selectedIndexes.push(t),this.selectIndexes.push(t)):this.selectedIndexes.includes(t)?(this.selectedIndexes=[],this.selectIndexes=[]):(this.selectedIndexes=[t],this.selectIndexes=[t])}getArray(){let t=[];return this.selectedIndexes.forEach(e=>{t.push(this.array[e])}),t}selectAll(){this.selectedIndexes=[],this.selectIndexes=[],this.array.forEach((t,e)=>{this.selectedIndexes.push(e),this.selectIndexes.push(e)})}removeAll(){this.selectedIndexes=[],this.selectIndexes=[]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayContent,deps:[{token:i1$2.NgbActiveModal},{token:i0.ChangeDetectorRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DialogSelectArrayContent,isStandalone:!1,selector:"resolveio-dialog.select-array",inputs:{title:"title",array:"array",multiple:"multiple",selectedIndexes:"selectedIndexes"},viewQueries:[{propertyName:"close",first:!0,predicate:["close"],descendants:!0},{propertyName:"allElements",first:!0,predicate:["allElements"],descendants:!0}],ngImport:i0,template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body" style="height: 60vh;">\n\t\t <responsive-button-group>\n\t\t @if (multiple) {\n\t\t <button type="button" class="btn btn-primary" (click)="selectAll()">Select All</button>\n\t\t <button type="button" class="btn btn-danger" (click)="removeAll()">Remove All</button>\n\t\t }\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'list\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'list\'">Use List</button>\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'dropdown\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'dropdown\'">Use Dropdown</button>\n\t\t </responsive-button-group>\n\t\t <div style="height: 50vh; overflow-y: auto; margin-top: 10px">\n\t\t @if (method === \'list\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (data of array; track data; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : isInSelectedIndex(i)}">\n\t\t <td>{{data}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t }\n\t\t @if (method === \'dropdown\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>Item</th>\n\t\t <th>Remove</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (item of selectIndexes; track item; let i = $index) {\n\t\t <tr>\n\t\t <td>\n\t\t <rio-select placeholder="Select Item" [ngModel]="item" (change)="onSelectDropdown($event, i)">\n\t\t @for (data of getFilteredArray(item); track data.value) {\n\t\t <rio-option [value]="data.value">{{data.text}}</rio-option>\n\t\t }\n\t\t </rio-select>\n\t\t </td>\n\t\t <td>\n\t\t <button type="button" class="btn btn-danger" (click)="onSelectItem(item)">Remove</button>\n\t\t </td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t @if (multiple || !selectIndexes.length) {\n\t\t <button type="button" class="btn btn-success" (click)="addDropDown()" [disabled]="!availableAdd()">Add</button>\n\t\t }\n\t\t }\n\t\t</div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" [ngClass]="[\'btn\', selectedIndexes.length ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedIndexes.length || this.selectedIndexes.includes(null)" (click)="_activeModal.close(this.multiple ? getArray() : array[selectedIndexes[0]])">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',isInline:!0,styles:["collapse-table tr:hover{background-color:#add8e6;cursor:pointer}.selected{background-color:#add8e6}collapse-table{width:100%}\n"],dependencies:[{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:i5.RioOptionComponent,selector:"rio-option",inputs:["value","disabled","label","id"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}],changeDetection:i0.ChangeDetectionStrategy.OnPush})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogSelectArrayContent,decorators:[{type:Component,args:[{selector:"resolveio-dialog.select-array",template:'\n\t\t<style>\n\t\t collapse-table tr:hover {\n\t\t background-color: lightblue;\n\t\t cursor: pointer;\n\t\t}\n\t\t\n\t\t.selected {\n\t\tbackground-color: lightblue;\n\t\t}\n\t\t\n\t\tcollapse-table {\n\t\twidth: 100%;\n\t\t}\n\t\t</style>\n\t\t<div #allElements>\n\t\t <div class="modal-header">\n\t\t <h4 class="modal-title"><i class="fa fa-question-circle" style="color: blue; font-size: 0.85em" aria-hidden="true"></i> {{ title }}</h4>\n\t\t <button type="button" class="btn-close ms-auto" aria-label="Close" (click)="_activeModal.dismiss()" #close></button>\n\t\t </div>\n\t\t <div class="modal-body" style="height: 60vh;">\n\t\t <responsive-button-group>\n\t\t @if (multiple) {\n\t\t <button type="button" class="btn btn-primary" (click)="selectAll()">Select All</button>\n\t\t <button type="button" class="btn btn-danger" (click)="removeAll()">Remove All</button>\n\t\t }\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'list\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'list\'">Use List</button>\n\t\t <button type="button" [ngClass]="[\'btn\', method === \'dropdown\' ? \'btn-success\' : \'btn-warning\']" (click)="method = \'dropdown\'">Use Dropdown</button>\n\t\t </responsive-button-group>\n\t\t <div style="height: 50vh; overflow-y: auto; margin-top: 10px">\n\t\t @if (method === \'list\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>List</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (data of array; track data; let i = $index) {\n\t\t <tr (click)="onSelectItem(i)" [ngClass]="{\'selected\' : isInSelectedIndex(i)}">\n\t\t <td>{{data}}</td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t }\n\t\t @if (method === \'dropdown\') {\n\t\t <collapse-table collapseSize="900">\n\t\t <thead>\n\t\t <tr>\n\t\t <th>Item</th>\n\t\t <th>Remove</th>\n\t\t </tr>\n\t\t </thead>\n\t\t <tbody>\n\t\t @for (item of selectIndexes; track item; let i = $index) {\n\t\t <tr>\n\t\t <td>\n\t\t <rio-select placeholder="Select Item" [ngModel]="item" (change)="onSelectDropdown($event, i)">\n\t\t @for (data of getFilteredArray(item); track data.value) {\n\t\t <rio-option [value]="data.value">{{data.text}}</rio-option>\n\t\t }\n\t\t </rio-select>\n\t\t </td>\n\t\t <td>\n\t\t <button type="button" class="btn btn-danger" (click)="onSelectItem(item)">Remove</button>\n\t\t </td>\n\t\t </tr>\n\t\t }\n\t\t </tbody>\n\t\t </collapse-table>\n\t\t @if (multiple || !selectIndexes.length) {\n\t\t <button type="button" class="btn btn-success" (click)="addDropDown()" [disabled]="!availableAdd()">Add</button>\n\t\t }\n\t\t }\n\t\t</div>\n\t\t</div>\n\t\t<div class="modal-footer">\n\t\t <button type="button" [ngClass]="[\'btn\', selectedIndexes.length ? \'btn-success\' : \'btn-danger\']" [disabled]="!selectedIndexes.length || this.selectedIndexes.includes(null)" (click)="_activeModal.close(this.multiple ? getArray() : array[selectedIndexes[0]])">Submit</button>\n\t\t <button type="button" class="btn btn-secondary" (click)="_activeModal.dismiss()">Cancel</button>\n\t\t</div>\n\t\t</div>\n\t\t',changeDetection:ChangeDetectionStrategy.OnPush,standalone:!1}]}],ctorParameters:()=>[{type:i1$2.NgbActiveModal},{type:i0.ChangeDetectorRef}],propDecorators:{title:[{type:Input}],array:[{type:Input}],multiple:[{type:Input}],selectedIndexes:[{type:Input}],close:[{type:ViewChild,args:["close",{static:!1}]}],allElements:[{type:ViewChild,args:["allElements",{static:!1}]}]}});class DialogService{modalService;constructor(t){this.modalService=t}openDialog(t,e={size:"lg",backdrop:"static"}){return this.modalService.open(t,e)}notify(t){const e=this.openDialog(DialogNotifyContent);e.componentInstance.title="Notify",e.componentInstance.body=t}input(t,e){const n=this.openDialog(DialogInputContent);return n.componentInstance.title=t,n.componentInstance.inputFields=e,n.result}error(t){const e=this.openDialog(DialogErrorContent);e.componentInstance.title="Error",e.componentInstance.body=t}confirm(t,e){const n=this.openDialog(DialogConfirmContent);return n.componentInstance.title="Confirm",n.componentInstance.body=t,n.componentInstance.html=e,n.result}selectDateTime(t,e=!0){const n=this.openDialog(DialogSelectDateTimeContent);return n.componentInstance.title="Select Date"+(e?" and Time":""),n.componentInstance.date=t,n.componentInstance.showTime=e,n.result}selectDataLabel(t,e=!0){const n=this.openDialog(DialogSelectDataLabelsContent,{size:"sm",backdrop:"static"});return n.componentInstance.title="Select Data Labels",n.componentInstance.data=t,n.componentInstance.showArraySubData=e,n.result}login(t,e=!0,n=!1){const o=this.openDialog(DialogLoginContent);return o.componentInstance.msAllowed=t,o.componentInstance.showLoginText=e,o.componentInstance.publicProgram=n,o.result}register(){return this.openDialog(DialogRegisterContent).result}selectWithButtonsURL(t){const e=this.openDialog(DialogSelectWithButtonsURLContent);return e.componentInstance.url=t,e.result}selectWithArrayObjs(t,e,n=!1,o=!1){const r=this.openDialog(DialogSelectArrayObjsContent);return r.componentInstance.title=t,r.componentInstance.objects=e,r.componentInstance.multiple=n,r.componentInstance.allowNone=o,r.result}selectArray(t,e,n=!1,o=[]){const r=this.openDialog(DialogSelectArrayContent);return r.componentInstance.title=t,r.componentInstance.array=e,r.componentInstance.multiple=n,r.componentInstance.selectedIndexes=o,r.result}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogService,deps:[{token:i1$2.NgbModal}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DialogService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1$2.NgbModal}]});class AuthService{_ds;_vs;_alert;_account;_socket;_core;_router;environment=null;userHasPhoneNumber=!1;userData;userAgentApplication;constructor(t,e,n,o,r,i,a){this._ds=t,this._vs=e,this._alert=n,this._account=o,this._socket=r,this._core=i,this._router=a}setupMSSingleSignOn(t){this.environment=t,"/auth365"===window.location.pathname&&window.location.hash&&window.location.hash.startsWith("#id_token=")&&(this.environment.MS_id_token=window.location.hash.replace("#","")),this.userAgentApplication=new UserAgentApplication({auth:{clientId:this.environment.MS_clientId,authority:this.environment.MS_authority,redirectUri:this.environment.MS_redirectUri,validateAuthority:!1,navigateToLoginRequestUrl:!1},framework:{isAngular:!0}})}setEnvironment(t){this.environment=t}setUserHasPhoneNumber(t){this.userHasPhoneNumber=t}registerUser(t,e=!0){return new Promise((n,o)=>{let r=[{label:"User Name",form:"username",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Username is required"],required:!0},{label:"Full Name",form:"fullname",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Full name is required"],required:!0},{label:"Email",form:"email",data:"",validators:[Validators.required,this._vs.email],validatorErrors:["required","email"],validatorMsg:["Email is required","Email is invalid"],required:!0}];this.userHasPhoneNumber&&r.push({label:"Phone",form:"phonenumber",data:"",validators:[this._vs.phoneNumber],validatorErrors:["phoneNumber"],validatorMsg:["Phone number is invalid"],type:"text"}),this._ds.input("Register New User",r).then(r=>{let i={username:r.username.value.trim().toLowerCase(),email:r.email.value.trim().toLowerCase(),fullname:r.fullname.value.trim(),roles:{super_admin:!1,approvals:[],groups:[],notifications:[],miscs:[]},active:!0,readonly:!1,phonenumber:r.phonenumber?r.phonenumber.value:"",other:t,attempts:0,salt:"",hash:""};this._socket.call("createUserAndEmailEnrollment",i,e,(t,e)=>{t?o(t):n(e)})},t=>o())})}editUser(t){let e=[{label:"User Name",form:"username",data:t.username,validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Username is required"],required:!0},{label:"Full Name",form:"fullname",data:t.fullname,validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Full name is required"],required:!0},{label:"Email",form:"email",data:t.email,validators:[Validators.required,this._vs.email],validatorErrors:["required","email"],validatorMsg:["Email is required","Email is invalid"],required:!0}];return this.userHasPhoneNumber&&e.push({label:"Phone",form:"phonenumber",data:t.phonenumber||"",validators:[this._vs.phoneNumber],validatorErrors:["phoneNumber"],validatorMsg:["Phone number is invalid"],type:"text"}),new Promise((n,o)=>{this._ds.input("Edit User",e).then(e=>{e.phonenumber&&e.phonenumber.value?t.phonenumber=e.phonenumber.value:t.phonenumber="",t.email=e.email.value.trim(),this._socket.call("editUser",t._id,e.username.value.trim().toLowerCase(),e.fullname.value.trim(),e.email.value.trim().toLowerCase(),t.phonenumber,(r,i)=>{if(r)this._socket.call("insertErrorLog","AuthService - edituser",[t,r]),o(r);else{let t={username:e.username.value.trim(),fullname:e.fullname.value.trim(),email:e.email.value.trim()};this._alert.setAlert("success","User has been edited"),n(t)}})},t=>{n(!0)})})}loginUser(){return new Promise((t,e)=>{this.loginModal().then(n=>{"PUBLIC_LOGIN"!==n.type?"PUBLIC_REGISTER"!==n.type?"MS"===n.type?this.microsoftSignOn():n.form.value.forgotPassword?this._account.resetUserPassword(n.form.value.username):this._account.logIn(n.form.value.username,n.form.value.password).then(e=>{t(e)},t=>e("Invalid login")):this._account.publicRegister({companyName:n.form.value.companyName,contactName:n.form.value.contactName,email:n.form.value.email,password:n.form.value.password,phone:n.form.value.phone}).then(e=>{this._router.navigateByUrl("/dashboard/client"),t(e)},t=>e(t)):this._account.publicLogIn(n.form.value.email,n.form.value.password).then(e=>{this._router.navigateByUrl("/dashboard/client"),t(e)},t=>e(t))},t=>e())})}microsoftSignOn(){this.userAgentApplication.loginRedirect(["user.read","mail.send"])}loginModal(){const t=!(!this.environment||!this.environment.MS_ALLOWED),e=!this.environment||!this.environment.HIDE_LOGIN_TEXT,n=this._core.publicProgram.getValue();return this._ds.login(t,e,n)}removeUser(t){return new Promise((e,n)=>{this._socket.call("removeDocument","users",t,(o,r)=>{o?(this._ds.error("Could not remove user"),this._socket.call("insertErrorLog","AuthService - removeUser",[t,o]),n(o)):e(!0)})})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthService,deps:[{token:DialogService},{token:ValidationService},{token:AlertService},{token:AccountManagerService},{token:SocketManagerService},{token:CoreService},{token:i1$1.Router}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:DialogService},{type:ValidationService},{type:AlertService},{type:AccountManagerService},{type:SocketManagerService},{type:CoreService},{type:i1$1.Router}]});class AuthPermissionService{modules=[];constructor(){}registerModule(t){this.modules.push(t),this.modules.sort((t,e)=>{let n=t.name,o=e.name;return n<o?-1:n>o?1:0})}getAllModulePermissions(){return this.modules}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthPermissionService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthPermissionService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthPermissionService,decorators:[{type:Injectable}],ctorParameters:()=>[]});class FeatureGateService{_app;constructor(t){this._app=t}isEnabled(t,e=!0){if(!t)return!0;const n=this.getGateConfig();return n?Array.isArray(n)?n.includes(t):"object"==typeof n&&t in n?!!n[t]:e:e}isLinkEnabled(t,e,n=!1){if(!t)return!0;const o=this.normalizeLink(t),r=Array.isArray(e)?e:[];for(let t=0;t<r.length;t++){const e=r[t],i=Array.isArray(e.views)?e.views:[];for(let t=0;t<i.length;t++){const r=i[t];if(this.isLinkMatch(r,o,n))return!(e.gate&&!this.isEnabled(e.gate,!0))&&!(r.gate&&!this.isEnabled(r.gate,!0))}}return!0}getGateConfig(){const t=this._app.environment.value||{};return t.FEATURE_GATES?t.FEATURE_GATES:t.MODULE_GATES?t.MODULE_GATES:t.FEATURE_FLAGS?t.FEATURE_FLAGS:null}normalizeLink(t){if(!t)return"";let e=t.replace(/\?.+$/,"");return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e}isLinkMatch(t,e,n){if(!t||!t.link||!e)return!1;if(t.link===e)return!0;if(t.has_parameter){const n=t.link.endsWith("/")?t.link:t.link+"/";if(e.startsWith(n))return!0}if(n){const n=e.endsWith("/")?e:e+"/";if(t.link.startsWith(n))return!0}return!1}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FeatureGateService,deps:[{token:CoreService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FeatureGateService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FeatureGateService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:CoreService}]});class CoreTourService{_tour;_app;activeStep=new BehaviorSubject(null);currentStepIndex=new BehaviorSubject(-1);totalSteps=new BehaviorSubject(0);completed$=new Subject;navTabs=[];customStops=[];autoStartedUserId="";constructor(t,e){this._tour=t,this._app=e,this._tour.setDefaults({enableBackdrop:!0,disablePageScrolling:!0,smoothScroll:!0,centerAnchorOnScroll:!0,showProgress:!0,prevBtnTitle:"Back",nextBtnTitle:"Next",endBtnTitle:"Finish",backdropConfig:{backgroundColor:"rgba(0, 0, 0, 0.45)",offset:6}}),this._tour.start$.subscribe(()=>{this._app.setTourStarted(!0),this.totalSteps.next((this._tour.steps||[]).length)}),this._tour.stepShow$.subscribe(({step:t})=>{this._app.setTourStarted(!0),this.activeStep.next(t),this.currentStepIndex.next(this.resolveStepIndex(t)),this.totalSteps.next((this._tour.steps||[]).length)}),this._tour.end$.subscribe(()=>{const t=this._app.tourStarted.getValue();this._app.setTourStarted(!1),this.activeStep.next(null),this.currentStepIndex.next(-1),this.totalSteps.next((this._tour.steps||[]).length),t&&this.completed$.next()})}configure(t,e){this.navTabs=Array.isArray(t)?t.slice():[],this.customStops=Array.isArray(e)?e.slice():[];const n=this.buildSteps();this._tour.initialize(n)}start(t=!1){if(!this._tour.steps||!this._tour.steps.length)return!1;const e=this._tour.getStatus();return!t&&e===TourState.ON||(e!==TourState.OFF&&this._tour.end(),setTimeout(()=>this._tour.start(),0),!0)}retake(){return this.start(!0)}autoStartIfNeeded(t){return!(!t||!t._id)&&(!this.hasCompletedTour(t)&&(this.autoStartedUserId!==t._id&&(this.autoStartedUserId=t._id,setTimeout(()=>this.start(!0),900),!0)))}hasCompletedTour(t){const e=t&&t.other&&"object"==typeof t.other?t.other:{};return!!(e.tour_completed||e.took_tour||e.core_tour_completed||e.welcome_tour_completed)}resolveModuleDescription(t){const e=String(t||"").trim(),n=e.toLowerCase();return"home"===n?"Start here for your launchpad, announcements, and key shortcuts.":n.includes("admin")?"Use this module for users, permissions, and account administration.":n.includes("dashboard")?"Use dashboards for live status, KPIs, and quick daily actions.":n.includes("manage")?"Use manage for maintenance tables, reference data, and settings.":n.includes("report")?"Use reports for exports, historical views, and printable outputs.":`Use ${e} for workflows related to ${e.toLowerCase()}.`}buildSteps(){const t=[],e=e=>{if(!e||!e.anchorId)return;const n=String(e.stepId||"").trim()||`step-${t.length+1}`;t.some(t=>t.stepId===n)||t.push({...e,stepId:n})};return e({stepId:"shell-nav-main",anchorId:"navBarMain",title:"Top Navigation",content:this.buildTopNavIntro(),isOptional:!0}),e({stepId:"shell-nav-home",anchorId:"topNavHome",title:"Home",content:this.resolveModuleDescription("Home"),isOptional:!0}),this.navTabs.forEach((t,n)=>{const o=String(t?.tourAnchor||"").trim();if(!o)return;const r=this.resolveTabLabel(t)||`Module ${n+1}`;e({stepId:`shell-top-nav-${this.toSlug(r)}-${n+1}`,anchorId:o,title:r,content:this.resolveModuleDescription(r),isOptional:!0})}),e({stepId:"shell-nav-module",anchorId:"navBarModule",title:"Module Views",content:"This left menu changes with your current module and gives you quick access to list, new, edit, and detail pages.",isOptional:!0}),e({stepId:"shell-ai-assistant",anchorId:"aiAssistantToggle",title:"AI Assistant",content:"Open AI Assistant for guided help, field suggestions, and rapid updates without leaving your workflow.",isOptional:!0}),e({stepId:"shell-user-settings",anchorId:"userSettings",title:"Your Settings",content:"Use user settings to tune colors, table density, and rerun this tour any time.",isOptional:!0}),this.customStops.forEach((t,n)=>{t&&e({...t,stepId:String(t.stepId||"").trim()||`custom-stop-${n+1}`,isOptional:!1!==t.isOptional})}),t}buildTopNavIntro(){const t=this.navTabs.map(t=>this.resolveTabLabel(t)).filter(t=>!!t);return t.length?`This top bar is your primary navigation. Key modules: ${t.join(", ")}.`:"This top bar is your primary navigation across the program."}resolveTabLabel(t){return t?"dropdown"===t.type?String(t.label||t.links?.[0]?.label||"").trim():String(t.links?.[0]?.label||t.label||"").trim():""}resolveStepIndex(t){const e=this._tour.steps||[];if(!e.length||!t)return-1;const n=String(t.stepId||"").trim();if(n){const t=e.findIndex(t=>String(t?.stepId||"").trim()===n);if(t>=0)return t}return e.indexOf(t)}toSlug(t){return String(t||"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourService,deps:[{token:i1$3.TourService},{token:CoreService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}],ctorParameters:()=>[{type:i1$3.TourService},{type:CoreService}]});class TourAnchorDirective{_el;_renderer;_tour;tourAnchor="";element;registeredAnchorId="";constructor(t,e,n){this._el=t,this._renderer=e,this._tour=n,this.element=t}ngOnInit(){this.syncRegistration()}ngOnChanges(t){t.tourAnchor&&this.syncRegistration()}ngOnDestroy(){this.unregister(),this.hideTourStep()}showTourStep(){this._renderer.addClass(this._el.nativeElement,"rio-tour-anchor-active")}hideTourStep(){this._renderer.removeClass(this._el.nativeElement,"rio-tour-anchor-active")}syncRegistration(){const t=String(this.tourAnchor||"").trim();t!==this.registeredAnchorId&&(this.unregister(),t&&(this._tour.register(t,this),this.registeredAnchorId=t))}unregister(){this.registeredAnchorId&&(this._tour.unregister(this.registeredAnchorId),this.registeredAnchorId="")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TourAnchorDirective,deps:[{token:i0.ElementRef},{token:i0.Renderer2},{token:i1$3.TourService}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:TourAnchorDirective,isStandalone:!0,selector:"[tourAnchor]",inputs:{tourAnchor:"tourAnchor"},usesOnChanges:!0,ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TourAnchorDirective,decorators:[{type:Directive,args:[{selector:"[tourAnchor]",standalone:!0}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:i0.Renderer2},{type:i1$3.TourService}],propDecorators:{tourAnchor:[{type:Input,args:["tourAnchor"]}]}});class CoreTourOverlayComponent{_tour;_coreTour;step=null;stepNumber=0;totalSteps=0;popoverTop=16;popoverLeft=16;subscriptions=[];constructor(t,e){this._tour=t,this._coreTour=e}ngOnInit(){this.subscriptions.push(this._coreTour.activeStep.subscribe(t=>{this.step=t,this.stepNumber=this._coreTour.currentStepIndex.getValue()+1,this.totalSteps=this._coreTour.totalSteps.getValue(),this.updatePosition()})),this.subscriptions.push(this._coreTour.currentStepIndex.subscribe(t=>{this.stepNumber=t+1})),this.subscriptions.push(this._coreTour.totalSteps.subscribe(t=>{this.totalSteps=t})),"undefined"!=typeof window&&(this.subscriptions.push(fromEvent(window,"resize").subscribe(()=>this.updatePosition())),this.subscriptions.push(fromEvent(window,"scroll").subscribe(()=>this.updatePosition())))}ngOnDestroy(){this.subscriptions.forEach(t=>t.unsubscribe())}canGoPrev(){return!(!this.step||!this._tour.hasPrev(this.step))}prev(){this.step&&this._tour.prev()}next(){this.step&&(this._tour.hasNext(this.step)?this._tour.next():this.end())}end(){this._tour.end()}nextButtonTitle(){return this.step?this._tour.hasNext(this.step)?this.step.nextBtnTitle||"Next":this.step.endBtnTitle||"Finish":"Next"}updatePosition(){if(!this.step||"undefined"==typeof window)return;const t=String(this.step.anchorId||"").trim(),e=t?this._tour.anchors[t]:null,n=e&&e.element?e.element.nativeElement:null;if(!n)return this.popoverTop=16,void(this.popoverLeft=16);const o=n.getBoundingClientRect(),r=Math.min(360,window.innerWidth-24),i=12;let a=o.bottom+i;a+220>window.innerHeight-i&&(a=o.top-220-i),a=Math.max(i,a);let s=o.left+o.width/2-r/2;s=Math.max(i,Math.min(s,window.innerWidth-r-i)),this.popoverTop=Math.round(a),this.popoverLeft=Math.round(s)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourOverlayComponent,deps:[{token:i1$3.TourService},{token:CoreTourService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:CoreTourOverlayComponent,isStandalone:!0,selector:"rio-core-tour-overlay",ngImport:i0,template:'\n\t\t@if (step) {\n\t\t\t<div [ngClass]="[\'rio-tour-popover\', step.popoverClass || \'\']" [style.top.px]="popoverTop" [style.left.px]="popoverLeft" role="dialog" aria-live="polite">\n\t\t\t\t<div class="rio-tour-header">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="rio-tour-title">{{ step.title || \'Guided Tour\' }}</div>\n\t\t\t\t\t\t@if (stepNumber > 0 && totalSteps > 0) {\n\t\t\t\t\t\t\t<div class="rio-tour-progress">Step {{ stepNumber }} of {{ totalSteps }}</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="end()">Skip</button>\n\t\t\t\t</div>\n\t\t\t\t@if (step.content) {\n\t\t\t\t\t<div class="rio-tour-content">{{ step.content }}</div>\n\t\t\t\t}\n\t\t\t\t<div class="rio-tour-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" [disabled]="!canGoPrev()" (click)="prev()">{{ step.prevBtnTitle || \'Back\' }}</button>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="next()">{{ nextButtonTitle() }}</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t',isInline:!0,styles:[".rio-tour-popover{position:fixed;z-index:1065;width:min(360px,calc(100vw - 24px));background:#fff;border:1px solid rgba(15,23,42,.15);border-radius:12px;box-shadow:0 18px 45px #0f172a47;padding:12px;color:#0f172a}.rio-tour-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.rio-tour-title{font-size:16px;font-weight:700;line-height:20px}.rio-tour-progress{font-size:12px;color:#64748b}.rio-tour-content{font-size:14px;line-height:20px;white-space:pre-line;margin-bottom:12px}.rio-tour-actions{display:flex;justify-content:space-between;gap:8px}\n"],dependencies:[{kind:"ngmodule",type:CommonModule},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreTourOverlayComponent,decorators:[{type:Component,args:[{selector:"rio-core-tour-overlay",standalone:!0,imports:[CommonModule],template:'\n\t\t@if (step) {\n\t\t\t<div [ngClass]="[\'rio-tour-popover\', step.popoverClass || \'\']" [style.top.px]="popoverTop" [style.left.px]="popoverLeft" role="dialog" aria-live="polite">\n\t\t\t\t<div class="rio-tour-header">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<div class="rio-tour-title">{{ step.title || \'Guided Tour\' }}</div>\n\t\t\t\t\t\t@if (stepNumber > 0 && totalSteps > 0) {\n\t\t\t\t\t\t\t<div class="rio-tour-progress">Step {{ stepNumber }} of {{ totalSteps }}</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="end()">Skip</button>\n\t\t\t\t</div>\n\t\t\t\t@if (step.content) {\n\t\t\t\t\t<div class="rio-tour-content">{{ step.content }}</div>\n\t\t\t\t}\n\t\t\t\t<div class="rio-tour-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" [disabled]="!canGoPrev()" (click)="prev()">{{ step.prevBtnTitle || \'Back\' }}</button>\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="next()">{{ nextButtonTitle() }}</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t}\n\t',styles:[".rio-tour-popover{position:fixed;z-index:1065;width:min(360px,calc(100vw - 24px));background:#fff;border:1px solid rgba(15,23,42,.15);border-radius:12px;box-shadow:0 18px 45px #0f172a47;padding:12px;color:#0f172a}.rio-tour-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px}.rio-tour-title{font-size:16px;font-weight:700;line-height:20px}.rio-tour-progress{font-size:12px;color:#64748b}.rio-tour-content{font-size:14px;line-height:20px;white-space:pre-line;margin-bottom:12px}.rio-tour-actions{display:flex;justify-content:space-between;gap:8px}\n"]}]}],ctorParameters:()=>[{type:i1$3.TourService},{type:CoreTourService}]});class AiTerminalService{provider;constructor(t){this.provider=t}call(t,...e){return this.provider._socket.call(t,...e)}subscribe(t,...e){return this.provider._socket.subscribe(t,...e)}subscribeBypass(t,...e){return this.provider._socket.subscribeBypassRoute(t,...e)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalService,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:ProviderService}]});class AiPageRouterService{adapters=[];registerAdapter(t){return t?(this.adapters.includes(t)||this.adapters.push(t),()=>this.unregisterAdapter(t)):()=>{}}unregisterAdapter(t){this.adapters=this.adapters.filter(e=>e!==t)}getAdapter(t){const e=this.adapters.filter(e=>e&&e.matches(t)).sort((t,e)=>(e.priority||0)-(t.priority||0));return e.length?e[0]:null}async handleMessage(t){const e=t?.context||{},n=this.getAdapter(e);if(!n)return{handled:!1};try{return await n.handle(t)}catch(t){const e=t?.message||"Unable to handle this request.";return{handled:!0,reply:e,error:e}}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageRouterService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageRouterService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageRouterService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});const DEFAULT_FORM_PATCH_METHOD="aiFormPatch";class AiPageFormAdapterService{router;registry;terminal;id="generic-form";priority=-10;constructor(t,e,n){this.router=t,this.registry=e,this.terminal=n,this.router.registerAdapter(this)}matches(t){return!0}async handle(t){if("all"===t?.context?.mode)return{handled:!1};const e=this.registry.getFormsForRoute(t?.context?.route).filter(t=>!t.element||!1!==t.element.isConnected);if(1!==e.length)return{handled:!1};const n=e[0],o=n?.form;if(!o)return{handled:!1};const r=this.buildFieldCatalog(o);if(!r.length)return{handled:!1};let i;try{i=await this.terminal.call("aiFormPatch",{message:t.message,allowed_fields:r,patch_format:this.buildPatchFormat(),route:t?.context?.route,id_client:t?.context?.idClient,id_app:t?.context?.idApp})}catch(t){const e=t?.message||"Unable to build a form patch.";return{handled:!0,reply:e,error:e}}if(i?.error){const t=i.error||"Unable to build a form patch.";return{handled:!0,reply:t,error:t}}const a=this.normalizePatchFields(i?.patch??i);if(!a.length){return{handled:!0,reply:i?.notes||"No matching fields found for this form."}}const s=this.applyFormPatch(o,a);return{handled:!0,reply:i?.notes||this.buildApplyReply(s),data:{patch:{fields:a},applied_fields:s.applied,skipped_fields:s.invalid}}}buildPatchFormat(){return["{",' "notes": "Short, plain-language explanation of what you filled in.",',' "patch": {',' "fields": [',' { "path": "field_name", "value": "any" }'," ]"," }","}"].join("\n")}buildFieldCatalog(t){const e=[];return this.walkControls(t,"",e),e}walkControls(t,e,n){if(t instanceof FormGroup)Object.keys(t.controls||{}).forEach(o=>{const r=t.controls[o],i=e?`${e}.${o}`:o;this.walkControls(r,i,n)});else{if(t instanceof FormArray){e&&n.push({name:e,type:"array"});const o=t.controls?.[0];return void(o instanceof FormGroup&&Object.keys(o.controls||{}).forEach(t=>{const r=e?`${e}.0.${t}`:`0.${t}`;this.walkControls(o.controls[t],r,n)}))}e&&n.push({name:e,type:this.inferType(t?.value)})}}inferType(t){if(t instanceof Date)return"date";if(Array.isArray(t))return"array";if(null==t)return"unknown";const e=typeof t;return"string"===e||"number"===e||"boolean"===e?e:"object"===e?"object":"unknown"}normalizePatchFields(t){return t?Array.isArray(t)?t.map(t=>this.normalizePatchField(t)).filter(t=>!!t):Array.isArray(t?.fields)?t.fields.map(t=>this.normalizePatchField(t)).filter(t=>!!t):t?.fields&&"object"==typeof t.fields?Object.entries(t.fields).map(([t,e])=>({path:t,value:e})):"object"==typeof t?Object.entries(t).map(([t,e])=>({path:t,value:e})):[]:[]}normalizePatchField(t){if(!t||"object"!=typeof t)return null;const e=String(t.path||t.field||t.name||"").trim();return e?{path:e,value:t.value}:null}applyFormPatch(t,e){const n=[],o=[];return e.forEach(e=>{const r=this.normalizePath(e.path);if(!r)return;const i=t.get(r);if(i)try{void 0!==e.value&&("function"==typeof i.patchValue&&e.value&&"object"==typeof e.value?i.patchValue(e.value):"function"==typeof i.setValue&&i.setValue(e.value),i.markAsDirty({onlySelf:!0}),i.markAsTouched({onlySelf:!0}),i.updateValueAndValidity({onlySelf:!0}),n.push(r))}catch{o.push(r)}else o.push(r)}),t.updateValueAndValidity({emitEvent:!0}),{applied:n,invalid:o}}normalizePath(t){const e=String(t||"").trim();return e?e.replace(/\[(\d+)\]/g,".$1"):""}buildApplyReply(t){return t.applied.length?t.invalid.length?`Applied ${t.applied.length} field${1===t.applied.length?"":"s"}. Skipped ${t.invalid.length} unknown field${1===t.invalid.length?"":"s"}.`:`Applied ${t.applied.length} field${1===t.applied.length?"":"s"} to the form.`:"No matching fields were applied to this form."}applyPatch(t,e){}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageFormAdapterService,deps:[{token:AiPageRouterService},{token:AiFormRegistryService},{token:AiTerminalService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageFormAdapterService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiPageFormAdapterService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:AiPageRouterService},{type:AiFormRegistryService},{type:AiTerminalService}]});const CSV_EOL="\r\n",CSV_BOM="\ufeff",CSV_DEFAULTS={filename:"export",fieldSeparator:",",quoteStrings:'"',decimalseparator:".",showLabels:!1,showTitle:!1,title:"My Report",useBom:!0,headers:[]};function exportCsv(t,e,n){const o=Array.isArray(t)?t:tryParse(t);if(!Array.isArray(o)||!o.length)return void console.log("Invalid data");const r={...CSV_DEFAULTS,...n};e&&(r.filename=e);const i=normalizeData(o,r);i.title&&!r.showTitle&&(r.showTitle=!0,r.title||(r.title=i.title));let a="";r.useBom&&(a+="\ufeff"),r.showTitle&&r.title&&(a+=`${r.title}\r\n\r\n`);const s=resolveHeaders(r,i.data),l=stripHeaderRow(i.data,s,r),c=resolveRowKeys(l,s);s.length&&(a+=`${s.join(r.fieldSeparator)}\r\n`),l.forEach(t=>{a+=`${resolveRow(t,c,r)}\r\n`});const d=new Blob([a],{type:"text/csv;charset=utf-8;"}),p=`${(r.filename||CSV_DEFAULTS.filename).replace(/ /g,"_")}.csv`;if(navigator.msSaveBlob)navigator.msSaveBlob(d,p);else{const t=document.createElement("a");t.href=URL.createObjectURL(d),t.setAttribute("visibility","hidden"),t.download=p,document.body.appendChild(t),t.click(),document.body.removeChild(t)}}function resolveHeaders(t,e){return t.headers&&t.headers.length?t.headers:t.showLabels&&e.length&&!Array.isArray(e[0])&&"object"==typeof e[0]?collectKeysInOrder(e):[]}function resolveRowKeys(t,e){return e.length?e:!t.length||Array.isArray(t[0])||"object"!=typeof t[0]?[]:Object.keys(t[0])}function resolveRow(t,e,n){return Array.isArray(t)?t.map(t=>formatValue(t,n)).join(n.fieldSeparator):e.length?e.map(e=>formatValue(t[e],n)).join(n.fieldSeparator):Object.keys(t).map(e=>formatValue(t[e],n)).join(n.fieldSeparator)}function formatValue(t,e){if("locale"===e.decimalseparator&&isFloat(t))return t.toLocaleString();if("."!==e.decimalseparator&&isFloat(t))return t.toString().replace(".",e.decimalseparator);if("string"==typeof t){const n=parseIsoDate(t);n&&(t=n.toLocaleString());let o=t.replace(/"/g,'""');return(e.quoteStrings||t.indexOf(",")>-1||t.indexOf("\n")>-1||t.indexOf("\r")>-1)&&(o=`${e.quoteStrings}${o}${e.quoteStrings}`),o}return"boolean"==typeof t?t?"TRUE":"FALSE":null==t?"":t}function normalizeData(t,e){if(!e.showLabels||!t.length||Array.isArray(t[0])||"object"!=typeof t[0])return{data:t};const[n,...o]=t;if(isTitleRow(n)){const t=Object.keys(n);return{data:o,title:String(n[t[0]])}}return{data:t}}function stripHeaderRow(t,e,n){if(!n.showLabels||!e.length||!t.length)return t;const[o,...r]=t;return isHeaderValueRow(o,e)?r:t}function collectKeysInOrder(t){const e=[];return t.forEach(t=>{Array.isArray(t)||"object"!=typeof t||Object.keys(t).forEach(t=>{-1===e.indexOf(t)&&e.push(t)})}),e}function isHeaderValueRow(t,e){return!(Array.isArray(t)||"object"!=typeof t||!e.length)&&e.every(e=>t[e]===e)}function isTitleRow(t){if(Array.isArray(t)||"object"!=typeof t||null===t)return!1;const e=Object.keys(t);if(1!==e.length)return!1;const n=t[e[0]];return"string"==typeof n&&n===e[0]}function tryParse(t){try{return JSON.parse(t)}catch(t){return console.log("Invalid CSV data",t),[]}}function isFloat(t){return+t===t&&(!isFinite(t)||Boolean(t%1))}const ISO_DATE_REGEX=/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})$/;function parseIsoDate(t){if(!ISO_DATE_REGEX.test(t))return null;const e=new Date(t);return Number.isNaN(e.getTime())?null:e}class DomSanitizorPipe{_sanitizer;constructor(t){this._sanitizer=t}transform(t,e="html"){switch(e){case"html":return this._sanitizer.bypassSecurityTrustHtml(t);case"style":return this._sanitizer.bypassSecurityTrustStyle(t);case"script":return this._sanitizer.bypassSecurityTrustScript(t);case"url":return this._sanitizer.bypassSecurityTrustUrl(t);case"resourceUrl":return this._sanitizer.bypassSecurityTrustResourceUrl(t);default:throw new Error(`Invalid safe type specified: ${e}`)}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DomSanitizorPipe,deps:[{token:i1$4.DomSanitizer}],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:DomSanitizorPipe,isStandalone:!1,name:"safe"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DomSanitizorPipe,decorators:[{type:Pipe,args:[{name:"safe",standalone:!1}]}],ctorParameters:()=>[{type:i1$4.DomSanitizer}]});const AI_TERMINAL_SUBSCRIPTION_COOLDOWN_MS=5e3,AI_TERMINAL_PROGRESS_ANALYZE_MS=4500,AI_TERMINAL_PROGRESS_DRAFT_MS=9e3,AI_TERMINAL_DEFAULT_TITLE="Ask AI About the System",AI_TERMINAL_LOCAL_CONVERSATION_PREFIX="local-convo",AI_TERMINAL_REQUEST_PREFIX="req",AI_TERMINAL_EXPORT_MAX_ROWS=5e3,AI_TERMINAL_USD_CURRENCY_TEXT_PATTERN=/\b(?:USD|US\$)(?:\s| | |[\u00A0\u202F\u2007])*\$?\s*([-+]?[0-9][0-9,]*(?:\.[0-9]+)?)/gi,AI_TERMINAL_PROMPT_FAVORITES_STORAGE_KEY="resolveioAiPromptFavorites.v1",AI_TERMINAL_PROMPT_FAVORITES_MAX=25,AI_TERMINAL_ISSUE_REPORT_MIN_REASON_CHARS=8,AI_TERMINAL_DISPLAY_ROW_PREVIEW_LIMIT=250,AI_TERMINAL_NON_CURRENCY_COLUMN_PATTERN=/\b(invoice\s*number|count|qty|quantity|index|rank|sequence|seq|id|code|ticket|number)\b/,AI_TERMINAL_CURRENCY_HINT_PATTERN=/\b(amount|price|cost|balance|fee|revenue|tax|billing|charge|payment|profit|margin|due)\b/,AI_TERMINAL_MONEY_TOTAL_PATTERN=/\b(sub\s*total|subtotal|grand\s*total|paid\s*total)\b/,AI_TERMINAL_TOTAL_WITH_MONEY_HINT_PATTERN=/\btotal\b.*\b(amount|revenue|sales|tax|price|cost|balance|paid|due|charge|billing|profit|margin)\b/,AI_TERMINAL_SUPPORT_TICKET_DIRECT_REQUEST_PATTERN=/\b(create|open|file|submit|raise)\b[\w\s]{0,40}\b(support\s*ticket|ticket)\b/i,AI_TERMINAL_SUPPORT_TICKET_AFFIRMATIVE_PATTERN=/\b(yes|yep|yeah|please|do it|go ahead|open it|create it|file it|submit it)\b/i,AI_TERMINAL_SUPPORT_TICKET_PROMPT_PATTERN=/\b(open|create|file|submit|raise)\b[\w\s]{0,40}\b(support\s*ticket|ticket)\b/i,DEFAULT_METHODS={conversationCreate:"aiTerminalConversationCreate",conversationUpdate:"aiTerminalConversationUpdate",conversationDelete:"aiTerminalConversationDelete",runOpenAI:"aiTerminalRun",uploadOpenAI:"aiTerminalUploadFile",runCodex:"aiCoderTerminalRunCodex",uploadCodex:"aiCoderTerminalUploadFile",reportIssue:"aiCoderTerminalReportIssue",deployTest:"aiCoderTerminalDeployTest",conversationsPublication:"aiTerminalConversations",messagesPublication:"aiTerminalMessages"};class AiTerminalComponent{terminal;services;pageRouter;_pageFormAdapter;locale;idClient="";idApp="";title="AI Terminal";config=null;conversationStatus="active";messageLimit=200;placeholder="Describe the change or ask a question...";singleConversation=!1;contextMode="auto";contextRoute="";paused=!1;bypassRouteSubscriptions=!1;messageScroll;conversations=[];messages=[];visibleMessages=[];activeConversationId="";activeConversation=null;messageText="";pendingFiles=[];promptFavoriteEnabled=!1;promptFavorites=[];isSending=!1;isDeployingTest=!1;isLoading=!1;errorMessage="";infoMessage="";editingConversationId="";editingTitle="";favoritePromptEditOpen=!1;favoritePromptEditOriginal="";favoritePromptEditValue="";issueReportOpen=!1;issueReportMessageId="";issueReportConversationId="";issueReportReason="";issueReportExpected="";isSubmittingIssueReport=!1;messagePartsCache=new Map;messageMarkdownCache=new Map;messageTablePresenceCache=new Map;displayTableCache=new Map;messageContentOverrides=new Map;messageDisplayOverrides=new Map;supportTicketMap=new Map;supportTicketInFlight=new Set;serverMessages=[];localMessagesByConversation=new Map;localMessageCounter=0;requestCounter=0;localConversationCounter=0;collapsedTableIds=new Set;expandedDebugIds=new Set;pendingProgressTimers=new Map;supportTicketStorageKey="resolveioAiSupportTicketMap";promptFavoritesStorageKey="resolveioAiPromptFavorites.v1";mongoReadCache=new Map;mongoReadInFlight=new Set;exportingMessageIds=new Set;loadingAllRowsMessageIds=new Set;fullDisplayPromises=new Map;fullDisplayCache=new Map;pulledAllMessageIds=new Set;subscribedConversationId="";conversationsSub;messagesSub;conversationsSubKey="";messagesSubKey="";subscriptionsPaused=!1;pauseTimer=null;pendingConversationId="";pendingConversation=null;createConversationPromise=null;currencySymbol="$";aiDebugEnabled=!1;timeZoneLabel=this.resolveTimeZoneLabel();constructor(t,e,n,o,r){this.terminal=t,this.services=e,this.pageRouter=n,this._pageFormAdapter=o,this.locale=r;try{this.currencySymbol=getCurrencySymbol("USD","narrow",this.locale)}catch{this.currencySymbol="$"}}get _services(){return this.services}refreshDebugFlag(){if("undefined"!=typeof window)try{const t=String(localStorage.getItem("resolveio.ai.debug")||"").trim().toLowerCase();this.aiDebugEnabled="1"===t||"true"===t||"on"===t}catch{this.aiDebugEnabled=!1}else this.aiDebugEnabled=!1}debugNow(){return"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()}debugLog(t,e){if(!this.aiDebugEnabled||"undefined"==typeof console||"function"!=typeof console.debug)return;const n=e&&"object"==typeof e?e:{};console.debug(`[AI.Terminal] ${t}`,n)}ngOnInit(){this.refreshDebugFlag(),this.loadSupportTicketMap(),this.loadPromptFavorites(),this.paused||this.subscribeConversations()}ngOnChanges(t){this.refreshDebugFlag(),t.paused&&(this.paused?this.schedulePause():(this.cancelPause(),(this.subscriptionsPaused||!this.conversationsSub||this.conversationsSub.closed)&&(this.subscriptionsPaused=!1,this.subscribeConversations(!0)),this.ensureMessageSubscription()),this.debugLog("paused.changed",{paused:this.paused,subscriptionsPaused:this.subscriptionsPaused,hasConversationsSub:!!this.conversationsSub&&!this.conversationsSub.closed,hasMessagesSub:!!this.messagesSub&&!this.messagesSub.closed})),(t.idClient||t.idApp||t.config)&&(this.loadPromptFavorites(),this.paused||this.subscribeConversations(),this.updateVisibleMessages(),this.debugLog("identity.changed",{idClient:this.idClient||"",idApp:this.idApp||"",hasConfig:!!this.config}))}ngOnDestroy(){this.cancelPause(),this.pendingProgressTimers.forEach(t=>t.forEach(t=>clearTimeout(t))),this.pendingProgressTimers.clear(),this.unsubscribeAll()}isCodexMode(){return"codex"===this.resolveMode()}showAdvanced(){return!0===this.resolveConfig()?.showAdvanced}showToolMessages(){const t=this.resolveConfig();return void 0!==t?.showToolMessages?!!t.showToolMessages:this.showAdvanced()}allowUploads(){return!1!==this.resolveConfig()?.allowUploads}maxFileMb(){return Number(this.resolveConfig()?.maxFileMb)||50}maxTotalMb(){return Number(this.resolveConfig()?.maxTotalMb)||100}deleteFilesAfterRun(){const t=this.resolveConfig();return!1!==t?.deleteFilesAfterRun}totalTokens(){return(this.messages||[]).reduce((t,e)=>t+(e?.usage?.total_tokens||0),0)}filteredMessages(){return this.visibleMessages}messageParts(t){const e=this.getMessageContent(t);if(!e)return[];const n=this.messageRenderCacheKey(t),o=this.messageUpdatedAtKey(t),r=this.messagePartsCache.get(n);if(r&&r.updatedAtKey===o)return r.value;const i=this.splitMessageContent(e);return this.messagePartsCache.set(n,{updatedAtKey:o,value:i}),i}messageMarkdown(t){let e=this.getMessageContent(t);if(!e)return"";t?.metadata?.tool_result?.output?.display&&(e=this.stripMarkdownTables(e));const n=this.messageRenderCacheKey(t),o=this.messageUpdatedAtKey(t),r=this.messageMarkdownCache.get(n);if(r&&r.updatedAtKey===o)return r.value;const i=this.markdownToHtml(e);return this.messageMarkdownCache.set(n,{updatedAtKey:o,value:i}),i}clearMessageRenderCaches(){this.messagePartsCache.clear(),this.messageMarkdownCache.clear(),this.messageTablePresenceCache.clear(),this.displayTableCache.clear()}messageRenderCacheKey(t){const e=String(t?._id||"").trim();return e||`${t?.role||"message"}:${this.messageTimestamp(t)}`}messageUpdatedAtKey(t){return this.messageTimestamp(t)}updateVisibleMessages(){this.showToolMessages()?this.visibleMessages=[...this.messages||[]]:this.visibleMessages=(this.messages||[]).filter(t=>"tool"!==t?.role)}trackByMessagePart(t,e){return e?.route?`route-${e.route}-${t}`:`text-${t}-${e.text?.length||0}`}markdownToHtml(t){const e=String(t||"").replace(/\r\n/g,"\n");if(!e.trim())return"";const n=e.split("\n"),o=[];let r=[],i=!1,a=!1;const s=()=>{if(!r.length)return;const t=r.map(t=>this.formatInlineMarkdown(t)).join("<br>");o.push(`<p>${t}</p>`),r=[]},l=()=>{i&&(o.push("</ul>"),i=!1),a&&(o.push("</ol>"),a=!1)};for(let t=0;t<n.length;t+=1){const e=n[t],c=e.trim();if(this.isMarkdownTableHeader(e,n[t+1])){s(),l();const e=this.parseMarkdownTable(n,t);o.push(e.html),t=e.nextIndex-1;continue}const d=e.match(/^\s*(#{1,6})\s+(.*)$/);if(d){s(),l();const t=d[1].length;o.push(`<h${t}>${this.formatInlineMarkdown(d[2])}</h${t}>`);continue}const p=e.match(/^\s*[-*\u2022]\s+(.*)$/);if(p){s(),a&&(o.push("</ol>"),a=!1),i||(o.push("<ul>"),i=!0),o.push(`<li>${this.formatInlineMarkdown(p[1])}</li>`);continue}const u=e.match(/^\s*\d+\.\s+(.*)$/);u?(s(),i&&(o.push("</ul>"),i=!1),a||(o.push("<ol>"),a=!0),o.push(`<li>${this.formatInlineMarkdown(u[1])}</li>`)):c?r.push(e):(s(),l())}return s(),l(),o.join("\n").trim()}formatInlineMarkdown(t){let e=this.escapeHtml(t);const n=[];e=e.replace(/`([^`]+)`/g,(t,e)=>{const o=`__CODE_${n.length}__`;return n.push(`<code>${e}</code>`),o});const o=[];return e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(t,e,n)=>{const r=`__LINK_${o.length}__`;return o.push(this.buildAnchor(e,n)),r}),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/(^|[^*])\*([^*]+)\*(?!\*)/g,"$1<em>$2</em>"),e=this.linkifyRoutes(e),o.forEach((t,n)=>{e=e.replace(`__LINK_${n}__`,t)}),n.forEach((t,n)=>{e=e.replace(`__CODE_${n}__`,t)}),e}escapeHtml(t){return String(t||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}linkifyRoutes(t){return t.replace(/\/[a-z0-9][a-z0-9/_-]*(?:\?[a-z0-9=&%._-]+)?(?:#[a-z0-9._-]+)?/gi,(e,n,o)=>{const r="number"==typeof n?n:0,i="string"==typeof o?o:t;return">"===(r>0?i[r-1]:"")||this.isRouteBoundary(i,r)?this.buildAnchor(e,e):e})}buildAnchor(t,e){const n=String(e||"").trim();if(!n)return t;const o=/^https?:\/\//i.test(n);return n.startsWith("/")||o?`<a href="${n}" target="_blank" rel="noopener" class="ai-terminal-route-link">${t}</a>`:t}isMarkdownTableHeader(t,e){if(!t||!e)return!1;if(!t.includes("|"))return!1;const n=e.trim();return!!n.includes("|")&&(/^[:|\-\s]+$/.test(n)&&n.includes("-"))}parseMarkdownTable(t,e){const n=this.splitMarkdownTableRow(t[e]);let o=e+2;const r=[];for(;o<t.length;){const e=t[o];if(!e.trim()||!e.includes("|"))break;r.push(this.splitMarkdownTableRow(e)),o+=1}const i=n.length||1,a=t=>{const e=t.slice(0,i);for(;e.length<i;)e.push("");return e};return{html:`<div class="ai-terminal-table-wrap"><table class="ai-terminal-table"><thead><tr>${a(n).map(t=>`<th>${this.formatInlineMarkdown(t)}</th>`).join("")}</tr></thead><tbody>${r.map(t=>`<tr>${a(t).map(t=>`<td>${this.formatInlineMarkdown(t)}</td>`).join("")}</tr>`).join("")}</tbody></table></div>`,nextIndex:o}}splitMarkdownTableRow(t){const e=String(t||"").trim();if(!e)return[];return e.replace(/^\|/,"").replace(/\|$/,"").split("|").map(t=>t.trim())}formatFileSize(t){if(!t||!Number.isFinite(t))return"0 B";if(t<1024)return`${t} B`;const e=t/1024;if(e<1024)return`${e.toFixed(1)} KB`;return`${(e/1024).toFixed(1)} MB`}trackByConversation(t,e){return e?._id||`convo-${t}`}trackByMessage(t,e){return e?._id||`message-${t}`}trackByFavoritePrompt(t,e){return`${t}-${e}`}async createConversation(){this.errorMessage="";try{const{id:t,conversation:e}=await this.createNewConversation();if(!t||!e)return;this.pendingConversationId=t,this.pendingConversation=e,this.activeConversationId=t,this.activeConversation=e,this.conversations=this.mergePendingConversation(this.conversations),this.localMessagesByConversation.set(t,[]),this.refreshMergedMessages(),this.paused||this.subscribeMessages(t)}catch(t){this.errorMessage=t?.message||"Unable to create a new conversation."}}setActiveConversation(t){t?._id&&(this.activeConversationId=t._id,this.activeConversation=t,this.subscribeMessages(t._id))}startRename(t){t?._id&&(this.editingConversationId=t._id,this.editingTitle=t.title||"")}cancelRename(){this.editingConversationId="",this.editingTitle=""}async saveRename(t){if(!t?._id)return;const e=(this.editingTitle||"").trim();if(e)try{await this.terminal.call(this.methodNames().conversationUpdate||DEFAULT_METHODS.conversationUpdate,t._id,{title:e}),this.cancelRename()}catch(t){this.errorMessage=t?.message||"Unable to rename conversation."}else this.cancelRename()}async deleteConversation(t){if(!t?._id)return;if(window.confirm("Delete this conversation?"))try{await this.terminal.call(this.methodNames().conversationDelete||DEFAULT_METHODS.conversationDelete,t._id),this.localMessagesByConversation.delete(t._id),this.activeConversationId===t._id&&(this.activeConversationId="",this.activeConversation=null,this.messages=[])}catch(t){this.errorMessage=t?.message||"Unable to delete conversation."}}async sendMessage(){if(this.isSending)return;const t=(this.messageText||"").trim();if(!t)return;this.promptFavoriteEnabled&&this.addPromptFavorite(t),this.promptFavoriteEnabled=!1,this.errorMessage="",this.isSending=!0;const e=this.generateRequestId();this.messageText="";let n="",o="",r="",i="";try{n=this.ensureLocalConversationForSend(),o=n;if(!0===this.resolveConfig()?.pageRouterEnabled&&!this.pendingFiles.length){const o=this.buildPageRouterContext(t),i=await this.pageRouter.handleMessage({message:t,context:o});if(i?.handled){r=this.appendLocalMessage(n,"user",t,{request_id:e});const o=i.reply||(i.error?`Unable to complete request: ${i.error}`:"Done.");return o&&this.appendLocalMessage(n,"assistant",o,{...i.data||{},request_id:e}),i.error&&(this.errorMessage=i.error),void(this.pendingFiles=[])}}r=this.appendLocalMessage(n,"user",t,{request_id:e}),i=this.appendLocalMessage(n,"assistant","Queued...",{progress:["Queued"],request_id:e},{pending:!0}),i&&this.schedulePendingProgress(i),n=await this.ensureConversationId(),n&&o&&n!==o&&this.reparentLocalConversation(o,n),n&&i&&this.updateLocalMessage(n,i,{content:"Planning...",metadata:{progress:["Planning"],pending:!0,request_id:e}}),n&&this.subscribedConversationId!==n&&this.subscribeMessages(n);const a=await this.uploadPendingFiles(),s={id_conversation:n||void 0,id_client:this.idClient||void 0,id_app:this.idApp||void 0,message:t,request_id:e,attachments:a,delete_files_after_run:this.deleteFilesAfterRun(),context:this.buildMessageContext(t)};if("openai"===this.resolveMode()){s.guardrails=!1!==this.resolveConfig()?.guardrails,s.profile_id=this.resolveConfig()?.profileId,s.config={mode:"openai",model:this.resolveConfig()?.model,system_prompt:this.resolveConfig()?.systemPrompt,user_prompt_template:this.resolveConfig()?.userPromptTemplate,response_format:this.resolveConfig()?.responseFormat,temperature:this.resolveConfig()?.temperature,max_tokens:this.resolveConfig()?.maxTokens};const t=await this.terminal.call(this.methodNames().runOpenAI||DEFAULT_METHODS.runOpenAI,s);this.applyServerMessageToLocal(n,e,t?.message),this.afterRunResponse(t?.conversation)}else{if(!s.id_app)throw new Error("App id is required for code changes.");const t=this.resolveMongoConfig();t&&(s.mongo=t);const o=this.resolveCodexPayloadConfig();o&&(s.config=o);const r=await this.terminal.call(this.methodNames().runCodex||DEFAULT_METHODS.runCodex,s);this.applyServerMessageToLocal(n,e,r?.message,r?.tool_result),this.afterRunResponse(r?.conversation)}this.pendingFiles=[]}catch(t){this.errorMessage=t?.message||"Unable to send message.",n&&r&&this.removeLocalMessage(n,r),n&&i&&this.removeLocalMessage(n,i)}finally{this.isSending=!1}}async startNewConversation(){this.pendingConversationId="",this.pendingConversation=null,this.activeConversationId="",this.activeConversation=null,this.promptFavoriteEnabled=!1,this.subscribedConversationId="",this.serverMessages=[],this.messages=[],this.refreshMergedMessages(),await this.createConversation()}async deployTest(){if(this.activeConversationId&&!this.isDeployingTest){this.errorMessage="",this.infoMessage="",this.isDeployingTest=!0;try{const t=await this.terminal.call(this.methodNames().deployTest||DEFAULT_METHODS.deployTest,this.activeConversationId);this.infoMessage=t?.build_id?`Test deploy started (${t.build_id}).`:"Test deploy started."}catch(t){this.errorMessage=t?.message||"Unable to deploy test build."}finally{this.isDeployingTest=!1}}}handleFileSelect(t){const e=t.target,n=Array.from(e?.files||[]);if(!n.length)return;const o=1024*this.maxFileMb()*1024,r=1024*this.maxTotalMb()*1024;let i=this.pendingFiles.reduce((t,e)=>t+e.size,0);n.forEach(t=>{t.size>o?this.errorMessage=`File ${t.name} exceeds ${this.maxFileMb()}MB.`:i+t.size>r?this.errorMessage=`Total upload size exceeds ${this.maxTotalMb()}MB.`:(i+=t.size,this.pendingFiles.push(t))}),e.value=""}removePendingFile(t){this.pendingFiles.splice(t,1)}clearComposer(){this.messageText="",this.pendingFiles=[],this.promptFavoriteEnabled=!1}togglePromptFavorite(){this.promptFavoriteEnabled=!this.promptFavoriteEnabled}async runFavoritePrompt(t){const e=this.normalizeFavoritePrompt(t);e&&!this.isSending&&(this.messageText=e,this.promptFavoriteEnabled=!1,await this.sendMessage())}removeFavoritePrompt(t,e){e&&(e.preventDefault(),e.stopPropagation()),this.removePromptFavorite(t)}startFavoritePromptEdit(t,e){e&&(e.preventDefault(),e.stopPropagation());const n=this.normalizeFavoritePrompt(t);n&&(this.favoritePromptEditOriginal=n,this.favoritePromptEditValue=n,this.favoritePromptEditOpen=!0)}cancelFavoritePromptEdit(){this.favoritePromptEditOpen=!1,this.favoritePromptEditOriginal="",this.favoritePromptEditValue=""}canSaveFavoritePromptEdit(){if(!this.favoritePromptEditOpen)return!1;const t=this.normalizeFavoritePrompt(this.favoritePromptEditValue);return!!t&&t.toLowerCase()!==this.favoritePromptEditOriginal.toLowerCase()}saveFavoritePromptEdit(){if(!this.favoritePromptEditOpen)return;const t=this.normalizeFavoritePrompt(this.favoritePromptEditOriginal),e=this.normalizeFavoritePrompt(this.favoritePromptEditValue);if(!t||!e)return;const n=t.toLowerCase(),o=this.promptFavorites.map(t=>{const o=this.normalizeFavoritePrompt(t);return o.toLowerCase()===n?e:o}),r=[],i=new Set;o.forEach(t=>{const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase();i.has(n)||(i.add(n),r.push(e))}),this.promptFavorites=r.slice(0,25),this.savePromptFavorites(),this.cancelFavoritePromptEdit()}canToggleFavoriteForMessage(t){return"user"===t?.role&&!!this.extractFavoritePromptFromMessage(t)}isMessagePromptFavorited(t){return this.isPromptFavorited(this.extractFavoritePromptFromMessage(t))}toggleMessagePromptFavorite(t,e){e&&(e.preventDefault(),e.stopPropagation());const n=this.extractFavoritePromptFromMessage(t);n&&(this.isPromptFavorited(n)?this.removePromptFavorite(n):this.addPromptFavorite(n))}resolveConfig(){return this.config||null}resolveMongoConfig(){const t=this.resolveConfig()?.mongo;return t?void 0===t.access&&void 0!==t.readonly?{...t,access:t.readonly?"read":"readWrite"}:t:null}resolveMode(){return this.resolveConfig()?.mode||"openai"}resolveCodexPayloadConfig(){const t=this.resolveConfig();if(!t)return null;const e=String(t.model||"").trim(),n=this.resolveCodexFallbackModels(t);if(!e&&!n.length)return null;const o={mode:"codex"};return e&&(o.model=e),1===n.length?o.fallback_model=n[0]:n.length>1&&(o.fallback_models=n),o}resolveCodexFallbackModels(t){const e=[],n=t=>{const n=String(t||"").trim();n&&!e.includes(n)&&e.push(n)};if(Array.isArray(t.fallbackModels))t.fallbackModels.forEach(n);else{const e=String(t?.fallbackModels||"").trim();e&&e.split(",").forEach(n)}return n(t.fallbackModel),e}resolveBranchEnabled(){const t=this.resolveConfig();return void 0!==t?.branchEnabled?!!t.branchEnabled:"codex"===this.resolveMode()}methodNames(){return{...DEFAULT_METHODS,...this.resolveConfig()?.methodNames||{}}}subscribeConversations(t=!1){const e=this.debugNow();if(this.debugLog("subscribeConversations.start",{preserveMessages:t,paused:this.paused,idClient:this.idClient||"",idApp:this.idApp||"",status:this.conversationStatus||"active"}),this.paused)return this.isLoading=!1,void this.debugLog("subscribeConversations.skip.paused");const n=this.methodNames().conversationsPublication||DEFAULT_METHODS.conversationsPublication,o=JSON.stringify({publication:n,idClient:this.idClient||"",idApp:this.idApp||"",status:this.conversationStatus||"active",bypass:!!this.bypassRouteSubscriptions});if(this.conversationsSub&&!this.conversationsSub.closed&&this.conversationsSubKey===o)return this.conversations=this.filterConversations(this.conversations||[]),this.ensureActiveConversation(t),this.isLoading=!1,void this.debugLog("subscribeConversations.reuse",{count:this.conversations.length,elapsedMs:Math.round(this.debugNow()-e)});this.conversationsSubKey=o,this.conversationsSub?.unsubscribe(),this.isLoading=!0;const r=this.bypassRouteSubscriptions?this.terminal.subscribeBypass(n,this.idClient||"",this.idApp||"",this.conversationStatus||"active"):this.terminal.subscribe(n,this.idClient||"",this.idApp||"",this.conversationStatus||"active");this.conversationsSub=r.subscribe({next:n=>{this.conversations=this.mergePendingConversation(this.filterConversations(n||[])),this.ensureActiveConversation(t),this.isLoading=!1,this.debugLog("subscribeConversations.next",{count:this.conversations.length,activeConversationId:this.activeConversationId||"",elapsedMs:Math.round(this.debugNow()-e)})},error:()=>{this.errorMessage="Unable to load conversations.",this.isLoading=!1,this.debugLog("subscribeConversations.error",{elapsedMs:Math.round(this.debugNow()-e)})}})}filterConversations(t){const e=this.resolveMode();return(t||[]).filter(t=>!e||(!t.mode||t.mode===e))}ensureActiveConversation(t=!1){if(this.activeConversationId){const e=this.conversations.find(t=>t._id===this.activeConversationId);if(e)return this.activeConversation=e,void(t&&this.subscribeMessages(e._id,!0))}this.conversations.length?this.setActiveConversation(this.conversations[0]):(this.activeConversationId="",this.activeConversation=null,this.messages=[],this.serverMessages=[],this.refreshMergedMessages(),this.messagesSub?.unsubscribe())}subscribeMessages(t,e=!1){const n=this.debugNow();if(this.debugLog("subscribeMessages.start",{conversationId:t||"",preserveExisting:e,paused:this.paused,messageLimit:this.messageLimit}),this.paused)return void this.debugLog("subscribeMessages.skip.paused",{conversationId:t||""});const o=this.methodNames().messagesPublication||DEFAULT_METHODS.messagesPublication,r=JSON.stringify({publication:o,conversationId:t,limit:this.messageLimit,bypass:!!this.bypassRouteSubscriptions});if(this.messagesSub&&!this.messagesSub.closed&&this.messagesSubKey===r)return void this.debugLog("subscribeMessages.reuse",{conversationId:t||"",elapsedMs:Math.round(this.debugNow()-n)});this.messagesSubKey=r,this.messagesSub?.unsubscribe();const i=this.subscribedConversationId===t;this.subscribedConversationId=t,e&&i||(this.serverMessages=[],this.refreshMergedMessages());const a=this.bypassRouteSubscriptions?this.terminal.subscribeBypass(o,t,this.messageLimit):this.terminal.subscribe(o,t,this.messageLimit);this.messagesSub=a.subscribe({next:e=>{this.serverMessages=this.capMessages(e||[]),this.refreshMergedMessages(),this.debugLog("subscribeMessages.next",{conversationId:t||"",serverCount:this.serverMessages.length,elapsedMs:Math.round(this.debugNow()-n)})},error:()=>{this.errorMessage="Unable to load messages.",this.debugLog("subscribeMessages.error",{conversationId:t||"",elapsedMs:Math.round(this.debugNow()-n)})}})}async uploadPendingFiles(){if(!this.allowUploads()||!this.pendingFiles.length)return[];const t=await this.ensureConversationId(),e=[];for(const n of this.pendingFiles){const o=await this.readFileAsBase64(n),r="codex"===this.resolveMode()?this.methodNames().uploadCodex||DEFAULT_METHODS.uploadCodex:this.methodNames().uploadOpenAI||DEFAULT_METHODS.uploadOpenAI,i=await this.terminal.call(r,t,n.name,o,n.size,n.type);e.push({id:i?.id_file||i?.id,name:i?.name||n.name,type:i?.type||n.type,size:i?.size||n.size,local_path:i?.local_path})}return e}readFileAsBase64(t){return new Promise((e,n)=>{const o=new FileReader;o.onload=()=>{const t="string"==typeof o.result?o.result:"",n=t.includes(",")?t.split(",")[1]:t;e(n)},o.onerror=()=>{n(o.error||new Error("Unable to read file."))},o.readAsDataURL(t)})}afterRunResponse(t){if(t?._id){const e=this.subscribedConversationId!==t._id;this.activeConversationId=t._id,this.activeConversation=t,!this.paused&&e&&this.subscribeMessages(t._id)}}handleComposerKeydown(t){t.isComposing||"Enter"===t.key&&(t.shiftKey||(t.preventDefault(),!this.isSending&&(this.messageText||"").trim()&&this.sendMessage()))}buildMessageContext(t){const e=String(this.contextRoute||"").trim();if("all"===this.contextMode)return{mode:"all"};if("current"===this.contextMode)return e?{mode:"current",route:e}:{mode:"all"};if(!e)return{mode:"all"};const n=String(t||"").toLowerCase();return[/\bthis\s+(page|screen|view|panel|form|tab|section|dialog|modal|drawer)\b/,/\bon\s+this\b/,/\bcurrent\s+(page|screen|view)\b/,/\bhere\b/,/\bwhy\s+is\s+(this|it)\b/,/\bwhy\s+does\s+(this|it)\b/,/\bwhat\s+is\s+(this|it)\b/].some(t=>t.test(n))?{mode:"current",route:e}:{mode:"all"}}buildPageRouterContext(t){const e=String(this.contextRoute||"").trim(),n=this.buildMessageContext(t).mode,o=this.services?._app?.environment?.value||{},r=o.FEATURE_FLAGS&&"object"==typeof o.FEATURE_FLAGS?o.FEATURE_FLAGS:o.FEATURE_GATES&&"object"==typeof o.FEATURE_GATES?o.FEATURE_GATES:o.MODULE_GATES&&"object"==typeof o.MODULE_GATES?o.MODULE_GATES:void 0;return{route:e||void 0,mode:n,idClient:this.idClient||void 0,idApp:this.idApp||void 0,featureFlags:r}}refreshMergedMessages(){const t=this.aiDebugEnabled,e=t?this.debugNow():0,n=this.activeConversationId||"";let o=n&&this.localMessagesByConversation.get(n)||[];if(o=this.syncLocalMessages(n,o,this.serverMessages),this.messages=this.mergeMessages(this.serverMessages,o),this.applyStoredSupportTicketOverrides(),this.applyStoredMongoReadOverrides(),this.processSupportTicketDirectives(this.messages),this.processMongoDirectives(this.messages),this.updateVisibleMessages(),this.scrollToBottom(),t){const t=Math.round(this.debugNow()-e);(t>=20||this.supportTicketInFlight.size||this.mongoReadInFlight.size)&&this.debugLog("refreshMergedMessages",{conversationId:n||"",serverCount:this.serverMessages.length,localCount:o.length,mergedCount:this.messages.length,mongoInFlight:this.mongoReadInFlight.size,supportTicketInFlight:this.supportTicketInFlight.size,elapsedMs:t})}}mergeMessages(t,e){const n=new Set;(e||[]).forEach(t=>{if(!this.isPendingAssistantMessage(t))return;const e=String(t?.metadata?.request_id||"").trim();e&&n.add(e)});const o=[...(t||[]).filter(t=>{if("assistant"!==t?.role||!0!==t?.metadata?.pending)return!0;const e=String(t?.metadata?.request_id||"").trim();return!e||!n.has(e)}),...e||[]],r=new Set;return o.filter(t=>{const e=String(t?._id||"").trim()||`${t?.role||"message"}:${this.messageTimestamp(t)}:${t?.content||""}`;return!r.has(e)&&(r.add(e),!0)}).sort((t,e)=>this.compareMessages(t,e))}capMessages(t){if(!Array.isArray(t)||!t.length)return[];const e=Number(this.messageLimit),n=Number.isFinite(e)?Math.min(Math.max(Math.round(e),1),400):200;return t.length<=n?t:t.slice(t.length-n)}syncLocalMessages(t,e,n){if(!t||!e.length||!n.length)return e;const o=new Map,r=[],i=new Set,a=new Set,s=new Map;n.forEach(t=>{const e=t?.role||"",n=this.normalizeMessageContent(t?.content);if(e&&n){const t=`${e}::${n}`;o.set(t,(o.get(t)||0)+1)}if("assistant"===e){const e=this.messageTimestamp(t);e>0&&r.push(e)}const l=String(t?.metadata?.request_id||"").trim();l&&(i.add(l),"assistant"===e&&(a.add(l),s.has(l)||s.set(l,t)))});let l=!1;s.size&&(e=(e||[]).map(t=>{if(!this.isPendingAssistantMessage(t))return t;const e=String(t?.metadata?.request_id||"").trim();if(!e)return t;const n=s.get(e);if(!n?.metadata?.pending)return t;const o=this.mergeProgressLists(t?.metadata?.progress,n?.metadata?.progress),r=Array.isArray(t?.metadata?.progress)?t.metadata?.progress:[];if(!o.length)return t;return o.length!==r.length||o.some((t,e)=>t!==r[e])?(l=!0,{...t,metadata:{...t.metadata||{},progress:o},updatedAt:new Date}):t}));const c=[],d=e.filter(t=>{if(!this.isLocalMessage(t))return!0;const e=String(t?.metadata?.request_id||"").trim();if(this.isPendingAssistantMessage(t)){if(e){const n=s.get(e);if(n)return!0===n?.metadata?.pending||(t?._id&&c.push(String(t._id)),!1)}const n=this.messageTimestamp(t);if(e&&a.has(e))return t?._id&&c.push(String(t._id)),!1;if(!n||!r.length)return!0;const o=!r.some(t=>t>=n);return!o&&t?._id&&c.push(String(t._id)),o}if(e&&i.has(e))return t?._id&&c.push(String(t._id)),!1;const n=t?.role||"",l=this.normalizeMessageContent(t?.content);if(!n||!l)return!0;const d=`${n}::${l}`,p=o.get(d)||0;return!(p>0)||(o.set(d,p-1),t?._id&&c.push(String(t._id)),!1)});return d.length!==e.length?(this.localMessagesByConversation.set(t,d),c.forEach(t=>this.clearPendingProgressTimers(t))):l&&this.localMessagesByConversation.set(t,d),d}messageTimestamp(t){const e=t?.createdAt,n=t?.updatedAt,o=e?new Date(e).getTime():0;if(o)return o;const r=n?new Date(n).getTime():0;if(r)return r;const i=String(t?.metadata?.request_id||"").trim();if(i){const t=i.match(/-(\d{10,})-/);if(t?.[1]){const e=Number(t[1]);if(Number.isFinite(e)&&e>0)return e}}return 0}compareMessages(t,e){const n=this.messageTimestamp(t),o=this.messageTimestamp(e),r=String(t?.role||"").toLowerCase(),i=String(e?.role||"").toLowerCase(),a=String(t?.metadata?.request_id||"").trim(),s=String(e?.metadata?.request_id||"").trim();if("assistant"===r&&"user"===i&&a&&(!s||a===s))return 1;if("assistant"===i&&"user"===r&&s&&(!a||a===s))return-1;if(0===n&&0!==o)return 1;if(0===o&&0!==n)return-1;if(n!==o)return n-o;if(a&&a===s){const n=this.roleSortRank(t)-this.roleSortRank(e);if(0!==n)return n}const l=this.roleSortRank(t)-this.roleSortRank(e);if(0!==l)return l;const c=String(t?._id||""),d=String(e?._id||"");if(c&&d&&c!==d)return c.localeCompare(d);const p=String(t?.content||""),u=String(e?.content||"");return p.localeCompare(u)}roleSortRank(t){const e=String(t?.role||"").toLowerCase();return"user"===e?0:"assistant"===e?1:"tool"===e?2:3}isLocalMessage(t){return!0===t?.metadata?.local}isPendingAssistantMessage(t){return this.isLocalMessage(t)&&"assistant"===t?.role&&!0===t?.metadata?.pending}normalizeMessageContent(t){return this.normalizeUsdCurrencyText(String(t||"").trim())}normalizeUsdCurrencyText(t){const e=String(t||"");return e?e.replace(AI_TERMINAL_USD_CURRENCY_TEXT_PATTERN,(t,e)=>`$${e}`):""}mergeProgressLists(t,e){const n=[],o=new Set,r=t=>{const e=String(t||"").trim();if(!e)return;const r=e.toLowerCase();o.has(r)||(o.add(r),n.push(e))};return(Array.isArray(t)?t:[]).forEach(r),(Array.isArray(e)?e:[]).forEach(r),n}appendLocalMessage(t,e,n,o,r){const i=String(n||"").trim();if(!t||!i)return"";const a=new Date,s=`local-${a.getTime()}-${this.localMessageCounter++}`,l={...o||{},local:!0};r?.pending&&(l.pending=!0);const c={_id:s,id_conversation:t,role:e,content:i,metadata:l,createdAt:a,updatedAt:a},d=this.localMessagesByConversation.get(t)||[];return d.push(c),this.localMessagesByConversation.set(t,d),this.refreshMergedMessages(),s}removeLocalMessage(t,e){if(!t||!e)return;const n=this.localMessagesByConversation.get(t)||[];if(!n.length)return;const o=n.filter(t=>t?._id!==e);o.length!==n.length&&(this.localMessagesByConversation.set(t,o),this.clearPendingProgressTimers(e),this.refreshMergedMessages())}updateLocalMessage(t,e,n){if(!t||!e)return;const o=this.localMessagesByConversation.get(t)||[];if(!o.length)return;const r=o.findIndex(t=>t?._id===e);if(-1===r)return;const i=o[r],a={...i,...n,metadata:{...i.metadata||{},...n.metadata||{}},updatedAt:n.updatedAt||new Date};o[r]=a,this.localMessagesByConversation.set(t,o),this.refreshMergedMessages()}findLocalMessageById(t){if(!t)return null;for(const[e,n]of this.localMessagesByConversation.entries()){const o=(n||[]).find(e=>e?._id===t);if(o)return{conversationId:e,message:o}}return null}schedulePendingProgress(t){if(!t)return;this.clearPendingProgressTimers(t);const e=[];[{delay:4500,label:"Analyzing request"},{delay:9e3,label:"Drafting response"}].forEach(n=>{const o=setTimeout(()=>{const e=this.findLocalMessageById(t);if(!e||!e.message?.metadata?.pending)return void this.clearPendingProgressTimers(t);const o=Array.isArray(e.message.metadata?.progress)?[...e.message.metadata.progress]:[];o.map(t=>String(t||"").toLowerCase()).includes(n.label.toLowerCase())||(o.push(n.label),this.updateLocalMessage(e.conversationId,t,{metadata:{progress:o}}))},n.delay);e.push(o)}),this.pendingProgressTimers.set(t,e)}clearPendingProgressTimers(t){const e=this.pendingProgressTimers.get(t);e&&(e.forEach(t=>clearTimeout(t)),this.pendingProgressTimers.delete(t))}applyServerMessageToLocal(t,e,n,o){if(!t||!e||!n)return;const r=this.localMessagesByConversation.get(t)||[],i=r.findIndex(t=>"assistant"===t?.role&&t?.metadata?.request_id===e);if(-1===i)return;const a=r[i],s={...a.metadata||{},...n.metadata||{},pending:!1};o&&(s.tool_result=o);const l={...a,content:n.content||a.content,metadata:s,usage:n.usage||a.usage,createdAt:n.createdAt||a.createdAt,updatedAt:n.updatedAt||new Date};r[i]=l,this.localMessagesByConversation.set(t,r),this.clearPendingProgressTimers(a?._id||n._id||""),this.refreshMergedMessages()}async ensureConversationId(){if(this.activeConversationId&&!this.isLocalConversationId(this.activeConversationId))return this.activeConversationId;const t=this.activeConversationId,{id:e,conversation:n}=await this.createNewConversation();return e&&(this.activeConversationId=e,n&&(this.pendingConversationId=e,this.pendingConversation=n,this.conversations=this.mergePendingConversation(this.conversations)),t&&t!==e&&this.reparentLocalConversation(t,e)),e}ensureLocalConversationForSend(){if(this.activeConversationId)return this.activeConversationId;const t=new Date,e=`local-convo-${t.getTime()}-${this.localConversationCounter++}`,n={_id:e,id_client:this.idClient||void 0,id_app:this.idApp||void 0,title:"Ask AI About the System",mode:this.resolveMode(),status:this.conversationStatus||"active",profile_id:this.resolveConfig()?.profileId,metadata:{pending:!0,local:!0},createdAt:t,updatedAt:t};return this.pendingConversationId=e,this.pendingConversation=n,this.activeConversationId=e,this.activeConversation=n,this.conversations=this.mergePendingConversation(this.conversations),this.localMessagesByConversation.has(e)||this.localMessagesByConversation.set(e,[]),this.refreshMergedMessages(),e}isLocalConversationId(t){return String(t||"").startsWith("local-convo-")}reparentLocalConversation(t,e){if(!t||!e||t===e)return;const n=this.localMessagesByConversation.get(t)||[];if(n.length){const t=n.map(t=>({...t,id_conversation:e})),o=this.localMessagesByConversation.get(e)||[];this.localMessagesByConversation.set(e,[...o,...t])}this.localMessagesByConversation.delete(t),this.activeConversationId===t&&(this.activeConversationId=e),this.subscribedConversationId===t&&(this.subscribedConversationId=e),this.pendingConversationId===t&&(this.pendingConversationId=e),this.pendingConversation&&this.pendingConversation._id===t&&(this.pendingConversation={...this.pendingConversation,_id:e})}generateRequestId(){return`req-${Date.now()}-${this.requestCounter++}`}scrollToBottom(){setTimeout(()=>{const t=this.messageScroll?.nativeElement;t&&(t.scrollTop=t.scrollHeight)},50)}splitMessageContent(t){const e=String(t||"");if(!e)return[];const n=/\/[a-z0-9][a-z0-9/_-]*(?:\?[a-z0-9=&%_-]+)?(?:#[a-z0-9_-]+)?/g,o=[];let r,i=0;for(;null!==(r=n.exec(e));){const t=r[0],n=r.index;if(!this.isRouteBoundary(e,n))continue;n>i&&o.push({text:e.slice(i,n)});const a=this.shouldLinkRoute(t);o.push(a?{text:t,route:t}:{text:t}),i=n+t.length}return i<e.length&&o.push({text:e.slice(i)}),o.length?o:[{text:e}]}isRouteBoundary(t,e){if(0===e)return!0;const n=t[e-1];return/[\s\[\]({'"`.,;:!?]/.test(n)}getMessageContent(t){const e=String(t?._id||"").trim();return e&&this.messageContentOverrides.has(e)?this.normalizeUsdCurrencyText(this.messageContentOverrides.get(e)||""):this.normalizeUsdCurrencyText(String(t?.content||""))}displayTableForMessage(t){const e=this.resolveDisplayTable(t);if(!e)return null;const n=this.getMessageContent(t);return this.hasMarkdownTable(t,n)&&!t?.metadata?.tool_result?.output?.display?null:e}isTableCollapsed(t){const e=String(t?._id||"").trim();return!!e&&this.collapsedTableIds.has(e)}toggleTable(t){const e=String(t?._id||"").trim();e&&(this.collapsedTableIds.has(e)?this.collapsedTableIds.delete(e):this.collapsedTableIds.add(e))}resolveTimeZoneLabel(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"Local"}catch{return"Local"}}pendingProgress(t){if(!t?.metadata?.pending)return null;const e=t?.metadata?.progress,n=Array.isArray(e)?e.map(t=>String(t||"").trim()).filter(Boolean):[],o=n.length?n:["Planning"],r=this.resolvePendingElapsed(t),i=[];r>=4500&&i.push("Analyzing request"),r>=9e3&&i.push("Drafting response");const a=[],s=new Set;return[...o,...i].forEach(t=>{const e=String(t||"").trim();if(!e)return;const n=e.toLowerCase();s.has(n)||(s.add(n),a.push(e))}),a.length?a:null}resolvePendingElapsed(t){const e=this.messageTimestamp(t);return e?Math.max(0,Date.now()-e):0}ensureMessageSubscription(){if(this.paused)return;const t=this.activeConversationId||"";if(!t||this.isLocalConversationId(t))return;const e=this.methodNames().messagesPublication||DEFAULT_METHODS.messagesPublication,n=JSON.stringify({publication:e,conversationId:t,limit:this.messageLimit,bypass:!!this.bypassRouteSubscriptions});(!this.messagesSub||this.messagesSub.closed||this.messagesSubKey!==n)&&this.subscribeMessages(t,!0)}formatDisplayCell(t,e){if(null==t||""===t)return"N/A";if(Array.isArray(t))return this.truncateText(t.map(t=>String(t)).join(", "),200);if(t instanceof Date)return formatDate(t,"short",this.locale);if("object"==typeof t)try{return this.truncateText(JSON.stringify(t),200)}catch{return this.truncateText(String(t),200)}const n=this.formatScalarValue(t,e);return this.truncateText(n,200)}formatScalarValue(t,e){const n=this.resolveNumericValue(t),o=String(e||"").toLowerCase();if(this.isDateColumn(o)&&this.isLikelyDateValue(t)){const e=t instanceof Date?t:new Date(t);if(!Number.isNaN(e.getTime()))return formatDate(e,"short",this.locale)}if(null!==n){if(this.isPercentColumn(o)){return formatPercent(n>1&&n<=100?n/100:n,this.locale,"1.0-2")}return this.isCurrencyColumn(o)?formatCurrency(n,this.locale,this.currencySymbol,"USD","1.2-2"):formatNumber(n,this.locale,"1.0-2")}if(this.isLikelyDateValue(t)&&this.isDateColumn(o)){const e=t instanceof Date?t:new Date(t);if(!Number.isNaN(e.getTime()))return formatDate(e,"short",this.locale)}return String(t)}resolveNumericValue(t){if("number"==typeof t&&Number.isFinite(t))return t;if("string"==typeof t){const e=t.trim();if(!e)return null;let n=!1,o=e;const r=o.match(/^\((.+)\)$/);if(r?.[1]&&(n=!0,o=r[1].trim()),o=o.replace(/^\$/,"").replace(/,/g,""),!o||!/^[+-]?(?:\d+|\d*\.\d+)%?$/.test(o)||!/[0-9]/.test(o))return null;const i=o.endsWith("%")?o.slice(0,-1):o,a=Number(i);if(!Number.isFinite(a))return null;const s=n?-a:a;return Number.isFinite(s)?s:null}return null}isPercentColumn(t){return/(percent|pct|percentage|ratio|rate)\b/.test(t)}isCurrencyColumn(t){const e=String(t||"").toLowerCase().replace(/[_-]+/g," ").trim();if(!e)return!1;const n=AI_TERMINAL_CURRENCY_HINT_PATTERN.test(e)||AI_TERMINAL_MONEY_TOTAL_PATTERN.test(e)||AI_TERMINAL_TOTAL_WITH_MONEY_HINT_PATTERN.test(e);return!(AI_TERMINAL_NON_CURRENCY_COLUMN_PATTERN.test(e)&&!n)&&(!(/\btotal\b/.test(e)&&!n)&&n)}isDateColumn(t){return/(date|time|created|updated|timestamp|at)\b/.test(t)}isLikelyDateValue(t){if(!t)return!1;if(t instanceof Date)return!0;if("string"==typeof t){if(!/[0-9]/.test(t))return!1;const e=Date.parse(t);return!Number.isNaN(e)}return!1}resolveDisplayTable(t){const e=String(t?._id||"").trim(),n=e?this.messageDisplayOverrides.get(e):null,o=t?.metadata?.tool_result?.output?.display,r=n||o;if(!r||!Array.isArray(r.columns)||!Array.isArray(r.rows))return e&&this.displayTableCache.delete(e),null;if(e){const t=this.displayTableCache.get(e);if(t&&t.source===r)return t.value}const i=!0===r.includeIds,a=r.columns.filter(t=>i||!this.shouldHideDisplayColumn(t)).map(t=>({key:t,label:this.formatDisplayColumn(t)}));if(!a.length)return e&&this.displayTableCache.delete(e),null;const s=Array.isArray(r.rows)?r.rows:[],l=s.length>250?s.slice(0,250):s,c=l.map(t=>{const e={};return a.forEach(({key:n,label:o})=>{e[o]=t?.[n]??t?.[o]}),e}),d={...r,columns:a.map(t=>t.label),rows:c,truncated:!0===r.truncated||s.length>l.length};return e&&this.displayTableCache.set(e,{source:r,value:d}),d}isSuperAdmin(){return!!this.services?._account?.isUserSuperAdmin()}resolveDebugPayload(t){const e=t?.metadata?.debug;if(e&&"object"==typeof e)return e;const n=t?.metadata?.tool_result?.output?.debug;if(n&&"object"==typeof n)return n;const o=t?.metadata?.tool_result?.debug;return o&&"object"==typeof o?o:null}showDebugForMessage(t){return!!this.isSuperAdmin()&&("assistant"===t?.role&&!!this.resolveDebugPayload(t))}canCopyMessage(t){return!(!t||t.metadata?.pending||"assistant"!==t.role&&"user"!==t.role)}canReportIssue(t){return!!String(t?._id||"").trim()&&"assistant"===t?.role&&!0!==t?.metadata?.pending}openIssueReport(t,e){e&&(e.preventDefault(),e.stopPropagation()),this.canReportIssue(t)&&(this.issueReportOpen=!0,this.issueReportMessageId=String(t?._id||"").trim(),this.issueReportConversationId=String(t?.id_conversation||this.activeConversationId||"").trim(),this.issueReportReason="",this.issueReportExpected="",this.isSubmittingIssueReport=!1)}cancelIssueReport(){this.isSubmittingIssueReport||(this.issueReportOpen=!1,this.issueReportMessageId="",this.issueReportConversationId="",this.issueReportReason="",this.issueReportExpected="")}canSubmitIssueReport(){return!(!this.issueReportOpen||this.isSubmittingIssueReport)&&this.issueReportReason.trim().length>=8}async submitIssueReport(){if(!this.canSubmitIssueReport())return;const t=String(this.issueReportMessageId||"").trim(),e=String(this.issueReportConversationId||this.activeConversationId||"").trim();if(t&&e){this.errorMessage="",this.infoMessage="",this.isSubmittingIssueReport=!0;try{const n={id_message:t,id_conversation:e,id_client:this.idClient||void 0,id_app:this.idApp||void 0,reason:this.issueReportReason.trim(),expected:this.issueReportExpected.trim()||void 0,metadata:{source:"ai-terminal-ui"}},o=await this.terminal.call(this.methodNames().reportIssue||DEFAULT_METHODS.reportIssue,n),r=String(o?.id_issue_report||"").trim();this.infoMessage=r?`Issue reported (${r}). Thank you.`:"Issue reported. Thank you.",this._services._alert.setAlert("success",this.infoMessage),this.isSubmittingIssueReport=!1,this.cancelIssueReport()}catch(t){this.errorMessage=t?.message||"Unable to report issue."}finally{this.isSubmittingIssueReport=!1}}else this.errorMessage="Unable to report issue: missing conversation context."}canCopyConversation(){return(this.messages||[]).some(t=>!(!t||t.metadata?.pending)&&(("assistant"===t.role||"user"===t.role)&&!!String(this.getMessageContent(t)||"").trim()))}async copyConversation(){const t=this.buildConversationCopyText();if(!t)return;let e=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(t),e=!0)}catch{}e||(e=this.copyTextFallback(t)),e&&this._services._alert.setAlert("success","Conversation copied to clipboard")}async copyMessage(t){if(!this.canCopyMessage(t))return;let e=null,n=!1;if(this.canExportMessage(t))try{e=await this.fetchFullDisplayForMessage(t)}catch{n=!0}const o=this.buildCopyText(t,e);if(!o)return;let r=!1;try{navigator?.clipboard?.writeText&&(await navigator.clipboard.writeText(o),r=!0)}catch{}r||(r=this.copyTextFallback(o)),r&&(n?this._services._alert.setAlert("warning","Copied preview content. Full table could not be loaded."):this._services._alert.setAlert("success","Copied to clipboard"))}async copyAssistantResponse(t){await this.copyMessage(t)}buildConversationCopyText(){const t=(this.messages||[]).filter(t=>!(!t||t.metadata?.pending)&&("user"===t.role||"assistant"===t.role));if(!t.length)return"";let e=0,n=0;const o=[],r=this.isSuperAdmin();return t.forEach(t=>{const i=String(this.getMessageContent(t)||"").trim();if(i){if("user"===t.role){e+=1;const t=1===e?"Request":"Follow Up Request";return void o.push(`${t}:\n${i}`)}if("assistant"===t.role){n+=1;let e=`${1===n?"Response":"Follow Up Response"}:\n${i}`;if(r){const n=this.resolveDebugPayload(t);if(n){const t=this.stringifyCopyDebug(n);t&&(e=`${e}\n\nDebug:\n${t}`)}}o.push(e)}}}),o.join("\n\n").trim()}buildCopyText(t,e){const n=this.getMessageContent(t);let o=String(n||"").trim();if(e?.rows?.length){const t=this.buildDisplayTableMarkdown(e);if(t){const e=this.stripMarkdownTables(o);o=e?`${e}\n\n${t}`:t}}if(this.isSuperAdmin()){const e=this.resolveDebugPayload(t);if(e){const t=this.stringifyCopyDebug(e);t&&(o=o?`${o}\n\nDebug:\n${t}`:`Debug:\n${t}`)}}return o.trim()}buildDisplayTableMarkdown(t){if(!t||!Array.isArray(t.rows)||!t.rows.length)return"";const e=Array.isArray(t.columns)&&t.columns.length?t.columns:Object.keys(t.rows[0]||{});if(!e.length)return"";return[`| ${e.join(" | ")} |`,`| ${e.map(()=>"---").join(" | ")} |`,...t.rows.map(t=>`| ${e.map(e=>this.escapeMarkdownCell(this.formatExportCell(t?.[e],e))).join(" | ")} |`)].join("\n").trim()}escapeMarkdownCell(t){return String(t??"").replace(/\r?\n/g," ").replace(/\|/g,"\\|")}stringifyCopyDebug(t){try{return JSON.stringify(t,null,2)}catch{return String(t||"")}}copyTextFallback(t){const e=String(t||"");if(!e)return!1;const n=document.createElement("textarea");n.value=e,n.setAttribute("readonly","true"),n.style.position="fixed",n.style.top="-1000px",n.style.opacity="0",document.body.appendChild(n),n.select();let o=!1;try{o=document.execCommand("copy")}catch{}finally{document.body.removeChild(n)}return o}toggleDebug(t){const e=String(t?._id||"").trim();e&&(this.expandedDebugIds.has(e)?this.expandedDebugIds.delete(e):this.expandedDebugIds.add(e))}isDebugCollapsed(t){const e=String(t?._id||"").trim();return!e||!this.expandedDebugIds.has(e)}debugText(t){const e=this.resolveDebugPayload(t);if(!e)return"";try{return this.truncateText(JSON.stringify(e,null,2),8e3)}catch{return this.truncateText(String(e),8e3)}}canExportMessage(t){return!!this.resolveExportableToolResult(t)}canPullAllMessage(t){const e=String(t?._id||"").trim();return!(!e||this.pulledAllMessageIds.has(e))&&this.canExportMessage(t)}isExportingMessage(t){const e=String(t?._id||"").trim();return!!e&&this.exportingMessageIds.has(e)}isPullingAllMessage(t){const e=String(t?._id||"").trim();return!!e&&this.loadingAllRowsMessageIds.has(e)}isAllRowsLoaded(t){const e=String(t?._id||"").trim();if(!e||!this.pulledAllMessageIds.has(e))return!1;const n=this.messageDisplayOverrides.get(e)||this.fullDisplayCache.get(e)||null;return!0!==n?.truncated}async pullAllMessageTable(t){if(String(t?._id||"").trim()&&!this.isPullingAllMessage(t)&&this.canPullAllMessage(t)){this.errorMessage="",this.infoMessage="";try{const e=await this.fetchFullDisplayForMessage(t,{applyToTable:!0});if(!e?.rows?.length)return void(this.infoMessage="No rows returned.");e.truncated?this.infoMessage=`Loaded ${e.rows.length} rows (max 5000). Narrow filters to fetch more.`:this.infoMessage=`Loaded ${e.rows.length} rows.`}catch(t){this.errorMessage=t?.message||"Unable to load all rows."}}}async exportMessageTable(t){const e=String(t?._id||"").trim();if(!e||this.isExportingMessage(t)||!this.canExportMessage(t))return;const n=this.resolveExportableToolResult(t);if(n){this.exportingMessageIds.add(e),this.errorMessage="",this.infoMessage="";try{const e=await this.fetchFullDisplayForMessage(t);if(!e?.rows?.length)return void(this.infoMessage="No rows returned to export.");const o=Array.isArray(e.columns)&&e.columns.length?e.columns:Object.keys(e.rows[0]||{}),r=e.rows.map(t=>{const e={};return o.forEach(n=>{e[n]=this.formatExportCell(t?.[n],n)}),e});exportCsv(r,this.buildExportFilename(n,e),{showLabels:!0,headers:o}),e.truncated?this.infoMessage=`Exported ${r.length} rows (max 5000). Narrow filters to export more.`:this.infoMessage=`Exported ${r.length} rows.`}catch(t){this.errorMessage=t?.message||"Unable to export data."}finally{this.exportingMessageIds.delete(e)}}}resolveExportableToolResult(t){const e=t?.metadata?.tool_result;return e?.input&&e?.type?"mongo_read"!==e.type&&"mongo_agg"!==e.type?null:e:null}buildFullFetchRequest(t){const e={...t.input||{}},n=e.options&&"object"==typeof e.options?{...e.options}:{};n.export=!0,n.skip=0,n.limit=5e3,e.options=n,"mongo_agg"===t.type&&(e.pipeline=this.removeAggregateLimitStages(e.pipeline)),!e.permissionView&&this.contextRoute&&(e.permissionView=this.contextRoute),!e.id_client&&this.idClient&&(e.id_client=this.idClient);const o=this.resolveMongoConfig();return o&&(e.mongo=o),{methodName:"mongo_agg"===t.type?"aiAssistantMongoAggregate":"aiAssistantMongoRead",payload:e}}removeAggregateLimitStages(t){return Array.isArray(t)?t.filter(t=>t&&"object"==typeof t&&!Array.isArray(t)).map(t=>({...t})).filter(t=>!Object.prototype.hasOwnProperty.call(t,"$limit")):[]}async fetchFullDisplayForMessage(t,e){const n=String(t?._id||"").trim();if(!n)return null;const o=!0===e?.applyToTable;if(!(!0===e?.forceRefresh)&&this.fullDisplayCache.has(n)){const t=this.fullDisplayCache.get(n)||null;return o&&t&&(this.messageDisplayOverrides.set(n,t),this.pulledAllMessageIds.add(n),this.clearMessageRenderCaches()),t}const r=this.fullDisplayPromises.get(n);if(r){const t=await r;return o&&t&&(this.messageDisplayOverrides.set(n,t),this.pulledAllMessageIds.add(n),this.clearMessageRenderCaches()),t}const i=this.resolveExportableToolResult(t);if(!i)return null;const a=this.buildFullFetchRequest(i),s=(async()=>{this.loadingAllRowsMessageIds.add(n);const t=await this.terminal.call(a.methodName,a.payload),e=t?.display;if(!e)throw new Error("No table data returned.");return this.fullDisplayCache.set(n,e),o&&(this.messageDisplayOverrides.set(n,e),this.pulledAllMessageIds.add(n),this.clearMessageRenderCaches()),e})().finally(()=>{this.loadingAllRowsMessageIds.delete(n),this.fullDisplayPromises.delete(n)});return this.fullDisplayPromises.set(n,s),await s}formatExportCell(t,e){if(null==t||""===t)return"";if(Array.isArray(t))return t.map(t=>this.formatExportCell(t,e)).join(", ");if(t instanceof Date)return formatDate(t,"short",this.locale);if("object"==typeof t)try{return JSON.stringify(t)}catch{return String(t)}return this.formatScalarValue(t,e)}buildExportFilename(t,e){return`${String(t?.output?.collection||t?.input?.collection||"export").trim()||"export"}-${formatDate(new Date,"yyyyMMdd-HHmm",this.locale)}-${e?.rows?.length||0}rows`}shouldHideDisplayColumn(t){const e=String(t||"").trim().toLowerCase().replace(/\s+/g,"_");if(!e)return!0;if("_id"===e||"__v"===e)return!0;if(e.startsWith("id_"))return!0;const n=e.split(".");return(n[n.length-1]||"").startsWith("id_")}formatDisplayColumn(t){const e=String(t||"").trim();if(!e)return"";if("_id"===e)return"id";if("_group"===e)return"Group";const n=e.replace(/[\s_]+/g,"").toLowerCase();return"createdat"===n?"Created At":"updatedat"===n?"Updated At":e}hasMarkdownTable(t,e){const n=this.messageRenderCacheKey(t),o=this.messageUpdatedAtKey(t),r=this.messageTablePresenceCache.get(n);if(r&&r.updatedAtKey===o)return r.value;const i=this.containsMarkdownTable(e);return this.messageTablePresenceCache.set(n,{updatedAtKey:o,value:i}),i}containsMarkdownTable(t){const e=String(t||"").split("\n");for(let t=0;t<e.length-1;t+=1)if(this.isMarkdownTableHeader(e[t],e[t+1]))return!0;return!1}stripMarkdownTables(t){const e=String(t||"").split("\n"),n=[];for(let t=0;t<e.length;t+=1)if(this.isMarkdownTableHeader(e[t],e[t+1]))for(t+=1;t+1<e.length;){const n=e[t+1];if(!n||!n.includes("|"))break;t+=1}else n.push(e[t]);return n.join("\n").trim()}addPromptFavorite(t){const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase(),o=[e,...this.promptFavorites.filter(t=>this.normalizeFavoritePrompt(t).toLowerCase()!==n)];this.promptFavorites=o.slice(0,25),this.savePromptFavorites()}removePromptFavorite(t){const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase(),o=this.promptFavorites.filter(t=>this.normalizeFavoritePrompt(t).toLowerCase()!==n);o.length!==this.promptFavorites.length&&(this.promptFavorites=o,this.savePromptFavorites())}isPromptFavorited(t){const e=this.normalizeFavoritePrompt(t);if(!e)return!1;const n=e.toLowerCase();return this.promptFavorites.some(t=>this.normalizeFavoritePrompt(t).toLowerCase()===n)}extractFavoritePromptFromMessage(t){return t&&"user"===t.role?this.normalizeFavoritePrompt(t.content||""):""}normalizeFavoritePrompt(t){return String(t||"").replace(/\s+/g," ").trim()}loadPromptFavorites(){try{const t=this.readPromptFavoritesPayload(),e=this.resolvePromptFavoritesScopeKey(),n=Array.isArray(t?.[e])?t[e]:[],o=[],r=new Set;n.forEach(t=>{const e=this.normalizeFavoritePrompt(t);if(!e)return;const n=e.toLowerCase();r.has(n)||(r.add(n),o.push(e))}),this.promptFavorites=o.slice(0,25)}catch{this.promptFavorites=[]}}savePromptFavorites(){try{const t=this.readPromptFavoritesPayload(),e=this.resolvePromptFavoritesScopeKey(),n=(this.promptFavorites||[]).map(t=>this.normalizeFavoritePrompt(t)).filter(Boolean).slice(0,25);n.length?t[e]=n:delete t[e],localStorage.setItem(this.promptFavoritesStorageKey,JSON.stringify(t))}catch{}}readPromptFavoritesPayload(){try{const t=localStorage.getItem(this.promptFavoritesStorageKey);if(!t)return{};const e=JSON.parse(t||"{}");if(!e||"object"!=typeof e)return{};const n={};return Object.entries(e).forEach(([t,e])=>{t&&Array.isArray(e)&&(n[t]=e.map(t=>this.normalizeFavoritePrompt(t)).filter(Boolean))}),n}catch{return{}}}resolvePromptFavoritesScopeKey(){return`${String(this.idClient||"").trim().toLowerCase()||"global"}::${String(this.idApp||"").trim().toLowerCase()||"global"}::${String(this.resolveMode()||"openai").trim().toLowerCase()||"openai"}`}loadSupportTicketMap(){try{const t=localStorage.getItem(this.supportTicketStorageKey);if(!t)return;const e=JSON.parse(t||"{}");Object.entries(e||{}).forEach(([t,e])=>{"string"==typeof t&&"string"==typeof e&&this.supportTicketMap.set(t,e)})}catch{}}saveSupportTicketMap(){try{const t={};this.supportTicketMap.forEach((e,n)=>{t[n]=e}),localStorage.setItem(this.supportTicketStorageKey,JSON.stringify(t))}catch{}}applyStoredSupportTicketOverrides(){if(!this.supportTicketMap.size)return;let t=!1;(this.messages||[]).forEach(e=>{const n=String(e?._id||"").trim();if(!n)return;const o=this.supportTicketMap.get(n);if(!o)return;const r=this.extractSupportTicketDirective(String(e?.content||"")),i=r?.cleaned||String(e?.content||""),a=this.appendSupportTicketLink(i,o);this.messageContentOverrides.get(n)!==a&&(this.messageContentOverrides.set(n,a),t=!0)}),t&&this.clearMessageRenderCaches()}processSupportTicketDirectives(t){const e=this.findLatestAssistantDirective(t,t=>this.extractSupportTicketDirective(t));if(!e)return;const{message:n,index:o,directive:r}=e,i=String(n?._id||"").trim();if(!i)return;if(this.supportTicketMap.has(i)||this.supportTicketInFlight.has(i))return;this.messageContentOverrides.get(i)!==r.cleaned&&(this.messageContentOverrides.set(i,r.cleaned),this.clearMessageRenderCaches());this.hasSupportTicketConsent(t,o)?(this.debugLog("supportDirective.execute",{id:i}),this.supportTicketInFlight.add(i),this.createSupportTicketFromDirective(i,r).finally(()=>this.supportTicketInFlight.delete(i))):this.debugLog("supportDirective.skip.noConsent",{id:i})}hasSupportTicketConsent(t,e){if(!Array.isArray(t)||e<0)return!1;const n=t.slice(0,e),o=n.slice().reverse().find(t=>"user"===t?.role);if(!o?.content)return!1;const r=String(o.content||"").trim();if(AI_TERMINAL_SUPPORT_TICKET_DIRECT_REQUEST_PATTERN.test(r))return!0;if(!AI_TERMINAL_SUPPORT_TICKET_AFFIRMATIVE_PATTERN.test(r))return!1;const i=n.slice().reverse().find(t=>"assistant"===t?.role);if(!i?.content)return!1;const a=String(i.content||"").trim();return AI_TERMINAL_SUPPORT_TICKET_PROMPT_PATTERN.test(a)}extractSupportTicketDirective(t){const e=String(t||"").split("\n"),n=e.findIndex(t=>t.trim().replace(/^[-*•]+\s*/,"").toUpperCase().startsWith("SUPPORT_TICKET_CREATE:"));if(-1===n)return null;const o=e[n].trim().replace(/^[-*•]+\s*/,"").split(":").slice(1).join(":").trim();let r="",i="",a="";const s=this.parseSupportTicketDirectivePayload(o);if(s?(r=s.summary,i=s.internalRecommendations,a=s.codeChangeRecommendations):r=o,!r){const t=e.slice(n+1).find(t=>t.trim());t&&(r=t.trim())}return{summary:r||"",internalRecommendations:i,codeChangeRecommendations:a,cleaned:e.filter((t,e)=>e!==n).join("\n").trim()}}parseSupportTicketDirectivePayload(t){const e=String(t||"").trim();if(!e||!e.startsWith("{"))return null;try{const t=JSON.parse(e);if(!t||"object"!=typeof t||Array.isArray(t))return null;const n=t;return{summary:this.normalizeSupportTicketDirectiveText(n.summary),internalRecommendations:this.normalizeSupportTicketDirectiveText(n.internal_recommendations,n.internalRecommendations,n.recommendations,n.recommendation,n.internal_notes),codeChangeRecommendations:this.normalizeSupportTicketDirectiveText(n.code_change_recommendations,n.codeChangeRecommendations,n.code_recommendations,n.codex_recommendations,n.fix_plan,n.implementation_plan)}}catch{return null}}normalizeSupportTicketDirectiveText(...t){for(const e of t)if("string"==typeof e){const t=e.trim();if(t)return t}return""}appendSupportTicketLink(t,e){const n=String(t||"").trim(),o=`Support ticket created: /support-ticket/detail/${e}`;return n?n.includes(o)?n:`${n}\n\n${o}`.trim():o}async createSupportTicketFromDirective(t,e){const n=this.resolveSupportTicketIssue(e.summary),o=this.buildSupportTicketPayload(n,{summary:e.summary,internalRecommendations:e.internalRecommendations,codeChangeRecommendations:e.codeChangeRecommendations,sourceMessageId:t});if(o)try{const e=await this.terminal.call("supportInsertSupportTicket",o),n=String(e||"").trim();if(!n)throw new Error("Support ticket creation failed.");this.supportTicketMap.set(t,n),this.saveSupportTicketMap();const r=this.messageContentOverrides.get(t)||"",i=this.appendSupportTicketLink(r,n);this.messageContentOverrides.set(t,i),this.clearMessageRenderCaches()}catch(t){this.errorMessage=t?.message||"Unable to create support ticket."}else this.errorMessage="Unable to create support ticket."}applyStoredMongoReadOverrides(){if(!this.mongoReadCache.size)return;let t=!1;(this.messages||[]).forEach(e=>{const n=String(e?._id||"").trim();if(!n)return;const o=this.mongoReadCache.get(n);o&&this.messageContentOverrides.get(n)!==o&&(this.messageContentOverrides.set(n,o),t=!0)}),t&&this.clearMessageRenderCaches()}processMongoDirectives(t){const e=this.findLatestAssistantDirective(t,t=>this.extractMongoDirective(t));if(!e)return;const{message:n,directive:o}=e,r=String(n?._id||"").trim();if(!r)return;if(this.mongoReadCache.has(r)||this.mongoReadInFlight.has(r))return;this.messageContentOverrides.get(r)!==o.cleaned&&(this.messageContentOverrides.set(r,o.cleaned),this.clearMessageRenderCaches()),this.debugLog("mongoDirective.execute",{id:r,type:o.type,collection:String(o?.payload?.collection||"")}),this.mongoReadInFlight.add(r);("aggregate"===o.type?this.createMongoAggregateFromDirective(r,o.payload,o.cleaned):this.createMongoReadFromDirective(r,o.payload,o.cleaned)).finally(()=>this.mongoReadInFlight.delete(r))}findLatestAssistantDirective(t,e){if(!Array.isArray(t)||!t.length)return null;for(let n=t.length-1;n>=0;n-=1){const o=t[n];if("assistant"!==o?.role)continue;const r=e(String(o?.content||""));if(r)return{message:o,index:n,directive:r}}return null}extractMongoDirective(t){const e=String(t||"").split("\n"),n=e.findIndex(t=>{const e=t.trim().replace(/^[-*•]+\s*/,"").toUpperCase();return e.startsWith("MONGO_READ:")||e.startsWith("MONGO_AGG:")||e.startsWith("MONGO_AGGREGATE:")});if(-1===n)return null;const o=e[n].trim().replace(/^[-*•]+\s*/,""),r=o.toUpperCase();let i=null;if(r.startsWith("MONGO_READ:")?i="read":(r.startsWith("MONGO_AGG:")||r.startsWith("MONGO_AGGREGATE:"))&&(i="aggregate"),!i)return null;const a=o.indexOf(":"),s=a>=0?o.slice(a+1).trim():"";if(!s)return null;try{const t=JSON.parse(s);if(!t||"object"!=typeof t)return null;return{type:i,payload:t,cleaned:e.filter((t,e)=>e!==n).join("\n").trim()}}catch{return null}}resolveMongoCountIntent(t){const e=this.messages||[],n=this.findPreviousUserMessage(t,e);return!!n?.content&&this.isMongoCountQuestion(n.content)}findPreviousUserMessage(t,e){if(!t||!e.length)return null;const n=e.findIndex(e=>String(e?._id||"").trim()===t);if(n>0)for(let t=n-1;t>=0;t-=1)if("user"===e[t]?.role)return e[t];for(let t=e.length-1;t>=0;t-=1)if("user"===e[t]?.role)return e[t];return null}isMongoCountQuestion(t){const e=String(t||"").toLowerCase();if(!e)return!1;return[/\bhow many\b/,/\bnumber of\b/,/\bcount\b/,/\btotal (number|count)\b/,/\btotal (records|entries|items)\b/].some(t=>t.test(e))}async createMongoReadFromDirective(t,e,n){const o={...e||{}},r=this.resolveMongoCountIntent(t),i=r||!0===o?.options?.includeTotal;if(i){const t=o.options&&"object"==typeof o.options?{...o.options}:{};!0!==t.includeTotal&&(t.includeTotal=!0),r&&("number"!=typeof t.limit&&(t.limit=1),t.projection&&"object"==typeof t.projection&&Object.keys(t.projection).length||(t.projection={_id:1})),o.options=t}!o.permissionView&&this.contextRoute&&(o.permissionView=this.contextRoute),!o.id_client&&this.idClient&&(o.id_client=this.idClient);const a=this.resolveMongoConfig();a&&(o.mongo=a);try{const e=await this.terminal.call("aiAssistantMongoRead",o);e?.display?this.messageDisplayOverrides.set(t,e.display):this.messageDisplayOverrides.delete(t);const a=this.formatMongoReadResult(e,{collection:o.collection,includeTotal:i,countIntent:r}),s=this.appendMongoReadResult(n,a);this.mongoReadCache.set(t,s),this.messageContentOverrides.set(t,s),this.clearMessageRenderCaches()}catch(e){const o=String(e?.message||"Unable to read data."),r=/access denied|permission scope required|super admin required/i.test(o)?"Data access via AI requires the appropriate module permissions. I can explain how to view this data in the app or request access.":`Mongo read failed: ${o}`,i=this.appendMongoReadResult(n,r);this.mongoReadCache.set(t,i),this.messageContentOverrides.set(t,i),this.messageDisplayOverrides.delete(t),this.clearMessageRenderCaches()}}async createMongoAggregateFromDirective(t,e,n){const o={...e||{}};!o.permissionView&&this.contextRoute&&(o.permissionView=this.contextRoute),!o.id_client&&this.idClient&&(o.id_client=this.idClient);const r=this.resolveMongoConfig();r&&(o.mongo=r);try{const e=await this.terminal.call("aiAssistantMongoAggregate",o);e?.display?this.messageDisplayOverrides.set(t,e.display):this.messageDisplayOverrides.delete(t);const r=this.formatMongoAggregateResult(e,{collection:o.collection}),i=this.appendMongoReadResult(n,r);this.mongoReadCache.set(t,i),this.messageContentOverrides.set(t,i),this.clearMessageRenderCaches()}catch(e){const o=String(e?.message||"Unable to aggregate data."),r=/access denied|permission scope required|super admin required/i.test(o)?"Data access via AI requires the appropriate module permissions. I can explain how to view this data in the app or request access.":`Mongo aggregate failed: ${o}`,i=this.appendMongoReadResult(n,r);this.mongoReadCache.set(t,i),this.messageContentOverrides.set(t,i),this.messageDisplayOverrides.delete(t),this.clearMessageRenderCaches()}}appendMongoReadResult(t,e){const n=String(t||"").trim(),o=String(e||"").trim();return o?n?n.includes(o)?n:`${n}\n\n${o}`.trim():o:n}formatCollectionLabel(t){const e=String(t||"").trim();return e?e.replace(/[_-]+/g," ").replace(/\s+/g," ").trim():""}formatMongoReadResult(t,e){const n=Array.isArray(t?.documents)?t.documents:[],o=t?.display,r="number"==typeof t?.total?t.total:null,i=!0===e?.includeTotal,a=!0===e?.countIntent,s=null!==r&&(i||a);if(!n.length){if(s){const t=this.formatCollectionLabel(e?.collection);return t?`Total ${t}: ${r}.`:`Total records: ${r}.`}return"Mongo read summary: No results found."}if(s&&a){const t=this.formatCollectionLabel(e?.collection);return t?`Total ${t}: ${r}.`:`Total records: ${r}.`}const l=o?.rows?.length??n.length,c=[];if(s){const t=this.formatCollectionLabel(e?.collection);c.push(t?`Total ${t}: ${r}.`:`Total records: ${r}.`)}c.push(`Preview: ${l} row${1===l?"":"s"}.`),o?.columns?.length&&c.push(`Columns: ${o.columns.join(", ")}`);return`Mongo read summary:\n${c.map(t=>`- ${t}`).join("\n")}`.trim()}formatMongoAggregateResult(t,e){const n=Array.isArray(t?.documents)?t.documents:[],o=t?.display;if(!n.length){const t=this.formatCollectionLabel(e?.collection);return t?`Mongo aggregate summary (${t}): No results found.`:"Mongo aggregate summary: No results found."}const r=o?.rows?.length??n.length,i=[];i.push(`Preview: ${r} group${1===r?"":"s"}.`),o?.columns?.length&&i.push(`Columns: ${o.columns.join(", ")}`);const a=i.map(t=>`- ${t}`).join("\n"),s=this.formatCollectionLabel(e?.collection);return`${s?`Mongo aggregate summary (${s}):`:"Mongo aggregate summary:"}\n${a}`.trim()}formatMongoAggregateDocumentSummary(t,e){if(!t||"object"!=typeof t)return`${e}) ${String(t)}`;const n=[];if(Object.prototype.hasOwnProperty.call(t,"_id")){const e=this.formatMongoAggregateId(t._id);e&&n.push(`_id: ${e}`)}const o=Object.keys(t).filter(t=>"_id"!==t);for(const e of o){if(n.length>=4)break;const o=t[e];null!=o&&("object"!=typeof o&&n.push(`${e}: ${String(o)}`))}return n.length?`${e}) ${n.join(" • ")}`:`${e}) [group]`}formatMongoAggregateId(t){if(null==t)return"";if(t&&"object"==typeof t){const e="function"==typeof t.toHexString?t.toHexString():"";if(e)return e}if(Array.isArray(t)){const e=t.slice(0,2).map(t=>String(t)).join(", ");return t.length>2?`[${e}, ...]`:`[${e}]`}if("object"==typeof t){const e=String(t);if(e&&"[object Object]"!==e)return e;const n=Object.keys(t);if(!n.length)return"[object]";const o=n.slice(0,2).map(e=>`${e}: ${String(t[e])}`);return n.length>2?`{ ${o.join(", ")}, ... }`:`{ ${o.join(", ")} }`}return String(t)}formatMongoDocumentSummary(t,e){if(!t||"object"!=typeof t)return`${e}) ${String(t)}`;const n=Object.keys(t),o=n.includes("_id")?["_id",...n.filter(t=>"_id"!==t)]:n,r=[];for(const e of o){if(r.length>=4)break;const n=t[e];null!=n&&("object"!=typeof n&&r.push(`${e}: ${String(n)}`))}return r.length?`${e}) ${r.join(" • ")}`:`${e}) [record]`}resolveSupportTicketIssue(t){const e=String(t||"").trim();if(e)return this.truncateText(e,1400);const n=(this.messages||[]).slice().reverse().find(t=>"user"===t?.role);return n?.content?this.truncateText(String(n.content),1400):"Support request from AI assistant."}buildSupportTicketPayload(t,e){const n=this.services?._account?.getUser?.(),o=this.services?._app?.client?.getValue?.(),r=String(this.idClient||o||"").trim();if(!n||!r)return null;const i=new Date,a=`${i.getFullYear()}/${i.getMonth()+1}/${i.getDate()}`,s=this.buildSupportTicketAiRecommendations(e,i);return{__v:0,type:"General Inquery",priority:"Low",issue:t||"Support request from AI assistant.",support_ticket_number:0,support_ticket_number_string:"0",status:"Opened",substatus:"New",client:r,id_client:r,messages:[],date_created:i,date_created_string:a,id_user_created:n._id,user_created:n.fullname,billable:!1,date_investigation:null,date_closed:null,files:[],current_watchers:[],client_user:{id_user:n._id,user:n.fullname,email:n.email?n.email:""},tasks:[],notes:[],users_assigned:[],estimated_billable_hours:null,billable_hours:null,bill_description:"",difficulty:1,ai_recommendations:s}}buildSupportTicketAiRecommendations(t,e){const n=this.truncateText(String(t?.summary||""),2e3),o=this.truncateText(String(t?.internalRecommendations||""),8e3),r=this.truncateText(String(t?.codeChangeRecommendations||""),12e3);return Boolean(n&&n.trim()||o&&o.trim()||r&&r.trim())?{source:"ai-assistant",hidden_from_client:!0,created_at:e,source_message_id:String(t?.sourceMessageId||"").trim(),summary:n||"",internal_recommendations:o||"",code_change_recommendations:r||""}:null}truncateText(t,e){const n=String(t||"").trim();return n.length<=e?n:`${n.slice(0,Math.max(0,e-3))}...`}shouldLinkRoute(t){if(!t)return!1;const e=String(this.contextRoute||"").trim();return!e||t!==e}unsubscribeAll(){this.conversationsSub?.unsubscribe(),this.messagesSub?.unsubscribe()}schedulePause(){this.pauseTimer&&clearTimeout(this.pauseTimer),this.pauseTimer=setTimeout(()=>{this.pauseTimer=null,this.paused&&(this.subscriptionsPaused=!0,this.unsubscribeAll())},5e3)}cancelPause(){this.pauseTimer&&(clearTimeout(this.pauseTimer),this.pauseTimer=null)}async createNewConversation(){if(this.createConversationPromise)return this.createConversationPromise;this.createConversationPromise=this.createConversationInternal();try{return await this.createConversationPromise}finally{this.createConversationPromise=null}}async createConversationInternal(){const t={id_client:this.idClient||void 0,id_app:this.idApp||void 0,title:"Ask AI About the System",mode:this.resolveMode(),branch_enabled:this.resolveBranchEnabled(),status:this.conversationStatus||"active",profile_id:this.resolveConfig()?.profileId},e=await this.terminal.call(this.methodNames().conversationCreate||DEFAULT_METHODS.conversationCreate,t),n=e?.id_conversation||e?._id||"";if(!n)return{id:"",conversation:null};const o=new Date;return{id:n,conversation:{_id:n,id_client:t.id_client,id_app:t.id_app,title:t.title,mode:t.mode,branch_enabled:t.branch_enabled,status:t.status,profile_id:t.profile_id,metadata:{pending:!0,local:!0},createdAt:o,updatedAt:o}}}mergePendingConversation(t){if(!this.pendingConversationId||!this.pendingConversation)return t;const e=(t||[]).find(t=>t?._id===this.pendingConversationId);return e&&!e?.metadata?.pending?(this.pendingConversationId="",this.pendingConversation=null,t):e?t:[this.pendingConversation,...t||[]]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalComponent,deps:[{token:AiTerminalService},{token:ProviderService},{token:AiPageRouterService},{token:AiPageFormAdapterService},{token:LOCALE_ID}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:AiTerminalComponent,isStandalone:!1,selector:"rio-ai-terminal",inputs:{idClient:"idClient",idApp:"idApp",title:"title",config:"config",conversationStatus:"conversationStatus",messageLimit:"messageLimit",placeholder:"placeholder",singleConversation:"singleConversation",contextMode:"contextMode",contextRoute:"contextRoute",paused:"paused",bypassRouteSubscriptions:"bypassRouteSubscriptions"},providers:[ProviderService,AiTerminalService,AiPageFormAdapterService],viewQueries:[{propertyName:"messageScroll",first:!0,predicate:["messageScroll"],descendants:!0}],usesOnChanges:!0,ngImport:i0,template:'<div class="ai-terminal-shell" [class.single-conversation]="singleConversation">\n\t<div class="ai-terminal-sidebar" *ngIf="!singleConversation">\n\t\t<div class="ai-terminal-sidebar-header">\n\t\t\t<div>\n\t\t\t\t<h5>{{ title }}</h5>\n\t\t\t\t<p class="ai-terminal-muted" *ngIf="idApp">App: {{ idApp }}</p>\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="createConversation()">New Chat</button>\n\t\t</div>\n\n\t\t<div class="ai-terminal-sidebar-body">\n\t\t\t<div class="ai-terminal-empty" *ngIf="isLoading">Loading conversations...</div>\n\t\t\t<div class="ai-terminal-empty" *ngIf="!isLoading && !conversations.length">No conversations yet.</div>\n\n\t\t\t<div class="ai-terminal-conversation"\n\t\t\t\t*ngFor="let conversation of conversations; trackBy: trackByConversation"\n\t\t\t\t[class.is-active]="conversation._id === activeConversationId">\n\t\t\t\t<div class="ai-terminal-conversation-main" (click)="setActiveConversation(conversation)">\n\t\t\t\t\t<div class="ai-terminal-conversation-title" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t\t{{ conversation.title && conversation.title !== \'New Conversation\' ? conversation.title : \'Ask AI About the System\' }}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-edit" *ngIf="editingConversationId === conversation._id">\n\t\t\t\t\t\t<input type="text" class="form-control form-control-sm" [(ngModel)]="editingTitle"\n\t\t\t\t\t\t\t(keyup.enter)="saveRename(conversation)" (keyup.escape)="cancelRename()">\n\t\t\t\t\t\t<div class="ai-terminal-inline-actions">\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="saveRename(conversation)">Save</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="cancelRename()">Cancel</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-meta">\n\t\t\t\t\t\t<span *ngIf="conversation.updatedAt">{{ conversation.updatedAt | date: \'short\' }}</span>\n\t\t\t\t\t\t<span *ngIf="conversation.branch_name && isCodexMode()">{{ conversation.branch_name }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-conversation-actions" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm" (click)="startRename(conversation)">Rename</button>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger ai-terminal-delete-btn" (click)="deleteConversation(conversation)">Delete</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div class="ai-terminal-main">\n\t\t<div class="ai-terminal-main-header">\n\t\t\t<div>\n\t\t\t\t<h4>{{ activeConversation?.title && activeConversation?.title !== \'New Conversation\' ? activeConversation?.title : \'Ask AI About the System\' }}</h4>\n\t\t\t\t<div class="ai-terminal-meta-row">\n\t\t\t\t\t<span *ngIf="activeConversation?.branch_name && isCodexMode()">Branch: {{ activeConversation?.branch_name }}</span>\n\t\t\t\t\t<span *ngIf="showAdvanced() && totalTokens()">Tokens: {{ totalTokens() | number }}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="ai-terminal-main-actions">\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation && canCopyConversation()"\n\t\t\t\t\t(click)="copyConversation()" [disabled]="isSending">\n\t\t\t\t\tCopy Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation"\n\t\t\t\t\t(click)="startNewConversation()" [disabled]="isSending">\n\t\t\t\t\tNew Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-primary"\n\t\t\t\t\t*ngIf="isCodexMode() && activeConversation?.branch_name"\n\t\t\t\t\t(click)="deployTest()" [disabled]="isDeployingTest">\n\t\t\t\t\t{{ isDeployingTest ? \'Deploying...\' : \'Deploy to Test\' }}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="ai-terminal-alert" *ngIf="errorMessage">\n\t\t\t<div class="alert alert-danger">{{ errorMessage }}</div>\n\t\t</div>\n\t\t<div class="ai-terminal-alert" *ngIf="infoMessage">\n\t\t\t<div class="alert alert-success">{{ infoMessage }}</div>\n\t\t</div>\n\n\t\t\t<div class="ai-terminal-messages" #messageScroll>\n\t\t\t\t<div class="ai-terminal-empty" *ngIf="!messages.length">\n\t\t\t\t\t<div class="ai-terminal-favorites" *ngIf="promptFavorites.length">\n\t\t\t\t\t\t<p class="ai-terminal-empty-title">Favorites</p>\n\t\t\t\t\t\t<div class="ai-terminal-favorite-list">\n\t\t\t\t\t\t\t<div class="ai-terminal-favorite-item" *ngFor="let prompt of promptFavorites; trackBy: trackByFavoritePrompt">\n\t\t\t\t\t\t\t\t<button type="button" class="ai-terminal-favorite-run" (click)="runFavoritePrompt(prompt)">\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-star">★</span>\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-text">{{ prompt }}</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<div class="ai-terminal-favorite-actions">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-edit"\n\t\t\t\t\t\t\t\t\t\t(click)="startFavoritePromptEdit(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Edit favorite prompt">\n\t\t\t\t\t\t\t\t\t\t✎\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-remove"\n\t\t\t\t\t\t\t\t\t\t(click)="removeFavoritePrompt(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Remove favorite prompt">\n\t\t\t\t\t\t\t\t\t\t×\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p class="ai-terminal-empty-title">Try one of these to get started:</p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>How do I get to the invoice report?</li>\n\t\t\t\t\t\t<li>Where is the setting for <feature>?</li>\n\t\t\t\t\t\t<li>Give me a checklist for <task>.</li>\n\t\t\t\t\t<li>Explain what this screen does and the fields I need.</li>\n\t\t\t\t\t<li>Flag anomalies in inventory for the last 3 months.</li>\n\t\t\t\t\t<li>Summarize invoice totals for <client> over the last <X> months.</li>\n\t\t\t\t\t<li>Show trends in invoice volume and average value for <client> over the past 6 months.</li>\n\t\t\t\t\t<li>List top 5 variance items in inventory counts this quarter.</li>\n\t\t\t\t\t<li>Help me fill out this form using data I paste (e.g., from Excel).</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message"\n\t\t\t\t\t*ngFor="let message of visibleMessages; trackBy: trackByMessage"\n\t\t\t\t\t[class.user]="message.role === \'user\'"\n\t\t\t\t\t[class.assistant]="message.role === \'assistant\'"\n\t\t\t\t\t[class.pending]="message.metadata?.pending"\n\t\t\t\t\t[class.tool]="message.role === \'tool\'">\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-message-favorite-toggle"\n\t\t\t\t\t\t*ngIf="canToggleFavoriteForMessage(message)"\n\t\t\t\t\t\t[class.is-active]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t(click)="toggleMessagePromptFavorite(message, $event)"\n\t\t\t\t\t\t[attr.aria-pressed]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t[attr.title]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'"\n\t\t\t\t\t\t[attr.aria-label]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'">\n\t\t\t\t\t\t{{ isMessagePromptFavorited(message) ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class="ai-terminal-message-role">{{ message.role }}</div>\n\t\t\t\t<ng-container *ngIf="pendingProgress(message) as progress; else messageBody">\n\t\t\t\t\t<div class="ai-terminal-message-progress">\n\t\t\t\t\t\t<ul class="ai-terminal-progress-list">\n\t\t\t\t\t\t\t<li class="ai-terminal-progress-item" *ngFor="let item of progress">{{ item }}</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #messageBody>\n\t\t\t\t\t<div class="ai-terminal-message-body" [innerHTML]="messageMarkdown(message) | safe:\'html\'"></div>\n\t\t\t\t</ng-template>\n\t\t\t\t\t<div class="ai-terminal-message-table" *ngIf="displayTableForMessage(message) as display">\n\t\t\t\t\t\t<div class="ai-terminal-table-meta">\n\t\t\t\t\t\t\t<span>{{ isAllRowsLoaded(message) ? \'Rows\' : \'Preview\' }}: {{ display.rows?.length || 0 }} rows</span>\n\t\t\t\t\t\t\t<span *ngIf="display.total !== undefined && display.total !== null">Total: {{ display.total }}</span>\n\t\t\t\t\t\t\t<span *ngIf="display.truncated">Truncated</span>\n\t\t\t\t\t\t\t<span *ngIf="isAllRowsLoaded(message)">All rows loaded</span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-meta-spacer"></span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-tz">Timezone: {{ timeZoneLabel }}</span>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-pull"\n\t\t\t\t\t\t\t\t*ngIf="canPullAllMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isPullingAllMessage(message) || isExportingMessage(message)"\n\t\t\t\t\t\t\t\t(click)="pullAllMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isPullingAllMessage(message) ? \'Loading...\' : \'Pull All\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-export"\n\t\t\t\t\t\t\t\t*ngIf="canExportMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isExportingMessage(message) || isPullingAllMessage(message)"\n\t\t\t\t\t\t\t\t(click)="exportMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isExportingMessage(message) ? \'Exporting...\' : \'Export\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-table-toggle" (click)="toggleTable(message)">\n\t\t\t\t\t\t\t\t{{ isTableCollapsed(message) ? \'Show Table\' : \'Hide Table\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ai-terminal-table-wrap" *ngIf="!isTableCollapsed(message)">\n\t\t\t\t\t\t\t<collapse-table>\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th *ngFor="let column of display.columns">{{ column }}</th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr *ngFor="let row of display.rows">\n\t\t\t\t\t\t\t\t\t\t<td *ngFor="let column of display.columns">{{ formatDisplayCell(row[column], column) }}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-debug" *ngIf="showDebugForMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-debug-toggle" (click)="toggleDebug(message)">\n\t\t\t\t\t\t{{ isDebugCollapsed(message) ? \'Show Debug\' : \'Hide Debug\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<pre class="ai-terminal-debug-body" *ngIf="!isDebugCollapsed(message)">{{ debugText(message) }}</pre>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-actions" [class.ai-terminal-message-actions-user]="message.role === \'user\'" *ngIf="canCopyMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-copy-btn" (click)="copyMessage(message)">\n\t\t\t\t\t\t<i class="fa fa-copy" aria-hidden="true"></i>\n\t\t\t\t\t\tCopy\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-report-btn"\n\t\t\t\t\t\t*ngIf="canReportIssue(message)"\n\t\t\t\t\t\t(click)="openIssueReport(message, $event)">\n\t\t\t\t\t\t<i class="fa fa-flag" aria-hidden="true"></i>\n\t\t\t\t\t\tReport Issue\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-meta" *ngIf="showAdvanced() && message.usage?.total_tokens">\n\t\t\t\t\tTokens: {{ message.usage?.total_tokens | number }}\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-attachments" *ngIf="message.attachments?.length">\n\t\t\t\t\t<div class="ai-terminal-attachment" *ngFor="let attachment of message.attachments">\n\t\t\t\t\t\t<span>{{ attachment.name }}</span>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(attachment.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-composer">\n\t\t\t\t<div class="ai-terminal-composer-input-wrap">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclass="form-control ai-terminal-composer-input"\n\t\t\t\t\t\trows="2"\n\t\t\t\t\t\t[placeholder]="placeholder"\n\t\t\t\t\t\t(keydown)="handleComposerKeydown($event)"\n\t\t\t\t\t\t[(ngModel)]="messageText"></textarea>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-composer-favorite-toggle"\n\t\t\t\t\t\t[class.is-active]="promptFavoriteEnabled"\n\t\t\t\t\t\t[disabled]="isSending"\n\t\t\t\t\t\t(click)="togglePromptFavorite()"\n\t\t\t\t\t\t[attr.aria-pressed]="promptFavoriteEnabled"\n\t\t\t\t\t\t[attr.title]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'"\n\t\t\t\t\t\t[attr.aria-label]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'">\n\t\t\t\t\t\t{{ promptFavoriteEnabled ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="ai-terminal-composer-row">\n\t\t\t\t\t<div class="ai-terminal-upload" *ngIf="allowUploads()">\n\t\t\t\t\t\t<input type="file" class="form-control" multiple (change)="handleFileSelect($event)">\n\t\t\t\t\t<small class="ai-terminal-muted">Max {{ maxFileMb() }}MB per file • {{ maxTotalMb() }}MB total</small>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-actions">\n\t\t\t\t\t<button type="button" class="btn btn-outline-secondary" (click)="clearComposer()" [disabled]="isSending">Clear</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="sendMessage()" [disabled]="isSending || !messageText.trim()">\n\t\t\t\t\t\t{{ isSending ? \'Sending...\' : \'Send\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-pending" *ngIf="pendingFiles.length">\n\t\t\t\t<div class="ai-terminal-pending-title">Attachments</div>\n\t\t\t\t<div class="ai-terminal-pending-item" *ngFor="let file of pendingFiles; let i = index">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ file.name }}</strong>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(file.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger" (click)="removePendingFile(i)">Remove</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="favoritePromptEditOpen" (click)="cancelFavoritePromptEdit()">\n\t<div class="ai-terminal-favorite-edit-modal" role="dialog" aria-modal="true" aria-label="Edit favorite prompt" (click)="$event.stopPropagation()">\n\t\t<h5>Edit Favorite Request</h5>\n\t\t<textarea\n\t\t\tclass="form-control"\n\t\t\trows="5"\n\t\t\t(keydown.escape)="cancelFavoritePromptEdit()"\n\t\t\t[(ngModel)]="favoritePromptEditValue"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" (click)="cancelFavoritePromptEdit()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSaveFavoritePromptEdit()" (click)="saveFavoritePromptEdit()">Save</button>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="issueReportOpen" (click)="cancelIssueReport()">\n\t<div class="ai-terminal-favorite-edit-modal ai-terminal-issue-report-modal" role="dialog" aria-modal="true" aria-label="Report issue with assistant response" (click)="$event.stopPropagation()">\n\t\t<h5>Report AI Response Issue</h5>\n\t\t<label for="ai-terminal-issue-reason">What was wrong?</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-reason"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Describe what was inaccurate, missing, or confusing."\n\t\t\t[(ngModel)]="issueReportReason"></textarea>\n\t\t<label for="ai-terminal-issue-expected">What did you expect instead? (Optional)</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-expected"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Share the result or format you expected."\n\t\t\t[(ngModel)]="issueReportExpected"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" [disabled]="isSubmittingIssueReport" (click)="cancelIssueReport()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSubmitIssueReport()" (click)="submitIssueReport()">\n\t\t\t\t{{ isSubmittingIssueReport ? \'Submitting...\' : \'Submit Report\' }}\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".ai-terminal-shell{display:grid;grid-template-columns:280px minmax(0,1fr);gap:1rem;align-items:stretch}.ai-terminal-shell.single-conversation{grid-template-columns:minmax(0,1fr)}.ai-terminal-sidebar,.ai-terminal-main{background:#fff;border:1px solid rgba(148,163,184,.25);border-radius:14px;box-shadow:0 10px 24px #0f172a0f}.ai-terminal-sidebar{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-sidebar-header h5{font-size:1rem;margin:0}.ai-terminal-sidebar-body{flex:1;overflow:auto;padding-top:.5rem;font-size:.85rem}.ai-terminal-main{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-main-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-main-header h4{font-size:1.15rem;margin:0}.ai-terminal-main-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-meta-row{display:flex;gap:.75rem;font-size:.72rem;color:#64748b}.ai-terminal-muted{color:#64748b;font-size:.72rem;margin:0}.ai-terminal-conversation{border:1px solid transparent;border-radius:12px;padding:.6rem .7rem;margin-bottom:.5rem;background:#f8fafc;transition:border-color .2s ease,box-shadow .2s ease}.ai-terminal-conversation.is-active{border-color:#3b82f699;box-shadow:0 6px 14px #3b82f626;background:#eff6ff}.ai-terminal-conversation-main{cursor:pointer}.ai-terminal-conversation-title{font-weight:600;font-size:.85rem;margin-bottom:.35rem;color:#0f172a}.ai-terminal-conversation-meta{display:flex;gap:.5rem;font-size:.75rem;color:#64748b}.ai-terminal-conversation-actions{display:flex;justify-content:space-between;margin-top:.4rem}.ai-terminal-inline-actions{display:flex;gap:.35rem;margin-top:.4rem}.ai-terminal-conversation-edit input{margin-bottom:.4rem}.ai-terminal-alert{margin-top:.5rem}.ai-terminal-messages{flex:1;overflow-y:auto;padding:.75rem .25rem;display:flex;flex-direction:column;gap:.75rem}.ai-terminal-message{position:relative;padding:.75rem .85rem;border-radius:14px;background:#f8fafc;border:1px solid rgba(148,163,184,.2)}.ai-terminal-message-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.05rem;line-height:1;padding:0;width:1.35rem;height:1.35rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-message-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-message-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-message.user{background:#e0f2fe;border-color:#0ea5e94d}.ai-terminal-message.assistant{background:#f1f5f9}.ai-terminal-message.pending{border-style:dashed;border-color:#94a3b873;background:#f8fafc}.ai-terminal-message.pending .ai-terminal-message-body{letter-spacing:.2em;font-weight:600;animation:ai-terminal-thinking 1.2s ease-in-out infinite;color:#64748b}.ai-terminal-message-progress{color:#334155;font-size:.78rem}.ai-terminal-progress-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem}.ai-terminal-progress-item{display:inline-flex;align-self:flex-start;padding:.2rem .6rem;border-radius:999px;background:#94a3b833;color:#334155;font-weight:600;font-size:.85rem}.ai-terminal-message.tool{background:#fef3c7;border-color:#f59e0b66}.ai-terminal-message-role{font-size:.7rem;letter-spacing:.05em;text-transform:uppercase;color:#64748b;margin-bottom:.35rem}.ai-terminal-message-body{color:#0f172a;white-space:normal;line-height:1.6;font-size:.82rem}.ai-terminal-message-body p{margin:0 0 .35rem}.ai-terminal-message.user .ai-terminal-message-body p{margin:0}.ai-terminal-message.user .ai-terminal-message-actions{margin-top:0}.ai-terminal-message-body p:last-child{margin-bottom:0}.ai-terminal-message-body ul,.ai-terminal-message-body ol{margin:.35rem 0 .6rem 1.4rem;padding:0}.ai-terminal-message-body h1,.ai-terminal-message-body h2,.ai-terminal-message-body h3,.ai-terminal-message-body h4,.ai-terminal-message-body h5,.ai-terminal-message-body h6{margin:0 0 .5rem;font-weight:600}.ai-terminal-message-body code{background:#94a3b833;border-radius:4px;padding:.1rem .3rem;font-size:.85em}.ai-terminal-route-link{color:#2563eb;text-decoration:underline;cursor:pointer}.ai-terminal-route-link:hover{color:#1d4ed8}.ai-terminal-message-meta{margin-top:.35rem;font-size:.68rem;color:#64748b}.ai-terminal-message-actions{margin-top:.35rem;display:flex;justify-content:flex-end;gap:.65rem}.ai-terminal-message-actions.ai-terminal-message-actions-user{margin-top:0}.ai-terminal-copy-btn{padding:0;font-weight:600;color:#2563eb;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-copy-btn:hover{color:#1d4ed8}.ai-terminal-report-btn{padding:0;font-weight:600;color:#b45309;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-report-btn:hover{color:#92400e}.ai-terminal-message-table{margin-top:.6rem}.ai-terminal-table-meta{display:flex;flex-wrap:wrap;gap:.75rem;font-size:.75rem;color:#64748b;margin-bottom:.35rem;align-items:center}.ai-terminal-table-meta-spacer{flex:1 1 auto}.ai-terminal-table-tz{font-weight:600}.ai-terminal-table-toggle,.ai-terminal-table-export,.ai-terminal-table-pull{padding:0;font-weight:600}.ai-terminal-message-debug{margin-top:.5rem}.ai-terminal-debug-toggle{padding:0;font-weight:600}.ai-terminal-debug-body{margin:.35rem 0 0;padding:.5rem .75rem;background:#0f172a;color:#e2e8f0;border-radius:8px;font-size:.75rem;white-space:pre-wrap;word-break:break-word}.ai-terminal-table-wrap{width:100%;overflow-x:auto}.ai-terminal-table-wrap collapse-table{display:block;width:100%}.ai-terminal-table{width:100%;border-collapse:collapse;font-size:.78rem}.ai-terminal-table th,.ai-terminal-table td{border:1px solid rgba(148,163,184,.3);padding:.35rem .5rem;vertical-align:top;white-space:nowrap}.ai-terminal-table thead{background:#94a3b826}.ai-terminal-table tbody tr:nth-child(2n){background:#94a3b814}.ai-terminal-message-attachments{margin-top:.5rem;border-top:1px dashed rgba(148,163,184,.4);padding-top:.4rem}.ai-terminal-attachment{display:flex;justify-content:space-between;font-size:.8rem}.ai-terminal-composer{border-top:1px solid rgba(148,163,184,.2);padding-top:.75rem;display:flex;flex-direction:column;gap:.6rem}.ai-terminal-composer-input-wrap{position:relative}.ai-terminal-composer-input{min-height:60px;padding:.85rem 2.7rem .85rem 1rem;border-radius:16px;border:1px solid rgba(234,179,8,.45);background:#fff7cc;box-shadow:0 10px 20px #eab3081f;font-size:.95rem;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease;resize:vertical}.ai-terminal-composer-input:focus{border-color:#f59e0bbf;background:#fff3b0;box-shadow:0 0 0 3px #fbbf2459,0 12px 24px #eab30833}.ai-terminal-composer-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.15rem;line-height:1;padding:0;width:1.5rem;height:1.5rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-composer-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-composer-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-composer-row{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap}.ai-terminal-upload{flex:1;min-width:220px}.ai-terminal-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-pending{background:#f8fafc;border:1px dashed rgba(148,163,184,.4);border-radius:12px;padding:.6rem .75rem}.ai-terminal-pending-title{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin-bottom:.4rem}.ai-terminal-pending-item{display:flex;justify-content:space-between;align-items:center;border-top:1px solid rgba(148,163,184,.2);padding-top:.4rem;margin-top:.4rem}.ai-terminal-empty-title{margin:0 0 .45rem;color:#64748b;font-size:.78rem;font-weight:600}.ai-terminal-favorites{margin-bottom:.9rem;padding:.6rem;border:1px solid rgba(148,163,184,.24);border-radius:12px;background:#f8fafc}.ai-terminal-favorite-list{display:flex;flex-direction:column;gap:.4rem}.ai-terminal-favorite-item{display:flex;align-items:center;gap:.4rem;width:100%;min-width:0}.ai-terminal-favorite-actions{display:inline-flex;align-items:center;gap:.35rem}.ai-terminal-favorite-run{flex:1;display:inline-flex;align-items:center;gap:.5rem;min-width:0;border:1px solid rgba(148,163,184,.3);border-radius:10px;padding:.45rem .55rem;background:#fff;color:#0f172a;font-size:.78rem;line-height:1.2;text-align:left;transition:border-color .2s ease,background-color .2s ease}.ai-terminal-favorite-run:hover{border-color:#f59e0bbf;background:#fffbeb}.ai-terminal-favorite-run-star{color:#d4a017;font-size:.86rem;line-height:1;flex:0 0 auto}.ai-terminal-favorite-run-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-terminal-favorite-edit,.ai-terminal-favorite-remove{border:1px solid rgba(148,163,184,.3);border-radius:10px;background:#fff;width:2rem;height:2rem;font-size:1rem;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-favorite-edit{color:#1d4ed8}.ai-terminal-favorite-remove{color:#b91c1c}.ai-terminal-empty{color:#94a3b8;font-size:.78rem;padding:.5rem .2rem}.ai-terminal-favorite-edit-overlay{position:fixed;inset:0;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:1rem;z-index:1060}.ai-terminal-favorite-edit-modal{width:min(560px,100%);background:#fff;border:1px solid rgba(148,163,184,.4);border-radius:12px;padding:.9rem;box-shadow:0 18px 40px #0f172a33;display:flex;flex-direction:column;gap:.65rem}.ai-terminal-favorite-edit-modal h5{margin:0;font-size:.95rem}.ai-terminal-favorite-edit-modal textarea{min-height:9rem}.ai-terminal-issue-report-modal textarea{min-height:7rem}.ai-terminal-issue-report-modal label{margin:0;font-size:.8rem;font-weight:600;color:#334155}.ai-terminal-favorite-edit-actions{display:flex;justify-content:flex-end;gap:.45rem}@keyframes ai-terminal-thinking{0%{opacity:.35}50%{opacity:1}to{opacity:.35}}@media(max-width:980px){.ai-terminal-shell{grid-template-columns:1fr}}\n"],dependencies:[{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"directive",type:i3.NgForOf,selector:"[ngFor][ngForOf]",inputs:["ngForOf","ngForTrackBy","ngForTemplate"]},{kind:"directive",type:i3.NgIf,selector:"[ngIf]",inputs:["ngIf","ngIfThen","ngIfElse"]},{kind:"pipe",type:DomSanitizorPipe,name:"safe"},{kind:"pipe",type:i3.DecimalPipe,name:"number"},{kind:"pipe",type:i3.DatePipe,name:"date"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalComponent,decorators:[{type:Component,args:[{selector:"rio-ai-terminal",providers:[ProviderService,AiTerminalService,AiPageFormAdapterService],standalone:!1,template:'<div class="ai-terminal-shell" [class.single-conversation]="singleConversation">\n\t<div class="ai-terminal-sidebar" *ngIf="!singleConversation">\n\t\t<div class="ai-terminal-sidebar-header">\n\t\t\t<div>\n\t\t\t\t<h5>{{ title }}</h5>\n\t\t\t\t<p class="ai-terminal-muted" *ngIf="idApp">App: {{ idApp }}</p>\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="createConversation()">New Chat</button>\n\t\t</div>\n\n\t\t<div class="ai-terminal-sidebar-body">\n\t\t\t<div class="ai-terminal-empty" *ngIf="isLoading">Loading conversations...</div>\n\t\t\t<div class="ai-terminal-empty" *ngIf="!isLoading && !conversations.length">No conversations yet.</div>\n\n\t\t\t<div class="ai-terminal-conversation"\n\t\t\t\t*ngFor="let conversation of conversations; trackBy: trackByConversation"\n\t\t\t\t[class.is-active]="conversation._id === activeConversationId">\n\t\t\t\t<div class="ai-terminal-conversation-main" (click)="setActiveConversation(conversation)">\n\t\t\t\t\t<div class="ai-terminal-conversation-title" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t\t{{ conversation.title && conversation.title !== \'New Conversation\' ? conversation.title : \'Ask AI About the System\' }}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-edit" *ngIf="editingConversationId === conversation._id">\n\t\t\t\t\t\t<input type="text" class="form-control form-control-sm" [(ngModel)]="editingTitle"\n\t\t\t\t\t\t\t(keyup.enter)="saveRename(conversation)" (keyup.escape)="cancelRename()">\n\t\t\t\t\t\t<div class="ai-terminal-inline-actions">\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="saveRename(conversation)">Save</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="cancelRename()">Cancel</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ai-terminal-conversation-meta">\n\t\t\t\t\t\t<span *ngIf="conversation.updatedAt">{{ conversation.updatedAt | date: \'short\' }}</span>\n\t\t\t\t\t\t<span *ngIf="conversation.branch_name && isCodexMode()">{{ conversation.branch_name }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-conversation-actions" *ngIf="editingConversationId !== conversation._id">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm" (click)="startRename(conversation)">Rename</button>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger ai-terminal-delete-btn" (click)="deleteConversation(conversation)">Delete</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n\n\t<div class="ai-terminal-main">\n\t\t<div class="ai-terminal-main-header">\n\t\t\t<div>\n\t\t\t\t<h4>{{ activeConversation?.title && activeConversation?.title !== \'New Conversation\' ? activeConversation?.title : \'Ask AI About the System\' }}</h4>\n\t\t\t\t<div class="ai-terminal-meta-row">\n\t\t\t\t\t<span *ngIf="activeConversation?.branch_name && isCodexMode()">Branch: {{ activeConversation?.branch_name }}</span>\n\t\t\t\t\t<span *ngIf="showAdvanced() && totalTokens()">Tokens: {{ totalTokens() | number }}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="ai-terminal-main-actions">\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation && canCopyConversation()"\n\t\t\t\t\t(click)="copyConversation()" [disabled]="isSending">\n\t\t\t\t\tCopy Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary"\n\t\t\t\t\t*ngIf="singleConversation"\n\t\t\t\t\t(click)="startNewConversation()" [disabled]="isSending">\n\t\t\t\t\tNew Conversation\n\t\t\t\t</button>\n\t\t\t\t<button type="button" class="btn btn-sm btn-outline-primary"\n\t\t\t\t\t*ngIf="isCodexMode() && activeConversation?.branch_name"\n\t\t\t\t\t(click)="deployTest()" [disabled]="isDeployingTest">\n\t\t\t\t\t{{ isDeployingTest ? \'Deploying...\' : \'Deploy to Test\' }}\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="ai-terminal-alert" *ngIf="errorMessage">\n\t\t\t<div class="alert alert-danger">{{ errorMessage }}</div>\n\t\t</div>\n\t\t<div class="ai-terminal-alert" *ngIf="infoMessage">\n\t\t\t<div class="alert alert-success">{{ infoMessage }}</div>\n\t\t</div>\n\n\t\t\t<div class="ai-terminal-messages" #messageScroll>\n\t\t\t\t<div class="ai-terminal-empty" *ngIf="!messages.length">\n\t\t\t\t\t<div class="ai-terminal-favorites" *ngIf="promptFavorites.length">\n\t\t\t\t\t\t<p class="ai-terminal-empty-title">Favorites</p>\n\t\t\t\t\t\t<div class="ai-terminal-favorite-list">\n\t\t\t\t\t\t\t<div class="ai-terminal-favorite-item" *ngFor="let prompt of promptFavorites; trackBy: trackByFavoritePrompt">\n\t\t\t\t\t\t\t\t<button type="button" class="ai-terminal-favorite-run" (click)="runFavoritePrompt(prompt)">\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-star">★</span>\n\t\t\t\t\t\t\t\t\t<span class="ai-terminal-favorite-run-text">{{ prompt }}</span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<div class="ai-terminal-favorite-actions">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-edit"\n\t\t\t\t\t\t\t\t\t\t(click)="startFavoritePromptEdit(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Edit favorite prompt">\n\t\t\t\t\t\t\t\t\t\t✎\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\t\t\tclass="ai-terminal-favorite-remove"\n\t\t\t\t\t\t\t\t\t\t(click)="removeFavoritePrompt(prompt, $event)"\n\t\t\t\t\t\t\t\t\t\taria-label="Remove favorite prompt">\n\t\t\t\t\t\t\t\t\t\t×\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<p class="ai-terminal-empty-title">Try one of these to get started:</p>\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li>How do I get to the invoice report?</li>\n\t\t\t\t\t\t<li>Where is the setting for <feature>?</li>\n\t\t\t\t\t\t<li>Give me a checklist for <task>.</li>\n\t\t\t\t\t<li>Explain what this screen does and the fields I need.</li>\n\t\t\t\t\t<li>Flag anomalies in inventory for the last 3 months.</li>\n\t\t\t\t\t<li>Summarize invoice totals for <client> over the last <X> months.</li>\n\t\t\t\t\t<li>Show trends in invoice volume and average value for <client> over the past 6 months.</li>\n\t\t\t\t\t<li>List top 5 variance items in inventory counts this quarter.</li>\n\t\t\t\t\t<li>Help me fill out this form using data I paste (e.g., from Excel).</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message"\n\t\t\t\t\t*ngFor="let message of visibleMessages; trackBy: trackByMessage"\n\t\t\t\t\t[class.user]="message.role === \'user\'"\n\t\t\t\t\t[class.assistant]="message.role === \'assistant\'"\n\t\t\t\t\t[class.pending]="message.metadata?.pending"\n\t\t\t\t\t[class.tool]="message.role === \'tool\'">\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-message-favorite-toggle"\n\t\t\t\t\t\t*ngIf="canToggleFavoriteForMessage(message)"\n\t\t\t\t\t\t[class.is-active]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t(click)="toggleMessagePromptFavorite(message, $event)"\n\t\t\t\t\t\t[attr.aria-pressed]="isMessagePromptFavorited(message)"\n\t\t\t\t\t\t[attr.title]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'"\n\t\t\t\t\t\t[attr.aria-label]="isMessagePromptFavorited(message) ? \'Remove prompt favorite\' : \'Save prompt favorite\'">\n\t\t\t\t\t\t{{ isMessagePromptFavorited(message) ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<div class="ai-terminal-message-role">{{ message.role }}</div>\n\t\t\t\t<ng-container *ngIf="pendingProgress(message) as progress; else messageBody">\n\t\t\t\t\t<div class="ai-terminal-message-progress">\n\t\t\t\t\t\t<ul class="ai-terminal-progress-list">\n\t\t\t\t\t\t\t<li class="ai-terminal-progress-item" *ngFor="let item of progress">{{ item }}</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</div>\n\t\t\t\t</ng-container>\n\t\t\t\t<ng-template #messageBody>\n\t\t\t\t\t<div class="ai-terminal-message-body" [innerHTML]="messageMarkdown(message) | safe:\'html\'"></div>\n\t\t\t\t</ng-template>\n\t\t\t\t\t<div class="ai-terminal-message-table" *ngIf="displayTableForMessage(message) as display">\n\t\t\t\t\t\t<div class="ai-terminal-table-meta">\n\t\t\t\t\t\t\t<span>{{ isAllRowsLoaded(message) ? \'Rows\' : \'Preview\' }}: {{ display.rows?.length || 0 }} rows</span>\n\t\t\t\t\t\t\t<span *ngIf="display.total !== undefined && display.total !== null">Total: {{ display.total }}</span>\n\t\t\t\t\t\t\t<span *ngIf="display.truncated">Truncated</span>\n\t\t\t\t\t\t\t<span *ngIf="isAllRowsLoaded(message)">All rows loaded</span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-meta-spacer"></span>\n\t\t\t\t\t\t\t<span class="ai-terminal-table-tz">Timezone: {{ timeZoneLabel }}</span>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-pull"\n\t\t\t\t\t\t\t\t*ngIf="canPullAllMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isPullingAllMessage(message) || isExportingMessage(message)"\n\t\t\t\t\t\t\t\t(click)="pullAllMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isPullingAllMessage(message) ? \'Loading...\' : \'Pull All\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-table-export"\n\t\t\t\t\t\t\t\t*ngIf="canExportMessage(message)"\n\t\t\t\t\t\t\t\t[disabled]="isExportingMessage(message) || isPullingAllMessage(message)"\n\t\t\t\t\t\t\t\t(click)="exportMessageTable(message)">\n\t\t\t\t\t\t\t\t{{ isExportingMessage(message) ? \'Exporting...\' : \'Export\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-table-toggle" (click)="toggleTable(message)">\n\t\t\t\t\t\t\t\t{{ isTableCollapsed(message) ? \'Show Table\' : \'Hide Table\' }}\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="ai-terminal-table-wrap" *ngIf="!isTableCollapsed(message)">\n\t\t\t\t\t\t\t<collapse-table>\n\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<th *ngFor="let column of display.columns">{{ column }}</th>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t\t<tr *ngFor="let row of display.rows">\n\t\t\t\t\t\t\t\t\t\t<td *ngFor="let column of display.columns">{{ formatDisplayCell(row[column], column) }}</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-debug" *ngIf="showDebugForMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-debug-toggle" (click)="toggleDebug(message)">\n\t\t\t\t\t\t{{ isDebugCollapsed(message) ? \'Show Debug\' : \'Hide Debug\' }}\n\t\t\t\t\t</button>\n\t\t\t\t\t<pre class="ai-terminal-debug-body" *ngIf="!isDebugCollapsed(message)">{{ debugText(message) }}</pre>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-actions" [class.ai-terminal-message-actions-user]="message.role === \'user\'" *ngIf="canCopyMessage(message)">\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm ai-terminal-copy-btn" (click)="copyMessage(message)">\n\t\t\t\t\t\t<i class="fa fa-copy" aria-hidden="true"></i>\n\t\t\t\t\t\tCopy\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="btn btn-link btn-sm ai-terminal-report-btn"\n\t\t\t\t\t\t*ngIf="canReportIssue(message)"\n\t\t\t\t\t\t(click)="openIssueReport(message, $event)">\n\t\t\t\t\t\t<i class="fa fa-flag" aria-hidden="true"></i>\n\t\t\t\t\t\tReport Issue\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-meta" *ngIf="showAdvanced() && message.usage?.total_tokens">\n\t\t\t\t\tTokens: {{ message.usage?.total_tokens | number }}\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-message-attachments" *ngIf="message.attachments?.length">\n\t\t\t\t\t<div class="ai-terminal-attachment" *ngFor="let attachment of message.attachments">\n\t\t\t\t\t\t<span>{{ attachment.name }}</span>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(attachment.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-composer">\n\t\t\t\t<div class="ai-terminal-composer-input-wrap">\n\t\t\t\t\t<textarea\n\t\t\t\t\t\tclass="form-control ai-terminal-composer-input"\n\t\t\t\t\t\trows="2"\n\t\t\t\t\t\t[placeholder]="placeholder"\n\t\t\t\t\t\t(keydown)="handleComposerKeydown($event)"\n\t\t\t\t\t\t[(ngModel)]="messageText"></textarea>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype="button"\n\t\t\t\t\t\tclass="ai-terminal-composer-favorite-toggle"\n\t\t\t\t\t\t[class.is-active]="promptFavoriteEnabled"\n\t\t\t\t\t\t[disabled]="isSending"\n\t\t\t\t\t\t(click)="togglePromptFavorite()"\n\t\t\t\t\t\t[attr.aria-pressed]="promptFavoriteEnabled"\n\t\t\t\t\t\t[attr.title]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'"\n\t\t\t\t\t\t[attr.aria-label]="promptFavoriteEnabled ? \'Favorite enabled for next prompt\' : \'Favorite this next prompt\'">\n\t\t\t\t\t\t{{ promptFavoriteEnabled ? \'★\' : \'☆\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\n\t\t\t\t<div class="ai-terminal-composer-row">\n\t\t\t\t\t<div class="ai-terminal-upload" *ngIf="allowUploads()">\n\t\t\t\t\t\t<input type="file" class="form-control" multiple (change)="handleFileSelect($event)">\n\t\t\t\t\t<small class="ai-terminal-muted">Max {{ maxFileMb() }}MB per file • {{ maxTotalMb() }}MB total</small>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-terminal-actions">\n\t\t\t\t\t<button type="button" class="btn btn-outline-secondary" (click)="clearComposer()" [disabled]="isSending">Clear</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="sendMessage()" [disabled]="isSending || !messageText.trim()">\n\t\t\t\t\t\t{{ isSending ? \'Sending...\' : \'Send\' }}\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="ai-terminal-pending" *ngIf="pendingFiles.length">\n\t\t\t\t<div class="ai-terminal-pending-title">Attachments</div>\n\t\t\t\t<div class="ai-terminal-pending-item" *ngFor="let file of pendingFiles; let i = index">\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<strong>{{ file.name }}</strong>\n\t\t\t\t\t\t<span class="ai-terminal-muted">{{ formatFileSize(file.size) }}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<button type="button" class="btn btn-link btn-sm text-danger" (click)="removePendingFile(i)">Remove</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="favoritePromptEditOpen" (click)="cancelFavoritePromptEdit()">\n\t<div class="ai-terminal-favorite-edit-modal" role="dialog" aria-modal="true" aria-label="Edit favorite prompt" (click)="$event.stopPropagation()">\n\t\t<h5>Edit Favorite Request</h5>\n\t\t<textarea\n\t\t\tclass="form-control"\n\t\t\trows="5"\n\t\t\t(keydown.escape)="cancelFavoritePromptEdit()"\n\t\t\t[(ngModel)]="favoritePromptEditValue"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" (click)="cancelFavoritePromptEdit()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSaveFavoritePromptEdit()" (click)="saveFavoritePromptEdit()">Save</button>\n\t\t</div>\n\t</div>\n</div>\n\n<div class="ai-terminal-favorite-edit-overlay" *ngIf="issueReportOpen" (click)="cancelIssueReport()">\n\t<div class="ai-terminal-favorite-edit-modal ai-terminal-issue-report-modal" role="dialog" aria-modal="true" aria-label="Report issue with assistant response" (click)="$event.stopPropagation()">\n\t\t<h5>Report AI Response Issue</h5>\n\t\t<label for="ai-terminal-issue-reason">What was wrong?</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-reason"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Describe what was inaccurate, missing, or confusing."\n\t\t\t[(ngModel)]="issueReportReason"></textarea>\n\t\t<label for="ai-terminal-issue-expected">What did you expect instead? (Optional)</label>\n\t\t<textarea\n\t\t\tid="ai-terminal-issue-expected"\n\t\t\tclass="form-control"\n\t\t\trows="4"\n\t\t\tplaceholder="Share the result or format you expected."\n\t\t\t[(ngModel)]="issueReportExpected"></textarea>\n\t\t<div class="ai-terminal-favorite-edit-actions">\n\t\t\t<button type="button" class="btn btn-outline-secondary btn-sm" [disabled]="isSubmittingIssueReport" (click)="cancelIssueReport()">Cancel</button>\n\t\t\t<button type="button" class="btn btn-primary btn-sm" [disabled]="!canSubmitIssueReport()" (click)="submitIssueReport()">\n\t\t\t\t{{ isSubmittingIssueReport ? \'Submitting...\' : \'Submit Report\' }}\n\t\t\t</button>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".ai-terminal-shell{display:grid;grid-template-columns:280px minmax(0,1fr);gap:1rem;align-items:stretch}.ai-terminal-shell.single-conversation{grid-template-columns:minmax(0,1fr)}.ai-terminal-sidebar,.ai-terminal-main{background:#fff;border:1px solid rgba(148,163,184,.25);border-radius:14px;box-shadow:0 10px 24px #0f172a0f}.ai-terminal-sidebar{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-sidebar-header{display:flex;align-items:center;justify-content:space-between;gap:.75rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-sidebar-header h5{font-size:1rem;margin:0}.ai-terminal-sidebar-body{flex:1;overflow:auto;padding-top:.5rem;font-size:.85rem}.ai-terminal-main{display:flex;flex-direction:column;padding:.75rem;min-height:500px}.ai-terminal-main-header{display:flex;justify-content:space-between;align-items:center;gap:1rem;padding-bottom:.5rem;border-bottom:1px solid rgba(148,163,184,.2)}.ai-terminal-main-header h4{font-size:1.15rem;margin:0}.ai-terminal-main-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-meta-row{display:flex;gap:.75rem;font-size:.72rem;color:#64748b}.ai-terminal-muted{color:#64748b;font-size:.72rem;margin:0}.ai-terminal-conversation{border:1px solid transparent;border-radius:12px;padding:.6rem .7rem;margin-bottom:.5rem;background:#f8fafc;transition:border-color .2s ease,box-shadow .2s ease}.ai-terminal-conversation.is-active{border-color:#3b82f699;box-shadow:0 6px 14px #3b82f626;background:#eff6ff}.ai-terminal-conversation-main{cursor:pointer}.ai-terminal-conversation-title{font-weight:600;font-size:.85rem;margin-bottom:.35rem;color:#0f172a}.ai-terminal-conversation-meta{display:flex;gap:.5rem;font-size:.75rem;color:#64748b}.ai-terminal-conversation-actions{display:flex;justify-content:space-between;margin-top:.4rem}.ai-terminal-inline-actions{display:flex;gap:.35rem;margin-top:.4rem}.ai-terminal-conversation-edit input{margin-bottom:.4rem}.ai-terminal-alert{margin-top:.5rem}.ai-terminal-messages{flex:1;overflow-y:auto;padding:.75rem .25rem;display:flex;flex-direction:column;gap:.75rem}.ai-terminal-message{position:relative;padding:.75rem .85rem;border-radius:14px;background:#f8fafc;border:1px solid rgba(148,163,184,.2)}.ai-terminal-message-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.05rem;line-height:1;padding:0;width:1.35rem;height:1.35rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-message-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-message-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-message.user{background:#e0f2fe;border-color:#0ea5e94d}.ai-terminal-message.assistant{background:#f1f5f9}.ai-terminal-message.pending{border-style:dashed;border-color:#94a3b873;background:#f8fafc}.ai-terminal-message.pending .ai-terminal-message-body{letter-spacing:.2em;font-weight:600;animation:ai-terminal-thinking 1.2s ease-in-out infinite;color:#64748b}.ai-terminal-message-progress{color:#334155;font-size:.78rem}.ai-terminal-progress-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.4rem}.ai-terminal-progress-item{display:inline-flex;align-self:flex-start;padding:.2rem .6rem;border-radius:999px;background:#94a3b833;color:#334155;font-weight:600;font-size:.85rem}.ai-terminal-message.tool{background:#fef3c7;border-color:#f59e0b66}.ai-terminal-message-role{font-size:.7rem;letter-spacing:.05em;text-transform:uppercase;color:#64748b;margin-bottom:.35rem}.ai-terminal-message-body{color:#0f172a;white-space:normal;line-height:1.6;font-size:.82rem}.ai-terminal-message-body p{margin:0 0 .35rem}.ai-terminal-message.user .ai-terminal-message-body p{margin:0}.ai-terminal-message.user .ai-terminal-message-actions{margin-top:0}.ai-terminal-message-body p:last-child{margin-bottom:0}.ai-terminal-message-body ul,.ai-terminal-message-body ol{margin:.35rem 0 .6rem 1.4rem;padding:0}.ai-terminal-message-body h1,.ai-terminal-message-body h2,.ai-terminal-message-body h3,.ai-terminal-message-body h4,.ai-terminal-message-body h5,.ai-terminal-message-body h6{margin:0 0 .5rem;font-weight:600}.ai-terminal-message-body code{background:#94a3b833;border-radius:4px;padding:.1rem .3rem;font-size:.85em}.ai-terminal-route-link{color:#2563eb;text-decoration:underline;cursor:pointer}.ai-terminal-route-link:hover{color:#1d4ed8}.ai-terminal-message-meta{margin-top:.35rem;font-size:.68rem;color:#64748b}.ai-terminal-message-actions{margin-top:.35rem;display:flex;justify-content:flex-end;gap:.65rem}.ai-terminal-message-actions.ai-terminal-message-actions-user{margin-top:0}.ai-terminal-copy-btn{padding:0;font-weight:600;color:#2563eb;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-copy-btn:hover{color:#1d4ed8}.ai-terminal-report-btn{padding:0;font-weight:600;color:#b45309;display:inline-flex;align-items:center;gap:.35rem;line-height:1}.ai-terminal-report-btn:hover{color:#92400e}.ai-terminal-message-table{margin-top:.6rem}.ai-terminal-table-meta{display:flex;flex-wrap:wrap;gap:.75rem;font-size:.75rem;color:#64748b;margin-bottom:.35rem;align-items:center}.ai-terminal-table-meta-spacer{flex:1 1 auto}.ai-terminal-table-tz{font-weight:600}.ai-terminal-table-toggle,.ai-terminal-table-export,.ai-terminal-table-pull{padding:0;font-weight:600}.ai-terminal-message-debug{margin-top:.5rem}.ai-terminal-debug-toggle{padding:0;font-weight:600}.ai-terminal-debug-body{margin:.35rem 0 0;padding:.5rem .75rem;background:#0f172a;color:#e2e8f0;border-radius:8px;font-size:.75rem;white-space:pre-wrap;word-break:break-word}.ai-terminal-table-wrap{width:100%;overflow-x:auto}.ai-terminal-table-wrap collapse-table{display:block;width:100%}.ai-terminal-table{width:100%;border-collapse:collapse;font-size:.78rem}.ai-terminal-table th,.ai-terminal-table td{border:1px solid rgba(148,163,184,.3);padding:.35rem .5rem;vertical-align:top;white-space:nowrap}.ai-terminal-table thead{background:#94a3b826}.ai-terminal-table tbody tr:nth-child(2n){background:#94a3b814}.ai-terminal-message-attachments{margin-top:.5rem;border-top:1px dashed rgba(148,163,184,.4);padding-top:.4rem}.ai-terminal-attachment{display:flex;justify-content:space-between;font-size:.8rem}.ai-terminal-composer{border-top:1px solid rgba(148,163,184,.2);padding-top:.75rem;display:flex;flex-direction:column;gap:.6rem}.ai-terminal-composer-input-wrap{position:relative}.ai-terminal-composer-input{min-height:60px;padding:.85rem 2.7rem .85rem 1rem;border-radius:16px;border:1px solid rgba(234,179,8,.45);background:#fff7cc;box-shadow:0 10px 20px #eab3081f;font-size:.95rem;transition:border-color .2s ease,box-shadow .2s ease,background-color .2s ease;resize:vertical}.ai-terminal-composer-input:focus{border-color:#f59e0bbf;background:#fff3b0;box-shadow:0 0 0 3px #fbbf2459,0 12px 24px #eab30833}.ai-terminal-composer-favorite-toggle{position:absolute;top:.45rem;right:.55rem;border:0;background:transparent;color:#94a3b8e6;font-size:1.15rem;line-height:1;padding:0;width:1.5rem;height:1.5rem;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-composer-favorite-toggle:hover{color:#f59e0be6}.ai-terminal-composer-favorite-toggle.is-active{color:#d4a017;text-shadow:0 0 10px rgba(245,158,11,.25)}.ai-terminal-composer-row{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap}.ai-terminal-upload{flex:1;min-width:220px}.ai-terminal-actions{display:flex;gap:.5rem;align-items:center}.ai-terminal-pending{background:#f8fafc;border:1px dashed rgba(148,163,184,.4);border-radius:12px;padding:.6rem .75rem}.ai-terminal-pending-title{font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin-bottom:.4rem}.ai-terminal-pending-item{display:flex;justify-content:space-between;align-items:center;border-top:1px solid rgba(148,163,184,.2);padding-top:.4rem;margin-top:.4rem}.ai-terminal-empty-title{margin:0 0 .45rem;color:#64748b;font-size:.78rem;font-weight:600}.ai-terminal-favorites{margin-bottom:.9rem;padding:.6rem;border:1px solid rgba(148,163,184,.24);border-radius:12px;background:#f8fafc}.ai-terminal-favorite-list{display:flex;flex-direction:column;gap:.4rem}.ai-terminal-favorite-item{display:flex;align-items:center;gap:.4rem;width:100%;min-width:0}.ai-terminal-favorite-actions{display:inline-flex;align-items:center;gap:.35rem}.ai-terminal-favorite-run{flex:1;display:inline-flex;align-items:center;gap:.5rem;min-width:0;border:1px solid rgba(148,163,184,.3);border-radius:10px;padding:.45rem .55rem;background:#fff;color:#0f172a;font-size:.78rem;line-height:1.2;text-align:left;transition:border-color .2s ease,background-color .2s ease}.ai-terminal-favorite-run:hover{border-color:#f59e0bbf;background:#fffbeb}.ai-terminal-favorite-run-star{color:#d4a017;font-size:.86rem;line-height:1;flex:0 0 auto}.ai-terminal-favorite-run-text{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ai-terminal-favorite-edit,.ai-terminal-favorite-remove{border:1px solid rgba(148,163,184,.3);border-radius:10px;background:#fff;width:2rem;height:2rem;font-size:1rem;line-height:1;padding:0;display:inline-flex;align-items:center;justify-content:center}.ai-terminal-favorite-edit{color:#1d4ed8}.ai-terminal-favorite-remove{color:#b91c1c}.ai-terminal-empty{color:#94a3b8;font-size:.78rem;padding:.5rem .2rem}.ai-terminal-favorite-edit-overlay{position:fixed;inset:0;background:#0f172a73;display:flex;align-items:center;justify-content:center;padding:1rem;z-index:1060}.ai-terminal-favorite-edit-modal{width:min(560px,100%);background:#fff;border:1px solid rgba(148,163,184,.4);border-radius:12px;padding:.9rem;box-shadow:0 18px 40px #0f172a33;display:flex;flex-direction:column;gap:.65rem}.ai-terminal-favorite-edit-modal h5{margin:0;font-size:.95rem}.ai-terminal-favorite-edit-modal textarea{min-height:9rem}.ai-terminal-issue-report-modal textarea{min-height:7rem}.ai-terminal-issue-report-modal label{margin:0;font-size:.8rem;font-weight:600;color:#334155}.ai-terminal-favorite-edit-actions{display:flex;justify-content:flex-end;gap:.45rem}@keyframes ai-terminal-thinking{0%{opacity:.35}50%{opacity:1}to{opacity:.35}}@media(max-width:980px){.ai-terminal-shell{grid-template-columns:1fr}}\n"]}]}],ctorParameters:()=>[{type:AiTerminalService},{type:ProviderService},{type:AiPageRouterService},{type:AiPageFormAdapterService},{type:void 0,decorators:[{type:Inject,args:[LOCALE_ID]}]}],propDecorators:{idClient:[{type:Input}],idApp:[{type:Input}],title:[{type:Input}],config:[{type:Input}],conversationStatus:[{type:Input}],messageLimit:[{type:Input}],placeholder:[{type:Input}],singleConversation:[{type:Input}],contextMode:[{type:Input}],contextRoute:[{type:Input}],paused:[{type:Input}],bypassRouteSubscriptions:[{type:Input}],messageScroll:[{type:ViewChild,args:["messageScroll",{static:!1}]}]}});const BASE_SYSTEM_PROMPT=["You are the ResolveIO in-app AI assistant for this product.","- You can only help users understand and navigate the existing codebase and UI.","- Never share code or file contents. All code is proprietary.","- Do not suggest or perform any hacking, bypass, or security abuse.","- Do not access databases directly, secrets, or other users' data.","- If the user has a customer portal scope (other.id_customer), only discuss that customer's data and what is visible in their customer portal. Never reference other customers or internal/admin-only data. If asked for anything outside the portal, say it isn't available.","- Do not change local browser data or run destructive actions.","- Provide detailed, expert-level explanations grounded in this product. Avoid generic answers.","- When explaining why something happens, describe the specific workflow, fields, and auto-filled data involved (what fills, where it comes from, and when it triggers). If unsure, ask a clarifying question about the screen or workflow.",'- When asked "why is this happening," respond with: cause, trigger, data source(s), and expected vs actual outcome.',"- For troubleshooting, ask clarifying questions only when needed to proceed; otherwise answer directly, then give a short decision tree (If X, do Y; If not, do Z).","- Provide checklists for common tasks, highlighting required fields and common pitfalls.",'- If asked "where is this set," give the screen/workflow name and navigation steps to reach it.','- If asked "what changed," summarize release notes if known; if not available, say so and suggest where to check or offer a support ticket.','- After answering, optionally suggest 0-1 related next steps only when helpful. Do not ask for "next steps" every time.',"- If access is blocked, name the permission/role needed and how to request it.","- Prefer high-level product guidance; only mention file paths if explicitly requested.","- Only include an in-app route when the user explicitly asks for navigation or a link to another screen. Never include the route for the current screen.",'- Avoid vague labels like "Operations app"; use the specific screen/workflow name.',"- Do not mention other client projects or ask which client; if clarification is needed, ask about the screen or workflow without listing other clients.","- Respond in English only. Do not include non-English text or characters unless required for JSON, links, or tool directives.",'- Respond with a single clear message; be thorough but stay focused. Do not add labels like "Customer-facing summary" or "Work ticket summary" and do not include estimated hours.','- Use structured responses by default: short heading, then bullet points. For "how do I" questions, provide a step-by-step list (numbered) with explicit page/screen names and actions.','- When giving steps, include navigation guidance like "Go to <screen>" and "Click/Select/Enter <field>" so the user can follow it exactly.',"- If context scope is provided (ex: current page), prioritize that screen in your answer.","- If a request is out of scope, offer to create a support ticket and provide a short summary.",'- If you identify a likely product issue, confirm the issue and ask: "Do you want me to open a support ticket?" before creating one.',"- If the user explicitly asks to create/open/file a support ticket, or explicitly confirms after your prompt, end your response with a single line in one of these formats:","- SUPPORT_TICKET_CREATE: <one-line summary>",'- SUPPORT_TICKET_CREATE: {"summary":"<customer-safe summary>","internal_recommendations":"<internal-only diagnosis and fix recommendation>","code_change_recommendations":"<codex-ready implementation notes>"}',"- Prefer the JSON form when you have useful internal recommendations. Keep the customer-safe summary concise.","- Only include SUPPORT_TICKET_CREATE when the user clearly wants a ticket created. Do not claim a ticket is created unless you include that line.",'- Do not end responses with tentative phrasing like "I could" or "I’m going to." Complete the request or state what is required to proceed.',"- Use the codebase context to choose correct collections/fields/workflows and use MONGO_READ/MONGO_AGG to answer with real data when needed.","- For direct questions, answer first. Ask a single follow-up only if required to run a query or resolve missing details.","- If you need database data to answer, end your response with a single line exactly in this format:",'- MONGO_READ: {"collection":"<name>","query":{...},"options":{"projection":{...},"sort":{...},"limit":20},"permissionView":"</route>"}',"- If you need grouped/aggregated data (totals by user, rankings, trends), end your response with a single line exactly in this format:",'- MONGO_AGG: {"collection":"<name>","pipeline":[...],"options":{"allowDiskUse":true,"limit":20},"permissionView":"</route>"}',"- For invoice data, set permissionView to an invoice-capable route (ex: /invoice/list or /report-builder). Do not use /report/* routes.","- For revenue/sales/billing questions, use invoices and sum paid_total (fallback to grand_total) with date_paid and Paid/Closed status when available.","- For blend ticket summaries, use product = blend_name (fallback chemical), total volume = chemical_recipe_quantity, and unit = lb when blend_in_pounds is true otherwise gal.","- For relative date ranges (last/past/recent), include an upper bound <= $$NOW unless the user specifies a future end date.","- Keep queries minimal, read-only, and avoid user/credential data unless the user is a super admin.","- Assume you are not a super admin unless explicitly told otherwise.","- Only request data when the user has permission for that module; invoice data requires invoice view access.","- If the user lacks permission, answer without data and explain how to view it in the app or request access.","- For simple counts or time-range totals, use MONGO_READ (includeTotal). For breakdowns, rankings, or sums grouped by a field, use MONGO_AGG.",'- Before issuing MONGO_READ or MONGO_AGG, verify the collection name and key fields by checking collection/model definitions in the current app (look for "collectionName:" and date fields like date_created/date_completed/createdAt). Do not invent collection names.',"- For creation-date questions when both date_created and createdAt exist, match both with $or so results are not missed.","- When grouping by fields that can be arrays (drivers, deliveries, routes, chemicals), $unwind first and group by both id and name when available.","- Use MONGO_READ/MONGO_AGG only to produce summaries/snapshots/health checks (not raw dumps) when permitted.","- When referencing data, summarize it in bullets and avoid raw JSON or dumps.","- Format currency as $1,234.56 (no USD prefix) with two decimals.","- Use medium reasoning effort."].join("\n"),DEFAULT_AI_ASSISTANT_CODEX_MODEL="gpt-5.3-codex",DEFAULT_AI_ASSISTANT_CODEX_FALLBACK_MODEL="gpt-5.2-codex";class AiAssistantComponent{router;_account;renderer;ngZone;idClient="";idApp="";title="AI Assistant";open=!1;supportTicketRoute="/support-ticket/new";supportTicketEnabled=!0;config=null;topOffset=0;panelHeight=0;currentRoute="";hoverEnabled=!0;openRequested=new EventEmitter;closed=new EventEmitter;terminal;panelRef;terminalConfig;contextMode="auto";hoverOpened=!1;panelWidthPx=null;isResizing=!1;resizeMinWidth=0;resizeMaxWidth=0;resizeStartWidth=0;suppressRailClick=!1;resizeMoved=!1;aiDebugEnabled=!1;detachResizeMoveListener=null;detachResizeEndListener=null;constructor(t,e,n,o){this.router=t,this._account=e,this.renderer=n,this.ngZone=o,this.terminalConfig=this.buildTerminalConfig()}refreshAiDebugFlag(){if("undefined"!=typeof window)try{const t=String(localStorage.getItem("resolveio.ai.debug")||"").trim().toLowerCase();this.aiDebugEnabled="1"===t||"true"===t||"on"===t}catch{this.aiDebugEnabled=!1}else this.aiDebugEnabled=!1}debugLog(t,e){if(!this.aiDebugEnabled||"undefined"==typeof console||"function"!=typeof console.debug)return;const n=e&&"object"==typeof e?e:{};console.debug(`[AI.Assistant] ${t}`,n)}ngOnChanges(t){this.refreshAiDebugFlag(),t.open&&!this.open&&(this.hoverOpened=!1,this.isResizing=!1,this.suppressRailClick=!1,this.unbindResizeListeners()),t.open&&this.debugLog("open.changed",{open:this.open,topOffset:this.topOffset,panelHeight:this.panelHeight,route:this.currentRoute||""}),(t.idApp||t.config)&&(this.terminalConfig=this.buildTerminalConfig())}ngOnDestroy(){this.unbindResizeListeners()}buildTerminalConfig(){return{mode:"codex",model:"gpt-5.3-codex",fallbackModel:"gpt-5.2-codex",guardrails:!0,allowUploads:!1,showAdvanced:!1,showToolMessages:!1,deleteFilesAfterRun:!0,pageRouterEnabled:!0,systemPrompt:this.buildSystemPrompt(),...this.config||{}}}closePanel(){this.hoverOpened=!1,this.debugLog("closePanel"),this.closed.emit()}handleRailClick(t){t?.stopPropagation(),this.suppressRailClick?this.suppressRailClick=!1:this.open||(this.hoverOpened=!1,this.debugLog("openRequested.railClick"),this.openRequested.emit())}handleRailMouseDown(t){this.open&&this.startResize(t)}handleRailEnter(){this.hoverEnabled&&!this.open&&(this.hoverOpened=!0,this.debugLog("openRequested.railHover"),this.openRequested.emit())}handleRailLeave(){this.hoverEnabled&&this.hoverOpened&&(this.hoverOpened=!1,this.closePanel())}setContextMode(t){this.contextMode="all"===t||"auto"===t?t:"current"}get contextRouteLabel(){return this.currentRoute||"Current page"}openSupportTicket(){if(!this.supportTicketEnabled)return;const t=this.buildSupportTicketSummary();t&&localStorage.setItem("resolveioSupportTicketDraft",JSON.stringify({issue:t,source:"ai-assistant",createdAt:(new Date).toISOString()})),this.closed.emit(),this.supportTicketRoute&&this.router.navigateByUrl(this.supportTicketRoute)}handleBackdropClick(t){t&&t.stopPropagation()}get panelWidthStyle(){return"number"==typeof this.panelWidthPx&&this.panelWidthPx>0?`${this.panelWidthPx}px`:"33.33vw"}startResize(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.resizeMoved=!1,this.suppressRailClick=!1;const n=this.panelRef?.nativeElement?.getBoundingClientRect().width,o=n||this.defaultPanelWidth();this.resizeStartWidth=this.clampPanelWidth(o);const r=this.defaultPanelWidth();this.resizeMinWidth=e?Math.max(r,this.resizeStartWidth):r,this.resizeMaxWidth=this.resolveMaxWidth(this.resizeMinWidth),this.panelWidthPx=this.clampPanelWidth(this.resizeStartWidth,this.resizeMinWidth,this.resizeMaxWidth),this.bindResizeListeners()}bindResizeListeners(){this.detachResizeMoveListener||this.detachResizeEndListener||"undefined"==typeof window||this.ngZone.runOutsideAngular(()=>{this.detachResizeMoveListener=this.renderer.listen("window","mousemove",t=>{this.handleResizeMoveOutsideAngular(t)}),this.detachResizeEndListener=this.renderer.listen("window","mouseup",()=>{this.handleResizeEndOutsideAngular()})})}unbindResizeListeners(){this.detachResizeMoveListener&&(this.detachResizeMoveListener(),this.detachResizeMoveListener=null),this.detachResizeEndListener&&(this.detachResizeEndListener(),this.detachResizeEndListener=null)}handleResizeMoveOutsideAngular(t){if(!this.isResizing||"undefined"==typeof window)return;const e=window.innerWidth-t.clientX,n=Math.abs(e-this.resizeStartWidth)>2;this.ngZone.run(()=>{this.isResizing&&(n&&(this.resizeMoved=!0,this.suppressRailClick=!0),this.panelWidthPx=this.clampPanelWidth(e,this.resizeMinWidth,this.resizeMaxWidth))})}handleResizeEndOutsideAngular(){this.isResizing&&this.ngZone.run(()=>this.finishResize())}finishResize(){this.isResizing?(this.isResizing=!1,this.resizeMoved&&this.suppressRailClick&&setTimeout(()=>{this.suppressRailClick=!1},0),this.unbindResizeListeners()):this.unbindResizeListeners()}clampPanelWidth(t,e,n){const o="number"==typeof e?e:window.innerWidth/3,r="number"==typeof n?n:Math.max(o,window.innerWidth-46);return Math.min(Math.max(t,o),r)}defaultPanelWidth(){return Math.round(window.innerWidth/3)}resolveMaxWidth(t){return Math.max(t,window.innerWidth-46)}buildSystemPrompt(){const t=String(this.idApp||"").trim(),e=t?`- Current app: ${t}. Treat this as the only project for this conversation.`:"- Treat the current app as the only project for this conversation.",n=this.buildCustomerScopeLine();return[BASE_SYSTEM_PROMPT,e,n].filter(Boolean).join("\n")}buildCustomerScopeLine(){const t=String(this._account.getUser()?.other?.id_customer||"").trim();return t?`- Customer portal scope: yes (id_customer: ${t}).`:""}buildSupportTicketSummary(){const t=this.terminal,e=t?.activeConversation,n=(t?.messages||[]).slice().reverse(),o=n.find(t=>"user"===t?.role),r=n.find(t=>"assistant"===t?.role),i=[],a=(e?.title||this.title||"").trim();return a&&i.push(`Conversation: ${a}`),o?.content&&i.push(`User request:\n${this.truncate(this.sanitizeSummary(o.content),1400)}`),r?.content&&i.push(`Assistant summary:\n${this.truncate(this.sanitizeSummary(r.content),2e3)}`),i.join("\n\n").trim()}sanitizeSummary(t){return String(t||"").replace(/```[\s\S]*?```/g,"").replace(/`([^`]+)`/g,"$1").replace(/\s{3,}/g," ").trim()}truncate(t,e){const n=String(t||"").trim();return n.length<=e?n:`${n.slice(0,Math.max(0,e-3))}...`}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiAssistantComponent,deps:[{token:i1$1.Router},{token:AccountManagerService},{token:i0.Renderer2},{token:i0.NgZone}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:AiAssistantComponent,isStandalone:!1,selector:"rio-ai-assistant",inputs:{idClient:"idClient",idApp:"idApp",title:"title",open:"open",supportTicketRoute:"supportTicketRoute",supportTicketEnabled:"supportTicketEnabled",config:"config",topOffset:"topOffset",panelHeight:"panelHeight",currentRoute:"currentRoute",hoverEnabled:"hoverEnabled"},outputs:{openRequested:"openRequested",closed:"closed"},viewQueries:[{propertyName:"terminal",first:!0,predicate:AiTerminalComponent,descendants:!0},{propertyName:"panelRef",first:!0,predicate:["panelRef"],descendants:!0}],usesOnChanges:!0,ngImport:i0,template:'<div class="ai-assistant-overlay" [class.is-open]="open"></div>\n<div\n\tclass="ai-assistant-drawer"\n\t[class.is-open]="open"\n\t[style.--ai-panel-width]="panelWidthStyle"\n\t[style.top.px]="topOffset"\n\t[style.height.px]="panelHeight">\n\t<button\n\t\ttype="button"\n\t\tclass="ai-assistant-rail"\n\t\t(click)="handleRailClick($event)"\n\t\t(mousedown)="handleRailMouseDown($event)">\n\t\t<span class="ai-assistant-rail-label">AI Assistant</span>\n\t</button>\n\t\t<div class="ai-assistant-panel" #panelRef [class.is-open]="open" (click)="$event.stopPropagation()">\n\t\t<div class="ai-assistant-resize-handle" (mousedown)="startResize($event)"></div>\n\t\t\t<div class="ai-assistant-header">\n\t\t\t\t<div class="ai-assistant-title">\n\t\t\t\t\t<h4>{{ title }}</h4>\n\t\t\t\t\t<p class="ai-assistant-subtitle">Ask about workflows, routes, and where features live.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-assistant-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-danger ai-assistant-close" (click)="closePanel()">Close</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<div class="ai-assistant-context">\n\t\t\t<div class="ai-assistant-context-controls">\n\t\t\t\t<select class="form-select form-select-sm" [value]="contextMode" (change)="setContextMode($event.target.value)" aria-label="Context">\n\t\t\t\t\t<option value="auto">Auto</option>\n\t\t\t\t\t<option value="current">Current Page</option>\n\t\t\t\t\t<option value="all">All Pages</option>\n\t\t\t\t</select>\n\t\t\t\t@if (contextMode !== \'all\') {\n\t\t\t\t\t<div class="ai-assistant-context-route">{{ contextRouteLabel }}</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t\t<div class="ai-assistant-body">\n\t\t\t\t@if (open) {\n\t\t\t\t\t<rio-ai-terminal\n\t\t\t\t\t\t[idClient]="idClient"\n\t\t\t\t\t\t[idApp]="idApp"\n\t\t\t\t\t\t[title]="title"\n\t\t\t\t\t\t[config]="terminalConfig"\n\t\t\t\t\t\t[conversationStatus]="\'active\'"\n\t\t\t\t\t\t[messageLimit]="80"\n\t\t\t\t\t\t[singleConversation]="true"\n\t\t\t\t\t\t[contextMode]="contextMode"\n\t\t\t\t\t\t[contextRoute]="currentRoute"\n\t\t\t\t\t\t[bypassRouteSubscriptions]="true"\n\t\t\t\t\t\t[paused]="false"\n\t\t\t\t\t\t[placeholder]="\'Ask about features, navigation, how things work, or request summaries/anomaly checks...\'">\n\t\t\t\t\t</rio-ai-terminal>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n',styles:[':host{position:fixed;inset:0;z-index:10000;pointer-events:none;--ai-rail-width: 46px;--ai-panel-width: 33.33vw;--ai-shadow: rgba(15, 23, 42, .2)}.ai-assistant-overlay{position:fixed;inset:0;background:transparent;opacity:0;pointer-events:none;transition:opacity .25s ease}.ai-assistant-overlay.is-open{opacity:0;pointer-events:none}.ai-assistant-drawer{position:fixed;right:-1px;display:flex;align-items:stretch;height:100%;min-height:360px;width:calc(var(--ai-rail-width) + var(--ai-panel-width));transform:translate(calc(100% - var(--ai-rail-width)));transition:transform .35s ease;pointer-events:auto}.ai-assistant-drawer.is-open{transform:translate(0)}.ai-assistant-rail{width:var(--ai-rail-width);border:none;background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;box-shadow:inset 1px 0 #fff3,inset -1px 0 #fff3;transition:background .2s ease,box-shadow .2s ease}.ai-assistant-rail:hover{background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));box-shadow:inset 1px 0 #ffffff47,inset -1px 0 #ffffff47}.ai-assistant-drawer.is-open .ai-assistant-rail{cursor:col-resize}.ai-assistant-rail-label{writing-mode:vertical-rl;transform:rotate(0);transform-origin:center;letter-spacing:.2em;font-size:.72rem;font-weight:700;text-transform:uppercase}.ai-assistant-panel{width:min(var(--ai-panel-width),100vw - var(--ai-rail-width));height:100%;background:#f8fafc;box-shadow:-18px 0 36px var(--ai-shadow);display:flex;flex-direction:column;gap:.75rem;padding:.9rem 1rem 1rem;border-radius:18px 0 0 18px;border:1px solid rgba(148,163,184,.3);position:relative;overflow:hidden}.ai-assistant-resize-handle{position:absolute;left:0;top:0;width:8px;height:100%;cursor:col-resize;z-index:2;background:linear-gradient(90deg,#94a3b866,#94a3b800)}.ai-assistant-header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.ai-assistant-title h4{margin:0;font-weight:700}.ai-assistant-subtitle{margin:.25rem 0 0;color:#475569;font-size:.85rem}.ai-assistant-actions{display:flex;flex:0 0 clamp(180px,24vw,260px)}.ai-assistant-close{width:100%;box-shadow:0 6px 14px #dc262640;font-weight:600;padding-inline:1rem}.ai-assistant-context{display:block;align-items:center;gap:.75rem;background:#eef2ff;border-radius:12px;padding:.5rem .75rem;border:1px solid rgba(129,140,248,.35)}.ai-assistant-context-label{font-weight:600;color:#1e293b;font-size:.85rem;text-transform:uppercase;letter-spacing:.08em}.ai-assistant-context-controls{display:grid;grid-template-columns:minmax(120px,20%) 1fr;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0}.ai-assistant-context-controls select{width:100%}.ai-assistant-context-route{font-size:.8rem;color:#334155;background:#fffc;border-radius:999px;padding:.15rem .6rem;border:1px solid rgba(148,163,184,.4);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-assistant-body{flex:1;overflow:hidden}.ai-assistant-empty{color:#6c757d;font-size:.95rem;text-align:center;padding:24px 16px}:host ::ng-deep .ai-terminal-shell{height:100%}:host ::ng-deep .ai-terminal-sidebar,:host ::ng-deep .ai-terminal-main{min-height:0;max-height:100%}:host ::ng-deep .ai-terminal-messages{height:100%}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn{padding:.2rem .4rem;font-size:0;line-height:1}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn:before{content:"\\f1f8";font-family:FontAwesome;font-size:.9rem}:host ::ng-deep .ai-terminal-actions{width:100%;flex-wrap:nowrap;align-items:stretch}:host ::ng-deep .ai-terminal-actions .btn-primary{flex:1 1 auto;width:auto}:host ::ng-deep .ai-terminal-actions .btn-outline-secondary{flex:0 0 auto}@media(max-width:1200px){:host{display:none}}\n'],dependencies:[{kind:"component",type:AiTerminalComponent,selector:"rio-ai-terminal",inputs:["idClient","idApp","title","config","conversationStatus","messageLimit","placeholder","singleConversation","contextMode","contextRoute","paused","bypassRouteSubscriptions"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiAssistantComponent,decorators:[{type:Component,args:[{selector:"rio-ai-assistant",standalone:!1,template:'<div class="ai-assistant-overlay" [class.is-open]="open"></div>\n<div\n\tclass="ai-assistant-drawer"\n\t[class.is-open]="open"\n\t[style.--ai-panel-width]="panelWidthStyle"\n\t[style.top.px]="topOffset"\n\t[style.height.px]="panelHeight">\n\t<button\n\t\ttype="button"\n\t\tclass="ai-assistant-rail"\n\t\t(click)="handleRailClick($event)"\n\t\t(mousedown)="handleRailMouseDown($event)">\n\t\t<span class="ai-assistant-rail-label">AI Assistant</span>\n\t</button>\n\t\t<div class="ai-assistant-panel" #panelRef [class.is-open]="open" (click)="$event.stopPropagation()">\n\t\t<div class="ai-assistant-resize-handle" (mousedown)="startResize($event)"></div>\n\t\t\t<div class="ai-assistant-header">\n\t\t\t\t<div class="ai-assistant-title">\n\t\t\t\t\t<h4>{{ title }}</h4>\n\t\t\t\t\t<p class="ai-assistant-subtitle">Ask about workflows, routes, and where features live.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="ai-assistant-actions">\n\t\t\t\t\t<button type="button" class="btn btn-sm btn-danger ai-assistant-close" (click)="closePanel()">Close</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<div class="ai-assistant-context">\n\t\t\t<div class="ai-assistant-context-controls">\n\t\t\t\t<select class="form-select form-select-sm" [value]="contextMode" (change)="setContextMode($event.target.value)" aria-label="Context">\n\t\t\t\t\t<option value="auto">Auto</option>\n\t\t\t\t\t<option value="current">Current Page</option>\n\t\t\t\t\t<option value="all">All Pages</option>\n\t\t\t\t</select>\n\t\t\t\t@if (contextMode !== \'all\') {\n\t\t\t\t\t<div class="ai-assistant-context-route">{{ contextRouteLabel }}</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t\t<div class="ai-assistant-body">\n\t\t\t\t@if (open) {\n\t\t\t\t\t<rio-ai-terminal\n\t\t\t\t\t\t[idClient]="idClient"\n\t\t\t\t\t\t[idApp]="idApp"\n\t\t\t\t\t\t[title]="title"\n\t\t\t\t\t\t[config]="terminalConfig"\n\t\t\t\t\t\t[conversationStatus]="\'active\'"\n\t\t\t\t\t\t[messageLimit]="80"\n\t\t\t\t\t\t[singleConversation]="true"\n\t\t\t\t\t\t[contextMode]="contextMode"\n\t\t\t\t\t\t[contextRoute]="currentRoute"\n\t\t\t\t\t\t[bypassRouteSubscriptions]="true"\n\t\t\t\t\t\t[paused]="false"\n\t\t\t\t\t\t[placeholder]="\'Ask about features, navigation, how things work, or request summaries/anomaly checks...\'">\n\t\t\t\t\t</rio-ai-terminal>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n',styles:[':host{position:fixed;inset:0;z-index:10000;pointer-events:none;--ai-rail-width: 46px;--ai-panel-width: 33.33vw;--ai-shadow: rgba(15, 23, 42, .2)}.ai-assistant-overlay{position:fixed;inset:0;background:transparent;opacity:0;pointer-events:none;transition:opacity .25s ease}.ai-assistant-overlay.is-open{opacity:0;pointer-events:none}.ai-assistant-drawer{position:fixed;right:-1px;display:flex;align-items:stretch;height:100%;min-height:360px;width:calc(var(--ai-rail-width) + var(--ai-panel-width));transform:translate(calc(100% - var(--ai-rail-width)));transition:transform .35s ease;pointer-events:auto}.ai-assistant-drawer.is-open{transform:translate(0)}.ai-assistant-rail{width:var(--ai-rail-width);border:none;background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));color:#fff;display:flex;align-items:center;justify-content:center;cursor:pointer;position:relative;box-shadow:inset 1px 0 #fff3,inset -1px 0 #fff3;transition:background .2s ease,box-shadow .2s ease}.ai-assistant-rail:hover{background:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1));box-shadow:inset 1px 0 #ffffff47,inset -1px 0 #ffffff47}.ai-assistant-drawer.is-open .ai-assistant-rail{cursor:col-resize}.ai-assistant-rail-label{writing-mode:vertical-rl;transform:rotate(0);transform-origin:center;letter-spacing:.2em;font-size:.72rem;font-weight:700;text-transform:uppercase}.ai-assistant-panel{width:min(var(--ai-panel-width),100vw - var(--ai-rail-width));height:100%;background:#f8fafc;box-shadow:-18px 0 36px var(--ai-shadow);display:flex;flex-direction:column;gap:.75rem;padding:.9rem 1rem 1rem;border-radius:18px 0 0 18px;border:1px solid rgba(148,163,184,.3);position:relative;overflow:hidden}.ai-assistant-resize-handle{position:absolute;left:0;top:0;width:8px;height:100%;cursor:col-resize;z-index:2;background:linear-gradient(90deg,#94a3b866,#94a3b800)}.ai-assistant-header{display:flex;justify-content:space-between;align-items:center;gap:1rem}.ai-assistant-title h4{margin:0;font-weight:700}.ai-assistant-subtitle{margin:.25rem 0 0;color:#475569;font-size:.85rem}.ai-assistant-actions{display:flex;flex:0 0 clamp(180px,24vw,260px)}.ai-assistant-close{width:100%;box-shadow:0 6px 14px #dc262640;font-weight:600;padding-inline:1rem}.ai-assistant-context{display:block;align-items:center;gap:.75rem;background:#eef2ff;border-radius:12px;padding:.5rem .75rem;border:1px solid rgba(129,140,248,.35)}.ai-assistant-context-label{font-weight:600;color:#1e293b;font-size:.85rem;text-transform:uppercase;letter-spacing:.08em}.ai-assistant-context-controls{display:grid;grid-template-columns:minmax(120px,20%) 1fr;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0}.ai-assistant-context-controls select{width:100%}.ai-assistant-context-route{font-size:.8rem;color:#334155;background:#fffc;border-radius:999px;padding:.15rem .6rem;border:1px solid rgba(148,163,184,.4);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.ai-assistant-body{flex:1;overflow:hidden}.ai-assistant-empty{color:#6c757d;font-size:.95rem;text-align:center;padding:24px 16px}:host ::ng-deep .ai-terminal-shell{height:100%}:host ::ng-deep .ai-terminal-sidebar,:host ::ng-deep .ai-terminal-main{min-height:0;max-height:100%}:host ::ng-deep .ai-terminal-messages{height:100%}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn{padding:.2rem .4rem;font-size:0;line-height:1}:host ::ng-deep .ai-terminal-conversation-actions .ai-terminal-delete-btn:before{content:"\\f1f8";font-family:FontAwesome;font-size:.9rem}:host ::ng-deep .ai-terminal-actions{width:100%;flex-wrap:nowrap;align-items:stretch}:host ::ng-deep .ai-terminal-actions .btn-primary{flex:1 1 auto;width:auto}:host ::ng-deep .ai-terminal-actions .btn-outline-secondary{flex:0 0 auto}@media(max-width:1200px){:host{display:none}}\n']}]}],ctorParameters:()=>[{type:i1$1.Router},{type:AccountManagerService},{type:i0.Renderer2},{type:i0.NgZone}],propDecorators:{idClient:[{type:Input}],idApp:[{type:Input}],title:[{type:Input}],open:[{type:Input}],supportTicketRoute:[{type:Input}],supportTicketEnabled:[{type:Input}],config:[{type:Input}],topOffset:[{type:Input}],panelHeight:[{type:Input}],currentRoute:[{type:Input}],hoverEnabled:[{type:Input}],openRequested:[{type:Output}],closed:[{type:Output}],terminal:[{type:ViewChild,args:[AiTerminalComponent]}],panelRef:[{type:ViewChild,args:["panelRef"]}]}});class ScrollDirective{onScroll=new EventEmitter;bottomOffset=100;topOffset=100;constructor(){}scrolled(t){this.elementScrollEvent(t)}windowScrolled(t){this.windowScrollEvent(t)}windowScrollEvent(t){const e=t.target,n=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0,o=n<this.topOffset,r={isReachingBottom:e.body.offsetHeight-(window.innerHeight+n)<this.bottomOffset,isReachingTop:o,originalEvent:t,isWindowEvent:!0};this.onScroll.emit(r)}elementScrollEvent(t){const e=t.target,n=e.scrollHeight-e.scrollTop,o=e.offsetHeight,r=e.scrollTop<this.topOffset,i={isReachingBottom:n-o<this.bottomOffset,isReachingTop:r,originalEvent:t,isWindowEvent:!1};this.onScroll.emit(i)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ScrollDirective,deps:[],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:ScrollDirective,isStandalone:!1,selector:"[detect-scroll]",inputs:{bottomOffset:"bottomOffset",topOffset:"topOffset"},outputs:{onScroll:"onScroll"},host:{listeners:{scroll:"scrolled($event)","window:scroll":"windowScrolled($event)"}},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ScrollDirective,decorators:[{type:Directive,args:[{selector:"[detect-scroll]",standalone:!1}]}],ctorParameters:()=>[],propDecorators:{onScroll:[{type:Output}],bottomOffset:[{type:Input}],topOffset:[{type:Input}],scrolled:[{type:HostListener,args:["scroll",["$event"]]}],windowScrolled:[{type:HostListener,args:["window:scroll",["$event"]]}]}});class NavbarMainComponent extends BaseComponent{_services;auth;_ds;_app;dropdowns;scrollable;logo="";navTabs=[];fontSize=12;publicProgram=!1;digitalSign=!1;showSupport=!0;aiAssistantVisible=!0;aiToggle=new EventEmitter;user=null;collapseShowing=!1;client="";isResolveIO=!1;tourStarted=!1;dropdownLeftTimer=null;scrollRightInterval=null;scrollLeftInterval=null;isDemo=!1;constructor(t,e,n,o){super(t),this._services=t,this.auth=e,this._ds=n,this._app=o}ngOnInit(){this._services._account.user.subscribe(t=>{this.user=t}),this.client=this._app.client.getValue(),this.tourStarted=this._services._app.tourStarted.getValue(),this.client||(this.isResolveIO=!0),this._services._app.tourStarted.subscribe(t=>{this.tourStarted=t}),this._services._app.isDemo.subscribe(t=>{this.isDemo=t})}ngAfterViewInit(){this.dropdownLeftTimer=setInterval(()=>{this.calculateDropdownsLeft()},500),document.documentElement.style.setProperty("--font-size",this.fontSize+"px")}ngOnDestroy(){this.dropdownLeftTimer&&(clearInterval(this.dropdownLeftTimer),this.dropdownLeftTimer=null)}async logout(){this._app.isLoggingOut.next(!0),await this._services._account.logOut(),this._app.isLoggingOut.next(!1)}login(){this.auth.loginUser().then(()=>{},t=>{})}hasScrolled(){return this.scrollable.nativeElement.scrollLeft<=0&&this.stopScrollRight(),this.scrollable.nativeElement.scrollLeft>0}hasMoreScroll(){return this.scrollable.nativeElement.scrollWidth<=this.scrollable.nativeElement.clientWidth+this.scrollable.nativeElement.scrollLeft&&this.stopScrollLeft(),this.scrollable.nativeElement.scrollWidth>this.scrollable.nativeElement.clientWidth+this.scrollable.nativeElement.scrollLeft}startScrollRight(){this.scrollRightInterval=setInterval(()=>{this.scrollable.nativeElement.scrollLeft-=2},1)}stopScrollRight(){clearInterval(this.scrollRightInterval)}scrollRightOnce(){this.scrollable.nativeElement.scrollLeft-=50}startScrollLeft(){this.scrollLeftInterval=setInterval(()=>{this.scrollable.nativeElement.scrollLeft+=2},1)}stopScrollLeft(){clearInterval(this.scrollLeftInterval)}scrollLeftOnce(){this.scrollable.nativeElement.scrollLeft+=50}handleNavLinkClick(t){if(t&&(t.metaKey||t.ctrlKey)){const e=t.currentTarget;e&&e.href&&(window.open(e.href,"_blank"),t.preventDefault(),t.stopPropagation())}}toggleAiAssistant(t){t&&(t.preventDefault(),t.stopPropagation()),this.aiToggle.emit()}calculateDropdownsLeft(){if(this.dropdowns&&this.dropdowns.toArray()&&this.dropdowns.toArray().length&&this.scrollable){const t=[];return this.navTabs.filter(t=>"dropdown"===t.type).forEach(e=>{const n=e.label||"",o=this.dropdowns.toArray().filter(t=>t.nativeElement.innerText.split("\n")[0].replace(/[^A-Za-z0-9]/g,"")===n.replace(/[^A-Za-z0-9]/g,""))[0],r=o?o.nativeElement.querySelector(".dropdown-menu"):null,i=o?Math.max(o.nativeElement.offsetLeft-this.scrollable.nativeElement.scrollLeft,this.scrollable.nativeElement.offsetLeft):0;if(r){parseInt(r.style.left||"0",10)!==i&&t.push({dropDownMenu:r,nextLeft:i})}}),t.length&&t.forEach(t=>{t.dropDownMenu.style.left=t.nextLeft+"px"}),!0}return!1}isInRole(t){if(!t)return!0;if(this.isSuperAdmin())return!0;if(this.user&&this.user.roles.groups)for(let e=0;e<this.user.roles.groups.length;e++){let n=this.user.roles.groups[e];for(let e=0;e<n.views.length;e++){let o=n.views[e];if(o===t||o.startsWith(t+"/"))return!0}}return!1}isSuperAdmin(){return!(!this.user||!this.user.roles)&&this.user.roles.super_admin}isInOneRole(t){if(this.isSuperAdmin())return!0;for(let e=0;e<t.length;e++){let n=t[e];if(!n)return!0;if(this._services._account.isUserInView(n))return!0}return!1}navigateTo(t){this._services._router.navigateByUrl(t)}help(){this._ds.input("What do you need help with?",[{label:"Title of Problem",form:"problem_title",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Problem title is required."],required:!0},{label:"Description of Problem",form:"problem_desc",data:"",validators:[Validators.required],validatorErrors:["required"],validatorMsg:["Problem description is required."],required:!0,type:"textarea"}]).then(t=>{this._services._socket.call("getHelpNotification",this._services._account.getUser().fullname,t.problem_title.value,t.problem_desc.value)},()=>{})}isCustomer(){const t=this._services._account.getUser();return!(!t||!t.other)&&!(!t.other.customers||!t.other.customers.length)}getWindowWidth(){return window.innerWidth}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarMainComponent,deps:[{token:ProviderService},{token:AuthService},{token:DialogService},{token:CoreService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:NavbarMainComponent,isStandalone:!1,selector:"navbar-main",inputs:{logo:"logo",navTabs:"navTabs",fontSize:"fontSize",publicProgram:"publicProgram",digitalSign:"digitalSign",showSupport:"showSupport",aiAssistantVisible:"aiAssistantVisible"},outputs:{aiToggle:"aiToggle"},providers:[ProviderService],viewQueries:[{propertyName:"scrollable",first:!0,predicate:["scrollable"],descendants:!0,static:!0},{propertyName:"dropdowns",predicate:["dropdowns"],descendants:!0}],usesInheritance:!0,ngImport:i0,template:'<style>\n\t:root {\n\t\t--font-size: 12;\n\t}\n\n\t:host ::ng-deep * {\n\t\tfont-size: var(--font-size);\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.navbarMain a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t\t.navbarMain .dropdown-menu {\n\t\t\tmargin-left: 10px;\n\t\t}\n\t\t.navbar-divider-pipe {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.navbar-divider-hr {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\theight: 1px;\n\t\t\tborder: 0;\n\t\t\tborder-top: 1px solid white;\n\t\t\tbackground-color: white;\n\t\t\tcolor: white;\n\t\t\topacity: 1;\n\t\t\tmargin: 0.25rem 0;\n\t\t}\n\t}\n\t@media (min-width: 1200px) {\n\t\t.scrollable-x {\n\t\t\tmax-width: 60vw;\n\t\t\toverflow-x: auto;\n\t\t\toverflow-y: visible;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t::-webkit-scrollbar {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.verticalAlign {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t.dropdown {\n\t\t\tposition: static;\n\t\t}\n\t}\n\n\t.navbar li {\n\t\tcursor: pointer;\n\t\ttext-align: center;\n\t}\n\n\t.navbarMain {\n\t\tposition: relative;\n\t\tz-index: 1035;\n\t}\n\n\t.navbarMain .dropdown-menu {\n\t\tz-index: 1036;\n\t}\n\n\t.navbar-divider-pipe {\n\t\tdisplay: inline-block;\n\t\talign-self: stretch;\n\t\twidth: 1px;\n\t\tbackground-color: white;\n\t\topacity: 0.8;\n\t\tmargin: 0 0.75rem;\n\t}\n\n\t.navbar-dark .navbar-nav .nav-link:hover,\n\t.navbar-dark .navbar-nav .nav-link:focus {\n\t\tcolor: gray;\n\t}\n\t.navbar-divider-item {\n\t\tdisplay: flex;\n\t\talign-items: stretch;\n\t}\n</style>\n\n<div class="row">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark navbarMain" style="width: 100%">\n\t\t<a class="navbar-brand" href="#">\n\t\t\t@if (!isDemo) {\n\t\t\t\t<img [src]="logo" style="width: auto; height: 36px" />\n\t\t\t}\n\t\t</a>\n\t\t<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" aria-controls="navbarMainNav" aria-expanded="false" aria-label="Toggle navigation">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" id="navbarMainNav">\n\t\t\t<ul class="navbar-nav">\n\t\t\t\t@if (!publicProgram && !digitalSign) {\n\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" [style.border-right]="getWindowWidth() > 1200 ? \'1px solid white\' : \'\'" tourAnchor="topNavHome">\n\t\t\t\t\t\t<a class="nav-link" routerLink="home" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLinkActive="active">Home</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasScrolled()) {\n\t\t\t\t<div (mouseover)="startScrollRight()" (mouseout)="stopScrollRight()" (click)="scrollRightOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-left" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<ul [ngClass]="[\'navbar-nav\', \'scrollable-x\']" #scrollable detect-scroll (onScroll)="calculateDropdownsLeft()">\n\t\t\t\t@for (tab of navTabs; track tab.label || tab.links?.[0]?.routerLink || i; let i = $index) {\n\t\t\t\t\t@if (tab.type === \'link\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && !digitalSign && isInRole(tab.links[0].role)) {\n\t\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" [tourAnchor]="tab.tourAnchor" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" [routerLink]="tab.links[0].routerLink" routerLinkActive="active">{{ tab.links[0].label }}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@if (tab.type === \'dropdown\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && isInOneRole(tab.roles)) {\n\t\t\t\t\t\t\t<li #dropdowns class="nav-item dropdown">\n\t\t\t\t\t\t\t\t<a class="nav-link dropdown-toggle" [class.disabled]="tourStarted ? true : null" id="navbarDropdownAsset" role="button" [tourAnchor]="tab.tourAnchor" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n\t\t\t\t\t\t\t\t\t{{ tab.label }}\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<div class="dropdown-menu bg-dark" aria-labelledby="navbarDropdownAsset" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t\t@for (link of tab.links; track link.routerLink || link.label) {\n\t\t\t\t\t\t\t\t\t\t@if ((publicProgram || user) && isInRole(link.role)) {\n\t\t\t\t\t\t\t\t\t\t\t<a class="dropdown-item nav-link" (click)="handleNavLinkClick($event)" [routerLink]="link.routerLink">{{ link.label }}</a>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasMoreScroll()) {\n\t\t\t\t<div (mouseover)="startScrollLeft()" (mouseout)="stopScrollLeft()" (click)="scrollLeftOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-right" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (getWindowWidth() < 1200) {\n\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t}\n\t\t\t@if ((!publicProgram || user) && !digitalSign) {\n\t\t\t\t<ul [ngClass]="[\'navbar-nav\', \'ms-auto\']">\n\t\t\t\t\t@if (user && getWindowWidth() > 1200 && aiAssistantVisible) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" tourAnchor="aiAssistantToggle">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="toggleAiAssistant($event)" [class.disabled]="tourStarted ? true : null">AI Assistant</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && client && (showSupport || isSuperAdmin())) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" style="height: 30px" tourAnchor="supportSection">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="support-ticket" routerLinkActive="active">Support</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="logs" routerLinkActive="active">Logs</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="super-admin" routerLinkActive="active">Super Admin</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item navbar-divider-item">\n\t\t\t\t\t\t\t@if (getWindowWidth() > 1200) {\n\t\t\t\t\t\t\t\t<span class="navbar-divider-pipe" aria-hidden="true"></span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!user) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="login()" style="cursor: pointer" routerLinkActive="active">Login</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" tourAnchor="userSettings">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="user-settings">Hello {{ user.fullname }}!</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" style="cursor: pointer" (click)="logout()" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null">Logout</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t</ul>\n\t\t\t}\n\t\t</div>\n\t</nav>\n</div>\n',styles:[":root{--font-size: 12}:host ::ng-deep *{font-size:var(--font-size)}@media(max-width:1200px){.navbarMain a{font-size:18px!important}.navbarMain .dropdown-menu{margin-left:10px}.navbar-divider-pipe{display:none}.navbar-divider-hr{display:block;width:100%;height:1px;border:0;border-top:1px solid white;background-color:#fff;color:#fff;opacity:1;margin:.25rem 0}}@media(min-width:1200px){.scrollable-x{max-width:60vw;overflow-x:auto;overflow-y:visible;align-items:center}::-webkit-scrollbar{display:none}.verticalAlign{display:flex;align-items:center}.dropdown{position:static}}.navbar li{cursor:pointer;text-align:center}.navbarMain{position:relative;z-index:1035}.navbarMain .dropdown-menu{z-index:1036}.navbar-divider-pipe{display:inline-block;align-self:stretch;width:1px;background-color:#fff;opacity:.8;margin:0 .75rem}.navbar-dark .navbar-nav .nav-link:hover,.navbar-dark .navbar-nav .nav-link:focus{color:gray}.navbar-divider-item{display:flex;align-items:stretch}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$1.RouterLink,selector:"[routerLink]",inputs:["target","queryParams","fragment","queryParamsHandling","state","info","relativeTo","preserveFragment","skipLocationChange","replaceUrl","routerLink"]},{kind:"directive",type:i1$1.RouterLinkActive,selector:"[routerLinkActive]",inputs:["routerLinkActiveOptions","ariaCurrentWhenActive","routerLinkActive"],outputs:["isActiveChange"],exportAs:["routerLinkActive"]},{kind:"directive",type:TourAnchorDirective,selector:"[tourAnchor]",inputs:["tourAnchor"]},{kind:"directive",type:ScrollDirective,selector:"[detect-scroll]",inputs:["bottomOffset","topOffset"],outputs:["onScroll"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarMainComponent,decorators:[{type:Component,args:[{selector:"navbar-main",providers:[ProviderService],standalone:!1,template:'<style>\n\t:root {\n\t\t--font-size: 12;\n\t}\n\n\t:host ::ng-deep * {\n\t\tfont-size: var(--font-size);\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.navbarMain a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t\t.navbarMain .dropdown-menu {\n\t\t\tmargin-left: 10px;\n\t\t}\n\t\t.navbar-divider-pipe {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.navbar-divider-hr {\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\theight: 1px;\n\t\t\tborder: 0;\n\t\t\tborder-top: 1px solid white;\n\t\t\tbackground-color: white;\n\t\t\tcolor: white;\n\t\t\topacity: 1;\n\t\t\tmargin: 0.25rem 0;\n\t\t}\n\t}\n\t@media (min-width: 1200px) {\n\t\t.scrollable-x {\n\t\t\tmax-width: 60vw;\n\t\t\toverflow-x: auto;\n\t\t\toverflow-y: visible;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t::-webkit-scrollbar {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.verticalAlign {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t.dropdown {\n\t\t\tposition: static;\n\t\t}\n\t}\n\n\t.navbar li {\n\t\tcursor: pointer;\n\t\ttext-align: center;\n\t}\n\n\t.navbarMain {\n\t\tposition: relative;\n\t\tz-index: 1035;\n\t}\n\n\t.navbarMain .dropdown-menu {\n\t\tz-index: 1036;\n\t}\n\n\t.navbar-divider-pipe {\n\t\tdisplay: inline-block;\n\t\talign-self: stretch;\n\t\twidth: 1px;\n\t\tbackground-color: white;\n\t\topacity: 0.8;\n\t\tmargin: 0 0.75rem;\n\t}\n\n\t.navbar-dark .navbar-nav .nav-link:hover,\n\t.navbar-dark .navbar-nav .nav-link:focus {\n\t\tcolor: gray;\n\t}\n\t.navbar-divider-item {\n\t\tdisplay: flex;\n\t\talign-items: stretch;\n\t}\n</style>\n\n<div class="row">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark navbarMain" style="width: 100%">\n\t\t<a class="navbar-brand" href="#">\n\t\t\t@if (!isDemo) {\n\t\t\t\t<img [src]="logo" style="width: auto; height: 36px" />\n\t\t\t}\n\t\t</a>\n\t\t<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" aria-controls="navbarMainNav" aria-expanded="false" aria-label="Toggle navigation">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" id="navbarMainNav">\n\t\t\t<ul class="navbar-nav">\n\t\t\t\t@if (!publicProgram && !digitalSign) {\n\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" [style.border-right]="getWindowWidth() > 1200 ? \'1px solid white\' : \'\'" tourAnchor="topNavHome">\n\t\t\t\t\t\t<a class="nav-link" routerLink="home" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLinkActive="active">Home</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasScrolled()) {\n\t\t\t\t<div (mouseover)="startScrollRight()" (mouseout)="stopScrollRight()" (click)="scrollRightOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-left" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<ul [ngClass]="[\'navbar-nav\', \'scrollable-x\']" #scrollable detect-scroll (onScroll)="calculateDropdownsLeft()">\n\t\t\t\t@for (tab of navTabs; track tab.label || tab.links?.[0]?.routerLink || i; let i = $index) {\n\t\t\t\t\t@if (tab.type === \'link\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && !digitalSign && isInRole(tab.links[0].role)) {\n\t\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" [tourAnchor]="tab.tourAnchor" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" [routerLink]="tab.links[0].routerLink" routerLinkActive="active">{{ tab.links[0].label }}</a>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t@if (tab.type === \'dropdown\') {\n\t\t\t\t\t\t@if ((publicProgram || user) && isInOneRole(tab.roles)) {\n\t\t\t\t\t\t\t<li #dropdowns class="nav-item dropdown">\n\t\t\t\t\t\t\t\t<a class="nav-link dropdown-toggle" [class.disabled]="tourStarted ? true : null" id="navbarDropdownAsset" role="button" [tourAnchor]="tab.tourAnchor" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">\n\t\t\t\t\t\t\t\t\t{{ tab.label }}\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t<div class="dropdown-menu bg-dark" aria-labelledby="navbarDropdownAsset" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t\t\t@for (link of tab.links; track link.routerLink || link.label) {\n\t\t\t\t\t\t\t\t\t\t@if ((publicProgram || user) && isInRole(link.role)) {\n\t\t\t\t\t\t\t\t\t\t\t<a class="dropdown-item nav-link" (click)="handleNavLinkClick($event)" [routerLink]="link.routerLink">{{ link.label }}</a>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</ul>\n\t\t\t@if (hasMoreScroll()) {\n\t\t\t\t<div (mouseover)="startScrollLeft()" (mouseout)="stopScrollLeft()" (click)="scrollLeftOnce()">\n\t\t\t\t\t<i class="fa fa-arrow-right" style="color: white; font-size: 20px"></i>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (getWindowWidth() < 1200) {\n\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t}\n\t\t\t@if ((!publicProgram || user) && !digitalSign) {\n\t\t\t\t<ul [ngClass]="[\'navbar-nav\', \'ms-auto\']">\n\t\t\t\t\t@if (user && getWindowWidth() > 1200 && aiAssistantVisible) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" tourAnchor="aiAssistantToggle">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="toggleAiAssistant($event)" [class.disabled]="tourStarted ? true : null">AI Assistant</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && client && (showSupport || isSuperAdmin())) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav" style="height: 30px" tourAnchor="supportSection">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="support-ticket" routerLinkActive="active">Support</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="logs" routerLinkActive="active">Logs</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user && isInRole(\'super-admin\')) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" routerLink="super-admin" routerLinkActive="active">Super Admin</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item navbar-divider-item">\n\t\t\t\t\t\t\t@if (getWindowWidth() > 1200) {\n\t\t\t\t\t\t\t\t<span class="navbar-divider-pipe" aria-hidden="true"></span>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t<hr class="navbar-divider-hr" />\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!user) {\n\t\t\t\t\t\t<li class="nav-item" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="login()" style="cursor: pointer" routerLinkActive="active">Login</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" tourAnchor="userSettings">\n\t\t\t\t\t\t\t<a class="nav-link" (click)="handleNavLinkClick($event)" [class.disabled]="tourStarted ? true : null" routerLink="user-settings">Hello {{ user.fullname }}!</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t\t@if (user) {\n\t\t\t\t\t\t<li class="nav-item" style="cursor: pointer" (click)="logout()" data-bs-toggle="collapse" data-bs-target="#navbarMainNav">\n\t\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null">Logout</a>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t}\n\t\t\t\t</ul>\n\t\t\t}\n\t\t</div>\n\t</nav>\n</div>\n'}]}],ctorParameters:()=>[{type:ProviderService},{type:AuthService},{type:DialogService},{type:CoreService}],propDecorators:{dropdowns:[{type:ViewChildren,args:["dropdowns"]}],scrollable:[{type:ViewChild,args:["scrollable",{static:!0}]}],logo:[{type:Input,args:["logo"]}],navTabs:[{type:Input,args:["navTabs"]}],fontSize:[{type:Input,args:["fontSize"]}],publicProgram:[{type:Input,args:["publicProgram"]}],digitalSign:[{type:Input,args:["digitalSign"]}],showSupport:[{type:Input,args:["showSupport"]}],aiAssistantVisible:[{type:Input,args:["aiAssistantVisible"]}],aiToggle:[{type:Output}]}});class FilterEqualPipe{transform(t,e,n){return t?t.filter(t=>t[e]===n):[]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterEqualPipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FilterEqualPipe,isStandalone:!1,name:"filterEqual",pure:!1})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterEqualPipe,decorators:[{type:Pipe,args:[{name:"filterEqual",pure:!1,standalone:!1}]}]});class FilterNotEqualPipe{transform(t,e,n){return t?t.filter(t=>t[e]!==n):[]}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterNotEqualPipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FilterNotEqualPipe,isStandalone:!1,name:"filterNotEqual"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FilterNotEqualPipe,decorators:[{type:Pipe,args:[{name:"filterNotEqual",standalone:!1}]}]});class NavbarModuleComponent extends BaseComponent{_cdRef;_services;sideNavHeight;sideNavWidth;menuData={title:"",module:null,description:null,description_name:"Description",tabs:[]};selectedTab=null;currentRoute="";routerEvents$=[];tourStarted=!1;drawerOpen=!1;isDeviceWidth=window.innerWidth<=1200;constructor(t,e){super(e),this._cdRef=t,this._services=e}ngOnInit(){this.tourStarted=this._services._app.tourStarted.getValue(),this.routerEvents$.push(this._services._router.events.subscribe(t=>{this._services._router.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,"")===this.currentRoute&&this.selectedTab||this.selectTabFromRouter()})),this.routerEvents$.push(this._services._app.navbarModuleData.subscribe(t=>{this.menuData=t,this._services._router.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,"")===this.currentRoute&&this.selectedTab||this.selectTabFromRouter()})),this.routerEvents$.push(this._services._app.tourStarted.subscribe(t=>{this.tourStarted=t}))}onResize(){this.isDeviceWidth=window.innerWidth<=1200}ngOnDestroy(){this.routerEvents$.forEach(t=>{t.unsubscribe()})}selectTabFromRouter(){if(this.menuData)if("/"===this._services._router.url)this.selectedTab=this.menuData.tabs[0];else{for(this.currentRoute=this._services._router.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,""),this.selectedTab=null;!this.selectedTab&&this.currentRoute.split("/").length>2;){for(let t=0;t<this.menuData.tabs.length;t++){let e=this.menuData.tabs[t];if(e.link===this.currentRoute){this.selectedTab=e;break}}this.currentRoute=this.currentRoute.replace(/(\/[^\/]+$)/,"")}this.selectedTab||(this.selectedTab=this.menuData.tabs[0])}}tabClass(t){return this.selectedTab&&this.selectedTab.label===t.label?"active":""}handleNavLinkClick(t){if(t&&(t.metaKey||t.ctrlKey)){const e=t.currentTarget;e&&e.href&&(window.open(e.href,"_blank"),t.preventDefault(),t.stopPropagation())}}onNavLinkClick(t){this.handleNavLinkClick(t),!t.defaultPrevented&&window.innerWidth<=1200&&(this.drawerOpen=!1)}toggleDrawer(){this.drawerOpen=!this.drawerOpen}navigateTo(t){this.selectedTab!==t&&(this.selectedTab=t,null===t.params?this._services._router.navigateByUrl(t.link):this._services._router.navigateByUrl(t.link+"/"+t.params),window.innerWidth<=1200&&(this.drawerOpen=!1))}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarModuleComponent,deps:[{token:i0.ChangeDetectorRef},{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:NavbarModuleComponent,isStandalone:!1,selector:"navbar-module",inputs:{sideNavHeight:"sideNavHeight",sideNavWidth:"sideNavWidth"},host:{listeners:{"window:resize":"onResize()"}},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\t.navbarModule li {\n\t\tcursor: pointer;\n\t}\n\t.navbarModule li.active {\n\t\tborder-left: 3px solid #d19b3d;\n\t}\n\t.navbarModule nav {\n\t\twidth: 100%;\n\t}\n\t.navbar-module-container {\n\t\tmargin-left: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t\tmargin-right: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t}\n\n\t.navbarModule .nav-link {\n\t\tmargin-left: 10px;\n\t}\n\n\t@media (min-width: 1200px) {\n\t\t.navbarModule {\n\t\t\theight: 95vh;\n\t\t\tmargin-left: -10px;\n\t\t}\n\n\t\thr {\n\t\t\tborder-top: white 1px solid;\n\t\t}\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.device-drawer-margin {\n\t\t\tmargin-left: 10px !important;\n\t\t}\n\n\t\thr {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.navbarModule a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t}\n</style>\n\n<div class="navbar-module-container">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark flex-xl-column navbarModule" [style.height]="sideNavHeight ? sideNavHeight + \'px\' : \'\'" [style.width]="sideNavWidth ? sideNavWidth : \'\'">\n\t\t<div href="#" style="color: white; font-size: 16px; margin-left: 10px;">\n\t\t\t{{ menuData.title }}\n\t\t</div>\n\t\t<button class="navbar-toggler" type="button" [attr.aria-controls]="\'navbarModuleNav\'" [attr.aria-expanded]="drawerOpen" aria-label="Toggle navigation" (click)="toggleDrawer()">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" [class.show]="drawerOpen" [ngClass]="{ \'device-drawer-margin\': isDeviceWidth }" id="navbarModuleNav" style="align-items: baseline; width: 100%; overflow-y: auto; overflow-x: hidden">\n\t\t\t<ul class="navbar-nav" style="display: block; float: left; width: 100%">\n\t\t\t\t@for (tab of menuData.tabs | filterNotEqual: \'params\' : \'0\'; track tab.label; let i = $index) {\n\t\t\t\t\t@if (tab.params !== null && menuData.tabs[i - 1] && menuData.tabs[i - 1].params === null) {\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div href="#" style="color: white; font-size: 16px">Selected {{ menuData.module }}</div>\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div style="color: white; margin-left: 5px; text-decoration: underline; font-size: 14px">{{ menuData.description_name }}:</div>\n\t\t\t\t\t\t<div style="color: white; margin-left: 8px; font-size: 12px">{{ menuData.description }}</div>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t}\n\t\t\t\t\t<li [ngClass]="[\'nav-item\', tabClass(tab)]" [tourAnchor]="tab.tourAnchor">\n\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null" (click)="onNavLinkClick($event)" [routerLink]="[tab.params ? tab.link + \'/\' + tab.params : tab.link]" routerLinkActive="active">{{ tab.label }}</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t</div>\n\t</nav>\n</div>\n',styles:[".navbarModule li{cursor:pointer}.navbarModule li.active{border-left:3px solid #d19b3d}.navbarModule nav{width:100%}.navbar-module-container{margin-left:calc(var(--bs-gutter-x, 1.5rem) / -2);margin-right:calc(var(--bs-gutter-x, 1.5rem) / -2)}.navbarModule .nav-link{margin-left:10px}@media(min-width:1200px){.navbarModule{height:95vh;margin-left:-10px}hr{border-top:white 1px solid}}@media(max-width:1200px){.device-drawer-margin{margin-left:10px!important}hr{display:none}.navbarModule a{font-size:18px!important}}\n"],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$1.RouterLink,selector:"[routerLink]",inputs:["target","queryParams","fragment","queryParamsHandling","state","info","relativeTo","preserveFragment","skipLocationChange","replaceUrl","routerLink"]},{kind:"directive",type:i1$1.RouterLinkActive,selector:"[routerLinkActive]",inputs:["routerLinkActiveOptions","ariaCurrentWhenActive","routerLinkActive"],outputs:["isActiveChange"],exportAs:["routerLinkActive"]},{kind:"directive",type:TourAnchorDirective,selector:"[tourAnchor]",inputs:["tourAnchor"]},{kind:"pipe",type:FilterNotEqualPipe,name:"filterNotEqual"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NavbarModuleComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"navbar-module",standalone:!1,template:'<style>\n\t.navbarModule li {\n\t\tcursor: pointer;\n\t}\n\t.navbarModule li.active {\n\t\tborder-left: 3px solid #d19b3d;\n\t}\n\t.navbarModule nav {\n\t\twidth: 100%;\n\t}\n\t.navbar-module-container {\n\t\tmargin-left: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t\tmargin-right: calc(var(--bs-gutter-x, 1.5rem) / -2);\n\t}\n\n\t.navbarModule .nav-link {\n\t\tmargin-left: 10px;\n\t}\n\n\t@media (min-width: 1200px) {\n\t\t.navbarModule {\n\t\t\theight: 95vh;\n\t\t\tmargin-left: -10px;\n\t\t}\n\n\t\thr {\n\t\t\tborder-top: white 1px solid;\n\t\t}\n\t}\n\n\t@media (max-width: 1200px) {\n\t\t.device-drawer-margin {\n\t\t\tmargin-left: 10px !important;\n\t\t}\n\n\t\thr {\n\t\t\tdisplay: none;\n\t\t}\n\n\t\t.navbarModule a {\n\t\t\tfont-size: 18px !important;\n\t\t}\n\t}\n</style>\n\n<div class="navbar-module-container">\n\t<nav class="navbar navbar-expand-xl navbar-dark bg-dark flex-xl-column navbarModule" [style.height]="sideNavHeight ? sideNavHeight + \'px\' : \'\'" [style.width]="sideNavWidth ? sideNavWidth : \'\'">\n\t\t<div href="#" style="color: white; font-size: 16px; margin-left: 10px;">\n\t\t\t{{ menuData.title }}\n\t\t</div>\n\t\t<button class="navbar-toggler" type="button" [attr.aria-controls]="\'navbarModuleNav\'" [attr.aria-expanded]="drawerOpen" aria-label="Toggle navigation" (click)="toggleDrawer()">\n\t\t\t<span class="navbar-toggler-icon"></span>\n\t\t</button>\n\t\t<div class="navbar-collapse collapse" [class.show]="drawerOpen" [ngClass]="{ \'device-drawer-margin\': isDeviceWidth }" id="navbarModuleNav" style="align-items: baseline; width: 100%; overflow-y: auto; overflow-x: hidden">\n\t\t\t<ul class="navbar-nav" style="display: block; float: left; width: 100%">\n\t\t\t\t@for (tab of menuData.tabs | filterNotEqual: \'params\' : \'0\'; track tab.label; let i = $index) {\n\t\t\t\t\t@if (tab.params !== null && menuData.tabs[i - 1] && menuData.tabs[i - 1].params === null) {\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div href="#" style="color: white; font-size: 16px">Selected {{ menuData.module }}</div>\n\t\t\t\t\t\t<hr />\n\t\t\t\t\t\t<div style="color: white; margin-left: 5px; text-decoration: underline; font-size: 14px">{{ menuData.description_name }}:</div>\n\t\t\t\t\t\t<div style="color: white; margin-left: 8px; font-size: 12px">{{ menuData.description }}</div>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t}\n\t\t\t\t\t<li [ngClass]="[\'nav-item\', tabClass(tab)]" [tourAnchor]="tab.tourAnchor">\n\t\t\t\t\t\t<a class="nav-link" [class.disabled]="tourStarted ? true : null" (click)="onNavLinkClick($event)" [routerLink]="[tab.params ? tab.link + \'/\' + tab.params : tab.link]" routerLinkActive="active">{{ tab.label }}</a>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ul>\n\t\t</div>\n\t</nav>\n</div>\n'}]}],ctorParameters:()=>[{type:i0.ChangeDetectorRef},{type:ProviderService}],propDecorators:{sideNavHeight:[{type:Input}],sideNavWidth:[{type:Input}],onResize:[{type:HostListener,args:["window:resize"]}]}});class CoreComponent extends BaseComponent{_deviceDet;_ds;_resizeService;_services;_offline;_storage;_auth;_aps;_featureGates;_tourManager;environment;logo="";navTabs=[];userHasPhoneNumber=!1;client="";showNavbarModule=!0;publicProgram=!1;showSupport=!0;aiAssistantEnabled=!0;tourStops=[];el_navBarMain;el_navBarModule;el_mobileNavigationBar;el_mobileResolveioFooter;year=(new Date).getFullYear().toString();fullScreen=!1;windowSizeHeight=this.getViewportHeight();windowSizeWidth=this.getViewportWidth();navbarMainHeight=56;navbarModuleHeight=0;statusHeight=0;connectedHeight=0;isDevice=!1;showNavigationMenu=!1;mobileNavigationBarHeight=54;mobileResolveioFooterHeight=20;swFlagAlert=null;isConnected=!1;isConnecting=!1;socketStatus;user;status;collapsableMenu=!0;fontSize=12;openedWindow=!1;aiAssistantOpen=!1;aiAssistantAppId="resolveio-assistant";aiAssistantConfig=null;currentRoute="";isOffline=!1;foundUpdate=!1;orientation="portrait";digitalSign=!1;savingTourCompletion=!1;aiDebugEnabled=!1;navbarResizeObserver=null;handleVisualViewportChange=()=>{this.windowSizeHeight=this.getViewportHeight(),this.windowSizeWidth=this.getViewportWidth(),this.updateStandaloneNavigation(),this.refreshLayoutMeasurements()};constructor(t,e,n,o,r,i,a,s,l,c){super(o),this._deviceDet=t,this._ds=e,this._resizeService=n,this._services=o,this._offline=r,this._storage=i,this._auth=a,this._aps=s,this._featureGates=l,this._tourManager=c}refreshAiDebugFlag(){if("undefined"!=typeof window)try{const t=String(localStorage.getItem("resolveio.ai.debug")||"").trim().toLowerCase();this.aiDebugEnabled="1"===t||"true"===t||"on"===t}catch{this.aiDebugEnabled=!1}else this.aiDebugEnabled=!1}aiDebugLog(t,e){if(!this.aiDebugEnabled||"undefined"==typeof console||"function"!=typeof console.debug)return;const n=e&&"object"==typeof e?e:{};console.debug(`[AI.Core] ${t}`,n)}ngOnInit(){this.refreshAiDebugFlag(),this._services._app.setEnvironment(this.environment),this.aiAssistantAppId=this.resolveAiAssistantAppId(),this.aiAssistantConfig=this.resolveAiAssistantConfig(),this.currentRoute=this._services._router?.url||"",this._offline.initStorage(this.environment.OFFLINE_DB_SECRET_KEY),this._services._app.setClient(this.client),this._services._app.setNavTabs(this.filterNavTabs(this.navTabs)),this._services._app.setTourStops(Array.isArray(this.tourStops)?this.tourStops:[]),this.configureTour(),this._services._app.navTabs.subscribe(()=>this.configureTour()),this._services._app.tourStops.subscribe(()=>this.configureTour()),this._tourManager.completed$.subscribe(()=>this.saveTourCompletion()),this._services._account.initLoginManager(this.environment),this.environment&&this.environment.MS_ALLOWED?this._auth.setupMSSingleSignOn(this.environment):this.environment&&this._auth.setEnvironment(this.environment),this._auth.setUserHasPhoneNumber(this.userHasPhoneNumber),this._resizeService.onResize$.subscribe(t=>{this.windowSizeHeight=this.getViewportHeight(t),this.windowSizeWidth=this.getViewportWidth(t),this.updateStandaloneNavigation(),this.refreshLayoutMeasurements()}),this._services._app.fullScreen.subscribe(t=>{this.fullScreen=t}),this._services._account.user.subscribe(t=>{t&&t.settings?(this.collapsableMenu=t.settings.collapsable_menu,this.fontSize=t.settings.font_size,document.documentElement.style.setProperty("--warning-color",t.settings.warning_color),document.documentElement.style.setProperty("--warning-font-color",t.settings.warning_font_color),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.warning_color,.5)),document.documentElement.style.setProperty("--warning-hover-color",t.settings.warning_hover_color),document.documentElement.style.setProperty("--success-color",t.settings.success_color),document.documentElement.style.setProperty("--success-font-color",t.settings.success_font_color),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.success_color,.5)),document.documentElement.style.setProperty("--success-hover-color",t.settings.success_hover_color),document.documentElement.style.setProperty("--danger-color",t.settings.danger_color),document.documentElement.style.setProperty("--danger-font-color",t.settings.danger_font_color),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.danger_color,.5)),document.documentElement.style.setProperty("--danger-hover-color",t.settings.danger_hover_color),document.documentElement.style.setProperty("--info-color",t.settings.info_color),document.documentElement.style.setProperty("--info-font-color",t.settings.info_font_color),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.info_color,.5)),document.documentElement.style.setProperty("--info-hover-color",t.settings.info_hover_color),document.documentElement.style.setProperty("--primary-color",t.settings.primary_color),document.documentElement.style.setProperty("--primary-font-color",t.settings.primary_font_color),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.primary_color,.5)),document.documentElement.style.setProperty("--primary-hover-color",t.settings.primary_hover_color),document.documentElement.style.setProperty("--secondary-color",t.settings.secondary_color),document.documentElement.style.setProperty("--secondary-font-color",t.settings.secondary_font_color),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB$1(t.settings.secondary_color,.5)),document.documentElement.style.setProperty("--secondary-hover-color",t.settings.secondary_hover_color)):!t||t.other.customers&&t.other.customers.length||t.other.id_customer||t.settings||this.openedWindow?(document.documentElement.style.setProperty("--warning-color","#ffc107"),document.documentElement.style.setProperty("--warning-font-color","#000000"),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem rgba(222, 170, 12, 0.5)"),document.documentElement.style.setProperty("--warning-hover-color","#e0a800"),document.documentElement.style.setProperty("--success-color","#28a745"),document.documentElement.style.setProperty("--success-font-color","#ffffff"),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem rgba(72, 180, 97, 0.5)"),document.documentElement.style.setProperty("--success-hover-color","#218838"),document.documentElement.style.setProperty("--danger-color","#dc3545"),document.documentElement.style.setProperty("--danger-font-color","#ffffff"),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem rgba(225, 83, 97, 0.5)"),document.documentElement.style.setProperty("--danger-hover-color","#c82333"),document.documentElement.style.setProperty("--info-color","#17a2b8"),document.documentElement.style.setProperty("--info-font-color","#ffffff"),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem rgba(58, 176, 195, 0.5)"),document.documentElement.style.setProperty("--info-hover-color","#138496"),document.documentElement.style.setProperty("--primary-color","#007bff"),document.documentElement.style.setProperty("--primary-font-color","#ffffff"),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem rgba(38, 143, 255, 0.5)"),document.documentElement.style.setProperty("--primary-hover-color","#0069d9"),document.documentElement.style.setProperty("--secondary-color","#868e96"),document.documentElement.style.setProperty("--secondary-font-color","#ffffff"),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem rgba(130, 138, 145, 0.5)"),document.documentElement.style.setProperty("--secondary-hover-color","#5a6268"),this.fontSize=12):(this.openedWindow=!0,document.documentElement.style.setProperty("--warning-color","#ffc107"),document.documentElement.style.setProperty("--warning-font-color","#000000"),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem rgba(222, 170, 12, 0.5)"),document.documentElement.style.setProperty("--warning-hover-color","#e0a800"),document.documentElement.style.setProperty("--success-color","#28a745"),document.documentElement.style.setProperty("--success-font-color","#ffffff"),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem rgba(72, 180, 97, 0.5)"),document.documentElement.style.setProperty("--success-hover-color","#218838"),document.documentElement.style.setProperty("--danger-color","#dc3545"),document.documentElement.style.setProperty("--danger-font-color","#ffffff"),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem rgba(225, 83, 97, 0.5)"),document.documentElement.style.setProperty("--danger-hover-color","#c82333"),document.documentElement.style.setProperty("--info-color","#17a2b8"),document.documentElement.style.setProperty("--info-font-color","#ffffff"),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem rgba(58, 176, 195, 0.5)"),document.documentElement.style.setProperty("--info-hover-color","#138496"),document.documentElement.style.setProperty("--primary-color","#007bff"),document.documentElement.style.setProperty("--primary-font-color","#ffffff"),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem rgba(38, 143, 255, 0.5)"),document.documentElement.style.setProperty("--primary-hover-color","#0069d9"),document.documentElement.style.setProperty("--secondary-color","#868e96"),document.documentElement.style.setProperty("--secondary-font-color","#ffffff"),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem rgba(130, 138, 145, 0.5)"),document.documentElement.style.setProperty("--secondary-hover-color","#5a6268"),this.fontSize=12,this._ds.notify("Hello, "+t.fullname+" it looks like there are no user settings saved for you. To adjust your user settings click your name at the top of the page next to the logout button, adjust any settings you want, then click submit to apply them."),this._services._router.navigateByUrl(this._services._router.url.split("/")[0]+"/user-settings/settings")),this.user=t,this.isDevice||this.digitalSign||this._tourManager.autoStartIfNeeded(t)}),this._deviceDet.isMobile()||this._deviceDet.isTablet()?(this._services._app.setIsDevice(!0),this.isDevice=!0):(this._services._app.setIsDevice(!1),this.isDevice=!1),this.updateStandaloneNavigation(),this.bindVisualViewportListeners(),this.environment.IS_PRODUCTION&&this._services._socket.subscribeBypassRoute("flagUpdateWithType","newSW").subscribe(t=>{t?(this.swFlagAlert=this._services._alert.setAlert("info","This page will reload once new version has been downloaded",0),this._services._app.setIsInvalidSW(!0),navigator.serviceWorker?navigator.serviceWorker.getRegistrations().then(t=>{t&&t.length||setTimeout(()=>{window.location.reload()},3e3)},t=>{setTimeout(()=>{window.location.reload()},3e3)}):setTimeout(()=>{window.location.reload()},3e3)):this.swFlagAlert&&(this._services._app.setIsInvalidSW(!1),this._services._alert.clearAlert(this.swFlagAlert.toastId),this.swFlagAlert=null)}),this._offline.offlineMode.subscribe(t=>{this.isOffline=t}),this._services._account.getSocketStatus().subscribe(t=>{this.socketStatus=t,this.publicProgram||this.digitalSign?this.connectedHeight=0:(this.user?(this.socketStatus===WebSocket.OPEN?(this.isConnected=!0,this.isConnecting=!1):(this.isConnected=!1,this.socketStatus===WebSocket.CONNECTING?this.isConnecting=!0:this.isConnecting=!1),this.isConnected?this.connectedHeight=0:this.connectedHeight=40):(this.isConnected=!1,this.isConnecting=!1,this.connectedHeight=40),this.isConnected||(this.aiAssistantOpen=!1))}),this._services._socket.subscribeBypassRoute("appstatus").subscribe(t=>{this.status=t,this._services._app.setHasStatusMessage(!!this.status),this.statusHeight=this.publicProgram||this.digitalSign?0:this.status?40:0});let t,e=!1,n=this._storage.get("lastURL");this._services._router.events.subscribe(t=>{t.url&&t.url.startsWith("/digital-sign?")&&(this.digitalSign=!0),t.urlAfterRedirects?this.currentRoute=t.urlAfterRedirects:t.url&&(this.currentRoute=t.url),this.refreshLayoutMeasurements(),this.isDevice&&(n&&"/"!==n&&!e&&(""!==t.url&&"/"!==t.url||this._services._router.navigateByUrl(n)),e=!0,t.url?this._storage.set("lastURL",t.url):t.urlAfterRedirects&&this._storage.set("lastURL",t.urlAfterRedirects))}),window.addEventListener("orientationchange",()=>{-90===window.orientation&&(this.orientation="landscape"),90===window.orientation&&(this.orientation="landscape"),0===window.orientation&&(this.orientation="portrait")},!0),document.addEventListener("focus",function(){document.activeElement instanceof HTMLElement&&"INPUT"===document.activeElement.nodeName&&"number"===document.activeElement.type&&(t=!0,document.addEventListener("mousewheel",handleMousewheelEvent,{passive:!0}))},!0),document.addEventListener("blur",function(){t&&(t=!1,document.removeEventListener("mousewheel",handleMousewheelEvent))},!0),window.addEventListener("dragover",t=>{(t||event).preventDefault()},!1),window.addEventListener("drop",t=>{(t||event).preventDefault()},!1)}ngAfterViewInit(){this.refreshLayoutMeasurements(),this.observeLayoutElements(),requestAnimationFrame(()=>this.refreshLayoutMeasurements())}ngOnDestroy(){this.navbarResizeObserver&&(this.navbarResizeObserver.disconnect(),this.navbarResizeObserver=null);const t="undefined"!=typeof window?window.visualViewport:null;t&&(t.removeEventListener("resize",this.handleVisualViewportChange),t.removeEventListener("scroll",this.handleVisualViewportChange))}filterNavTabs(t){if(!Array.isArray(t))return[];const e=this._aps.getAllModulePermissions(),n=[];return t.forEach(t=>{if(!t||!Array.isArray(t.links))return void n.push(t);const o=t.links.filter(t=>this.isRoleGateEnabled(t.role,e));if(!o.length)return;const r={...t,links:o};if("dropdown"===t.type){const n=Array.isArray(t.roles)?t.roles.filter(t=>this.isRoleGateEnabled(t,e)):[];if(!n.length)return;r.roles=n}n.push(r)}),n}isRoleGateEnabled(t,e){return!t||this._featureGates.isLinkEnabled(t,e,!0)}getNavbarModuleHeight(){return this.navbarModuleHeight>0?this.navbarModuleHeight:0}updateStandaloneNavigation(){const t=this.showNavigationMenu,e=this.windowSizeWidth<=1200;this.showNavigationMenu=this.isDevice&&e&&this.isStandaloneWebApp(),!e&&this.aiAssistantEnabled||(this.aiAssistantOpen=!1),t!==this.showNavigationMenu&&"undefined"!=typeof window&&requestAnimationFrame(()=>this.refreshLayoutMeasurements())}isStandaloneWebApp(){if("undefined"==typeof window)return!1;const t=!0===window.navigator.standalone,e="undefined"!=typeof document&&"string"==typeof document.referrer&&document.referrer.startsWith("android-app://"),n="function"==typeof window.matchMedia&&(window.matchMedia("(display-mode: standalone)").matches||window.matchMedia("(display-mode: fullscreen)").matches||window.matchMedia("(display-mode: minimal-ui)").matches);return t||e||n}toggleAiAssistant(){this.refreshAiDebugFlag(),this.aiAssistantEnabled&&this.isConnected&&(this.aiAssistantOpen=!this.aiAssistantOpen,this.aiDebugLog("toggleAiAssistant",{open:this.aiAssistantOpen,route:this.currentRoute||"",windowWidth:this.windowSizeWidth,windowHeight:this.windowSizeHeight}))}openAiAssistant(){this.refreshAiDebugFlag(),this.aiAssistantEnabled&&this.isConnected&&(this.aiAssistantOpen=!0,this.aiDebugLog("openAiAssistant",{open:this.aiAssistantOpen,route:this.currentRoute||"",windowWidth:this.windowSizeWidth,windowHeight:this.windowSizeHeight}))}closeAiAssistant(){this.aiAssistantOpen=!1,this.aiDebugLog("closeAiAssistant",{open:this.aiAssistantOpen,route:this.currentRoute||"",windowWidth:this.windowSizeWidth,windowHeight:this.windowSizeHeight})}getAiAssistantTopOffset(){return this.navbarMainHeight+this.statusHeight+this.connectedHeight}getAiAssistantHeight(){const t=this.getAiAssistantTopOffset(),e=this.showNavigationMenu?54+this.getNavbarModuleHeight():0,n=!this.isDevice||this.isDevice&&this.showNavigationMenu?20:0,o=this.windowSizeHeight-t-e-n;return o>0?o:0}getMainScrollHeight(){const t=this.getNavbarModuleHeight(),e=t>100?0:t,n=this.navbarMainHeight+(this.publicProgram||this.digitalSign?0:this.statusHeight)+(this.publicProgram||this.digitalSign?0:this.connectedHeight),o=this.isDevice&&this.windowSizeWidth<=1200&&!this.showNavigationMenu?e:0,r=this.isDevice&&this.showNavigationMenu?e:0,i=this.windowSizeHeight-o-n-r-this.getShellBottomOffset()-5;return i>0?i:0}getBottomNavSpacerHeight(){return 0}getAiAssistantReservedWidth(){if(!this.aiAssistantEnabled||!this.user||this.isDevice||this.windowSizeWidth<=1200||this.digitalSign||this.publicProgram)return 0;return 46}resolveAiAssistantClientId(){const t=String(this.user?.other?.id_client||this.user?.id_client||this.user?.idClient||"").trim();return t||String(this.client||"").trim()}resolveAiAssistantAppId(){const t=this.environment||{},e=t.AI_ASSISTANT_APP_ID||t.APP_ID||t.CLIENT_APP_ID||"";return String(e||"resolveio-assistant").trim()}resolveAiAssistantConfig(){const t=this.environment||{},e=this.normalizeOptionalEnvString(t.AI_ASSISTANT_CODEX_MODEL||t.AI_TERMINAL_CODEX_MODEL||t.AI_DASHBOARD_CODEX_MODEL),n=this.resolveEnvModelList(t.AI_ASSISTANT_CODEX_FALLBACK_MODELS||t.AI_TERMINAL_CODEX_FALLBACK_MODELS||t.AI_DASHBOARD_CODEX_FALLBACK_MODELS),o=this.normalizeOptionalEnvString(t.AI_ASSISTANT_CODEX_FALLBACK_MODEL||t.AI_TERMINAL_CODEX_FALLBACK_MODEL||t.AI_DASHBOARD_CODEX_FALLBACK_MODEL);if(o&&!n.includes(o)&&n.unshift(o),e){const t=n.filter(t=>t!==e);n.length=0,t.forEach(t=>n.push(t))}if(!e&&!n.length)return null;const r={};return e&&(r.model=e),1===n.length?r.fallbackModel=n[0]:n.length>1&&(r.fallbackModels=n),r}resolveEnvModelList(t){const e=[],n=t=>{const n=this.normalizeOptionalEnvString(t);n&&!e.includes(n)&&e.push(n)};if(Array.isArray(t))return t.forEach(n),e;const o=this.normalizeOptionalEnvString(t);return o?(o.split(",").forEach(n),e):e}normalizeOptionalEnvString(t){return"string"==typeof t?t.trim():""}configureTour(){const t=this._services._app.navTabs.getValue(),e=this._services._app.tourStops.getValue();this._tourManager.configure(Array.isArray(t)?t:[],Array.isArray(e)?e:[])}saveTourCompletion(){const t=this._services._account.getUser();if(!t||!t._id||this.savingTourCompletion||this._tourManager.hasCompletedTour(t))return;const e={...t.other||{},tour_completed:!0,core_tour_completed:!0,tour_completed_at:(new Date).toISOString()};this.savingTourCompletion=!0,this._services._socket.call("updateDocumentProps","users",t._id,[{prop:"other",data:e}],t.__v,(n,o)=>{if(this.savingTourCompletion=!1,!o)return;const r={...t,other:e,__v:o&&o.__v?o.__v:t.__v};this._services._account.setUser(r)})}onPushBackButton(){window.history.back()}onPushReloadButton(){window.location.reload()}onPushForwardButton(){window.history.forward()}openNav(){let t=document.getElementById("navSid"),e=document.getElementById("main_cont");t&&e&&("40px"===t.style.width&&"45px"===e.style.paddingLeft?(t.style.width="195px",e.style.paddingLeft="210px"):(t.style.width="40px",e.style.paddingLeft="45px"))}closeNav(){let t=document.getElementById("navSid"),e=document.getElementById("main_cont");t&&e&&(t.style.width="40px",e.style.paddingLeft="45px")}bindVisualViewportListeners(){const t="undefined"!=typeof window?window.visualViewport:null;t&&(t.addEventListener("resize",this.handleVisualViewportChange),t.addEventListener("scroll",this.handleVisualViewportChange))}observeLayoutElements(){if("undefined"==typeof ResizeObserver)return;this.navbarResizeObserver&&this.navbarResizeObserver.disconnect(),this.navbarResizeObserver=new ResizeObserver(()=>this.refreshLayoutMeasurements());const t=this.getNavbarMainElement(),e=this.getNavbarModuleElement();t&&this.navbarResizeObserver.observe(t),e&&this.navbarResizeObserver.observe(e)}refreshLayoutMeasurements(){const t=this.navbarMainHeight,e=this.navbarModuleHeight,n=this.mobileNavigationBarHeight,o=this.mobileResolveioFooterHeight,r=this.measureElementHeight(this.getNavbarMainElement());r>0&&(this.navbarMainHeight=r);const i=this.measureElementHeight(this.getNavbarModuleElement());i>0&&(this.navbarModuleHeight=i);const a=this.measureElementHeight(this.getMobileNavigationBarElement());a>0&&(this.mobileNavigationBarHeight=a);const s=this.measureElementHeight(this.getMobileResolveioFooterElement());s>0&&(this.mobileResolveioFooterHeight=s),!this.aiDebugEnabled||t===this.navbarMainHeight&&e===this.navbarModuleHeight&&n===this.mobileNavigationBarHeight&&o===this.mobileResolveioFooterHeight||this.aiDebugLog("refreshLayoutMeasurements",{navbarMainHeight:this.navbarMainHeight,navbarModuleHeight:this.navbarModuleHeight,mobileNavigationBarHeight:this.mobileNavigationBarHeight,mobileResolveioFooterHeight:this.mobileResolveioFooterHeight})}getNavbarMainElement(){const t=this.el_navBarMain?.nativeElement;return t?t.querySelector(".navbarMain")||t:null}getNavbarModuleElement(){const t=this.el_navBarModule?.nativeElement;return t?t.querySelector(".navbarModule")||t:null}getMobileNavigationBarElement(){return this.el_mobileNavigationBar?.nativeElement||null}getMobileResolveioFooterElement(){return this.el_mobileResolveioFooter?.nativeElement||null}getMobileBottomOverlayHeight(){if(!this.isDevice||!this.showNavigationMenu)return 0;const t=this.mobileNavigationBarHeight+this.mobileResolveioFooterHeight;return t>0?t:74}getMobileResolveioFooterOverlayHeight(){const t=this.mobileResolveioFooterHeight;return t>0?t:20}getShellBottomOffset(){return this.isDevice&&this.showNavigationMenu?this.getMobileBottomOverlayHeight():this.isDevice?this.getMobileResolveioFooterOverlayHeight():20}measureElementHeight(t){if(!t)return 0;const e=(t.getBoundingClientRect?t.getBoundingClientRect().height:0)||t.offsetHeight||t.clientHeight||0;return e>0?Math.round(e):0}getViewportHeight(t){if("undefined"==typeof window)return 0;const e=window.visualViewport,n=e?.height||t?.innerHeight||window.innerHeight;return n>0?Math.round(n):0}getViewportWidth(t){if("undefined"==typeof window)return 0;const e=window.visualViewport,n=e?.width||t?.innerWidth||window.innerWidth;return n>0?Math.round(n):0}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreComponent,deps:[{token:i1$5.DeviceDetectorService},{token:DialogService},{token:ResizeService},{token:ProviderService},{token:OfflineManagerService},{token:LocalStorageService},{token:AuthService},{token:AuthPermissionService},{token:FeatureGateService},{token:CoreTourService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:CoreComponent,isStandalone:!1,selector:"resolveio-client-lib-core",inputs:{environment:"environment",logo:"logo",navTabs:"navTabs",userHasPhoneNumber:"userHasPhoneNumber",client:"client",showNavbarModule:"showNavbarModule",publicProgram:"publicProgram",showSupport:"showSupport",aiAssistantEnabled:"aiAssistantEnabled",tourStops:"tourStops"},providers:[ProviderService],viewQueries:[{propertyName:"el_navBarMain",first:!0,predicate:["navBarMain"],descendants:!0,read:ElementRef,static:!0},{propertyName:"el_navBarModule",first:!0,predicate:["navBarModule"],descendants:!0,read:ElementRef,static:!0},{propertyName:"el_mobileNavigationBar",first:!0,predicate:["mobileNavigationBar"],descendants:!0,read:ElementRef},{propertyName:"el_mobileResolveioFooter",first:!0,predicate:["mobileResolveioFooter"],descendants:!0,read:ElementRef}],usesInheritance:!0,ngImport:i0,template:'<style>\n\t:root {\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t:host ::ng-deep .btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\t:host ::ng-deep .btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\t:host ::ng-deep .btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\t:host ::ng-deep .btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\t:host ::ng-deep .btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\t:host ::ng-deep .btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\t:host ::ng-deep .btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\t:host ::ng-deep .btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\t:host ::ng-deep .btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\t:host ::ng-deep .btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\t:host ::ng-deep .btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t@media print {\n\t\t.dontPrint * {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t.myDivToPrintCs {\n\t\t\tbackground-color: white;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t\tfont-size: 12px;\n\t\t\tline-height: 12px;\n\t\t\tpage-break-after: avoid;\n\t\t\tdisplay: initial;\n\t\t}\n\n\t\t.removeOverflow {\n\t\t\toverflow-y: hidden !important;\n\t\t\theight: 100% !important;\n\t\t}\n\t}\n\n\t.hideThis {\n\t\tdisplay: none !important;\n\t}\n\n\t.navSidbar {\n\t\twidth: 0px;\n\t\tposition: fixed;\n\t\tz-index: 1;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\toverflow: hidden;\n\t\ttransition: 0.5s;\n\t\tpadding-top: 0px;\n\t}\n\n\t.navSidbar a {\n\t\tpadding: 8px 8px 8px 32px;\n\t\ttext-decoration: none;\n\t\tfont-size: 25px;\n\t\tcolor: #818181;\n\t\tdisplay: block;\n\t\ttransition: 0.3s;\n\t}\n\n\t.navSidbar a:hover {\n\t\tcolor: #f1f1f1;\n\t}\n\n\t.openbtn {\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\tborder: none;\n\t\tcolor: #fff;\n\t\tpadding: 5px 20px;\n\t\tfont-size: 18px;\n\t\tright: 0;\n\t\ttop: 0px;\n\t\tposition: absolute;\n\t\tz-index: 999999;\n\t\tcursor: pointer;\n\t\tfloat: right;\n\t\theight: 100%;\n\t}\n\n\t.openbtn span {\n\t\tfont-size: 20px;\n\t\tdisplay: block;\n\t\theight: auto;\n\t\twidth: auto;\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tleft: 50%;\n\t\ttop: 50%;\n\t\ttransform: translate(-50%, -50%) rotate(-90deg);\n\t\tmargin-top: -55px;\n\t\tletter-spacing: 30px;\n\t}\n\n\t.ai-openbtn {\n\t\tdisplay: none;\n\t}\n\t#main_cont {\n\t\ttransition: padding-left 0.5s;\n\t}\n\n\t.sid_inr {\n\t\tpadding-left: 25px;\n\t}\n\n\t@keyframes shimmer {\n\t\t0%,\n\t\t50% {\n\t\t\tbackground-position: 120% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -80% 0;\n\t\t}\n\t}\n\n\t.shimmer::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tbackground: linear-gradient(-75deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 60%);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: shimmer 5s linear infinite;\n\t\tanimation-fill-mode: forwards;\n\t\tz-index: 11;\n\t}\n\n\t.shell-status-banner {\n\t\tmin-height: 40px;\n\t\ttext-align: center;\n\t\tbackground-color: red;\n\t\tcolor: white;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 0 12px;\n\t}\n\n\t.shell-status-banner__message {\n\t\twidth: 100%;\n\t\tpadding: 9px 0;\n\t\tline-height: 1.2;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.scroll-shell {\n\t\toverscroll-behavior-y: contain;\n\t}\n\n\t.scroll-bottom-spacer {\n\t\tpointer-events: none;\n\t}\n\n\t.mobile-resolveio-footer {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: env(safe-area-inset-bottom);\n\t\theight: 20px;\n\t\ttext-align: center;\n\t\tfont-style: italic;\n\t\tfont-weight: bold;\n\t\tbackground-color: lightgray;\n\t\tz-index: 10019;\n\t}\n\n\t.mobile-resolveio-footer.with-mobile-nav {\n\t\tbottom: calc(54px + env(safe-area-inset-bottom));\n\t}\n\n\t.mobile-navigation-bar {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\theight: calc(54px + env(safe-area-inset-bottom));\n\t\tpadding-bottom: env(safe-area-inset-bottom);\n\t\tbackground-color: lightgray;\n\t\tz-index: 10020;\n\t}\n\n\t:host ::ng-deep .rio-tour-anchor-active {\n\t\tposition: relative;\n\t\tz-index: 1062;\n\t\toutline: 2px solid #ffb300;\n\t\toutline-offset: 3px;\n\t\tborder-radius: 6px;\n\t\tbox-shadow: 0 0 0 4px rgba(255, 179, 0, 0.25);\n\t}\n\n\t@media all and (max-width: 768px) {\n\t\t.shell-status-banner {\n\t\t\tmin-height: 32px;\n\t\t\tpadding: 0 8px;\n\t\t}\n\n\t\t.shell-status-banner__message {\n\t\t\tpadding: 6px 0;\n\t\t\tfont-size: 12px;\n\t\t}\n\t}\n</style>\n@if (isDevice) {\n\t<link rel="stylesheet" type="text/css" href="/assets/css/tablet.css" />\n}\n<div #shell [style.height.px]="isDevice && showNavigationMenu ? windowSizeHeight : null" [style.overflow]="isDevice && showNavigationMenu ? \'hidden\' : null">\n\t@if (user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** OFFLINE MODE ***</div>\n\t\t</div>\n\t}\n\t@if (!user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** PLEASE LOGIN ***</div>\n\t\t</div>\n\t}\n\t@if (status) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer" [title]="status.message">*** {{ status.message }} ***</div>\n\t\t</div>\n\t}\n\t@if (fullScreen) {\n\t\t<router-outlet name="jobboardfsoutlet"></router-outlet>\n\t}\n\t<div [ngClass]="[\'container-fluid\', fullScreen ? \'hideThis\' : \'\']" [style.font-size.px]="fontSize">\n\t\t<div class="dontPrint">\n\t\t\t<navbar-main style="width: 100%" tourAnchor="navBarMain" #navBarMain [logo]="logo" [showSupport]="showSupport" [navTabs]="navTabs" [fontSize]="fontSize" [publicProgram]="publicProgram || digitalSign" [digitalSign]="digitalSign" [aiAssistantVisible]="aiAssistantEnabled && isConnected" (aiToggle)="toggleAiAssistant()"></navbar-main>\n\t\t</div>\n\t\t<rio-core-tour-overlay></rio-core-tour-overlay>\n\t\t<ng-template ngbModalContainer></ng-template>\n\t\t@if (aiAssistantEnabled && user && isConnected && !isDevice && windowSizeWidth > 1200 && !digitalSign && !publicProgram) {\n\t\t\t<rio-ai-assistant\n\t\t\t\t[idClient]="resolveAiAssistantClientId()"\n\t\t\t\t[idApp]="aiAssistantAppId"\n\t\t\t\t[config]="aiAssistantConfig"\n\t\t\t\t[open]="aiAssistantOpen"\n\t\t\t\t[currentRoute]="currentRoute"\n\t\t\t\t[topOffset]="getAiAssistantTopOffset()"\n\t\t\t\t[panelHeight]="getAiAssistantHeight()"\n\t\t\t\t(openRequested)="openAiAssistant()"\n\t\t\t\t(closed)="closeAiAssistant()"></rio-ai-assistant>\n\t\t}\n\t\t\t<div class="row">\n\t\t\t\t@if (showNavbarModule && !digitalSign) {\n\t\t\t\t\t<div id="navSid" [ngClass]="[\'dontPrint\', windowSizeWidth > 1200 && collapsableMenu ? \'navSidbar\' : \'col-xl-1\']" [style.width]="windowSizeWidth > 1200 && collapsableMenu ? \'40px\' : windowSizeWidth > 1200 ? \'\' : \'100%\'" [style.margin-top.px]="windowSizeWidth > 1200 && collapsableMenu ? navbarMainHeight + statusHeight + connectedHeight : 0">\n\t\t\t\t\t\t@if (windowSizeWidth > 1200 && collapsableMenu) {\n\t\t\t\t\t\t\t<div class="openbtn" (mouseenter)="openNav()"><span>MENU</span></div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<div [ngClass]="windowSizeWidth > 1200 && collapsableMenu ? \'sid_inr\' : \'\'">\n\t\t\t\t\t\t\t<navbar-module #navBarModule tourAnchor="navBarModule" [sideNavWidth]="windowSizeWidth > 1200 && collapsableMenu ? \'90%\' : \'auto\'" [sideNavHeight]="windowSizeWidth > 1200 ? windowSizeHeight - navbarMainHeight - statusHeight - connectedHeight - (showNavigationMenu ? 54 + getNavbarModuleHeight() : 0) - 20 : \'\'"></navbar-module>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div [id]="windowSizeWidth > 1200 ? \'main_cont\' : \'main_cont_mobile\'" [ngClass]="[windowSizeWidth > 1200 && collapsableMenu ? \'col-xl-12\' : \'col-xl-11\']" [style.padding-left]="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? 45 + \'px\' : null" [style.padding-right.px]="getAiAssistantReservedWidth()" (mouseenter)="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? closeNav() : null" style="padding-top: 5px">\n\t\t\t\t\t<div style="-webkit-overflow-scrolling: touch" [style.overflow-y]="isDevice && !showNavigationMenu ? \'initial\' : \'scroll\'" [style.height.px]="getMainScrollHeight()" class="removeOverflow scroll-shell">\n\t\t\t\t\t\t<router-outlet></router-outlet>\n\t\t\t\t\t\t<div class="scroll-bottom-spacer" [style.height.px]="getBottomNavSpacerHeight()" aria-hidden="true"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t@if (isDevice) {\n\t\t\t\t\t<div #mobileResolveioFooter class="mobile-resolveio-footer dontPrint" [class.with-mobile-nav]="showNavigationMenu">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t\t@if (isDevice && showNavigationMenu) {\n\t\t\t\t\t<div #mobileNavigationBar class="mobile-navigation-bar dontPrint">\n\t\t\t\t\t\t<table style="width: 100%">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushBackButton()"><i class="fa fa-arrow-left" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushReloadButton()"><i class="fa fa-refresh" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushForwardButton()"><i class="fa fa-arrow-right" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!isDevice) {\n\t\t\t\t\t<div style="text-align: center; height: 20px; font-style: italic; font-weight: bold; background-color: lightgray; margin-left: -15px; margin-right: -15px">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n',styles:[':root{--warning-color: #ffc107;--warning-font-color: #000000;--warning-hover-color: #e0a800;--warning-shadow-color: 0 0 0 .2rem rgba(222, 170, 12, .5);--success-color: #28a745;--success-font-color: #ffffff;--success-hover-color: #218838;--success-shadow-color: 0 0 0 .2rem rgba(72, 180, 97, .5);--danger-color: #dc3545;--danger-font-color: #ffffff;--danger-hover-color: #c82333;--danger-shadow-color: 0 0 0 .2rem rgba(225, 83, 97, .5);--info-color: #17a2b8;--info-font-color: #ffffff;--info-hover-color: #138496;--info-shadow-color: 0 0 0 .2rem rgba(58, 176, 195, .5);--primary-color: #007bff;--primary-font-color: #ffffff;--primary-hover-color: #0069d9;--primary-shadow-color: 0 0 0 .2rem rgba(38, 143, 255, .5);--secondary-color: #868e96;--secondary-font-color: #ffffff;--secondary-hover-color: #5a6268;--secondary-shadow-color: 0 0 0 .2rem rgba(130, 138, 145, .5)}:host ::ng-deep .btn-warning{color:var(--warning-font-color);background-color:var(--warning-color);border-color:var(--warning-color)}:host ::ng-deep .btn-warning:focus,.btn-warning.focus{box-shadow:var(--warning-shadow-color)}:host ::ng-deep .btn-warning:hover{color:var(--warning-font-color);background-color:var(--warning-hover-color);border-color:var(--warning-hover-color)}:host ::ng-deep .btn-success{color:var(--success-font-color);background-color:var(--success-color);border-color:var(--success-color)}:host ::ng-deep .btn-success:focus,.btn-success.focus{box-shadow:var(--success-shadow-color)}:host ::ng-deep .btn-success:hover{color:var(--success-font-color);background-color:var(--success-hover-color);border-color:var(--success-hover-color)}:host ::ng-deep .btn-danger{color:var(--danger-font-color);background-color:var(--danger-color);border-color:var(--danger-color)}:host ::ng-deep .btn-danger:focus,.btn-danger.focus{box-shadow:var(--danger-shadow-color)}:host ::ng-deep .btn-danger:hover{color:var(--danger-font-color);background-color:var(--danger-hover-color);border-color:var(--danger-hover-color)}:host ::ng-deep .btn-info{color:var(--info-font-color);background-color:var(--info-color);border-color:var(--info-color)}:host ::ng-deep .btn-info:focus,.btn-info.focus{box-shadow:var(--info-shadow-color)}:host ::ng-deep .btn-info:hover{color:var(--info-font-color);background-color:var(--info-hover-color);border-color:var(--info-hover-color)}:host ::ng-deep .btn-primary{color:var(--primary-font-color);background-color:var(--primary-color);border-color:var(--primary-color)}:host ::ng-deep .btn-primary:focus,.btn-primary.focus{box-shadow:var(--primary-shadow-color)}:host ::ng-deep .btn-primary:hover{color:var(--primary-font-color);background-color:var(--primary-hover-color);border-color:var(--primary-hover-color)}:host ::ng-deep .btn-secondary{color:var(--secondary-font-color);background-color:var(--secondary-color);border-color:var(--secondary-color)}:host ::ng-deep .btn-secondary:focus,.btn-secondary.focus{box-shadow:var(--secondary-shadow-color)}:host ::ng-deep .btn-secondary:hover{color:var(--secondary-font-color);background-color:var(--secondary-hover-color);border-color:var(--secondary-hover-color)}@media print{.dontPrint *{display:none!important}.myDivToPrintCs{background-color:#fff;height:100%;width:100%;font-size:12px;line-height:12px;page-break-after:avoid;display:initial}.removeOverflow{overflow-y:hidden!important;height:100%!important}}.hideThis{display:none!important}.navSidbar{width:0px;position:fixed;z-index:1;top:0;left:0;background-color:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1))!important;overflow:hidden;transition:.5s;padding-top:0}.navSidbar a{padding:8px 8px 8px 32px;text-decoration:none;font-size:25px;color:#818181;display:block;transition:.3s}.navSidbar a:hover{color:#f1f1f1}.openbtn{background-color:var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1))!important;border:none;color:#fff;padding:5px 20px;font-size:18px;right:0;top:0;position:absolute;z-index:999999;cursor:pointer;float:right;height:100%}.openbtn span{font-size:20px;display:block;height:auto;width:auto;text-align:center;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-90deg);margin-top:-55px;letter-spacing:30px}.ai-openbtn{display:none}#main_cont{transition:padding-left .5s}.sid_inr{padding-left:25px}@keyframes shimmer{0%,50%{background-position:120% 0}to{background-position:-80% 0}}.shimmer:before{content:"";position:absolute;inset:0;background:linear-gradient(-75deg,#fff0 40%,#ffffffb3,#fff0 60%);background-size:200% 100%;animation:shimmer 5s linear infinite;animation-fill-mode:forwards;z-index:11}.shell-status-banner{min-height:40px;text-align:center;background-color:red;color:#fff;display:flex;align-items:center;justify-content:center;padding:0 12px}.shell-status-banner__message{width:100%;padding:9px 0;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.scroll-shell{overscroll-behavior-y:contain}.scroll-bottom-spacer{pointer-events:none}.mobile-resolveio-footer{position:fixed;left:0;right:0;bottom:env(safe-area-inset-bottom);height:20px;text-align:center;font-style:italic;font-weight:700;background-color:#d3d3d3;z-index:10019}.mobile-resolveio-footer.with-mobile-nav{bottom:calc(54px + env(safe-area-inset-bottom))}.mobile-navigation-bar{position:fixed;left:0;right:0;bottom:0;height:calc(54px + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background-color:#d3d3d3;z-index:10020}:host ::ng-deep .rio-tour-anchor-active{position:relative;z-index:1062;outline:2px solid #ffb300;outline-offset:3px;border-radius:6px;box-shadow:0 0 0 4px #ffb30040}@media all and (max-width:768px){.shell-status-banner{min-height:32px;padding:0 8px}.shell-status-banner__message{padding:6px 0;font-size:12px}}\n'],dependencies:[{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i1$1.RouterOutlet,selector:"router-outlet",inputs:["name","routerOutletData"],outputs:["activate","deactivate","attach","detach"],exportAs:["outlet"]},{kind:"directive",type:TourAnchorDirective,selector:"[tourAnchor]",inputs:["tourAnchor"]},{kind:"component",type:CoreTourOverlayComponent,selector:"rio-core-tour-overlay"},{kind:"component",type:AiAssistantComponent,selector:"rio-ai-assistant",inputs:["idClient","idApp","title","open","supportTicketRoute","supportTicketEnabled","config","topOffset","panelHeight","currentRoute","hoverEnabled"],outputs:["openRequested","closed"]},{kind:"component",type:NavbarMainComponent,selector:"navbar-main",inputs:["logo","navTabs","fontSize","publicProgram","digitalSign","showSupport","aiAssistantVisible"],outputs:["aiToggle"]},{kind:"component",type:NavbarModuleComponent,selector:"navbar-module",inputs:["sideNavHeight","sideNavWidth"]}]})}function handleMousewheelEvent(){document.activeElement.blur()}function hexToRGB$1(t,e){let n=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e?"rgba("+n+", "+o+", "+r+", "+e+")":"rgb("+n+", "+o+", "+r+")"}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"resolveio-client-lib-core",standalone:!1,template:'<style>\n\t:root {\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t:host ::ng-deep .btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\t:host ::ng-deep .btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\t:host ::ng-deep .btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\t:host ::ng-deep .btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\t:host ::ng-deep .btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\t:host ::ng-deep .btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\t:host ::ng-deep .btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\t:host ::ng-deep .btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\t:host ::ng-deep .btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\t:host ::ng-deep .btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t:host ::ng-deep .btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\t:host ::ng-deep .btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\t:host ::ng-deep .btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t@media print {\n\t\t.dontPrint * {\n\t\t\tdisplay: none !important;\n\t\t}\n\n\t\t.myDivToPrintCs {\n\t\t\tbackground-color: white;\n\t\t\theight: 100%;\n\t\t\twidth: 100%;\n\t\t\tfont-size: 12px;\n\t\t\tline-height: 12px;\n\t\t\tpage-break-after: avoid;\n\t\t\tdisplay: initial;\n\t\t}\n\n\t\t.removeOverflow {\n\t\t\toverflow-y: hidden !important;\n\t\t\theight: 100% !important;\n\t\t}\n\t}\n\n\t.hideThis {\n\t\tdisplay: none !important;\n\t}\n\n\t.navSidbar {\n\t\twidth: 0px;\n\t\tposition: fixed;\n\t\tz-index: 1;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\toverflow: hidden;\n\t\ttransition: 0.5s;\n\t\tpadding-top: 0px;\n\t}\n\n\t.navSidbar a {\n\t\tpadding: 8px 8px 8px 32px;\n\t\ttext-decoration: none;\n\t\tfont-size: 25px;\n\t\tcolor: #818181;\n\t\tdisplay: block;\n\t\ttransition: 0.3s;\n\t}\n\n\t.navSidbar a:hover {\n\t\tcolor: #f1f1f1;\n\t}\n\n\t.openbtn {\n\t\tbackground-color: var(--navbar-bg-color, rgba(var(--bs-dark-rgb, 33, 37, 41), 1)) !important;\n\t\tborder: none;\n\t\tcolor: #fff;\n\t\tpadding: 5px 20px;\n\t\tfont-size: 18px;\n\t\tright: 0;\n\t\ttop: 0px;\n\t\tposition: absolute;\n\t\tz-index: 999999;\n\t\tcursor: pointer;\n\t\tfloat: right;\n\t\theight: 100%;\n\t}\n\n\t.openbtn span {\n\t\tfont-size: 20px;\n\t\tdisplay: block;\n\t\theight: auto;\n\t\twidth: auto;\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tleft: 50%;\n\t\ttop: 50%;\n\t\ttransform: translate(-50%, -50%) rotate(-90deg);\n\t\tmargin-top: -55px;\n\t\tletter-spacing: 30px;\n\t}\n\n\t.ai-openbtn {\n\t\tdisplay: none;\n\t}\n\t#main_cont {\n\t\ttransition: padding-left 0.5s;\n\t}\n\n\t.sid_inr {\n\t\tpadding-left: 25px;\n\t}\n\n\t@keyframes shimmer {\n\t\t0%,\n\t\t50% {\n\t\t\tbackground-position: 120% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -80% 0;\n\t\t}\n\t}\n\n\t.shimmer::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tbackground: linear-gradient(-75deg, rgba(255, 255, 255, 0) 40%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 60%);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: shimmer 5s linear infinite;\n\t\tanimation-fill-mode: forwards;\n\t\tz-index: 11;\n\t}\n\n\t.shell-status-banner {\n\t\tmin-height: 40px;\n\t\ttext-align: center;\n\t\tbackground-color: red;\n\t\tcolor: white;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tpadding: 0 12px;\n\t}\n\n\t.shell-status-banner__message {\n\t\twidth: 100%;\n\t\tpadding: 9px 0;\n\t\tline-height: 1.2;\n\t\twhite-space: nowrap;\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t}\n\n\t.scroll-shell {\n\t\toverscroll-behavior-y: contain;\n\t}\n\n\t.scroll-bottom-spacer {\n\t\tpointer-events: none;\n\t}\n\n\t.mobile-resolveio-footer {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: env(safe-area-inset-bottom);\n\t\theight: 20px;\n\t\ttext-align: center;\n\t\tfont-style: italic;\n\t\tfont-weight: bold;\n\t\tbackground-color: lightgray;\n\t\tz-index: 10019;\n\t}\n\n\t.mobile-resolveio-footer.with-mobile-nav {\n\t\tbottom: calc(54px + env(safe-area-inset-bottom));\n\t}\n\n\t.mobile-navigation-bar {\n\t\tposition: fixed;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\theight: calc(54px + env(safe-area-inset-bottom));\n\t\tpadding-bottom: env(safe-area-inset-bottom);\n\t\tbackground-color: lightgray;\n\t\tz-index: 10020;\n\t}\n\n\t:host ::ng-deep .rio-tour-anchor-active {\n\t\tposition: relative;\n\t\tz-index: 1062;\n\t\toutline: 2px solid #ffb300;\n\t\toutline-offset: 3px;\n\t\tborder-radius: 6px;\n\t\tbox-shadow: 0 0 0 4px rgba(255, 179, 0, 0.25);\n\t}\n\n\t@media all and (max-width: 768px) {\n\t\t.shell-status-banner {\n\t\t\tmin-height: 32px;\n\t\t\tpadding: 0 8px;\n\t\t}\n\n\t\t.shell-status-banner__message {\n\t\t\tpadding: 6px 0;\n\t\t\tfont-size: 12px;\n\t\t}\n\t}\n</style>\n@if (isDevice) {\n\t<link rel="stylesheet" type="text/css" href="/assets/css/tablet.css" />\n}\n<div #shell [style.height.px]="isDevice && showNavigationMenu ? windowSizeHeight : null" [style.overflow]="isDevice && showNavigationMenu ? \'hidden\' : null">\n\t@if (user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** OFFLINE MODE ***</div>\n\t\t</div>\n\t}\n\t@if (!user && (!isConnected || isOffline) && !publicProgram && !digitalSign) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer">*** PLEASE LOGIN ***</div>\n\t\t</div>\n\t}\n\t@if (status) {\n\t\t<div class="shell-status-banner">\n\t\t\t<div class="shell-status-banner__message shimmer" [title]="status.message">*** {{ status.message }} ***</div>\n\t\t</div>\n\t}\n\t@if (fullScreen) {\n\t\t<router-outlet name="jobboardfsoutlet"></router-outlet>\n\t}\n\t<div [ngClass]="[\'container-fluid\', fullScreen ? \'hideThis\' : \'\']" [style.font-size.px]="fontSize">\n\t\t<div class="dontPrint">\n\t\t\t<navbar-main style="width: 100%" tourAnchor="navBarMain" #navBarMain [logo]="logo" [showSupport]="showSupport" [navTabs]="navTabs" [fontSize]="fontSize" [publicProgram]="publicProgram || digitalSign" [digitalSign]="digitalSign" [aiAssistantVisible]="aiAssistantEnabled && isConnected" (aiToggle)="toggleAiAssistant()"></navbar-main>\n\t\t</div>\n\t\t<rio-core-tour-overlay></rio-core-tour-overlay>\n\t\t<ng-template ngbModalContainer></ng-template>\n\t\t@if (aiAssistantEnabled && user && isConnected && !isDevice && windowSizeWidth > 1200 && !digitalSign && !publicProgram) {\n\t\t\t<rio-ai-assistant\n\t\t\t\t[idClient]="resolveAiAssistantClientId()"\n\t\t\t\t[idApp]="aiAssistantAppId"\n\t\t\t\t[config]="aiAssistantConfig"\n\t\t\t\t[open]="aiAssistantOpen"\n\t\t\t\t[currentRoute]="currentRoute"\n\t\t\t\t[topOffset]="getAiAssistantTopOffset()"\n\t\t\t\t[panelHeight]="getAiAssistantHeight()"\n\t\t\t\t(openRequested)="openAiAssistant()"\n\t\t\t\t(closed)="closeAiAssistant()"></rio-ai-assistant>\n\t\t}\n\t\t\t<div class="row">\n\t\t\t\t@if (showNavbarModule && !digitalSign) {\n\t\t\t\t\t<div id="navSid" [ngClass]="[\'dontPrint\', windowSizeWidth > 1200 && collapsableMenu ? \'navSidbar\' : \'col-xl-1\']" [style.width]="windowSizeWidth > 1200 && collapsableMenu ? \'40px\' : windowSizeWidth > 1200 ? \'\' : \'100%\'" [style.margin-top.px]="windowSizeWidth > 1200 && collapsableMenu ? navbarMainHeight + statusHeight + connectedHeight : 0">\n\t\t\t\t\t\t@if (windowSizeWidth > 1200 && collapsableMenu) {\n\t\t\t\t\t\t\t<div class="openbtn" (mouseenter)="openNav()"><span>MENU</span></div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<div [ngClass]="windowSizeWidth > 1200 && collapsableMenu ? \'sid_inr\' : \'\'">\n\t\t\t\t\t\t\t<navbar-module #navBarModule tourAnchor="navBarModule" [sideNavWidth]="windowSizeWidth > 1200 && collapsableMenu ? \'90%\' : \'auto\'" [sideNavHeight]="windowSizeWidth > 1200 ? windowSizeHeight - navbarMainHeight - statusHeight - connectedHeight - (showNavigationMenu ? 54 + getNavbarModuleHeight() : 0) - 20 : \'\'"></navbar-module>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div [id]="windowSizeWidth > 1200 ? \'main_cont\' : \'main_cont_mobile\'" [ngClass]="[windowSizeWidth > 1200 && collapsableMenu ? \'col-xl-12\' : \'col-xl-11\']" [style.padding-left]="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? 45 + \'px\' : null" [style.padding-right.px]="getAiAssistantReservedWidth()" (mouseenter)="windowSizeWidth > 1200 && collapsableMenu && showNavbarModule ? closeNav() : null" style="padding-top: 5px">\n\t\t\t\t\t<div style="-webkit-overflow-scrolling: touch" [style.overflow-y]="isDevice && !showNavigationMenu ? \'initial\' : \'scroll\'" [style.height.px]="getMainScrollHeight()" class="removeOverflow scroll-shell">\n\t\t\t\t\t\t<router-outlet></router-outlet>\n\t\t\t\t\t\t<div class="scroll-bottom-spacer" [style.height.px]="getBottomNavSpacerHeight()" aria-hidden="true"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t\t@if (isDevice) {\n\t\t\t\t\t<div #mobileResolveioFooter class="mobile-resolveio-footer dontPrint" [class.with-mobile-nav]="showNavigationMenu">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t\t@if (isDevice && showNavigationMenu) {\n\t\t\t\t\t<div #mobileNavigationBar class="mobile-navigation-bar dontPrint">\n\t\t\t\t\t\t<table style="width: 100%">\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushBackButton()"><i class="fa fa-arrow-left" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushReloadButton()"><i class="fa fa-refresh" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style="text-align: center">\n\t\t\t\t\t\t\t\t<button type="button" class="btn" style="background-color: lightgray" (click)="onPushForwardButton()"><i class="fa fa-arrow-right" style="color: black; font-size: 20px"></i></button>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!isDevice) {\n\t\t\t\t\t<div style="text-align: center; height: 20px; font-style: italic; font-weight: bold; background-color: lightgray; margin-left: -15px; margin-right: -15px">© {{ year }} RESOLVEIO ALL RIGHTS RESERVED</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n'}]}],ctorParameters:()=>[{type:i1$5.DeviceDetectorService},{type:DialogService},{type:ResizeService},{type:ProviderService},{type:OfflineManagerService},{type:LocalStorageService},{type:AuthService},{type:AuthPermissionService},{type:FeatureGateService},{type:CoreTourService}],propDecorators:{environment:[{type:Input,args:["environment"]}],logo:[{type:Input,args:["logo"]}],navTabs:[{type:Input,args:["navTabs"]}],userHasPhoneNumber:[{type:Input,args:["userHasPhoneNumber"]}],client:[{type:Input,args:["client"]}],showNavbarModule:[{type:Input,args:["showNavbarModule"]}],publicProgram:[{type:Input,args:["publicProgram"]}],showSupport:[{type:Input,args:["showSupport"]}],aiAssistantEnabled:[{type:Input,args:["aiAssistantEnabled"]}],tourStops:[{type:Input,args:["tourStops"]}],el_navBarMain:[{type:ViewChild,args:["navBarMain",{read:ElementRef,static:!0}]}],el_navBarModule:[{type:ViewChild,args:["navBarModule",{read:ElementRef,static:!0}]}],el_mobileNavigationBar:[{type:ViewChild,args:["mobileNavigationBar",{read:ElementRef}]}],el_mobileResolveioFooter:[{type:ViewChild,args:["mobileResolveioFooter",{read:ElementRef}]}]}});class HomeComponent extends BaseComponent{_route;auth;_services;_http;_app;menuData={title:"Home",module:null,description:null,description_name:null,tabs:[{link:"home",params:null,label:"Home"}]};selectedSolution="Asset";loggingOut$=null;subscription$=null;isLoggedIn;form;constructor(t,e,n,o,r){super(n),this._route=t,this.auth=e,this._services=n,this._http=o,this._app=r}ngOnInit(){this._services._app.setNavbarModuleData(this.menuData),this.loggingOut$=this._app.isLoggingOut.subscribe(t=>{t||(this._services._account.getUser()?this._services._account.getUser().settings&&this._services._account.getUser().settings.opening_route&&"/home"!==this._services._account.getUser().settings.opening_route?this._services._router.navigateByUrl(this._services._account.getUser().settings.opening_route):"/home"!==this._services._router.url&&this._services._router.navigateByUrl("/home"):(this.subscription$&&this.subscription$.unsubscribe(),this.subscription$=this._services._account.user.subscribe(t=>{t&&t.settings&&t.settings.opening_route&&"/home"!==t.settings.opening_route?this._services._router.navigateByUrl(t.settings.opening_route):"/home"!==this._services._router.url&&this._services._router.navigateByUrl("/home")},()=>{})))})}ngOnDestroy(){this.subscription$&&this.subscription$.unsubscribe(),this.loggingOut$&&this.loggingOut$.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HomeComponent,deps:[{token:i1$1.ActivatedRoute},{token:AuthService},{token:ProviderService},{token:i4.HttpClient},{token:CoreService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:HomeComponent,isStandalone:!1,selector:"resolveio-home",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<div class="home-hero h-100">\n\t<div class="row h-100 m-0">\n\t\t<div class="col-lg-12 h-100">\n\t\t\t<div class="jumbotron jumbotron-fluid h-100 home-hero__jumbotron">\n\t\t\t\t<div class="container text-center h-100 home-hero__container">\n\t\t\t\t\t<img src="/assets/images/ResolveIO.png" class="img-fluid home-hero__logo" alt="ResolveIO logo" />\n\t\t\t\t\t<p class="home-hero__tagline">The All-in-One Solution Software</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".home-hero{height:100%;overflow-x:hidden}.home-hero__jumbotron{padding-bottom:0}.home-hero__container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding-left:1.5rem;padding-right:1.5rem}.home-hero__logo{width:100%;max-width:750px;height:auto;object-fit:contain}.home-hero__tagline{font-size:24px;font-style:italic}@media(max-width:767.98px){.home-hero__container{padding-left:1.25rem;padding-right:1.25rem}.home-hero__tagline{font-size:18px}}\n"]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HomeComponent,decorators:[{type:Component,args:[{selector:"resolveio-home",providers:[ProviderService],standalone:!1,template:'<div class="home-hero h-100">\n\t<div class="row h-100 m-0">\n\t\t<div class="col-lg-12 h-100">\n\t\t\t<div class="jumbotron jumbotron-fluid h-100 home-hero__jumbotron">\n\t\t\t\t<div class="container text-center h-100 home-hero__container">\n\t\t\t\t\t<img src="/assets/images/ResolveIO.png" class="img-fluid home-hero__logo" alt="ResolveIO logo" />\n\t\t\t\t\t<p class="home-hero__tagline">The All-in-One Solution Software</p>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',styles:[".home-hero{height:100%;overflow-x:hidden}.home-hero__jumbotron{padding-bottom:0}.home-hero__container{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;padding-left:1.5rem;padding-right:1.5rem}.home-hero__logo{width:100%;max-width:750px;height:auto;object-fit:contain}.home-hero__tagline{font-size:24px;font-style:italic}@media(max-width:767.98px){.home-hero__container{padding-left:1.25rem;padding-right:1.25rem}.home-hero__tagline{font-size:18px}}\n"]}]}],ctorParameters:()=>[{type:i1$1.ActivatedRoute},{type:AuthService},{type:ProviderService},{type:i4.HttpClient},{type:CoreService}]});class UserRoleComponent extends BaseComponent{_services;role;constructor(t){super(t),this._services=t}userInRole(){return this._services._account.isUserInView(this.role)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleComponent,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:UserRoleComponent,isStandalone:!1,selector:"user-role",inputs:{role:"role"},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"@if (userInRole()) {<ng-content></ng-content>}",isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"user-role",template:"@if (userInRole()) {<ng-content></ng-content>}",standalone:!1}]}],ctorParameters:()=>[{type:ProviderService}],propDecorators:{role:[{type:Input}]}});class UserRoleModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,declarations:[UserRoleComponent],imports:[CommonModule],exports:[UserRoleComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,imports:[CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserRoleModule,decorators:[{type:NgModule,args:[{imports:[CommonModule],exports:[UserRoleComponent],declarations:[UserRoleComponent]}]}]});class FormButtonModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,declarations:[FormButtonComponent],imports:[CommonModule,NgbTooltipModule],exports:[FormButtonComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,imports:[CommonModule,NgbTooltipModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FormButtonModule,decorators:[{type:NgModule,args:[{imports:[CommonModule,NgbTooltipModule],exports:[FormButtonComponent],declarations:[FormButtonComponent]}]}]});class ResponsiveButtonGroupModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,declarations:[ResponsiveButtonGroupComponent],imports:[CommonModule],exports:[ResponsiveButtonGroupComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,imports:[CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ResponsiveButtonGroupModule,decorators:[{type:NgModule,args:[{imports:[CommonModule],declarations:[ResponsiveButtonGroupComponent],exports:[ResponsiveButtonGroupComponent]}]}]});class CollapseTableModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,declarations:[CollapseTableComponent],imports:[FormsModule,CommonModule],exports:[CollapseTableComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,providers:[ResizeService],imports:[FormsModule,CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CollapseTableModule,decorators:[{type:NgModule,args:[{imports:[FormsModule,CommonModule],exports:[CollapseTableComponent],declarations:[CollapseTableComponent],providers:[ResizeService]}]}]});class PhonePipe{transform(t){if(!t)return"";let e,n,o;switch((t=(t=(t=(t=t.replace(new RegExp("-","g"),"")).replace(new RegExp(" ","g"),"")).replace("(","")).replace(")","")).length){case 10:e=1,n=t.slice(0,3),o=t.slice(3);break;case 11:e=t[0],n=t.slice(1,4),o=t.slice(4);break;case 12:e=t.slice(0,3),n=t.slice(3,5),o=t.slice(5);break;default:return t}return 1===e&&(e=""),o=o.slice(0,3)+"-"+o.slice(3),(e+" ("+n+") "+o).trim()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PhonePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:PhonePipe,isStandalone:!1,name:"phone"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PhonePipe,decorators:[{type:Pipe,args:[{name:"phone",standalone:!1}]}]});class ReversePipe{transform(t){return t.slice(0).reverse()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ReversePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:ReversePipe,isStandalone:!1,name:"reverse"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ReversePipe,decorators:[{type:Pipe,args:[{name:"reverse",standalone:!1}]}]});class MinusCurrencyPipe{transform(t,e){return"-"===t.charAt(0)?"("+t.substring(1,t.length)+")":t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:MinusCurrencyPipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:MinusCurrencyPipe,isStandalone:!1,name:"minusCurrency"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:MinusCurrencyPipe,decorators:[{type:Pipe,args:[{name:"minusCurrency",standalone:!1}]}]});class TitleCaseAndUnderscorePipe{transform(t){let e=t.replace("_"," ").toLowerCase().split(" ");for(let t=0;t<e.length;t++)e[t]=e[t].charAt(0).toUpperCase()+e[t].slice(1);return e.join(" ")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TitleCaseAndUnderscorePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:TitleCaseAndUnderscorePipe,isStandalone:!1,name:"titleCase",pure:!1})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:TitleCaseAndUnderscorePipe,decorators:[{type:Pipe,args:[{name:"titleCase",pure:!1,standalone:!1}]}]});class JsonParsePipe{transform(t){let e=null,n=!1;try{e=JSON.parse(t,dateReviver)}catch(t){n=!0}return n?t:JSON.stringify(e,null,2)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:JsonParsePipe,deps:[],target:i0.ɵɵFactoryTarget.Pipe});static"ɵpipe"=i0.ɵɵngDeclarePipe({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:JsonParsePipe,isStandalone:!1,name:"jsonParse",pure:!1})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:JsonParsePipe,decorators:[{type:Pipe,args:[{name:"jsonParse",pure:!1,standalone:!1}]}]});class PipeModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PipeModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:PipeModule,declarations:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe],exports:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PipeModule})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:PipeModule,decorators:[{type:NgModule,args:[{declarations:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe],exports:[FilterEqualPipe,FilterNotEqualPipe,PhonePipe,ReversePipe,MinusCurrencyPipe,DomSanitizorPipe,TitleCaseAndUnderscorePipe,JsonParsePipe]}]}]});class SortTableDirective{element;sortables=new Map;_stateChanges=new Subject;active;start=1;disabled=!1;tableFixed=!1;headerFixed=!1;secondaryColor=!1;tertiaryColor=!1;get direction(){return this._direction}set direction(t){if(t&&-1!==t&&1!==t)throw Error(t+" is not a valid sort direction (0 or 1).");this._direction=t}_direction=0;_data=new BehaviorSubject([]);sortChange=new EventEmitter;constructor(t){this.element=t}register(t){if(!t.id)throw Error("CTSortHeader must be provided with a unique id");if(this.sortables.has(t.id))throw Error("Cannot have two CTSortables with the same id "+t.id);this.sortables.set(t.id,t)}deregister(t){this.sortables.delete(t.id)}sort(t){if(this.active!=t.id?(this.active=t.id,this.direction=t.start?t.start:this.start):this.direction*=-1,this.sortChange.emit({active:this.active,direction:this.direction}),this._data.value.length){let e=null;for(let n=0;n<this._data.value.length;n++)if(t.id.split(".").reduce((t,e)=>t[e],this._data.value[n])){e=t.id.split(".").reduce((t,e)=>t[e],this._data.value[n]);break}if(null!=e)if("string"==typeof e){let e=new RegExp(/^[\d.,$]+$/);this._data.value.filter(e=>t.id.split(".").reduce((t,e)=>t[e],e)).some(n=>!e.test(t.id.split(".").reduce((t,e)=>t[e],n)))?1===this.direction?this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],e)||"zzzzzz").localeCompare(t.id.split(".").reduce((t,e)=>t[e],n)||"zzzzzz"))):this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],n)||"AAAAAAA").localeCompare(t.id.split(".").reduce((t,e)=>t[e],e)||"AAAAAAA"))):1===this.direction?this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],e)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],e).replace(/\$/g,"").replace(",","")):999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],n)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],n).replace(/\$/g,"").replace(",","")):999999999999))):this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],n)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],n).replace(/\$/g,"").replace(",","")):-999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],e)?parseFloat(t.id.split(".").reduce((t,e)=>t[e],e).replace(/\$/g,"").replace(",","")):-999999999999)))}else"number"==typeof e?1===this.direction?this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e):999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n):999999999999))):this._data.next(this._data.value.sort((e,n)=>(null!==t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n):-999999999999)-(null!==t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e):-999999999999))):e instanceof Date?1===this.direction?this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e).getTime():0)-(t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n).getTime():0))):this._data.next(this._data.value.sort((e,n)=>(t.id.split(".").reduce((t,e)=>t[e],n)?t.id.split(".").reduce((t,e)=>t[e],n).getTime():0)-(t.id.split(".").reduce((t,e)=>t[e],e)?t.id.split(".").reduce((t,e)=>t[e],e).getTime():0))):"boolean"==typeof e?this._data.next(this._data.value.sort((e,n)=>t.id.split(".").reduce((t,e)=>t[e],e)===t.id.split(".").reduce((t,e)=>t[e],n)?0:t.id.split(".").reduce((t,e)=>t[e],e)?1===this.direction?-1:1:1===this.direction?1:-1)):this._data.next(this._data.value.sort((e,n)=>t.id.split(".").reduce((t,e)=>t[e],e)===t.id.split(".").reduce((t,e)=>t[e],n)?0:t.id.split(".").reduce((t,e)=>t[e],e)>t.id.split(".").reduce((t,e)=>t[e],n)?-1:1))}}getData(){return this._data.asObservable()}setData(t){this._data.next(t)}ngOnInit(){}ngOnChanges(){this._stateChanges.next()}ngOnDestroy(){this._stateChanges.complete()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableDirective,deps:[{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:SortTableDirective,isStandalone:!1,selector:"[sortable]",inputs:{active:["sortActive","active"],start:["sortStart","start"],disabled:["sortDisabled","disabled"],tableFixed:"tableFixed",headerFixed:"headerFixed",secondaryColor:"secondaryColor",tertiaryColor:"tertiaryColor"},outputs:{sortChange:"sortChange"},usesOnChanges:!0,ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableDirective,decorators:[{type:Directive,args:[{selector:"[sortable]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef}],propDecorators:{active:[{type:Input,args:["sortActive"]}],start:[{type:Input,args:["sortStart"]}],disabled:[{type:Input,args:["sortDisabled"]}],tableFixed:[{type:Input}],headerFixed:[{type:Input}],secondaryColor:[{type:Input}],tertiaryColor:[{type:Input}],sortChange:[{type:Output,args:["sortChange"]}]}});class SortTableHeaderComponent{_sort;_arrowDirection=0;id;arrowPosition="after";start;_rerenderSubscription;disabled;constructor(t,e){if(this._sort=e,!e)throw Error("SortTableSortHeader must be placed within a parent element with the CTSortable directive.");this._rerenderSubscription=merge(e.sortChange,e._stateChanges).subscribe(()=>{this._isSorted()&&this._updateArrowDirection(),t.markForCheck()})}ngOnInit(){this._sort.register(this)}ngOnDestroy(){this._sort.deregister(this),this._rerenderSubscription.unsubscribe()}_isSorted(){return this._sort.active===this.id}_getSortDirection(){return this._sort.direction}_updateArrowDirection(){this._arrowDirection=this._isSorted()?this._sort.direction:this.start||this._sort.start}_isDisabled(){return this._sort.disabled||this.disabled}onClick(t){this._isDisabled()||this._sort.sort(this)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableHeaderComponent,deps:[{token:i0.ChangeDetectorRef},{token:SortTableDirective,optional:!0}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:SortTableHeaderComponent,isStandalone:!1,selector:"[sort-table-header]",inputs:{disabled:"disabled",id:["sort-table-header","id"],arrowPosition:"arrowPosition",start:"start"},ngImport:i0,template:'<div (click)="onClick($event)">\n\t<ng-content></ng-content>\n\t@if (_isSorted() && _getSortDirection() === -1) {\n\t\t<i class="fa fa-arrow-down" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n\t@if (_isSorted() && _getSortDirection() === 1) {\n\t\t<i class="fa fa-arrow-up" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n</div>\n',changeDetection:i0.ChangeDetectionStrategy.OnPush,encapsulation:i0.ViewEncapsulation.None})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableHeaderComponent,decorators:[{type:Component,args:[{selector:"[sort-table-header]",encapsulation:ViewEncapsulation.None,changeDetection:ChangeDetectionStrategy.OnPush,inputs:["disabled"],standalone:!1,template:'<div (click)="onClick($event)">\n\t<ng-content></ng-content>\n\t@if (_isSorted() && _getSortDirection() === -1) {\n\t\t<i class="fa fa-arrow-down" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n\t@if (_isSorted() && _getSortDirection() === 1) {\n\t\t<i class="fa fa-arrow-up" style="margin-left: 10px; font-size: 14px"></i>\n\t}\n</div>\n'}]}],ctorParameters:()=>[{type:i0.ChangeDetectorRef},{type:SortTableDirective,decorators:[{type:Optional}]}],propDecorators:{id:[{type:Input,args:["sort-table-header"]}],arrowPosition:[{type:Input}],start:[{type:Input}],disabled:[{type:Input}]}});class SortTableNgForComponent{_sort;data=[];dataChanged=new EventEmitter;sortSub$=null;sortedData=[];constructor(t){if(this._sort=t,!t)throw Error("SortTableNgFor must be placed within a parent element with the CTSortable directive.")}ngOnInit(){this.sortSub$=this._sort.getData().subscribe(t=>{this.sortedData=t,this.dataChanged.emit(this.sortedData)})}ngOnChanges(){this._sort.setData(this.data)}ngOnDestroy(){this.sortSub$.unsubscribe()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableNgForComponent,deps:[{token:SortTableDirective,optional:!0}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:SortTableNgForComponent,isStandalone:!1,selector:"[sort-table-ngfor]",inputs:{data:["sort-table-ngfor","data"]},outputs:{dataChanged:"dataChanged"},usesOnChanges:!0,ngImport:i0,template:"<ng-content></ng-content>",isInline:!0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableNgForComponent,decorators:[{type:Component,args:[{selector:"[sort-table-ngfor]",template:"<ng-content></ng-content>",standalone:!1}]}],ctorParameters:()=>[{type:SortTableDirective,decorators:[{type:Optional}]}],propDecorators:{data:[{type:Input,args:["sort-table-ngfor"]}],dataChanged:[{type:Output}]}});class SortTableModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,declarations:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent],imports:[FormsModule,CommonModule],exports:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,imports:[FormsModule,CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortTableModule,decorators:[{type:NgModule,args:[{imports:[FormsModule,CommonModule],exports:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent],declarations:[SortTableDirective,SortTableHeaderComponent,SortTableNgForComponent]}]}]});class Sortable{container;options;dragItem;startIndex;listeners=[];direction;swapThreshold;constructor(t,e={}){this.container=t,this.options=e,this.direction=this.resolveDirection(),this.swapThreshold=this.resolveSwapThreshold(),this.bindListeners(),this.ensureDraggable()}static create(t,e={}){return new Sortable(t,e)}destroy(){this.listeners.forEach(t=>t()),this.listeners=[],this.dragItem=void 0,this.startIndex=void 0}bindListeners(){const t=(t,e)=>{this.container.addEventListener(t,e),this.listeners.push(()=>this.container.removeEventListener(t,e))};t("dragstart",this.handleDragStart),t("dragover",this.handleDragOver),t("drop",this.handleDrop),t("dragend",this.handleDragEnd)}handleDragStart=t=>{const e=this.getSortableElement(t.target);if(e&&this.hasValidHandle(t.target,e)&&(this.ensureDraggable(),this.dragItem=e,this.startIndex=this.getElementIndex(e),t.dataTransfer)){t.dataTransfer.effectAllowed="move";try{t.dataTransfer.setData("text/plain","")}catch{}}};handleDragOver=t=>{if(!this.dragItem)return;const e=this.getSortableElement(t.target);if(!e||e===this.dragItem)return;t.preventDefault();const n=e.getBoundingClientRect(),o=("horizontal"===this.direction?t.clientX-n.left>n.width*this.swapThreshold:t.clientY-n.top>n.height*this.swapThreshold)?e.nextElementSibling:e;o!==this.dragItem&&this.container.insertBefore(this.dragItem,o)};handleDrop=t=>{this.dragItem&&(t.preventDefault(),this.finish(t))};handleDragEnd=t=>{this.dragItem&&(t.preventDefault(),this.finish(t))};finish(t){if(!this.dragItem)return;const e=this.getElementIndex(this.dragItem),n={oldIndex:this.startIndex,newIndex:e,item:this.dragItem,from:this.container,to:this.container};this.options.onEnd&&this.options.onEnd(n),this.options.onUpdate&&void 0!==this.startIndex&&e!==this.startIndex&&this.options.onUpdate(n),this.dragItem=void 0,this.startIndex=void 0}ensureDraggable(){this.getItems().forEach(t=>{t.getAttribute("draggable")||t.setAttribute("draggable","true")})}getItems(){return(this.options.draggable?Array.from(this.container.querySelectorAll(this.options.draggable)):Array.from(this.container.children)).filter(t=>t.parentElement===this.container)}getSortableElement(t){if(!t)return null;let e=t;for(;e&&e!==this.container;){if(this.isSortableItem(e))return e;e=e.parentElement}return null}isSortableItem(t){return this.options.draggable?t.matches(this.options.draggable)&&t.parentElement===this.container:t.parentElement===this.container}hasValidHandle(t,e){if(!this.options.handle||!t)return!0;const n=t.closest(this.options.handle);return!!n&&e.contains(n)}getElementIndex(t){return this.getItems().indexOf(t)}resolveDirection(){if("horizontal"===this.options.direction||"vertical"===this.options.direction)return this.options.direction;const t=this.container.tagName.toLowerCase();if("tr"===t)return"horizontal";if("tbody"===t||"ul"===t||"ol"===t)return"vertical";const e=window.getComputedStyle(this.container),n="flex"===e.display&&e.flexDirection.startsWith("row"),o="grid"===e.display&&e.gridAutoFlow.includes("column");return n||o?"horizontal":"vertical"}resolveSwapThreshold(){const t="number"==typeof this.options.swapThreshold?this.options.swapThreshold:.45;return t>0&&t<1?t:.45}}const SORTABLEJS_DEFAULT_OPTIONS=new InjectionToken("SORTABLEJS_DEFAULT_OPTIONS");class SortablejsDirective{_el;defaultOptions;items;options;sortableInstance;constructor(t,e){this._el=t,this.defaultOptions=e}ngOnInit(){const t={animation:150,onEnd:t=>{this.updateOrder(t),this.options&&"function"==typeof this.options.onEnd&&this.options.onEnd(t),this.options&&"function"==typeof this.options.onUpdate&&t.oldIndex!==t.newIndex&&this.options.onUpdate(t)}},e=Object.assign({},t,this.defaultOptions||{},this.options||{});this.sortableInstance=Sortable.create(this._el.nativeElement,e)}ngOnDestroy(){this.sortableInstance&&this.sortableInstance.destroy()}updateOrder(t){if(this.items&&void 0!==t.oldIndex&&void 0!==t.newIndex&&t.oldIndex!==t.newIndex)if(this.isFormArray(this.items)){const e=this.items.at(t.oldIndex);this.items.removeAt(t.oldIndex),this.items.insert(t.newIndex,e)}else if(Array.isArray(this.items)){const e=this.items.splice(t.oldIndex,1)[0];this.items.splice(t.newIndex,0,e)}}isFormArray(t){return t&&"function"==typeof t.at&&"function"==typeof t.removeAt&&"function"==typeof t.insert}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsDirective,deps:[{token:i0.ElementRef},{token:SORTABLEJS_DEFAULT_OPTIONS,optional:!0}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:SortablejsDirective,isStandalone:!1,selector:"[sortablejs]",inputs:{items:["sortablejs","items"],options:["sortablejsOptions","options"]},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsDirective,decorators:[{type:Directive,args:[{selector:"[sortablejs]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:void 0,decorators:[{type:Optional},{type:Inject,args:[SORTABLEJS_DEFAULT_OPTIONS]}]}],propDecorators:{items:[{type:Input,args:["sortablejs"]}],options:[{type:Input,args:["sortablejsOptions"]}]}});class SortablejsModule{static forRoot(t){return{ngModule:SortablejsModule,providers:t?[{provide:SORTABLEJS_DEFAULT_OPTIONS,useValue:t}]:[]}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule,declarations:[SortablejsDirective],exports:[SortablejsDirective]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SortablejsModule,decorators:[{type:NgModule,args:[{declarations:[SortablejsDirective],exports:[SortablejsDirective]}]}]});class NgDragDropService{dragData;dragEffect=null;scope=null;onDragStart=new Subject;onDragEnd=new Subject;static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropService,providedIn:"root"})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropService,decorators:[{type:Injectable,args:[{providedIn:"root"}]}]});class DomHelper{static addClass(t,e){const n=this.resolveElement(t);n&&(n.classList.contains(e)||n.classList.add(e))}static removeClass(t,e){const n=this.resolveElement(t);n&&n.classList.remove(e)}static matches(t,e){if(!t)return!1;const n=t.matches||t.msMatchesSelector||t.mozMatchesSelector||t.webkitMatchesSelector;return!!n&&n.call(t,e)}static resolveElement(t){return t?t.nativeElement?t.nativeElement:t:null}}class Draggable{el;renderer;ng2DragDropService;zone;dragData;dragHandle;dragEffect="move";dragScope="default";dragHandleClass="drag-handle";dragClass="drag-border";dragTransitClass="drag-transit";onDragStart=new EventEmitter;onDrag=new EventEmitter;onDragEnd=new EventEmitter;mouseDownElement;_dragEnabled=!0;_dragImage;dragImageElement;unbindDragListener;constructor(t,e,n,o){this.el=t,this.renderer=e,this.ng2DragDropService=n,this.zone=o}get dragEnabled(){return this._dragEnabled}set dragEnabled(t){this._dragEnabled=t,this.applyDragHandleClass()}get dragImage(){return this._dragImage}set dragImage(t){this._dragImage=t,this.dragImageElement=new Image,this.dragImageElement.src=this._dragImage}ngOnInit(){this.applyDragHandleClass()}ngOnDestroy(){this.unbindDragListeners()}dragStart(t){if(this.allowDrag()){DomHelper.addClass(this.el,this.dragTransitClass),setTimeout(()=>{DomHelper.addClass(this.el,this.dragClass),DomHelper.removeClass(this.el,this.dragTransitClass)},10),this.ng2DragDropService.dragData=this.dragData,this.ng2DragDropService.scope=this.dragScope,this.ng2DragDropService.dragEffect=this.dragEffect;const e=this.getDragHandleElement();e&&this.updateCursor(e,"grabbing"),null!=t.dataTransfer&&(t.dataTransfer.effectAllowed=this.dragEffect,t.dataTransfer.dropEffect=this.dragEffect,t.dataTransfer.setData("text","")),this.dragImage&&t.dataTransfer&&t.dataTransfer.setDragImage(this.dragImageElement,0,0),t.stopPropagation(),this.onDragStart.emit(t),this.ng2DragDropService.onDragStart.next(),this.zone.runOutsideAngular(()=>{this.unbindDragListener=this.renderer.listen(this.el.nativeElement,"drag",t=>{this.drag(t)})})}else t.preventDefault()}drag(t){this.onDrag.emit(t)}dragEnd(t){this.unbindDragListeners(),DomHelper.removeClass(this.el,this.dragClass),this.ng2DragDropService.dragData=null,this.ng2DragDropService.dragEffect=null,this.ng2DragDropService.scope=null;const e=this.getDragHandleElement();e&&this.updateCursor(e,this.dragEnabled?"grab":null),this.ng2DragDropService.onDragEnd.next(),this.onDragEnd.emit(t),t.stopPropagation(),t.preventDefault()}mousedown(t){this.mouseDownElement=t.target}allowDrag(){return this.dragHandle?DomHelper.matches(this.mouseDownElement,this.dragHandle)&&this.dragEnabled:this.dragEnabled}applyDragHandleClass(){const t=this.getDragHandleElement();t&&(this.dragEnabled?DomHelper.addClass(t,this.dragHandleClass):DomHelper.removeClass(t,this.dragHandleClass),this.updateCursor(t,this.dragEnabled?"grab":null))}getDragHandleElement(){let t=this.el.nativeElement;return this.dragHandle&&(t=this.el.nativeElement.querySelector(this.dragHandle)),t}unbindDragListeners(){this.unbindDragListener&&this.unbindDragListener()}updateCursor(t,e){e?this.renderer.setStyle(t,"cursor",e):this.renderer.removeStyle(t,"cursor")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Draggable,deps:[{token:i0.ElementRef},{token:i0.Renderer2},{token:NgDragDropService},{token:i0.NgZone}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:Draggable,isStandalone:!1,selector:"[draggable]",inputs:{dragData:"dragData",dragHandle:"dragHandle",dragEffect:"dragEffect",dragScope:"dragScope",dragHandleClass:"dragHandleClass",dragClass:"dragClass",dragTransitClass:"dragTransitClass",dragEnabled:"dragEnabled",dragImage:"dragImage"},outputs:{onDragStart:"onDragStart",onDrag:"onDrag",onDragEnd:"onDragEnd"},host:{listeners:{dragstart:"dragStart($event)",dragend:"dragEnd($event)",mousedown:"mousedown($event)",touchstart:"mousedown($event)"},properties:{draggable:"this.dragEnabled"}},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Draggable,decorators:[{type:Directive,args:[{selector:"[draggable]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:i0.Renderer2},{type:NgDragDropService},{type:i0.NgZone}],propDecorators:{dragData:[{type:Input}],dragHandle:[{type:Input}],dragEffect:[{type:Input}],dragScope:[{type:Input}],dragHandleClass:[{type:Input}],dragClass:[{type:Input}],dragTransitClass:[{type:Input}],onDragStart:[{type:Output}],onDrag:[{type:Output}],onDragEnd:[{type:Output}],dragEnabled:[{type:Input},{type:HostBinding,args:["draggable"]}],dragImage:[{type:Input}],dragStart:[{type:HostListener,args:["dragstart",["$event"]]}],dragEnd:[{type:HostListener,args:["dragend",["$event"]]}],mousedown:[{type:HostListener,args:["mousedown",["$event"]]},{type:HostListener,args:["touchstart",["$event"]]}]}});class DropEvent{nativeEvent;dragData;constructor(t,e){this.nativeEvent=t,this.dragData=e}}class Droppable{el;renderer;ng2DragDropService;zone;onDragEnter=new EventEmitter;onDragOver=new EventEmitter;onDragLeave=new EventEmitter;onDrop=new EventEmitter;dragOverClass="drag-over-border";dragHintClass="drag-hint-border";dropScope="default";_dropEnabled=!0;_isDragActive=!1;_isServiceActive=!1;dragStartSubscription;dragEndSubscription;unbindDragEnterListener;unbindDragOverListener;unbindDragLeaveListener;constructor(t,e,n,o){this.el=t,this.renderer=e,this.ng2DragDropService=n,this.zone=o}get dropEnabled(){return this._dropEnabled}set dropEnabled(t){this._dropEnabled=t,!0===this._dropEnabled?this.subscribeService():this.unsubscribeService()}ngOnInit(){!0===this.dropEnabled&&this.subscribeService()}ngOnDestroy(){this.unsubscribeService(),this.unbindDragListeners()}drop(t){this.allowDrop().subscribe(e=>{e&&this._isDragActive&&(DomHelper.removeClass(this.el,this.dragOverClass),t.preventDefault(),t.stopPropagation(),this.ng2DragDropService.onDragEnd.next(),this.onDrop.emit(new DropEvent(t,this.ng2DragDropService.dragData)),this.ng2DragDropService.dragData=null,this.ng2DragDropService.dragEffect=null,this.ng2DragDropService.scope=null)})}dragEnter(t){t.preventDefault(),t.stopPropagation(),this.onDragEnter.emit(t)}dragOver(t,e){if(e){if(DomHelper.addClass(this.el,this.dragOverClass),t.dataTransfer){const e=this.ng2DragDropService.dragEffect??"move";t.dataTransfer.dropEffect=e}t.preventDefault(),this.onDragOver.emit(t)}}dragLeave(t){DomHelper.removeClass(this.el,this.dragOverClass),t.preventDefault(),this.onDragLeave.emit(t)}allowDrop(){let t=!1;if("string"==typeof this.dropScope)"string"==typeof this.ng2DragDropService.scope?t=this.ng2DragDropService.scope===this.dropScope:this.ng2DragDropService.scope instanceof Array&&(t=this.ng2DragDropService.scope.indexOf(this.dropScope)>-1);else if(this.dropScope instanceof Array)"string"==typeof this.ng2DragDropService.scope?t=this.dropScope.indexOf(this.ng2DragDropService.scope)>-1:this.ng2DragDropService.scope instanceof Array&&(t=this.dropScope.filter(t=>-1!==this.ng2DragDropService.scope.indexOf(t)).length>0);else if("function"==typeof this.dropScope&&(t=this.dropScope(this.ng2DragDropService.dragData),t instanceof Observable))return t.pipe(map(t=>t&&this.dropEnabled));return of(t&&this.dropEnabled)}subscribeService(){!0!==this._isServiceActive&&(this._isServiceActive=!0,this.dragStartSubscription=this.ng2DragDropService.onDragStart.subscribe(()=>{this._isDragActive=!0,this.allowDrop().subscribe(t=>{t&&this._isDragActive&&(DomHelper.addClass(this.el,this.dragHintClass),this.zone.runOutsideAngular(()=>{this.unbindDragEnterListener=this.renderer.listen(this.el.nativeElement,"dragenter",t=>{this.dragEnter(t)}),this.unbindDragOverListener=this.renderer.listen(this.el.nativeElement,"dragover",e=>{this.dragOver(e,t)}),this.unbindDragLeaveListener=this.renderer.listen(this.el.nativeElement,"dragleave",t=>{this.dragLeave(t)})}))})}),this.dragEndSubscription=this.ng2DragDropService.onDragEnd.subscribe(()=>{this._isDragActive=!1,DomHelper.removeClass(this.el,this.dragHintClass),this.unbindDragListeners()}))}unsubscribeService(){this._isServiceActive=!1,this.dragStartSubscription&&this.dragStartSubscription.unsubscribe(),this.dragEndSubscription&&this.dragEndSubscription.unsubscribe()}unbindDragListeners(){this.unbindDragEnterListener&&this.unbindDragEnterListener(),this.unbindDragOverListener&&this.unbindDragOverListener(),this.unbindDragLeaveListener&&this.unbindDragLeaveListener()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Droppable,deps:[{token:i0.ElementRef},{token:i0.Renderer2},{token:NgDragDropService},{token:i0.NgZone}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:Droppable,isStandalone:!1,selector:"[droppable]",inputs:{dragOverClass:"dragOverClass",dragHintClass:"dragHintClass",dropScope:"dropScope",dropEnabled:"dropEnabled"},outputs:{onDragEnter:"onDragEnter",onDragOver:"onDragOver",onDragLeave:"onDragLeave",onDrop:"onDrop"},host:{listeners:{drop:"drop($event)"}},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Droppable,decorators:[{type:Directive,args:[{selector:"[droppable]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef},{type:i0.Renderer2},{type:NgDragDropService},{type:i0.NgZone}],propDecorators:{onDragEnter:[{type:Output}],onDragOver:[{type:Output}],onDragLeave:[{type:Output}],onDrop:[{type:Output}],dragOverClass:[{type:Input}],dragHintClass:[{type:Input}],dropScope:[{type:Input}],dropEnabled:[{type:Input}],drop:[{type:HostListener,args:["drop",["$event"]]}]}});class NgDragDropModule{static forRoot(){return{ngModule:NgDragDropModule,providers:[NgDragDropService]}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule,declarations:[Draggable,Droppable],exports:[Draggable,Droppable]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:NgDragDropModule,decorators:[{type:NgModule,args:[{declarations:[Draggable,Droppable],exports:[Draggable,Droppable]}]}]});class SharedModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,imports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule],exports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,imports:[ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SharedModule,decorators:[{type:NgModule,args:[{imports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule],exports:[AiFormAutoRegisterDirective,TourAnchorDirective,ReactiveFormsModule,FormsModule,CollapseTableModule,RouterModule,NgbModule,NgbAccordionModule,FormButtonModule,ResponsiveButtonGroupModule,PipeModule,UserRoleModule,RioSelectModule,SortTableModule,CommonModule,SortablejsModule,NgDragDropModule,RioDatePickerModule]}]}]});class AiTerminalModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,declarations:[AiTerminalComponent],imports:[SharedModule],exports:[AiTerminalComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AiTerminalModule,decorators:[{type:NgModule,args:[{imports:[SharedModule],declarations:[AiTerminalComponent],exports:[AiTerminalComponent]}]}]});class FocusDirective{element;focus;constructor(t){this.element=t}ngOnChanges(){this.focus&&this.element.nativeElement.focus()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FocusDirective,deps:[{token:i0.ElementRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:FocusDirective,isStandalone:!1,selector:"[focus]",inputs:{focus:"focus"},usesOnChanges:!0,ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FocusDirective,decorators:[{type:Directive,args:[{selector:"[focus]",standalone:!1}]}],ctorParameters:()=>[{type:i0.ElementRef}],propDecorators:{focus:[{type:Input}]}});class RioSelectStickyAdapterService{_account;_socket;constructor(t,e){this._account=t,this._socket=e}get userChanges(){return this._account.user.asObservable()}getUser(){return this._account.getUser()}saveStickySelects(t,e="rio-select"){const n=this._account.getUser();if(!n)return;const o={...n.other||{},stickySelects:t},r={...n,other:o};return this._account.setUser(r),this._socket.call("saveUserStickySelects",t,n._id).then(e=>{const o=this._account.getUser();if(!o||o._id!==n._id)return;const r=e?.stickySelects||t,i={...o,__v:e?.__v??o.__v,other:{...o.other||{},stickySelects:r}};this._account.setUser(i)}).catch(()=>{})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioSelectStickyAdapterService,deps:[{token:AccountManagerService},{token:SocketManagerService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioSelectStickyAdapterService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioSelectStickyAdapterService,decorators:[{type:Injectable}],ctorParameters:()=>[{type:AccountManagerService},{type:SocketManagerService}]});class AuthGuard{_router;_auth;_ds;_account;_app;_offline;_aps;_alert;_featureGates;redirectUrl;constructor(t,e,n,o,r,i,a,s,l){this._router=t,this._auth=e,this._ds=n,this._account=o,this._app=r,this._offline=i,this._aps=a,this._alert=s,this._featureGates=l}canActivate(t,e){return new Promise(t=>{this._account.isInitCompleted().then(()=>{let n=this._account.getUser();if(n||(n=this._offline.getUser(),n&&this._account.setUser(n)),n)if(n.active){let o=e.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,""),r=o.replace(/([^\/]+\/?$)/,"");if(this.isLinkGateEnabled(o))if(n.roles.super_admin)t(!0);else{let e=!1;for(;!e&&o.split("/").length>2;){if(!this.isLinkFakeRoute(o))if(n.roles.groups.some(t=>t.views.some(t=>t===o)))e=!0,t(!0);else if(n.roles.groups.some(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))){let o=n.roles.groups.filter(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))[0].views.filter(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t))[0];e=!0,this._router.navigateByUrl(o),t(!1)}r=r.replace(/([^\/]+\/?$)/,""),o=o.replace(/(\/[^\/]+$)/,"")}e||(this._router.navigateByUrl("/home"),t(!1))}else this._router.navigateByUrl("/home"),t(!1)}else this._router.navigateByUrl("/home"),t(!1);else if(navigator.onLine)this._auth.loginUser().then(o=>{this._account.isLoginCompleted().then(()=>{if(n=this._account.getUser(),n.active){let o=e.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,""),r=o.replace(/([^\/]+\/?$)/,"");if(this.isLinkGateEnabled(o))if(n.roles.super_admin)t(!0);else{let e=!1;for(;!e&&o.split("/").length>2;){if(!this.isLinkFakeRoute(o))if(n.roles.groups.some(t=>t.views.some(t=>t===o)))e=!0,t(!0);else if(n.roles.groups.some(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))){let o=n.roles.groups.filter(t=>t.views.some(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t)))[0].views.filter(t=>t.startsWith(r)&&!this.doesLinkHaveParameter(t)&&!this.isLinkFakeRoute(t))[0];e=!0,this._router.navigateByUrl(o),t(!1)}r=r.replace(/([^\/]+\/?$)/,""),o=o.replace(/(\/[^\/]+$)/,"")}e||(this._router.navigateByUrl("/home"),t(!1))}else this._router.navigateByUrl("/home"),t(!1)}else this._router.navigateByUrl("/home"),t(!1)})},()=>{this._router.navigateByUrl("/home"),t(!1)});else{let n=e.url.replace(/\/[a-f0-9]{24}$/,"").replace(/\?.+$/,"");this.isLinkGateEnabled(n)?t(!0):(this._router.navigateByUrl("/home"),t(!1))}},()=>{})})}doesLinkHaveParameter(t){let e=this._aps.getAllModulePermissions();for(let n=0;n<e.length;n++){let o=e[n];for(let e=0;e<o.views.length;e++){let n=o.views[e];if(n.link===t)return!!n.has_parameter}}return!1}isLinkGateEnabled(t){const e=this._aps.getAllModulePermissions();return this._featureGates.isLinkEnabled(t,e)}isLinkFakeRoute(t){let e=this._aps.getAllModulePermissions();for(let n=0;n<e.length;n++){let o=e[n];for(let e=0;e<o.views.length;e++){let n=o.views[e];if(n.link===t)return!!n.fake_route}}return!0}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthGuard,deps:[{token:i1$1.Router},{token:AuthService},{token:DialogService},{token:AccountManagerService},{token:CoreService},{token:OfflineManagerService},{token:AuthPermissionService},{token:AlertService},{token:FeatureGateService}],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthGuard})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:AuthGuard,decorators:[{type:Injectable}],ctorParameters:()=>[{type:i1$1.Router},{type:AuthService},{type:DialogService},{type:AccountManagerService},{type:CoreService},{type:OfflineManagerService},{type:AuthPermissionService},{type:AlertService},{type:FeatureGateService}]});class CanDeactivateGuard{canDeactivate(t){return!t.canDeactivate||t.canDeactivate()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CanDeactivateGuard,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CanDeactivateGuard})}function getWindow(){return window}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CanDeactivateGuard,decorators:[{type:Injectable}]});class WindowRefService{get nativeWindow(){return getWindow()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:WindowRefService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:WindowRefService})}function rioDatePickerConfigFactory(t,e){return{resolveFirstDayOfWeek:()=>{const e=t.getUser()?.other?.date_picker_day_start;if("M"===e||"S"===e)return e;if("string"==typeof e){const t=e.toUpperCase();if("M"===t||"S"===t)return t}return 1===e?"M":7===e||0===e?"S":null},resolveTimezone:()=>e.environment.value?.TZ_CLIENT||null}}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:WindowRefService,decorators:[{type:Injectable}]});class CoreServicesModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,imports:[BrowserAnimationsModule,i1.ToastrModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,providers:[CoreService,AuthService,AuthGuard,CanDeactivateGuard,DialogService,ValidationService,AwsService,AuthPermissionService,FeatureGateService,WindowRefService,AlertService,SocketService,SocketManagerService,TokenManagerService,AccountManagerService,OfflineManagerService,DeviceDetectorService,LocalStorageService,RioSelectStickyAdapterService,{provide:RIO_SELECT_STICKY_ADAPTER,useExisting:RioSelectStickyAdapterService},{provide:RIO_DATE_PICKER_CONFIG,useFactory:rioDatePickerConfigFactory,deps:[AccountManagerService,CoreService]},provideHttpClient(withInterceptorsFromDi())],imports:[BrowserAnimationsModule,ToastrModule.forRoot()]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreServicesModule,decorators:[{type:NgModule,args:[{imports:[BrowserAnimationsModule,ToastrModule.forRoot()],providers:[CoreService,AuthService,AuthGuard,CanDeactivateGuard,DialogService,ValidationService,AwsService,AuthPermissionService,FeatureGateService,WindowRefService,AlertService,SocketService,SocketManagerService,TokenManagerService,AccountManagerService,OfflineManagerService,DeviceDetectorService,LocalStorageService,RioSelectStickyAdapterService,{provide:RIO_SELECT_STICKY_ADAPTER,useExisting:RioSelectStickyAdapterService},{provide:RIO_DATE_PICKER_CONFIG,useFactory:rioDatePickerConfigFactory,deps:[AccountManagerService,CoreService]},provideHttpClient(withInterceptorsFromDi())]}]}]});class CoreShellModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,declarations:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective],imports:[CommonModule,RouterModule,PipeModule,NgbModalModule,AiTerminalModule,CoreServicesModule,TourAnchorDirective,CoreTourOverlayComponent],exports:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,providers:[TourService,{provide:UI_TOUR_OPTIONS,useValue:{}}],imports:[CommonModule,RouterModule,PipeModule,NgbModalModule,AiTerminalModule,CoreServicesModule,CoreTourOverlayComponent]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreShellModule,decorators:[{type:NgModule,args:[{declarations:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective],imports:[CommonModule,RouterModule,PipeModule,NgbModalModule,AiTerminalModule,CoreServicesModule,TourAnchorDirective,CoreTourOverlayComponent],exports:[CoreComponent,HomeComponent,AiAssistantComponent,NavbarMainComponent,NavbarModuleComponent,FocusDirective,ScrollDirective],providers:[TourService,{provide:UI_TOUR_OPTIONS,useValue:{}}]}]}]});class ForgotPasswordComponent extends BaseComponent{_route;_services;_http;_ds;serverURL="";form;user;subscription$=[];token;disableFormButton=!1;constructor(t,e,n,o){super(e),this._route=t,this._services=e,this._http=n,this._ds=o}ngOnInit(){2!==this._route.snapshot.queryParamMap.keys.length?(this._ds.error("Invalid params"),this._services._router.navigateByUrl("/home")):(this.serverURL=this._route.snapshot.queryParamMap.keys[0],this.token=this._route.snapshot.queryParamMap.keys[1]),this.form=this._services._fb.group({password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]],confirm_password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]]},{validator:this._services._vs.matchPassword}),this._http.post(this.serverURL+"/userWithForgotPasswordToken",{forgotPasswordToken:this.token}).toPromise().then(t=>{t.error?(this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")):this.user=t.result.user},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")})}ngOnDestroy(){this.subscription$.forEach(t=>{t.unsubscribe()})}submit(){this.disableFormButton=!0,this._http.post(this.serverURL+"/setUserWithForgotPasswordToken",{forgotPasswordToken:this.token,password:this.form.value.password}).toPromise().then(t=>{t.error?(this._ds.error("Could not update user"),this._services._router.navigateByUrl("/home")):(this._services._alert.setAlert("success","User has been updated, please log in"),this._services._router.navigateByUrl("/home"))},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")}),this._services._router.navigateByUrl("/home")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ForgotPasswordComponent,deps:[{token:i1$1.ActivatedRoute},{token:ProviderService},{token:i4.HttpClient},{token:DialogService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:ForgotPasswordComponent,isStandalone:!1,selector:"resolveio-forgot-password",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && form.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n',styles:["input{width:100%}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:ForgotPasswordComponent,decorators:[{type:Component,args:[{selector:"resolveio-forgot-password",providers:[ProviderService],standalone:!1,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && form.valid ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n'}]}],ctorParameters:()=>[{type:i1$1.ActivatedRoute},{type:ProviderService},{type:i4.HttpClient},{type:DialogService}]});class EnrollComponent extends BaseComponent{_route;_services;_http;_ds;serverURL="";form;user;subscription$=[];token;disableFormButton=!1;constructor(t,e,n,o){super(e),this._route=t,this._services=e,this._http=n,this._ds=o}ngOnInit(){2!==this._route.snapshot.queryParamMap.keys.length?(this._ds.error("Invalid params"),this._services._router.navigateByUrl("/home")):(this.serverURL=this._route.snapshot.queryParamMap.keys[0],this.token=this._route.snapshot.queryParamMap.keys[1]),this.form=this._services._fb.group({password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]],confirm_password:["",[Validators.compose([Validators.required,Validators.minLength(6)])]]},{validator:this._services._vs.matchPassword}),this._http.post(this.serverURL+"/userWithEnrollmentToken",{enrollmentToken:this.token}).toPromise().then(t=>{t.error?(this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")):this.user=t.result.user},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")})}ngOnDestroy(){this.subscription$.forEach(t=>{t.unsubscribe()})}submit(){this.disableFormButton=!0,this._http.post(this.serverURL+"/setUserWithEnrollmentToken",{enrollmentToken:this.token,password:this.form.value.password}).toPromise().then(t=>{t.error?(this._ds.error("Could not update user"),this._services._router.navigateByUrl("/home")):(this._services._alert.setAlert("success","User has been updated, please log in"),this._services._router.navigateByUrl("/home"))},t=>{this._ds.error("Invalid token"),this._services._router.navigateByUrl("/home")})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:EnrollComponent,deps:[{token:i1$1.ActivatedRoute},{token:ProviderService},{token:i4.HttpClient},{token:DialogService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:EnrollComponent,isStandalone:!1,selector:"resolveio-enroll",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n',styles:["input{width:100%}\n"],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:EnrollComponent,decorators:[{type:Component,args:[{selector:"resolveio-enroll",providers:[ProviderService],standalone:!1,template:'<style>\n\tinput {\n\t\twidth: 100%;\n\t}\n</style>\n\n@if (user) {\n\t<h4>\n\t\tWelcome to ResolveIO.\n\t\t<br />\n\t\t<br />\n\t\tYour username will be {{ user.username }}. Please create a password for your account.\n\t</h4>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submit()">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Username</label>\n\t\t\t\t\t{{ user.username }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Password</label>\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\') || form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.controls.password.hasError(\'minlength\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password must be 6 or more characters</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (!form.controls.password.hasError(\'minlength\') && form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<div class="form-group">\n\t\t\t\t\t<label class="form-control-label">Confirm Password</label>\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<em>- Required</em>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<em>- Invalid</em>\n\t\t\t\t\t}\n\t\t\t\t\t<input type="text" [ngClass]="[\'form-control\', form.controls.confirm_password.valid && !form.hasError(\'matchPassword\') ? \'is-valid\' : \'is-invalid\']" formControlName="confirm_password" type="password" autocomplete="new-password" />\n\t\t\t\t\t@if (form.controls.confirm_password.hasError(\'required\')) {\n\t\t\t\t\t\t<div class="invalid-feedback">Password is required</div>\n\t\t\t\t\t}\n\t\t\t\t\t@if (form.hasError(\'matchPassword\')) {\n\t\t\t\t\t\t<div class="invalid-feedback" align="start">Passwords do not match</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="row" style="margin-top: 30px">\n\t\t\t<div class="col-lg-12">\n\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t</div>\n\t\t</div>\n\t</form>\n}\n'}]}],ctorParameters:()=>[{type:i1$1.ActivatedRoute},{type:ProviderService},{type:i4.HttpClient},{type:DialogService}]});class Auth365Component extends BaseComponent{_app;_route;_services;_http;_ds;_socket;token;constructor(t,e,n,o,r,i){super(n),this._app=t,this._route=e,this._services=n,this._http=o,this._ds=r,this._socket=i,this._app.environment.value.MS_id_token?this._services._account.logIn365(this._app.environment.value.MS_id_token).then(()=>{this._services._router.navigateByUrl("/home")},()=>{}):this._services._router.navigateByUrl("/home")}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Auth365Component,deps:[{token:CoreService},{token:i1$1.ActivatedRoute},{token:ProviderService},{token:i4.HttpClient},{token:DialogService},{token:SocketManagerService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:Auth365Component,isStandalone:!1,selector:"resolveio-auth365",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"<router-outlet></router-outlet>",isInline:!0,dependencies:[{kind:"directive",type:i1$1.RouterOutlet,selector:"router-outlet",inputs:["name","routerOutletData"],outputs:["activate","deactivate","attach","detach"],exportAs:["outlet"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:Auth365Component,decorators:[{type:Component,args:[{selector:"resolveio-auth365",providers:[ProviderService],template:"<router-outlet></router-outlet>",standalone:!1}]}],ctorParameters:()=>[{type:CoreService},{type:i1$1.ActivatedRoute},{type:ProviderService},{type:i4.HttpClient},{type:DialogService},{type:SocketManagerService}]});class CoreAuthModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,declarations:[ForgotPasswordComponent,EnrollComponent,Auth365Component],imports:[SharedModule],exports:[ForgotPasswordComponent,EnrollComponent,Auth365Component]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreAuthModule,decorators:[{type:NgModule,args:[{declarations:[ForgotPasswordComponent,EnrollComponent,Auth365Component],imports:[SharedModule],exports:[ForgotPasswordComponent,EnrollComponent,Auth365Component]}]}]});class CoreDialogModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,declarations:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent],imports:[SharedModule],exports:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreDialogModule,decorators:[{type:NgModule,args:[{declarations:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent],imports:[SharedModule],exports:[DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogNotifyContent,DialogSelectDateTimeContent,DialogSelectDataLabelsContent,DialogLoginContent,DialogRegisterContent,DialogSelectWithButtonsURLContent,DialogSelectArrayObjsContent,DialogSelectArrayContent]}]}]});class HtmlDiffViewerComponent{payloadStr="";leftTextarea;rightTextarea;diffContent;leftContent="";rightContent="";diffLines=[];visibleDiffLines=[];showFullDiff=!1;constructor(){}ngAfterViewInit(){if(this.payloadStr){let t=JSON.parse(this.payloadStr,dateReviver);t[0]&&t[2]&&(this.leftContent=JSON.stringify(t[0],null,2),this.rightContent=JSON.stringify(t[2],null,2),this.rightContent.includes("$")&&(this.rightContent=JSON.stringify(applyMongoUpdate(t[0],t[2]),null,2)),this.generateDiff())}}toggleDiffView(){this.showFullDiff=!this.showFullDiff,this.updateVisibleLines()}updateVisibleLines(){if(this.showFullDiff)return void(this.visibleDiffLines=[...this.diffLines.map((t,e)=>(t.leftNumber=e+1,t))]);const t=new Set,e=new Set;this.diffLines.forEach((e,n)=>{"added"!==e.type&&"removed"!==e.type&&"changed"!==e.type||t.add(n)});const n=new Set;t.forEach(t=>{let e=t,o=0;const r=[];for(;e>=0;){const t=this.diffLines[e],i=t.leftContent||t.rightContent||"";i.trim().endsWith("}")||i.trim().endsWith("]")?o++:(i.trim().endsWith("{")||i.trim().endsWith("["))&&(o>0?o--:(n.add(e),r.push(e))),e--}r.forEach(t=>{let e=t,o=1;for(;e<this.diffLines.length&&o>0;){e++;const t=this.diffLines[e];if(!t)break;const r=t.leftContent||t.rightContent||"";r.trim().endsWith("{")||r.trim().endsWith("[")?o++:(r.trim().endsWith("}")||r.trim().endsWith("]"))&&(o--,0===o&&n.add(e))}})});const o=new Set([...t,...n]);o.forEach(t=>{for(let n=Math.max(0,t-1);n<=Math.min(this.diffLines.length-1,t+1);n++)e.add(n)}),this.visibleDiffLines=this.diffLines.map((t,n)=>({...t,isContext:e.has(n)&&!o.has(n),hidden:!(o.has(n)||e.has(n))}))}generateDiff(){try{const t=JSON.parse(this.leftContent),e=JSON.parse(this.rightContent),n=this.normalizeValue(t),o=this.normalizeValue(e),r=this.compareValues(null,n,o,0);this.diffLines=this.assignLineNumbers(r),this.updateVisibleLines(),this.setupScrollSync()}catch(t){console.error("Error generating diff:",t),this.diffLines=[],this.visibleDiffLines=[]}}normalizeValue(t){if(Array.isArray(t)){if(0===t.length)return t;if("object"==typeof t[0]&&null!==t[0])return t.map(t=>this.normalizeValue(t));if("string"==typeof t[0]||"number"==typeof t[0]||"boolean"==typeof t[0]){const e=[...t];return e.sort((t,e)=>t<e?-1:t>e?1:0),e}return t}if(t&&"object"==typeof t){const e={};return Object.keys(t).sort().forEach(n=>{e[n]=this.normalizeValue(t[n])}),e}return t}compareValues(t,e,n,o){const r=[],i=this.getType(e),a=this.getType(n);if(void 0===e&&void 0!==n)return this.isComplexType(a)?(r.push(this.makeLine("added","",this.openingBrace(t,a,o))),r.push(...this.renderComplex(n,"added",o+1,!0)),r.push(this.makeLine("added","",this.closingBrace(a,o)))):r.push(this.makeLine("added","",this.renderPrimitive(t,n,o))),r;if(void 0!==e&&void 0===n)return this.isComplexType(i)?(r.push(this.makeLine("removed",this.openingBrace(t,i,o),"")),r.push(...this.renderComplex(e,"removed",o+1,!1)),r.push(this.makeLine("removed",this.closingBrace(i,o),""))):r.push(this.makeLine("removed",this.renderPrimitive(t,e,o),"")),r;if(i!==a||"object"!==i&&"array"!==i)this.isEqual(e,n)?r.push(this.makeLine("unchanged",this.renderPrimitive(t,e,o),this.renderPrimitive(t,n,o))):r.push(this.makeLine("changed",this.renderPrimitive(t,e,o),this.renderPrimitive(t,n,o)));else{if(r.push(this.makeLine("unchanged",this.openingBrace(t,i,o),this.openingBrace(t,a,o))),"object"===i){const t=new Set([...Object.keys(e),...Object.keys(n)]),i=Array.from(t).sort();for(const t of i){const i=e[t],a=n[t];r.push(...this.compareValues(t,i,a,o+1))}}else{const t=Math.max(e.length,n.length);let i=!1;for(let o=0;o<t;o++){const t=e[o],r=n[o];if(!this.isEqual(t,r)){i=!0;break}}if(i)for(let i=0;i<t;i++){const t=e[i],a=n[i];this.isEqual(t,a)||(void 0===t&&void 0!==a?this.isComplexType(this.getType(a))?(r.push(this.makeLine("added","",this.openingBrace(`[${i}]`,this.getType(a),o+1))),r.push(...this.renderComplex(a,"added",o+2,!0)),r.push(this.makeLine("added","",this.closingBrace(this.getType(a),o+1)))):r.push(this.makeLine("added","",this.renderPrimitive(`[${i}]`,a,o+1))):void 0!==t&&void 0===a?this.isComplexType(this.getType(t))?(r.push(this.makeLine("removed",this.openingBrace(`[${i}]`,this.getType(t),o+1),"")),r.push(...this.renderComplex(t,"removed",o+2,!1)),r.push(this.makeLine("removed",this.closingBrace(this.getType(t),o+1),""))):r.push(this.makeLine("removed",this.renderPrimitive(`[${i}]`,t,o+1),"")):r.push(...this.compareValues(`[${i}]`,t,a,o+1)))}else for(let t=0;t<e.length;t++)r.push(...this.compareValues(`[${t}]`,e[t],n[t],o+1))}r.push(this.makeLine("unchanged",this.closingBrace(i,o),this.closingBrace(a,o)))}return r}isComplexType(t){return"object"===t||"array"===t}renderComplex(t,e,n,o){const r=[],i=this.getType(t);if("object"===i){Object.keys(t).sort().forEach(i=>{const a=t[i],s=this.getType(a);this.isComplexType(s)?(r.push(this.makeLine(e,o?"":this.openingBrace(i,s,n),o?this.openingBrace(i,s,n):"")),r.push(...this.renderComplex(a,e,n+1,o)),r.push(this.makeLine(e,o?"":this.closingBrace(s,n),o?this.closingBrace(s,n):""))):r.push(this.makeLine(e,o?"":this.renderPrimitive(i,a,n),o?this.renderPrimitive(i,a,n):""))})}else if("array"===i)for(let i=0;i<t.length;i++){const a=t[i],s=this.getType(a);this.isComplexType(s)?(r.push(this.makeLine(e,o?"":this.openingBrace(`[${i}]`,s,n),o?this.openingBrace(`[${i}]`,s,n):"")),r.push(...this.renderComplex(a,e,n+1,o)),r.push(this.makeLine(e,o?"":this.closingBrace(s,n),o?this.closingBrace(s,n):""))):r.push(this.makeLine(e,o?"":this.renderPrimitive(`[${i}]`,a,n),o?this.renderPrimitive(`[${i}]`,a,n):""))}else r.push(this.makeLine(e,o?"":this.renderPrimitive(null,t,n),o?this.renderPrimitive(null,t,n):""));return r}getType(t){return null===t?"null":Array.isArray(t)?"array":"object"==typeof t?"object":"primitive"}isEqual(t,e){return JSON.stringify(t)===JSON.stringify(e)}makeLine(t,e,n){return{type:t,leftContent:e,rightContent:n}}openingBrace(t,e,n){const o=this.getIndentString(n),r="array"===e?"[":"{";return t?t.startsWith("[")?`${o}${t}: ${r}`:`${o}"${t}": ${r}`:`${o}${r}`}closingBrace(t,e){return`${this.getIndentString(e)}${"array"===t?"]":"}"}`}renderPrimitive(t,e,n){const o=this.getIndentString(n),r=JSON.stringify(e);return t?t.startsWith("[")?`${o}${t}: ${r}`:`${o}"${t}": ${r}`:`${o}${r}`}getIndentString(t){let e="";for(let n=0;n<t;n++)e+="\t";return e}assignLineNumbers(t){let e=1,n=1;return t.map(t=>{let o="",r="";return"removed"===t.type?(o=(e++).toString(),r=""):"added"===t.type?(o="",r=(n++).toString()):(o=(e++).toString(),r=(n++).toString()),{...t,leftNumber:o,rightNumber:r}})}setupScrollSync(){setTimeout(()=>{const t=this.diffContent.nativeElement,e=t.querySelectorAll(".left"),n=t.querySelectorAll(".right");if(e.length&&n.length){const t=e[0],o=n[0];t.addEventListener("scroll",()=>{o.scrollTop=t.scrollTop,o.scrollLeft=t.scrollLeft}),o.addEventListener("scroll",()=>{t.scrollTop=o.scrollTop,t.scrollLeft=o.scrollLeft})}})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HtmlDiffViewerComponent,deps:[],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:HtmlDiffViewerComponent,isStandalone:!1,selector:"html-diff-viewer",inputs:{payloadStr:"payloadStr"},viewQueries:[{propertyName:"leftTextarea",first:!0,predicate:["leftTextarea"],descendants:!0},{propertyName:"rightTextarea",first:!0,predicate:["rightTextarea"],descendants:!0},{propertyName:"diffContent",first:!0,predicate:["diffContent"],descendants:!0}],ngImport:i0,template:'\n\t\t<div class="diff-container">\n\t\t <div class="diff-controls">\n\t\t <button type="button" class="btn"\n\t\t [class.btn-primary]="!showFullDiff"\n\t\t [class.btn-secondary]="showFullDiff"\n\t\t (click)="toggleDiffView()">\n\t\t {{ showFullDiff ? \'Show Full Content\' : \'Show Changes Only\' }}\n\t\t </button>\n\t\t </div>\n\t\t <div class="diff-header">\n\t\t <div class="diff-header-left">Original</div>\n\t\t <div class="diff-header-right">Modified</div>\n\t\t </div>\n\t\t <div class="diff-content" #diffContent>\n\t\t <div class="diff-lines">\n\t\t @for (line of visibleDiffLines; track line) {\n\t\t <div class="diff-line"\n\t\t [class.context-line]="line.isContext"\n\t\t [class.hidden-line]="line.hidden">\n\t\t <div class="line-number left">{{ line.leftNumber }}</div>\n\t\t <div class="line-content left"\n\t\t [class.deleted]="line.type === \'removed\'"\n\t\t [class.changed-left]="line.type === \'changed\'">\n\t\t <span>{{ line.leftContent }}</span>\n\t\t </div>\n\t\t <div class="line-number right">{{ line.rightNumber }}</div>\n\t\t <div class="line-content right"\n\t\t [class.added]="line.type === \'added\'"\n\t\t [class.changed-right]="line.type === \'changed\'">\n\t\t <span>{{ line.rightContent }}</span>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="input-container">\n\t\t <textarea #leftTextarea [(ngModel)]="leftContent" placeholder="Left side content" rows="10"></textarea>\n\t\t <textarea #rightTextarea [(ngModel)]="rightContent" placeholder="Right side content" rows="10"></textarea>\n\t\t </div>\n\t\t</div>\n\t\t',isInline:!0,styles:[".diff-container{display:flex;flex-direction:column;font-family:monospace;font-size:12px;line-height:1.5}.diff-controls{margin-bottom:10px}.btn{padding:5px 10px;border-radius:4px;cursor:pointer;border:1px solid #ddd}.btn-primary{background-color:#0366d6;color:#fff}.btn-secondary{background-color:#f6f8fa;color:#24292e}.diff-header{display:flex;background:#f6f8fa;border:1px solid #e1e4e8;border-bottom:none;padding:8px 16px;font-weight:700}.diff-header-left,.diff-header-right{width:50%;box-sizing:border-box}.diff-content{border:1px solid #e1e4e8;overflow:auto;max-height:500px}.diff-lines{display:flex;flex-direction:column;width:100%}.diff-line{display:flex;width:100%}.context-line{background-color:#f1f8ff}.hidden-line{display:none}.line-number{width:40px!important;min-width:40px!important;padding:0 10px;text-align:right;color:#1b1f234d;background-color:#f6f8fa;border-right:1px solid #e1e4e8;-webkit-user-select:none;user-select:none}.line-content{flex:1;padding:0 10px;white-space:pre;min-width:0;overflow-x:auto}.left{width:50%;border-right:1px solid #e1e4e8}.right{width:50%}.added{background-color:#e6ffed}.deleted{background-color:#ffebe9}.changed-left{background-color:#fff3bf;text-decoration:line-through}.changed-right{background-color:#d4edda}.input-container{display:flex;margin-top:20px;gap:10px}textarea{width:50%;height:200px;font-family:monospace;padding:10px;border:1px solid #ddd;border-radius:4px;box-sizing:border-box}*{word-wrap:normal!important}\n"],dependencies:[{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:HtmlDiffViewerComponent,decorators:[{type:Component,args:[{selector:"html-diff-viewer",template:'\n\t\t<div class="diff-container">\n\t\t <div class="diff-controls">\n\t\t <button type="button" class="btn"\n\t\t [class.btn-primary]="!showFullDiff"\n\t\t [class.btn-secondary]="showFullDiff"\n\t\t (click)="toggleDiffView()">\n\t\t {{ showFullDiff ? \'Show Full Content\' : \'Show Changes Only\' }}\n\t\t </button>\n\t\t </div>\n\t\t <div class="diff-header">\n\t\t <div class="diff-header-left">Original</div>\n\t\t <div class="diff-header-right">Modified</div>\n\t\t </div>\n\t\t <div class="diff-content" #diffContent>\n\t\t <div class="diff-lines">\n\t\t @for (line of visibleDiffLines; track line) {\n\t\t <div class="diff-line"\n\t\t [class.context-line]="line.isContext"\n\t\t [class.hidden-line]="line.hidden">\n\t\t <div class="line-number left">{{ line.leftNumber }}</div>\n\t\t <div class="line-content left"\n\t\t [class.deleted]="line.type === \'removed\'"\n\t\t [class.changed-left]="line.type === \'changed\'">\n\t\t <span>{{ line.leftContent }}</span>\n\t\t </div>\n\t\t <div class="line-number right">{{ line.rightNumber }}</div>\n\t\t <div class="line-content right"\n\t\t [class.added]="line.type === \'added\'"\n\t\t [class.changed-right]="line.type === \'changed\'">\n\t\t <span>{{ line.rightContent }}</span>\n\t\t </div>\n\t\t </div>\n\t\t }\n\t\t </div>\n\t\t </div>\n\t\t <div class="input-container">\n\t\t <textarea #leftTextarea [(ngModel)]="leftContent" placeholder="Left side content" rows="10"></textarea>\n\t\t <textarea #rightTextarea [(ngModel)]="rightContent" placeholder="Right side content" rows="10"></textarea>\n\t\t </div>\n\t\t</div>\n\t\t',standalone:!1,styles:[".diff-container{display:flex;flex-direction:column;font-family:monospace;font-size:12px;line-height:1.5}.diff-controls{margin-bottom:10px}.btn{padding:5px 10px;border-radius:4px;cursor:pointer;border:1px solid #ddd}.btn-primary{background-color:#0366d6;color:#fff}.btn-secondary{background-color:#f6f8fa;color:#24292e}.diff-header{display:flex;background:#f6f8fa;border:1px solid #e1e4e8;border-bottom:none;padding:8px 16px;font-weight:700}.diff-header-left,.diff-header-right{width:50%;box-sizing:border-box}.diff-content{border:1px solid #e1e4e8;overflow:auto;max-height:500px}.diff-lines{display:flex;flex-direction:column;width:100%}.diff-line{display:flex;width:100%}.context-line{background-color:#f1f8ff}.hidden-line{display:none}.line-number{width:40px!important;min-width:40px!important;padding:0 10px;text-align:right;color:#1b1f234d;background-color:#f6f8fa;border-right:1px solid #e1e4e8;-webkit-user-select:none;user-select:none}.line-content{flex:1;padding:0 10px;white-space:pre;min-width:0;overflow-x:auto}.left{width:50%;border-right:1px solid #e1e4e8}.right{width:50%}.added{background-color:#e6ffed}.deleted{background-color:#ffebe9}.changed-left{background-color:#fff3bf;text-decoration:line-through}.changed-right{background-color:#d4edda}.input-container{display:flex;margin-top:20px;gap:10px}textarea{width:50%;height:200px;font-family:monospace;padding:10px;border:1px solid #ddd;border-radius:4px;box-sizing:border-box}*{word-wrap:normal!important}\n"]}]}],ctorParameters:()=>[],propDecorators:{payloadStr:[{type:Input}],leftTextarea:[{type:ViewChild,args:["leftTextarea"]}],rightTextarea:[{type:ViewChild,args:["rightTextarea"]}],diffContent:[{type:ViewChild,args:["diffContent"]}]}});class LoggerComponent extends BaseComponent{_services;_ds;_cd;subscription$=[];logs=[];entries_per_page=25;page_num=1;log_cnt=0;user=null;users=[];startDateTime;endDateTime;dateStart;dateEnd;selectedTypes=[];client=null;clients=[];collection="";method="";route="";id_document="";constructor(t,e,n){super(t),this._services=t,this._ds=e,this._cd=n}ngOnInit(){this._services._account.getUser().roles.super_admin||this._services._router.navigateByUrl("/home"),this.subscription$.push(this._services._socket.subscribe("activeClients").subscribe(t=>{this.clients=t,this._cd.detectChanges()})),this.subscription$.push(this._services._socket.subscribe("allUsers").subscribe(t=>{this.users=t,this._cd.detectChanges()}));let t=new Date;t.setHours(0,0,0,0);let e=new Date(moment$1(t).subtract(10,"days").toDate());this.startDateTime=this.createPickerValue(e,0);let n=new Date;n.setHours(23,59,59,999),this.endDateTime=this.createPickerValue(n,59),this.getLogData()}ngOnDestroy(){this.subscription$.forEach(t=>{t.unsubscribe()})}getLogData(){this.dateStart=this.toDate(this.startDateTime),this.dateEnd=this.toDate(this.endDateTime,!0);let t={$and:[{createdAt:{$gte:this.dateStart}},{createdAt:{$lte:this.dateEnd}}]};if(this.client)if(this.client.includes(",")){let e=this.client.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({client:{$in:e}}),this.client.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({client:{$ne:e.replace("!","")}})})}else this.client.startsWith("!")?t.$and.push({client:{$ne:this.client.replace("!","").trim()}}):t.$and.push({client:this.client.trim()});else t.$and.push({client:"ResolveIO"});if(this.selectedTypes.length){if(t.$and.push({type:{$in:this.selectedTypes}}),this.collection)if(this.collection.includes(",")){let e=this.collection.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({collection:{$in:e}}),this.collection.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({collection:{$ne:e.replace("!","")}})})}else this.collection.startsWith("!")?t.$and.push({collection:{$ne:this.collection.replace("!","").trim()}}):t.$and.push({collection:this.collection.trim()});if(this.method)if(this.method.includes(",")){let e=this.method.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({method:{$in:e}}),this.method.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({method:{$ne:e.replace("!","")}})})}else this.method.startsWith("!")?t.$and.push({method:{$ne:this.method.replace("!","").trim()}}):t.$and.push({method:this.method.trim()});if(this.route)if(this.route.includes(",")){let e=this.route.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({route:{$in:e}}),this.route.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({route:{$ne:e.replace("!","")}})})}else this.route.startsWith("!")?t.$and.push({route:{$ne:this.route.replace("!","").trim()}}):t.$and.push({route:this.route.trim()});if(this.id_document)if(this.id_document.includes(",")){let e=this.id_document.split(",").map(t=>t.trim()).filter(t=>!t.startsWith("!"));e.length&&t.$and.push({id_document:{$in:e}}),this.id_document.split(",").map(t=>t.trim()).filter(t=>t.startsWith("!")).forEach(e=>{t.$and.push({id_document:{$ne:e.replace("!","")}})})}else this.id_document.startsWith("!")?t.$and.push({id_document:{$ne:this.id_document.replace("!","").trim()}}):t.$and.push({id_document:this.id_document.trim()});this.user&&t.$and.push({user:this.user}),"string"==typeof this.entries_per_page&&(this.entries_per_page=parseInt(this.entries_per_page)),this._services._socket.call("findWithOptions","logs",t,{sort:{createdAt:-1},limit:this.entries_per_page,skip:this.entries_per_page*(this.page_num-1)},(t,e)=>{this.logs=e,this._cd.detectChanges()}),this._services._socket.call("countCollectionWithQuery","logs",t,(t,e)=>{this.log_cnt=e,this._cd.detectChanges()}),this._cd.detectChanges()}}selectType(t){"all"!==t?this.selectedTypes.includes(t)?this.selectedTypes.splice(this.selectedTypes.indexOf(t),1):this.selectedTypes.push(t):7===this.selectedTypes.length?this.selectedTypes=[]:this.selectedTypes=["error","document","query","queryResponse","client-request","client-response","callMethod"],this.logs=[],this.selectedTypes.length&&this.getLogData()}icon(t){return"error"===t?"danger":"document"===t?"info":"client-response"===t?"success":"client-request"===t?"primary":"secondary"}removeAllLogs(){this._ds.confirm("Are you sure you want to delete all logs?").then(()=>{this._services._socket.call("removeAllDocuments","logs")},()=>{})}toDate(t,e=!1){if(!t||!t.date)return new Date;let n=t.time||{hour:0,minute:0,second:0,ms:0},o=e?999:n.ms||0;return new Date(t.date.year,t.date.month-1,t.date.day,n.hour||0,n.minute||0,n.second||0,o)}createPickerValue(t,e=null){return{mode:"datetime",date:{year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()},time:{hour:t.getHours(),minute:t.getMinutes(),second:null!==e?e:t.getSeconds(),ms:t.getMilliseconds()}}}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LoggerComponent,deps:[{token:ProviderService},{token:DialogService},{token:i0.ChangeDetectorRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:LoggerComponent,isStandalone:!1,selector:"resolveio-logger",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<div class="row">\n\t<div class="col-lg-12">\n\t\t<div class="card">\n\t\t\t<div class="card-header"><b>Filters</b></div>\n\t\t\t<div class="card-body">\n\t\t\t\t<div class="row">\n\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') && selectedTypes.includes(\'document\') && selectedTypes.includes(\'query\') && selectedTypes.includes(\'client-request\') && selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'all\')">All</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'error\')">Errors</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'document\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'document\')">Document</button>\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'query\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'query\')">Query</button> --\x3e\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'queryResponse\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'queryResponse\')">Query Response</button> --\x3e\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-request\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-request\')">Client Requests</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-response\')">Client Responses</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'callMethod\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'callMethod\')">Call Method</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-danger" (click)="removeAllLogs()">REMOVE ALL LOGS</button>\n\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Client</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="client" (change)="getLogData()" placeholder="Select Client" [options]="clients" optionValueKey="name" optionLabelKey="name"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">User</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="user" (change)="getLogData()" placeholder="Select User" [options]="users" optionValueKey="fullname" optionLabelKey="fullname"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Collection</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="collection" (change)="getLogData()" placeholder="Input Colls Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Method</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="method" (change)="getLogData()" placeholder="Input Methods Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Route</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="route" (change)="getLogData()" placeholder="Input Routes Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Document</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="id_document" (change)="getLogData()" placeholder="Input Ids Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2 offset-lg-4">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time Start</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="startDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time End</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="endDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div ngbAccordion #acc="ngbAccordion" activeIds="">\n\t\t\t\t\t\t@for (log of logs; track log._id; let i = $index) {\n\t\t\t\t\t\t\t<div ngbAccordionItem [id]="\'log_\' + i">\n\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t<label class="label-accordion" style="width: 90%; height: 22px">\n\t\t\t\t\t\t\t\t\t\t\t<strong class="float-start">Type: {{ log.type }}{{ log.method ? \' - Method: \' + log.method : \'\' }}{{ log.collection ? \' - Collection: \' + log.collection : \'\' }}{{ log.user ? \' - User: \' + log.user : \'\' }}{{ log.route ? \' - Route: \' + log.route : \'\' }}{{ log.id_document ? \' - id_document: \' + log.id_document : \'\' }}{{ log.messageId ? \' - messageId: \' + log.messageId : \'\' }}{{ log.instance ? \' - instance: \' + log.instance : \'\' }}</strong>\n\t\t\t\t\t\t\t\t\t\t\t<p class="float-end mb-0">{{ log.createdAt | date: \'medium\' }}</p>\n\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t@if (log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method === \'replaceOne\' || log.method === \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordion #acc2="ngbAccordion" activeIds="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Diff</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<html-diff-viewer [payloadStr]="log.payload"></html-diff-viewer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="raw">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Raw</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method !== \'replaceOne\' && log.method !== \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t@if (!log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\tNo Data\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t\t<div class="col-lg-4">\n\t\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t\t\t<label class="form-control-label">Entries Per Page</label>\n\t\t\t\t\t\t\t\t\t<select class="form-control" [(ngModel)]="entries_per_page" (change)="getLogData()">\n\t\t\t\t\t\t\t\t\t\t<option value="10">10</option>\n\t\t\t\t\t\t\t\t\t\t<option value="25">25</option>\n\t\t\t\t\t\t\t\t\t\t<option value="50">50</option>\n\t\t\t\t\t\t\t\t\t\t<option value="100">100</option>\n\t\t\t\t\t\t\t\t\t\t<option value="250">250</option>\n\t\t\t\t\t\t\t\t\t\t<option value="500">500</option>\n\t\t\t\t\t\t\t\t\t\t<option value="1000">1000</option>\n\t\t\t\t\t\t\t\t\t\t<option value="5000">5000</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t<ngb-pagination class="float-end" boundaryLinks="true" [collectionSize]="log_cnt" directionLinks="true" ellipses="false" [(page)]="page_num" maxSize="6" [pageSize]="entries_per_page" rotate="true" (pageChange)="getLogData()"></ngb-pagination>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',dependencies:[{kind:"directive",type:i2.NgSelectOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.ɵNgSelectMultipleOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.SelectControlValueAccessor,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:["compareWith"]},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"directive",type:i1$2.NgbAccordionButton,selector:"button[ngbAccordionButton]"},{kind:"directive",type:i1$2.NgbAccordionDirective,selector:"[ngbAccordion]",inputs:["animation","closeOthers","destroyOnHide"],outputs:["show","shown","hide","hidden"],exportAs:["ngbAccordion"]},{kind:"directive",type:i1$2.NgbAccordionItem,selector:"[ngbAccordionItem]",inputs:["ngbAccordionItem","destroyOnHide","disabled","collapsed"],outputs:["show","shown","hide","hidden"],exportAs:["ngbAccordionItem"]},{kind:"directive",type:i1$2.NgbAccordionHeader,selector:"[ngbAccordionHeader]"},{kind:"component",type:i1$2.NgbAccordionBody,selector:"[ngbAccordionBody]"},{kind:"directive",type:i1$2.NgbAccordionCollapse,selector:"[ngbAccordionCollapse]",exportAs:["ngbAccordionCollapse"]},{kind:"component",type:i1$2.NgbPagination,selector:"ngb-pagination",inputs:["disabled","boundaryLinks","directionLinks","ellipses","rotate","collectionSize","maxSize","page","pageSize","size"],outputs:["pageChange"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"component",type:i7.RioDatePickerComponent,selector:"rio-date-picker",inputs:["enableDate","enableTime","selectionMode","firstDayOfWeek","toggleWeekFirstDay","timezone","minDate","maxDate","disabled","label","allowSeconds","minuteStep","panelWidth"],outputs:["change"]},{kind:"component",type:HtmlDiffViewerComponent,selector:"html-diff-viewer",inputs:["payloadStr"]},{kind:"pipe",type:JsonParsePipe,name:"jsonParse"},{kind:"pipe",type:i3.DatePipe,name:"date"}],changeDetection:i0.ChangeDetectionStrategy.OnPush})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:LoggerComponent,decorators:[{type:Component,args:[{selector:"resolveio-logger",providers:[ProviderService],changeDetection:ChangeDetectionStrategy.OnPush,standalone:!1,template:'<div class="row">\n\t<div class="col-lg-12">\n\t\t<div class="card">\n\t\t\t<div class="card-header"><b>Filters</b></div>\n\t\t\t<div class="card-body">\n\t\t\t\t<div class="row">\n\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') && selectedTypes.includes(\'document\') && selectedTypes.includes(\'query\') && selectedTypes.includes(\'client-request\') && selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'all\')">All</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'error\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'error\')">Errors</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'document\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'document\')">Document</button>\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'query\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'query\')">Query</button> --\x3e\n\t\t\t\t\t\t\t\x3c!-- <button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'queryResponse\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'queryResponse\')">Query Response</button> --\x3e\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-request\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-request\')">Client Requests</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'client-response\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'client-response\')">Client Responses</button>\n\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', selectedTypes.includes(\'callMethod\') ? \'btn-success\' : \'btn-warning\']" (click)="selectType(\'callMethod\')">Call Method</button>\n\t\t\t\t\t\t\t<button type="button" class="btn btn-danger" (click)="removeAllLogs()">REMOVE ALL LOGS</button>\n\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Client</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="client" (change)="getLogData()" placeholder="Select Client" [options]="clients" optionValueKey="name" optionLabelKey="name"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">User</label>\n\t\t\t\t\t\t<rio-select [(ngModel)]="user" (change)="getLogData()" placeholder="Select User" [options]="users" optionValueKey="fullname" optionLabelKey="fullname"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Collection</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="collection" (change)="getLogData()" placeholder="Input Colls Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Method</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="method" (change)="getLogData()" placeholder="Input Methods Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Route</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="route" (change)="getLogData()" placeholder="Input Routes Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Document</label>\n\t\t\t\t\t\t<input class="form-control" [(ngModel)]="id_document" (change)="getLogData()" placeholder="Input Ids Sep By , & ! for !Not" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div class="col-lg-2 offset-lg-4">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time Start</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="startDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="col-lg-2">\n\t\t\t\t\t\t<label class="form-control-label">Date/Time End</label>\n\t\t\t\t\t\t<div class="input-group">\n\t\t\t\t\t\t\t<rio-date-picker [(ngModel)]="endDateTime" (ngModelChange)="getLogData()" selectionMode="datetime" [allowSeconds]="true"></rio-date-picker>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t<div ngbAccordion #acc="ngbAccordion" activeIds="">\n\t\t\t\t\t\t@for (log of logs; track log._id; let i = $index) {\n\t\t\t\t\t\t\t<div ngbAccordionItem [id]="\'log_\' + i">\n\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t<label class="label-accordion" style="width: 90%; height: 22px">\n\t\t\t\t\t\t\t\t\t\t\t<strong class="float-start">Type: {{ log.type }}{{ log.method ? \' - Method: \' + log.method : \'\' }}{{ log.collection ? \' - Collection: \' + log.collection : \'\' }}{{ log.user ? \' - User: \' + log.user : \'\' }}{{ log.route ? \' - Route: \' + log.route : \'\' }}{{ log.id_document ? \' - id_document: \' + log.id_document : \'\' }}{{ log.messageId ? \' - messageId: \' + log.messageId : \'\' }}{{ log.instance ? \' - instance: \' + log.instance : \'\' }}</strong>\n\t\t\t\t\t\t\t\t\t\t\t<p class="float-end mb-0">{{ log.createdAt | date: \'medium\' }}</p>\n\t\t\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t@if (log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method === \'replaceOne\' || log.method === \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordion #acc2="ngbAccordion" activeIds="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="diff">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Diff</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<html-diff-viewer [payloadStr]="log.payload"></html-diff-viewer>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionItem id="raw">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionHeader>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button ngbAccordionButton type="button">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span class="label-accordion" style="width: 90%; height: 22px">Raw</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionCollapse>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div ngbAccordionBody>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t@if (log.method !== \'replaceOne\' && log.method !== \'updateOne\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<pre>{{ log.payload | jsonParse }}</pre>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t@if (!log.payload) {\n\t\t\t\t\t\t\t\t\t\t\t\tNo Data\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</ng-template>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t\t<div class="col-lg-4">\n\t\t\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t\t\t<label class="form-control-label">Entries Per Page</label>\n\t\t\t\t\t\t\t\t\t<select class="form-control" [(ngModel)]="entries_per_page" (change)="getLogData()">\n\t\t\t\t\t\t\t\t\t\t<option value="10">10</option>\n\t\t\t\t\t\t\t\t\t\t<option value="25">25</option>\n\t\t\t\t\t\t\t\t\t\t<option value="50">50</option>\n\t\t\t\t\t\t\t\t\t\t<option value="100">100</option>\n\t\t\t\t\t\t\t\t\t\t<option value="250">250</option>\n\t\t\t\t\t\t\t\t\t\t<option value="500">500</option>\n\t\t\t\t\t\t\t\t\t\t<option value="1000">1000</option>\n\t\t\t\t\t\t\t\t\t\t<option value="5000">5000</option>\n\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-8">\n\t\t\t\t\t\t\t<ngb-pagination class="float-end" boundaryLinks="true" [collectionSize]="log_cnt" directionLinks="true" ellipses="false" [(page)]="page_num" maxSize="6" [pageSize]="entries_per_page" rotate="true" (pageChange)="getLogData()"></ngb-pagination>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}]}],ctorParameters:()=>[{type:ProviderService},{type:DialogService},{type:i0.ChangeDetectorRef}]});class CoreLoggerModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,declarations:[LoggerComponent,HtmlDiffViewerComponent],imports:[SharedModule],exports:[LoggerComponent,HtmlDiffViewerComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,imports:[SharedModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreLoggerModule,decorators:[{type:NgModule,args:[{declarations:[LoggerComponent,HtmlDiffViewerComponent],imports:[SharedModule],exports:[LoggerComponent,HtmlDiffViewerComponent]}]}]});class UserSettingsService{selectedUser=new BehaviorSubject("0");constructor(){}setSelectedUser(t){this.selectedUser.next(t)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsService,deps:[],target:i0.ɵɵFactoryTarget.Injectable});static"ɵprov"=i0.ɵɵngDeclareInjectable({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsService})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsService,decorators:[{type:Injectable}],ctorParameters:()=>[]});const UserSettingsModulePermission={name:"user-settings",views:[{link:"/user-settings/settings",label:"Settings"}],approval:{type:"user-settings"}};class UserSettingsComponent extends BaseComponent{_us;_services;selectedUserSettings$;menuData;constructor(t,e){super(e),this._us=t,this._services=e}ngOnInit(){this.selectedUserSettings$=this._us.selectedUser.subscribe(t=>this.selectedUserSettingsChanged(t))}ngOnDestroy(){this._us.setSelectedUser("0"),this.selectedUserSettings$.unsubscribe()}selectedUserSettingsChanged(t){this.setUserSettingsMenuData()}setUserSettingsMenuData(t,e){let n=[];UserSettingsModulePermission.views.forEach(t=>{if((this._services._account.isUserInView(t.link)||this._services._account.isUserSuperAdmin())&&"/user-settings/settings"===t.link)n.push({link:"/user-settings/settings",params:null,label:"Settings"})}),this.menuData={title:"User Settings",module:"User Settings",description_name:"User: ",description:e?e.fullname:"",tabs:n},this._services._app.setNavbarModuleData(this.menuData)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsComponent,deps:[{token:UserSettingsService},{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:UserSettingsComponent,isStandalone:!1,selector:"resolveio-user-settings",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:"<router-outlet></router-outlet>",isInline:!0,dependencies:[{kind:"directive",type:i1$1.RouterOutlet,selector:"router-outlet",inputs:["name","routerOutletData"],outputs:["activate","deactivate","attach","detach"],exportAs:["outlet"]}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsComponent,decorators:[{type:Component,args:[{selector:"resolveio-user-settings",providers:[ProviderService],template:"<router-outlet></router-outlet>",standalone:!1}]}],ctorParameters:()=>[{type:UserSettingsService},{type:ProviderService}]});class UsersSettingsComponent extends BaseComponent{_aps;_us;_services;_ds;_tourManager;_stickyAdapter;subscription$=[];form;disableFormButton=!1;user;client="";views=[];stickySelects=[];stickySelections={};constructor(t,e,n,o,r,i){super(n),this._aps=t,this._us=e,this._services=n,this._ds=o,this._tourManager=r,this._stickyAdapter=i}ngOnInit(){this._us.setSelectedUser("0"),this.client=this._services._app.client.getValue(),this.form=this._services._fb.group({table_color:["#3b3ee3",[Validators.required]],table_font_color:["#ffffff",[Validators.required]],font_size:[12,[Validators.required,this._services._vs.wholeNumbersGreaterThanZero,this._services._vs.maxValue(18),this._services._vs.minValue(8)]],secondary_table_color:["#87ceeb",[Validators.required]],secondary_table_font_color:["#000000",[Validators.required]],tertiary_table_color:["#ff4500",[Validators.required]],tertiary_table_font_color:["#000000",[Validators.required]],collapsable_menu:[!0],entries_per_page:["25",[Validators.required]],warning_color:["#ffc107",[Validators.required]],warning_font_color:["#000000",[Validators.required]],warning_hover_color:["#e0a800",[Validators.required]],success_color:["#28a745",[Validators.required]],success_font_color:["#ffffff",[Validators.required]],success_hover_color:["#218838",[Validators.required]],danger_color:["#dc3545",[Validators.required]],danger_font_color:["#ffffff",[Validators.required]],danger_hover_color:["#c82333",[Validators.required]],info_color:["#17a2b8",[Validators.required]],info_font_color:["#ffffff",[Validators.required]],info_hover_color:["#138496",[Validators.required]],primary_color:["#007bff",[Validators.required]],primary_font_color:["#ffffff",[Validators.required]],primary_hover_color:["#0069d9",[Validators.required]],secondary_color:["#868e96",[Validators.required]],secondary_font_color:["#ffffff",[Validators.required]],secondary_hover_color:["#5a6268",[Validators.required]],date_picker_day_start:["S",[Validators.required]],routing_preference:[""],opening_route:["/home"],rio_select_search_mode:["exact",[Validators.required]]});const t=this._services._account.getUser();t&&t.settings&&(this.form.patchValue(t.settings),t.roles.groups.forEach(t=>{t.views.forEach(t=>{this.views.some(e=>e.value===t)||this.views.push({value:t,display:toTitleCase(t.replace("/","").replace(new RegExp("/","g")," - "))})})}));const e=this._normalizeDatePickerDayStart(t?.other?.date_picker_day_start);this.form.controls.date_picker_day_start.setValue(e),this._loadStickySelects(this._services._account.getUser()),document.documentElement.style.setProperty("--primary-table-color",this.form.controls.table_color.value),document.documentElement.style.setProperty("--primary-table-font-color",this.form.controls.table_font_color.value),document.documentElement.style.setProperty("--font-size",this.form.controls.font_size.value+"px"),document.documentElement.style.setProperty("--secondary-table-color",this.form.controls.secondary_table_color.value),document.documentElement.style.setProperty("--secondary-table-font-color",this.form.controls.secondary_table_font_color.value),document.documentElement.style.setProperty("--tertiary-table-color",this.form.controls.tertiary_table_color.value),document.documentElement.style.setProperty("--tertiary-table-font-color",this.form.controls.tertiary_table_font_color.value),document.documentElement.style.setProperty("--warning-color",this.form.controls.warning_color.value),document.documentElement.style.setProperty("--warning-font-color",this.form.controls.warning_font_color.value),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.warning_color.value,.5)),document.documentElement.style.setProperty("--warning-hover-color",this.form.controls.warning_hover_color.value),document.documentElement.style.setProperty("--success-color",this.form.controls.success_color.value),document.documentElement.style.setProperty("--success-font-color",this.form.controls.success_font_color.value),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.success_color.value,.5)),document.documentElement.style.setProperty("--success-hover-color",this.form.controls.success_hover_color.value),document.documentElement.style.setProperty("--danger-color",this.form.controls.danger_color.value),document.documentElement.style.setProperty("--danger-font-color",this.form.controls.danger_font_color.value),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.danger_color.value,.5)),document.documentElement.style.setProperty("--danger-hover-color",this.form.controls.danger_hover_color.value),document.documentElement.style.setProperty("--info-color",this.form.controls.info_color.value),document.documentElement.style.setProperty("--info-font-color",this.form.controls.info_font_color.value),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.info_color.value,.5)),document.documentElement.style.setProperty("--info-hover-color",this.form.controls.info_hover_color.value),document.documentElement.style.setProperty("--primary-color",this.form.controls.primary_color.value),document.documentElement.style.setProperty("--primary-font-color",this.form.controls.primary_font_color.value),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.primary_color.value,.5)),document.documentElement.style.setProperty("--primary-hover-color",this.form.controls.primary_hover_color.value),document.documentElement.style.setProperty("--secondary-color",this.form.controls.secondary_color.value),document.documentElement.style.setProperty("--secondary-font-color",this.form.controls.secondary_font_color.value),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.secondary_color.value,.5)),document.documentElement.style.setProperty("--secondary-hover-color",this.form.controls.secondary_hover_color.value),this.subscription$.push(this._services._account.user.subscribe(t=>{this.user=t,this._loadStickySelects(t)}))}ngOnDestroy(){const t=this._services._account.getUser();t&&!t.settings&&this.form&&this.form.valid&&this.submitForm(this.form),this.subscription$.forEach(t=>{t.unsubscribe()})}changePrimaryColor(){document.documentElement.style.setProperty("--primary-table-color",this.form.controls.table_color.value)}changePrimaryFontColor(){document.documentElement.style.setProperty("--primary-table-font-color",this.form.controls.table_font_color.value)}changePrimaryFontSize(){document.documentElement.style.setProperty("--font-size",this.form.controls.font_size.value+"px")}changeSecondaryColor(){document.documentElement.style.setProperty("--secondary-table-color",this.form.controls.secondary_table_color.value)}changeSecondaryFontColor(){document.documentElement.style.setProperty("--secondary-table-font-color",this.form.controls.secondary_table_font_color.value)}changeTertiaryColor(){document.documentElement.style.setProperty("--tertiary-table-color",this.form.controls.tertiary_table_color.value)}changeTertiaryFontColor(){document.documentElement.style.setProperty("--tertiary-table-font-color",this.form.controls.tertiary_table_font_color.value)}changeWarningColor(){document.documentElement.style.setProperty("--warning-color",this.form.controls.warning_color.value),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.warning_color.value,.5))}changeWarningHoverColor(){document.documentElement.style.setProperty("--warning-hover-color",this.form.controls.warning_hover_color.value)}changeWarningFontColor(){document.documentElement.style.setProperty("--warning-font-color",this.form.controls.warning_font_color.value)}changeSuccessColor(){document.documentElement.style.setProperty("--success-color",this.form.controls.success_color.value),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.success_color.value,.5))}changeSuccessHoverColor(){document.documentElement.style.setProperty("--success-hover-color",this.form.controls.success_hover_color.value)}changeSuccessFontColor(){document.documentElement.style.setProperty("--success-font-color",this.form.controls.success_font_color.value)}changeDangerColor(){document.documentElement.style.setProperty("--danger-color",this.form.controls.danger_color.value),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.danger_color.value,.5))}changeDangerHoverColor(){document.documentElement.style.setProperty("--danger-hover-color",this.form.controls.danger_hover_color.value)}changeDangerFontColor(){document.documentElement.style.setProperty("--danger-font-color",this.form.controls.danger_font_color.value)}changeInfoColor(){document.documentElement.style.setProperty("--info-color",this.form.controls.info_color.value),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.info_color.value,.5))}changeInfoHoverColor(){document.documentElement.style.setProperty("--info-hover-color",this.form.controls.info_hover_color.value)}changeInfoFontColor(){document.documentElement.style.setProperty("--info-font-color",this.form.controls.info_font_color.value)}changePrimaryButtonColor(){document.documentElement.style.setProperty("--primary-color",this.form.controls.primary_color.value),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.primary_color.value,.5))}changePrimaryButtonHoverColor(){document.documentElement.style.setProperty("--primary-hover-color",this.form.controls.primary_hover_color.value)}changePrimaryButtonFontColor(){document.documentElement.style.setProperty("--primary-font-color",this.form.controls.primary_font_color.value)}changeSecondaryButtonColor(){document.documentElement.style.setProperty("--secondary-color",this.form.controls.secondary_color.value),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.secondary_color.value,.5))}changeSecondaryHoverColor(){document.documentElement.style.setProperty("--secondary-hover-color",this.form.controls.secondary_hover_color.value)}changeSecondaryButtonFontColor(){document.documentElement.style.setProperty("--secondary-font-color",this.form.controls.secondary_font_color.value)}reset(){this.form.controls.table_color.setValue("#3b3ee3"),this.form.controls.table_font_color.setValue("#ffffff"),this.form.controls.font_size.setValue(12),this.form.controls.secondary_table_color.setValue("#87ceeb"),this.form.controls.secondary_table_font_color.setValue("#000000"),this.form.controls.tertiary_table_color.setValue("#ff4500"),this.form.controls.tertiary_table_font_color.setValue("#000000"),this.form.controls.collapsable_menu.setValue(!0),this.form.controls.entries_per_page.setValue("25"),this.form.controls.warning_color.setValue("#ffc107"),this.form.controls.warning_font_color.setValue("#000000"),this.form.controls.warning_hover_color.setValue("#e0a800"),this.form.controls.success_color.setValue("#28a745"),this.form.controls.success_font_color.setValue("#ffffff"),this.form.controls.success_hover_color.setValue("#218838"),this.form.controls.danger_color.setValue("#dc3545"),this.form.controls.danger_font_color.setValue("#ffffff"),this.form.controls.danger_hover_color.setValue("#c82333"),this.form.controls.info_color.setValue("#17a2b8"),this.form.controls.info_font_color.setValue("#ffffff"),this.form.controls.info_hover_color.setValue("#138496"),this.form.controls.primary_color.setValue("#007bff"),this.form.controls.primary_font_color.setValue("#ffffff"),this.form.controls.primary_hover_color.setValue("#0069d9"),this.form.controls.secondary_color.setValue("#868e96"),this.form.controls.secondary_font_color.setValue("#ffffff"),this.form.controls.secondary_hover_color.setValue("#5a6268"),this.form.controls.date_picker_day_start.setValue("S"),this.form.controls.rio_select_search_mode.setValue("exact"),document.documentElement.style.setProperty("--primary-table-color",this.form.controls.table_color.value),document.documentElement.style.setProperty("--primary-table-font-color",this.form.controls.table_font_color.value),document.documentElement.style.setProperty("--font-size",this.form.controls.font_size.value+"px"),document.documentElement.style.setProperty("--secondary-table-color",this.form.controls.secondary_table_color.value),document.documentElement.style.setProperty("--secondary-table-font-color",this.form.controls.secondary_table_font_color.value),document.documentElement.style.setProperty("--tertiary-table-color",this.form.controls.tertiary_table_color.value),document.documentElement.style.setProperty("--tertiary-table-font-color",this.form.controls.tertiary_table_font_color.value),document.documentElement.style.setProperty("--warning-color",this.form.controls.warning_color.value),document.documentElement.style.setProperty("--warning-font-color",this.form.controls.warning_font_color.value),document.documentElement.style.setProperty("--warning-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.warning_color.value,.5)),document.documentElement.style.setProperty("--warning-hover-color",this.form.controls.warning_hover_color.value),document.documentElement.style.setProperty("--success-color",this.form.controls.success_color.value),document.documentElement.style.setProperty("--success-font-color",this.form.controls.success_font_color.value),document.documentElement.style.setProperty("--success-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.success_color.value,.5)),document.documentElement.style.setProperty("--success-hover-color",this.form.controls.success_hover_color.value),document.documentElement.style.setProperty("--danger-color",this.form.controls.danger_color.value),document.documentElement.style.setProperty("--danger-font-color",this.form.controls.danger_font_color.value),document.documentElement.style.setProperty("--danger-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.danger_color.value,.5)),document.documentElement.style.setProperty("--danger-hover-color",this.form.controls.danger_hover_color.value),document.documentElement.style.setProperty("--info-color",this.form.controls.info_color.value),document.documentElement.style.setProperty("--info-font-color",this.form.controls.info_font_color.value),document.documentElement.style.setProperty("--info-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.info_color.value,.5)),document.documentElement.style.setProperty("--info-hover-color",this.form.controls.info_hover_color.value),document.documentElement.style.setProperty("--primary-color",this.form.controls.primary_color.value),document.documentElement.style.setProperty("--primary-font-color",this.form.controls.primary_font_color.value),document.documentElement.style.setProperty("--primary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.primary_color.value,.5)),document.documentElement.style.setProperty("--primary-hover-color",this.form.controls.primary_hover_color.value),document.documentElement.style.setProperty("--secondary-color",this.form.controls.secondary_color.value),document.documentElement.style.setProperty("--secondary-font-color",this.form.controls.secondary_font_color.value),document.documentElement.style.setProperty("--secondary-shadow-color","0 0 0 0.2rem "+hexToRGB(this.form.controls.secondary_color.value,.5)),document.documentElement.style.setProperty("--secondary-hover-color",this.form.controls.secondary_hover_color.value)}updateStickyDefault(t,e){const n=this.stickySelects.findIndex(e=>e.key===t);if(-1===n)return;const o=this.stickySelects.map(t=>({...t,options:t.options||[]})),r={...o[n]};r.defaultValue=void 0===e?null:e,r.defaultLabel=this._resolveStickyLabel(r,e),r.updatedAt=(new Date).toISOString(),o[n]=r,this.stickySelects=o,this.stickySelections[t]=e,this._stickyAdapter&&this._stickyAdapter.saveStickySelects(o,"user-settings")}retakeTour(){this._tourManager.retake()}_loadStickySelects(t){const e=t||this._services._account.getUser();if(e&&e.other&&Array.isArray(e.other.stickySelects)){const t=[],n=new Set;e.other.stickySelects.forEach(e=>{e&&e.key&&!n.has(e.key)&&(n.add(e.key),t.push({...e,options:e.options||[]}))}),this.stickySelects=t}else this.stickySelects=[];this.stickySelections={},this.stickySelects.forEach(t=>{this.stickySelections[t.key]=void 0!==t.defaultValue?t.defaultValue:null})}_resolveStickyLabel(t,e){if(null==e)return"";const n=(t.options||[]).find(t=>JSON.stringify(t.value)===JSON.stringify(e));return n&&n.label?n.label:"string"==typeof e?e:JSON.stringify(e)}submitForm(t){const e=this._services._account.getUser(),n=this.form.value,o=this._normalizeDatePickerDayStart(n.date_picker_day_start),{date_picker_day_start:r,...i}=n,a={...e?.other||{},date_picker_day_start:o};this._services._socket.call("updateDocumentProps","users",e._id,[{prop:"settings",data:i},{prop:"other",data:a}],e.__v,(t,n)=>{if(n){if(this._services._alert.setAlert("success","Settings have been updated"),e){const t={...e,__v:n&&n.__v?n.__v:e.__v,settings:i,other:a};this._services._account.setUser(t)}}else this._ds.error("Could not update settings"),this._services._socket.call("insertErrorLog","user settings - update user",[this._services._account.getUser(),t])})}_normalizeDatePickerDayStart(t){return"M"===t||"m"===t||1===t||"1"===t?"M":"S"}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UsersSettingsComponent,deps:[{token:AuthPermissionService},{token:UserSettingsService},{token:ProviderService},{token:DialogService},{token:CoreTourService},{token:RIO_SELECT_STICKY_ADAPTER,optional:!0}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:UsersSettingsComponent,isStandalone:!1,selector:"resolveio-users-settings",providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'<style>\n\t.sticky-section-card,\n\t.sticky-section-card * {\n\t\ttransform: none !important;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: #ffffff;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t.settings-shell {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t\tpadding: 12px 8px 32px;\n\t\tbackground: radial-gradient(circle at 15% 20%, rgba(111, 136, 255, 0.12), transparent 35%),\n\t\t\tradial-gradient(circle at 80% 0%, rgba(255, 130, 92, 0.12), transparent 32%),\n\t\t\tlinear-gradient(135deg, #f7f9ff 0%, #ffffff 60%, #f5f7fb 100%);\n\t}\n\n\t.aurora {\n\t\tposition: absolute;\n\t\twidth: 420px;\n\t\theight: 420px;\n\t\tborder-radius: 50%;\n\t\tfilter: blur(70px);\n\t\topacity: .55;\n\t\tmix-blend-mode: screen;\n\t\tanimation: drift 18s ease-in-out infinite alternate;\n\t\tz-index: 0;\n\t}\n\n\t.aurora.aurora-one {\n\t\tbackground: radial-gradient(circle, rgba(82, 163, 255, .7), rgba(134, 120, 255, .25));\n\t\ttop: -120px;\n\t\tleft: -70px;\n\t}\n\n\t.aurora.aurora-two {\n\t\tbackground: radial-gradient(circle, rgba(255, 147, 92, .6), rgba(255, 227, 187, .35));\n\t\tbottom: -140px;\n\t\tright: -40px;\n\t\tanimation-duration: 22s;\n\t}\n\n\t.settings-hero {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 16px;\n\t\talign-items: center;\n\t\tmargin-bottom: 18px;\n\t}\n\n\t.glass-card {\n\t\tposition: relative;\n\t\tbackground: rgba(255, 255, 255, .78);\n\t\tborder: 1px solid rgba(255, 255, 255, .55);\n\t\tbox-shadow: 0 10px 40px rgba(54, 74, 120, .14), inset 0 0 0 1px rgba(255, 255, 255, .32);\n\t\tborder-radius: 18px;\n\t\tpadding: 18px;\n\t\toverflow: hidden;\n\t}\n\n\t.glass-card::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\tinset: 0;\n\t\tborder-radius: inherit;\n\t\tpointer-events: none;\n\t\tz-index: 0;\n\t}\n\n\t.hero-main h2 {\n\t\tfont-weight: 800;\n\t\tfont-size: 26px;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #0f172a;\n\t}\n\n\t.hero-main p {\n\t\tcolor: #4b5563;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.hero-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 12px;\n\t\tborder-radius: 999px;\n\t\tfont-weight: 700;\n\t\tcolor: #1f2937;\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .1), rgba(16, 185, 129, .1), rgba(59, 130, 246, .12));\n\t\tborder: 1px solid rgba(99, 102, 241, .25);\n\t\tmargin-bottom: 10px;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: .04em;\n\t\tfont-size: 12px;\n\t}\n\n\t.hero-actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 12px;\n\t\talign-items: center;\n\t\tmargin-top: 12px;\n\t}\n\n\t.neon-btn {\n\t\tposition: relative;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .15), rgba(59, 130, 246, .08));\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tpadding: 10px 16px;\n\t\tborder-radius: 12px;\n\t\tbox-shadow: 0 10px 24px rgba(99, 102, 241, .15);\n\t\ttransition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;\n\t}\n\n\t.neon-btn:hover {\n\t\ttransform: translateY(-2px);\n\t\tborder-color: rgba(99, 102, 241, .45);\n\t\tbox-shadow: 0 14px 26px rgba(99, 102, 241, .22);\n\t}\n\n\t.save-button form-button ::ng-deep button {\n\t\tborder-radius: 12px;\n\t\tfont-weight: 800;\n\t\tletter-spacing: .01em;\n\t\tpadding: 11px 18px;\n\t\tbox-shadow: 0 10px 26px rgba(16, 185, 129, .24);\n\t}\n\n\t.hero-preview {\n\t\tposition: relative;\n\t}\n\n\t.preview-card {\n\t\tborder-radius: 16px;\n\t\tpadding: 16px;\n\t\tbackground: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .52));\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 12px 30px rgba(80, 110, 185, .16);\n\t\tborder: 1px solid rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-title {\n\t\tfont-weight: 800;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #111827;\n\t}\n\n\t.swatch-row {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(140px, 1fr));\n\t\tgap: 10px;\n\t}\n\n\t.swatch {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);\n\t\topacity: .98;\n\t}\n\n\t.swatch span {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: rgba(15, 23, 42, .85);\n\t}\n\n\t.preview-pulse {\n\t\tposition: absolute;\n\t\twidth: 120px;\n\t\theight: 120px;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(circle, rgba(16, 185, 129, .3), transparent 60%);\n\t\tbottom: -18px;\n\t\tright: -14px;\n\t\tfilter: blur(12px);\n\t\tanimation: pulse 2.4s ease-in-out infinite;\n\t}\n\n\t.hero-metrics {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-top: 14px;\n\t}\n\n\t.metric-pill {\n\t\tbackground: rgba(15, 23, 42, .06);\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 999px;\n\t\tpadding: 8px 12px;\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t}\n\n\t.section-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 14px;\n\t\tposition: relative;\n\t\tz-index: 1;\n\t}\n\n\t.section-card {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t}\n\n\t.section-heading {\n\t\tmargin-bottom: 12px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 10px;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.section-heading h3 {\n\t\tmargin: 0;\n\t\tfont-weight: 800;\n\t\tcolor: #0f172a;\n\t}\n\n\t.section-heading p {\n\t\tmargin: 0;\n\t\tcolor: #4b5563;\n\t}\n\n\t.field-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n\t\tgap: 12px;\n\t}\n\n\t.field-card {\n\t\tpadding: 12px;\n\t\tborder-radius: 14px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .85);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t\ttransition: transform .2s ease, box-shadow .2s ease;\n\t}\n\n\t.field-card:hover {\n\t\tbox-shadow: 0 8px 22px rgba(99, 102, 241, .12);\n\t}\n\n\t/* Avoid transforming the sticky select card so the fixed overlay positions correctly. */\n\t.sticky-select-card:hover {\n\t\ttransform: none;\n\t}\n\n\t.sticky-section-card {\n\t\tanimation: none;\n\t\ttransform: none;\n\t}\n\n\t.field-label {\n\t\tfont-weight: 700;\n\t\tcolor: #111827;\n\t\tmargin-bottom: 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 6px;\n\t}\n\n\t.field-hint {\n\t\tfont-size: 12px;\n\t\tcolor: #6b7280;\n\t\tmargin: 0;\n\t}\n\n\t.input-bevel {\n\t\tborder-radius: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: rgba(255, 255, 255, .92);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t\tpadding: 10px 12px;\n\t\twidth: 100%;\n\t}\n\n\t.toggle {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t}\n\n\t.toggle-input {\n\t\tdisplay: none;\n\t}\n\n\t.toggle-track {\n\t\twidth: 54px;\n\t\theight: 30px;\n\t\tborder-radius: 999px;\n\t\tbackground: linear-gradient(120deg, rgba(15, 23, 42, .08), rgba(15, 23, 42, .15));\n\t\tposition: relative;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t\tborder: 1px solid rgba(15, 23, 42, .12);\n\t\ttransition: background .2s ease;\n\t}\n\n\t.toggle-thumb {\n\t\tposition: absolute;\n\t\ttop: 3px;\n\t\tleft: 3px;\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tborder-radius: 50%;\n\t\tbackground: linear-gradient(135deg, #63a4ff, #83eaf1);\n\t\tbox-shadow: 0 8px 16px rgba(99, 102, 241, .35);\n\t\ttransition: transform .2s ease;\n\t}\n\n\t.toggle-input:checked + .toggle-track {\n\t\tbackground: linear-gradient(120deg, rgba(16, 185, 129, .15), rgba(52, 211, 153, .25));\n\t\tborder-color: rgba(16, 185, 129, .45);\n\t}\n\n\t.toggle-input:checked + .toggle-track .toggle-thumb {\n\t\ttransform: translateX(24px);\n\t\tbackground: linear-gradient(135deg, #10b981, #22d3ee);\n\t\tbox-shadow: 0 10px 18px rgba(16, 185, 129, .32);\n\t}\n\n\t.toggle-state {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(260px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-top: 10px;\n\t}\n\n\t.color-card {\n\t\tborder-radius: 14px;\n\t\tpadding: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .9);\n\t\tdisplay: grid;\n\t\tgrid-template-columns: 1fr 120px;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t}\n\n\t.color-chip {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 4px;\n\t}\n\n\t.color-name {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-preview {\n\t\tborder-radius: 12px;\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.color-input {\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 12px;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);\n\t\twidth: 100%;\n\t\tcursor: pointer;\n\t}\n\n\t.palette-preview {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-bottom: 8px;\n\t}\n\n\t.preview-table {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tbackground: linear-gradient(160deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .7));\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t}\n\n\t.preview-table .row-swatch {\n\t\tborder-radius: 10px;\n\t\tpadding: 10px;\n\t\tfont-weight: 700;\n\t\tmargin-bottom: 6px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-table .row-swatch:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.button-demo {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t}\n\n\t.btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\n\t.btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\n\t.btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t.btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\n\t.btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\n\t.btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t.btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\n\t.btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\n\t.btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t.btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\n\t.btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\n\t.btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t.btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\n\t.btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\n\t.btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t.btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\n\t.btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\n\t.btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t.rio-select .rio-select-container {\n\t\tborder-radius: 12px !important;\n\t\tmin-height: 42px !important;\n\t\tborder-color: rgba(15, 23, 42, .1) !important;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.sticky-empty {\n\t\tbackground: rgba(23, 162, 184, .12);\n\t\tcolor: #0f4c75;\n\t\tborder: 1px solid rgba(23, 162, 184, .2);\n\t\tborder-radius: 12px;\n\t\tpadding: 12px;\n\t}\n\n\t.animate-rise {\n\t\tanimation: rise .5s ease;\n\t}\n\n\t@keyframes drift {\n\t\tfrom {\n\t\t\ttransform: translateY(0) translateX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: translateY(-30px) translateX(20px);\n\t\t}\n\t}\n\n\t@keyframes pulse {\n\t\t0% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t\t50% {\n\t\t\ttransform: scale(1.08);\n\t\t\topacity: .9;\n\t\t}\n\t\t100% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t}\n\n\t@keyframes rise {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(12px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n</style>\n\n<div class="settings-shell">\n\t<div class="aurora aurora-one"></div>\n\t<div class="aurora aurora-two"></div>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submitForm(form)">\n\t\t<div class="settings-hero glass-card animate-rise">\n\t\t\t<div class="hero-main">\n\t\t\t\t<div class="hero-chip">User Settings</div>\n\t\t\t\t<h2>Welcome {{ user?.fullname || user?.username || user?.email || \'back\' }}!</h2>\n\t\t\t\t<p>Shape {{ client || \'your workspace\' }} into something joyful, colorful and uniquely you.</p>\n\t\t\t\t<div class="hero-actions">\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="reset()">Reset to defaults</button>\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="retakeTour()">Retake Tour</button>\n\t\t\t\t\t<div class="save-button">\n\t\t\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="hero-metrics">\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Entries / page</span>\n\t\t\t\t\t\t<strong>{{ form.controls.entries_per_page.value }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Font size</span>\n\t\t\t\t\t\t<strong>{{ form.controls.font_size.value }}px</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Week starts</span>\n\t\t\t\t\t\t<strong>{{ form.controls.date_picker_day_start.value === \'M\' ? \'Monday\' : \'Sunday\' }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="hero-preview">\n\t\t\t\t<div class="preview-card">\n\t\t\t\t\t<div class="preview-title">Live palette peek</div>\n\t\t\t\t\t<div class="swatch-row">\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.primary_color.value" [style.color]="form.controls.primary_font_color.value">\n\t\t\t\t\t\t\t<span>Primary buttons</span>\n\t\t\t\t\t\t\t{{ form.controls.primary_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\t<span>Success tone</span>\n\t\t\t\t\t\t\t{{ form.controls.success_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\t<span>Primary table</span>\n\t\t\t\t\t\t\t{{ form.controls.table_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="preview-pulse"></div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="section-grid">\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Experience preferences</h3>\n\t\t\t\t\t<p>Tune how the app greets you each day.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="field-grid">\n\t\t\t\t\t<label class="field-card">\n\t\t\t\t\t\t<div class="field-label">Collapsable menu</div>\n\t\t\t\t\t\t<p class="field-hint">Keep navigation cozy when you want focus.</p>\n\t\t\t\t\t\t<div class="toggle">\n\t\t\t\t\t\t\t<input class="toggle-input" type="checkbox" formControlName="collapsable_menu" />\n\t\t\t\t\t\t\t<span class="toggle-track">\n\t\t\t\t\t\t\t\t<span class="toggle-thumb"></span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class="toggle-state">\n\t\t\t\t\t\t\t\t@if (form.controls.collapsable_menu.value) {\n\t\t\t\t\t\t\t\t\tCompact\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\tOpen\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</label>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Default entries per page</div>\n\t\t\t\t\t\t<p class="field-hint">Pick your sweet spot for list density.</p>\n\t\t\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.entries_per_page.valid ? \'is-valid\' : \'is-invalid\']" formControlName="entries_per_page" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t\t\t<rio-option value="25">25</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="50">50</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="100">100</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="250">250</rio-option>\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (!form.controls.entries_per_page.valid) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Entries per page is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Select search style</div>\n\t\t\t\t\t\t<p class="field-hint">Decide if typing should be fuzzy or exact.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.rio_select_search_mode.valid ? \'is-valid\' : \'is-invalid\']" formControlName="rio_select_search_mode" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="fuzzy">Fuzzy (flexible matching)</rio-option>\n\t\t\t\t\t\t\t<rio-option value="exact">Exact (must contain the term)</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Font size</div>\n\t\t\t\t\t\t<p class="field-hint">We recommend between 11–14px for quick scanning.</p>\n\t\t\t\t\t\t<input class="input-bevel" [ngClass]="[form.controls.font_size.valid ? \'is-valid\' : \'is-invalid\']" type="number" formControlName="font_size" (keyup)="changePrimaryFontSize()" />\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'wholeNumbersGreaterThanZero\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is invalid</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'maxValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not exceed 18</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'minValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not be less than 8</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Week start (date picker)</div>\n\t\t\t\t\t\t<p class="field-hint">Pick where your planner begins.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.date_picker_day_start.valid ? \'is-valid\' : \'is-invalid\']" formControlName="date_picker_day_start" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option [value]="\'S\'">Sunday</rio-option>\n\t\t\t\t\t\t\t<rio-option [value]="\'M\'">Monday</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (form.controls.date_picker_day_start.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Week start is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Starting page</div>\n\t\t\t\t\t\t<p class="field-hint">Jump right into the view you love most.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.opening_route.valid ? \'is-valid\' : \'\']" formControlName="opening_route" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="/home">Home</rio-option>\n\t\t\t\t\t\t\t@for (view of views; track view.display) {\n\t\t\t\t\t\t\t\t<rio-option [value]="view.value">{{ view.display | titleCase }}</rio-option>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Routing preference</div>\n\t\t\t\t\t\t<p class="field-hint">Leave as default to follow company behavior, or override just for your account.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.routing_preference.valid ? \'is-valid\' : \'\']" formControlName="routing_preference" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="">Use App Default</rio-option>\n\t\t\t\t\t\t\t<rio-option value="alwaysAsk">Always Ask</rio-option>\n\t\t\t\t\t\t\t<rio-option value="sameTab">Same Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newTab">New Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newWindow">New Window</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Table palette</h3>\n\t\t\t\t\t<p>Pick vibrant layers for your data rows.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="palette-preview">\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\tPrimary header\n\t\t\t\t\t\t\t<span>{{ form.controls.table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.secondary_table_color.value" [style.color]="form.controls.secondary_table_font_color.value">\n\t\t\t\t\t\t\tSecondary header\n\t\t\t\t\t\t\t<span>{{ form.controls.secondary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.tertiary_table_color.value" [style.color]="form.controls.tertiary_table_font_color.value">\n\t\t\t\t\t\t\tTertiary header\n\t\t\t\t\t\t\t<span>{{ form.controls.tertiary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.warning_color.value" [style.color]="form.controls.warning_font_color.value">\n\t\t\t\t\t\t\tWarnings\n\t\t\t\t\t\t\t<span>{{ form.controls.warning_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\tSuccess\n\t\t\t\t\t\t\t<span>{{ form.controls.success_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.info_color.value" [style.color]="form.controls.info_font_color.value">\n\t\t\t\t\t\t\tInfo\n\t\t\t\t\t\t\t<span>{{ form.controls.info_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero row that anchors your data.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_color" (ngModelChange)="changePrimaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it crisp and readable.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_font_color" (ngModelChange)="changePrimaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for supporting sections.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_color" (ngModelChange)="changeSecondaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Match contrast with the new hue.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_font_color" (ngModelChange)="changeSecondaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">For extra callouts.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_color" (ngModelChange)="changeTertiaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Balance brightness for legibility.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_font_color" (ngModelChange)="changeTertiaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Button glow-up</h3>\n\t\t\t\t\t<p>Make clicks feel friendly and intentional.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="button-demo">\n\t\t\t\t\t<button type="button" class="btn btn-success">Success</button>\n\t\t\t\t\t<button type="button" class="btn btn-warning">Warning</button>\n\t\t\t\t\t<button type="button" class="btn btn-danger">Danger</button>\n\t\t\t\t\t<button type="button" class="btn btn-info">Info</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary">Primary</button>\n\t\t\t\t\t<button type="button" class="btn btn-secondary">Secondary</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Celebrate wins.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_color" (ngModelChange)="changeSuccessColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it sharp.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_font_color" (ngModelChange)="changeSuccessFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">How the button greets hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_hover_color" (ngModelChange)="changeSuccessHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle but visible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_color" (ngModelChange)="changeWarningColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning font</div>\n\t\t\t\t\t\t\t<div class="field-hint">High contrast copy.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_font_color" (ngModelChange)="changeWarningFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add motion to caution.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_hover_color" (ngModelChange)="changeWarningHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Clear stop signal.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_color" (ngModelChange)="changeDangerColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Stay readable on alert.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_font_color" (ngModelChange)="changeDangerFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Softer on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_hover_color" (ngModelChange)="changeDangerHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Highlight helpful hints.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_color" (ngModelChange)="changeInfoColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep tips legible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_font_color" (ngModelChange)="changeInfoFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle motion on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_hover_color" (ngModelChange)="changeInfoHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero action.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_color" (ngModelChange)="changePrimaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Strong contrast for CTA.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_font_color" (ngModelChange)="changePrimaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">A playful shift on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_hover_color" (ngModelChange)="changePrimaryButtonHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for subtle actions.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_color" (ngModelChange)="changeSecondaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it balanced.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_font_color" (ngModelChange)="changeSecondaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add a soft glow.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_hover_color" (ngModelChange)="changeSecondaryHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise sticky-section-card">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Sticky select defaults</h3>\n\t\t\t\t\t<p>Teach ResolveIO which choices you love.</p>\n\t\t\t\t</div>\n\t\t\t\t@if (!stickySelects.length) {\n\t\t\t\t\t<div class="sticky-empty">\n\t\t\t\t\t\tNo sticky selects saved yet. Add a stickyKey on a select to remember your favorite defaults.\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t@for (sticky of stickySelects; track sticky.key) {\n\t\t\t\t\t\t<div class="field-card sticky-select-card">\n\t\t\t\t\t\t\t<div class="field-label">{{ sticky.key }}</div>\n\t\t\t\t\t\t\t@if (sticky.options && sticky.options.length) {\n\t\t\t\t\t\t\t\t<rio-select\n\t\t\t\t\t\t\t\t\t[(ngModel)]="stickySelections[sticky.key]"\n\t\t\t\t\t\t\t\t\t[ngModelOptions]="{standalone: true}"\n\t\t\t\t\t\t\t\t\t[options]="sticky.options"\n\t\t\t\t\t\t\t\t\toptionValueKey="value"\n\t\t\t\t\t\t\t\t\toptionLabelKey="label"\n\t\t\t\t\t\t\t\t\t[searchable]="false"\n\t\t\t\t\t\t\t\t\tappendTo="body"\n\t\t\t\t\t\t\t\t\t[stickyAutoSave]="true"\n\t\t\t\t\t\t\t\t\t(ngModelChange)="updateStickyDefault(sticky.key, $event)">\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@if (!sticky.options || !sticky.options.length) {\n\t\t\t\t\t\t\t\t<div class="text-muted">No saved options yet.</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>\n',styles:['.sticky-section-card,.sticky-section-card *{transform:none!important}:host{display:block}::ng-deep :root{--primary-table-color: #3b3ee3;--primary-table-font-color: #ffffff;--font-size: 12px;--secondary-table-color: #87ceeb;--secondary-table-font-color: #000000;--tertiary-table-color: #ff4500;--tertiary-table-font-color: #000000;--warning-color: #ffc107;--warning-font-color: #000000;--warning-hover-color: #e0a800;--warning-shadow-color: 0 0 0 .2rem rgba(222, 170, 12, .5);--success-color: #28a745;--success-font-color: #ffffff;--success-hover-color: #218838;--success-shadow-color: 0 0 0 .2rem rgba(72, 180, 97, .5);--danger-color: #dc3545;--danger-font-color: #ffffff;--danger-hover-color: #c82333;--danger-shadow-color: 0 0 0 .2rem rgba(225, 83, 97, .5);--info-color: #17a2b8;--info-font-color: #ffffff;--info-hover-color: #138496;--info-shadow-color: 0 0 0 .2rem rgba(58, 176, 195, .5);--primary-color: #007bff;--primary-font-color: #ffffff;--primary-hover-color: #0069d9;--primary-shadow-color: 0 0 0 .2rem rgba(38, 143, 255, .5);--secondary-color: #868e96;--secondary-font-color: #ffffff;--secondary-hover-color: #5a6268;--secondary-shadow-color: 0 0 0 .2rem rgba(130, 138, 145, .5)}.settings-shell{position:relative;overflow:visible;padding:12px 8px 32px;background:radial-gradient(circle at 15% 20%,rgba(111,136,255,.12),transparent 35%),radial-gradient(circle at 80% 0%,rgba(255,130,92,.12),transparent 32%),linear-gradient(135deg,#f7f9ff,#fff 60%,#f5f7fb)}.aurora{position:absolute;width:420px;height:420px;border-radius:50%;filter:blur(70px);opacity:.55;mix-blend-mode:screen;animation:drift 18s ease-in-out infinite alternate;z-index:0}.aurora.aurora-one{background:radial-gradient(circle,#52a3ffb3,#8678ff40);top:-120px;left:-70px}.aurora.aurora-two{background:radial-gradient(circle,#ff935c99,#ffe3bb59);bottom:-140px;right:-40px;animation-duration:22s}.settings-hero{position:relative;z-index:1;display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;align-items:center;margin-bottom:18px}.glass-card{position:relative;background:#ffffffc7;border:1px solid rgba(255,255,255,.55);box-shadow:0 10px 40px #364a7824,inset 0 0 0 1px #ffffff52;border-radius:18px;padding:18px;overflow:hidden}.glass-card:before{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;z-index:0}.hero-main h2{font-weight:800;font-size:26px;margin-bottom:8px;color:#0f172a}.hero-main p{color:#4b5563;margin-bottom:12px}.hero-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;font-weight:700;color:#1f2937;background:linear-gradient(120deg,#6366f11a,#10b9811a,#3b82f61f);border:1px solid rgba(99,102,241,.25);margin-bottom:10px;text-transform:uppercase;letter-spacing:.04em;font-size:12px}.hero-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center;margin-top:12px}.neon-btn{position:relative;border:1px solid rgba(15,23,42,.1);background:linear-gradient(120deg,#6366f126,#3b82f614);color:#0f172a;font-weight:700;padding:10px 16px;border-radius:12px;box-shadow:0 10px 24px #6366f126;transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease}.neon-btn:hover{transform:translateY(-2px);border-color:#6366f173;box-shadow:0 14px 26px #6366f138}.save-button form-button ::ng-deep button{border-radius:12px;font-weight:800;letter-spacing:.01em;padding:11px 18px;box-shadow:0 10px 26px #10b9813d}.hero-preview{position:relative}.preview-card{border-radius:16px;padding:16px;background:radial-gradient(circle at 20% 20%,#ffffffb3,#ffffff85);box-shadow:inset 0 1px #fffc,0 12px 30px #506eb929;border:1px solid rgba(255,255,255,.6)}.preview-title{font-weight:800;margin-bottom:8px;color:#111827}.swatch-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:10px}.swatch{border-radius:12px;padding:10px;color:#0f172a;font-weight:700;display:flex;align-items:center;justify-content:space-between;box-shadow:inset 0 1px #ffffff73;opacity:.98}.swatch span{font-size:12px;font-weight:600;color:#0f172ad9}.preview-pulse{position:absolute;width:120px;height:120px;border-radius:50%;background:radial-gradient(circle,rgba(16,185,129,.3),transparent 60%);bottom:-18px;right:-14px;filter:blur(12px);animation:pulse 2.4s ease-in-out infinite}.hero-metrics{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}.metric-pill{background:#0f172a0f;border:1px solid rgba(15,23,42,.08);border-radius:999px;padding:8px 12px;font-weight:700;color:#0f172a;display:inline-flex;align-items:center;gap:6px}.section-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px;position:relative;z-index:1}.section-card{position:relative;overflow:visible}.section-heading{margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}.section-heading h3{margin:0;font-weight:800;color:#0f172a}.section-heading p{margin:0;color:#4b5563}.field-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}.field-card{padding:12px;border-radius:14px;border:1px solid rgba(15,23,42,.06);background:#ffffffd9;box-shadow:inset 0 1px #ffffffb3;transition:transform .2s ease,box-shadow .2s ease}.field-card:hover{box-shadow:0 8px 22px #6366f11f}.sticky-select-card:hover{transform:none}.sticky-section-card{animation:none;transform:none}.field-label{font-weight:700;color:#111827;margin-bottom:4px;display:flex;align-items:center;justify-content:space-between;gap:6px}.field-hint{font-size:12px;color:#6b7280;margin:0}.input-bevel{border-radius:12px;border:1px solid rgba(15,23,42,.1);background:#ffffffeb;box-shadow:inset 0 1px #fffc;padding:10px 12px;width:100%}.toggle{display:flex;align-items:center;gap:8px}.toggle-input{display:none}.toggle-track{width:54px;height:30px;border-radius:999px;background:linear-gradient(120deg,#0f172a14,#0f172a26);position:relative;box-shadow:inset 0 1px #fff9;border:1px solid rgba(15,23,42,.12);transition:background .2s ease}.toggle-thumb{position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:linear-gradient(135deg,#63a4ff,#83eaf1);box-shadow:0 8px 16px #6366f159;transition:transform .2s ease}.toggle-input:checked+.toggle-track{background:linear-gradient(120deg,#10b98126,#34d39940);border-color:#10b98173}.toggle-input:checked+.toggle-track .toggle-thumb{transform:translate(24px);background:linear-gradient(135deg,#10b981,#22d3ee);box-shadow:0 10px 18px #10b98152}.toggle-state{font-weight:700;color:#0f172a}.color-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px;margin-top:10px}.color-card{border-radius:14px;padding:12px;border:1px solid rgba(15,23,42,.06);background:#ffffffe6;display:grid;grid-template-columns:1fr 120px;gap:10px;align-items:center}.color-chip{display:flex;flex-direction:column;gap:4px}.color-name{font-weight:700;color:#0f172a}.color-preview{border-radius:12px;height:48px;border:1px solid rgba(15,23,42,.08);box-shadow:inset 0 1px #ffffffb3}.color-input{height:48px;border:1px solid rgba(15,23,42,.08);border-radius:12px;box-shadow:inset 0 1px #ffffffbf;width:100%;cursor:pointer}.palette-preview{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:10px;margin-bottom:8px}.preview-table{border-radius:12px;padding:10px;background:linear-gradient(160deg,#ffffffd9,#ffffffb3);border:1px solid rgba(15,23,42,.08);box-shadow:inset 0 1px #fffc}.preview-table .row-swatch{border-radius:10px;padding:10px;font-weight:700;margin-bottom:6px;display:flex;align-items:center;justify-content:space-between;box-shadow:inset 0 1px #fff9}.preview-table .row-swatch:last-child{margin-bottom:0}.button-demo{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}.btn-warning{color:var(--warning-font-color);background-color:var(--warning-color);border-color:var(--warning-color)}.btn-warning:focus,.btn-warning.focus{box-shadow:var(--warning-shadow-color)}.btn-warning:hover{color:var(--warning-font-color);background-color:var(--warning-hover-color);border-color:var(--warning-hover-color)}.btn-success{color:var(--success-font-color);background-color:var(--success-color);border-color:var(--success-color)}.btn-success:focus,.btn-success.focus{box-shadow:var(--success-shadow-color)}.btn-success:hover{color:var(--success-font-color);background-color:var(--success-hover-color);border-color:var(--success-hover-color)}.btn-danger{color:var(--danger-font-color);background-color:var(--danger-color);border-color:var(--danger-color)}.btn-danger:focus,.btn-danger.focus{box-shadow:var(--danger-shadow-color)}.btn-danger:hover{color:var(--danger-font-color);background-color:var(--danger-hover-color);border-color:var(--danger-hover-color)}.btn-info{color:var(--info-font-color);background-color:var(--info-color);border-color:var(--info-color)}.btn-info:focus,.btn-info.focus{box-shadow:var(--info-shadow-color)}.btn-info:hover{color:var(--info-font-color);background-color:var(--info-hover-color);border-color:var(--info-hover-color)}.btn-primary{color:var(--primary-font-color);background-color:var(--primary-color);border-color:var(--primary-color)}.btn-primary:focus,.btn-primary.focus{box-shadow:var(--primary-shadow-color)}.btn-primary:hover{color:var(--primary-font-color);background-color:var(--primary-hover-color);border-color:var(--primary-hover-color)}.btn-secondary{color:var(--secondary-font-color);background-color:var(--secondary-color);border-color:var(--secondary-color)}.btn-secondary:focus,.btn-secondary.focus{box-shadow:var(--secondary-shadow-color)}.btn-secondary:hover{color:var(--secondary-font-color);background-color:var(--secondary-hover-color);border-color:var(--secondary-hover-color)}.rio-select .rio-select-container{border-radius:12px!important;min-height:42px!important;border-color:#0f172a1a!important;box-shadow:inset 0 1px #ffffffb3}.sticky-empty{background:#17a2b81f;color:#0f4c75;border:1px solid rgba(23,162,184,.2);border-radius:12px;padding:12px}.animate-rise{animation:rise .5s ease}@keyframes drift{0%{transform:translateY(0) translate(0)}to{transform:translateY(-30px) translate(20px)}}@keyframes pulse{0%{transform:scale(1);opacity:.6}50%{transform:scale(1.08);opacity:.9}to{transform:scale(1);opacity:.6}}@keyframes rise{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}\n'],dependencies:[{kind:"directive",type:AiFormAutoRegisterDirective,selector:"form[formGroup]",inputs:["aiFormAutoRegister","aiFormLabel","aiFormIgnore"]},{kind:"directive",type:i2.ɵNgNoValidate,selector:"form:not([ngNoForm]):not([ngNativeValidate])"},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.NumberValueAccessor,selector:"input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]"},{kind:"directive",type:i2.CheckboxControlValueAccessor,selector:"input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]"},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgControlStatusGroup,selector:"[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]"},{kind:"directive",type:i2.FormGroupDirective,selector:"[formGroup]",inputs:["formGroup"],outputs:["ngSubmit"],exportAs:["ngForm"]},{kind:"directive",type:i2.FormControlName,selector:"[formControlName]",inputs:["formControlName","disabled","ngModel"],outputs:["ngModelChange"]},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:FormButtonComponent,selector:"form-button",inputs:["form","disabled","type"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:i5.RioOptionComponent,selector:"rio-option",inputs:["value","disabled","label","id"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"pipe",type:TitleCaseAndUnderscorePipe,name:"titleCase"}]})}function hexToRGB(t,e){let n=parseInt(t.slice(1,3),16),o=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e?"rgba("+n+", "+o+", "+r+", "+e+")":"rgb("+n+", "+o+", "+r+")"}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UsersSettingsComponent,decorators:[{type:Component,args:[{selector:"resolveio-users-settings",providers:[ProviderService],standalone:!1,template:'<style>\n\t.sticky-section-card,\n\t.sticky-section-card * {\n\t\ttransform: none !important;\n\t}\n\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t::ng-deep :root {\n\t\t--primary-table-color: #3b3ee3;\n\t\t--primary-table-font-color: #ffffff;\n\t\t--font-size: 12px;\n\t\t--secondary-table-color: #87ceeb;\n\t\t--secondary-table-font-color: #000000;\n\t\t--tertiary-table-color: #ff4500;\n\t\t--tertiary-table-font-color: #000000;\n\t\t--warning-color: #ffc107;\n\t\t--warning-font-color: #000000;\n\t\t--warning-hover-color: #e0a800;\n\t\t--warning-shadow-color: 0 0 0 0.2rem rgba(222, 170, 12, 0.5);\n\t\t--success-color: #28a745;\n\t\t--success-font-color: #ffffff;\n\t\t--success-hover-color: #218838;\n\t\t--success-shadow-color: 0 0 0 0.2rem rgba(72, 180, 97, 0.5);\n\t\t--danger-color: #dc3545;\n\t\t--danger-font-color: #ffffff;\n\t\t--danger-hover-color: #c82333;\n\t\t--danger-shadow-color: 0 0 0 0.2rem rgba(225, 83, 97, 0.5);\n\t\t--info-color: #17a2b8;\n\t\t--info-font-color: #ffffff;\n\t\t--info-hover-color: #138496;\n\t\t--info-shadow-color: 0 0 0 0.2rem rgba(58, 176, 195, 0.5);\n\t\t--primary-color: #007bff;\n\t\t--primary-font-color: #ffffff;\n\t\t--primary-hover-color: #0069d9;\n\t\t--primary-shadow-color: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);\n\t\t--secondary-color: #868e96;\n\t\t--secondary-font-color: #ffffff;\n\t\t--secondary-hover-color: #5a6268;\n\t\t--secondary-shadow-color: 0 0 0 0.2rem rgba(130, 138, 145, 0.5);\n\t}\n\n\t.settings-shell {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t\tpadding: 12px 8px 32px;\n\t\tbackground: radial-gradient(circle at 15% 20%, rgba(111, 136, 255, 0.12), transparent 35%),\n\t\t\tradial-gradient(circle at 80% 0%, rgba(255, 130, 92, 0.12), transparent 32%),\n\t\t\tlinear-gradient(135deg, #f7f9ff 0%, #ffffff 60%, #f5f7fb 100%);\n\t}\n\n\t.aurora {\n\t\tposition: absolute;\n\t\twidth: 420px;\n\t\theight: 420px;\n\t\tborder-radius: 50%;\n\t\tfilter: blur(70px);\n\t\topacity: .55;\n\t\tmix-blend-mode: screen;\n\t\tanimation: drift 18s ease-in-out infinite alternate;\n\t\tz-index: 0;\n\t}\n\n\t.aurora.aurora-one {\n\t\tbackground: radial-gradient(circle, rgba(82, 163, 255, .7), rgba(134, 120, 255, .25));\n\t\ttop: -120px;\n\t\tleft: -70px;\n\t}\n\n\t.aurora.aurora-two {\n\t\tbackground: radial-gradient(circle, rgba(255, 147, 92, .6), rgba(255, 227, 187, .35));\n\t\tbottom: -140px;\n\t\tright: -40px;\n\t\tanimation-duration: 22s;\n\t}\n\n\t.settings-hero {\n\t\tposition: relative;\n\t\tz-index: 1;\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 16px;\n\t\talign-items: center;\n\t\tmargin-bottom: 18px;\n\t}\n\n\t.glass-card {\n\t\tposition: relative;\n\t\tbackground: rgba(255, 255, 255, .78);\n\t\tborder: 1px solid rgba(255, 255, 255, .55);\n\t\tbox-shadow: 0 10px 40px rgba(54, 74, 120, .14), inset 0 0 0 1px rgba(255, 255, 255, .32);\n\t\tborder-radius: 18px;\n\t\tpadding: 18px;\n\t\toverflow: hidden;\n\t}\n\n\t.glass-card::before {\n\t\tcontent: \'\';\n\t\tposition: absolute;\n\t\tinset: 0;\n\t\tborder-radius: inherit;\n\t\tpointer-events: none;\n\t\tz-index: 0;\n\t}\n\n\t.hero-main h2 {\n\t\tfont-weight: 800;\n\t\tfont-size: 26px;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #0f172a;\n\t}\n\n\t.hero-main p {\n\t\tcolor: #4b5563;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.hero-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tpadding: 6px 12px;\n\t\tborder-radius: 999px;\n\t\tfont-weight: 700;\n\t\tcolor: #1f2937;\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .1), rgba(16, 185, 129, .1), rgba(59, 130, 246, .12));\n\t\tborder: 1px solid rgba(99, 102, 241, .25);\n\t\tmargin-bottom: 10px;\n\t\ttext-transform: uppercase;\n\t\tletter-spacing: .04em;\n\t\tfont-size: 12px;\n\t}\n\n\t.hero-actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 12px;\n\t\talign-items: center;\n\t\tmargin-top: 12px;\n\t}\n\n\t.neon-btn {\n\t\tposition: relative;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: linear-gradient(120deg, rgba(99, 102, 241, .15), rgba(59, 130, 246, .08));\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tpadding: 10px 16px;\n\t\tborder-radius: 12px;\n\t\tbox-shadow: 0 10px 24px rgba(99, 102, 241, .15);\n\t\ttransition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;\n\t}\n\n\t.neon-btn:hover {\n\t\ttransform: translateY(-2px);\n\t\tborder-color: rgba(99, 102, 241, .45);\n\t\tbox-shadow: 0 14px 26px rgba(99, 102, 241, .22);\n\t}\n\n\t.save-button form-button ::ng-deep button {\n\t\tborder-radius: 12px;\n\t\tfont-weight: 800;\n\t\tletter-spacing: .01em;\n\t\tpadding: 11px 18px;\n\t\tbox-shadow: 0 10px 26px rgba(16, 185, 129, .24);\n\t}\n\n\t.hero-preview {\n\t\tposition: relative;\n\t}\n\n\t.preview-card {\n\t\tborder-radius: 16px;\n\t\tpadding: 16px;\n\t\tbackground: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .7), rgba(255, 255, 255, .52));\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 12px 30px rgba(80, 110, 185, .16);\n\t\tborder: 1px solid rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-title {\n\t\tfont-weight: 800;\n\t\tmargin-bottom: 8px;\n\t\tcolor: #111827;\n\t}\n\n\t.swatch-row {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(140px, 1fr));\n\t\tgap: 10px;\n\t}\n\n\t.swatch {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tcolor: #0f172a;\n\t\tfont-weight: 700;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);\n\t\topacity: .98;\n\t}\n\n\t.swatch span {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: rgba(15, 23, 42, .85);\n\t}\n\n\t.preview-pulse {\n\t\tposition: absolute;\n\t\twidth: 120px;\n\t\theight: 120px;\n\t\tborder-radius: 50%;\n\t\tbackground: radial-gradient(circle, rgba(16, 185, 129, .3), transparent 60%);\n\t\tbottom: -18px;\n\t\tright: -14px;\n\t\tfilter: blur(12px);\n\t\tanimation: pulse 2.4s ease-in-out infinite;\n\t}\n\n\t.hero-metrics {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-top: 14px;\n\t}\n\n\t.metric-pill {\n\t\tbackground: rgba(15, 23, 42, .06);\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 999px;\n\t\tpadding: 8px 12px;\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t}\n\n\t.section-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(320px, 1fr));\n\t\tgap: 14px;\n\t\tposition: relative;\n\t\tz-index: 1;\n\t}\n\n\t.section-card {\n\t\tposition: relative;\n\t\toverflow: visible;\n\t}\n\n\t.section-heading {\n\t\tmargin-bottom: 12px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 10px;\n\t\tflex-wrap: wrap;\n\t}\n\n\t.section-heading h3 {\n\t\tmargin: 0;\n\t\tfont-weight: 800;\n\t\tcolor: #0f172a;\n\t}\n\n\t.section-heading p {\n\t\tmargin: 0;\n\t\tcolor: #4b5563;\n\t}\n\n\t.field-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(240px, 1fr));\n\t\tgap: 12px;\n\t}\n\n\t.field-card {\n\t\tpadding: 12px;\n\t\tborder-radius: 14px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .85);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t\ttransition: transform .2s ease, box-shadow .2s ease;\n\t}\n\n\t.field-card:hover {\n\t\tbox-shadow: 0 8px 22px rgba(99, 102, 241, .12);\n\t}\n\n\t/* Avoid transforming the sticky select card so the fixed overlay positions correctly. */\n\t.sticky-select-card:hover {\n\t\ttransform: none;\n\t}\n\n\t.sticky-section-card {\n\t\tanimation: none;\n\t\ttransform: none;\n\t}\n\n\t.field-label {\n\t\tfont-weight: 700;\n\t\tcolor: #111827;\n\t\tmargin-bottom: 4px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 6px;\n\t}\n\n\t.field-hint {\n\t\tfont-size: 12px;\n\t\tcolor: #6b7280;\n\t\tmargin: 0;\n\t}\n\n\t.input-bevel {\n\t\tborder-radius: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .1);\n\t\tbackground: rgba(255, 255, 255, .92);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t\tpadding: 10px 12px;\n\t\twidth: 100%;\n\t}\n\n\t.toggle {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t}\n\n\t.toggle-input {\n\t\tdisplay: none;\n\t}\n\n\t.toggle-track {\n\t\twidth: 54px;\n\t\theight: 30px;\n\t\tborder-radius: 999px;\n\t\tbackground: linear-gradient(120deg, rgba(15, 23, 42, .08), rgba(15, 23, 42, .15));\n\t\tposition: relative;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t\tborder: 1px solid rgba(15, 23, 42, .12);\n\t\ttransition: background .2s ease;\n\t}\n\n\t.toggle-thumb {\n\t\tposition: absolute;\n\t\ttop: 3px;\n\t\tleft: 3px;\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tborder-radius: 50%;\n\t\tbackground: linear-gradient(135deg, #63a4ff, #83eaf1);\n\t\tbox-shadow: 0 8px 16px rgba(99, 102, 241, .35);\n\t\ttransition: transform .2s ease;\n\t}\n\n\t.toggle-input:checked + .toggle-track {\n\t\tbackground: linear-gradient(120deg, rgba(16, 185, 129, .15), rgba(52, 211, 153, .25));\n\t\tborder-color: rgba(16, 185, 129, .45);\n\t}\n\n\t.toggle-input:checked + .toggle-track .toggle-thumb {\n\t\ttransform: translateX(24px);\n\t\tbackground: linear-gradient(135deg, #10b981, #22d3ee);\n\t\tbox-shadow: 0 10px 18px rgba(16, 185, 129, .32);\n\t}\n\n\t.toggle-state {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(260px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-top: 10px;\n\t}\n\n\t.color-card {\n\t\tborder-radius: 14px;\n\t\tpadding: 12px;\n\t\tborder: 1px solid rgba(15, 23, 42, .06);\n\t\tbackground: rgba(255, 255, 255, .9);\n\t\tdisplay: grid;\n\t\tgrid-template-columns: 1fr 120px;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t}\n\n\t.color-chip {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 4px;\n\t}\n\n\t.color-name {\n\t\tfont-weight: 700;\n\t\tcolor: #0f172a;\n\t}\n\n\t.color-preview {\n\t\tborder-radius: 12px;\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.color-input {\n\t\theight: 48px;\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tborder-radius: 12px;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);\n\t\twidth: 100%;\n\t\tcursor: pointer;\n\t}\n\n\t.palette-preview {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\tgap: 10px;\n\t\tmargin-bottom: 8px;\n\t}\n\n\t.preview-table {\n\t\tborder-radius: 12px;\n\t\tpadding: 10px;\n\t\tbackground: linear-gradient(160deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .7));\n\t\tborder: 1px solid rgba(15, 23, 42, .08);\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);\n\t}\n\n\t.preview-table .row-swatch {\n\t\tborder-radius: 10px;\n\t\tpadding: 10px;\n\t\tfont-weight: 700;\n\t\tmargin-bottom: 6px;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .6);\n\t}\n\n\t.preview-table .row-swatch:last-child {\n\t\tmargin-bottom: 0;\n\t}\n\n\t.button-demo {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t}\n\n\t.btn-warning {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-color);\n\t\tborder-color: var(--warning-color);\n\t}\n\n\t.btn-warning:focus,\n\t.btn-warning.focus {\n\t\tbox-shadow: var(--warning-shadow-color);\n\t}\n\n\t.btn-warning:hover {\n\t\tcolor: var(--warning-font-color);\n\t\tbackground-color: var(--warning-hover-color);\n\t\tborder-color: var(--warning-hover-color);\n\t}\n\n\t.btn-success {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-color);\n\t\tborder-color: var(--success-color);\n\t}\n\n\t.btn-success:focus,\n\t.btn-success.focus {\n\t\tbox-shadow: var(--success-shadow-color);\n\t}\n\n\t.btn-success:hover {\n\t\tcolor: var(--success-font-color);\n\t\tbackground-color: var(--success-hover-color);\n\t\tborder-color: var(--success-hover-color);\n\t}\n\n\t.btn-danger {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-color);\n\t\tborder-color: var(--danger-color);\n\t}\n\n\t.btn-danger:focus,\n\t.btn-danger.focus {\n\t\tbox-shadow: var(--danger-shadow-color);\n\t}\n\n\t.btn-danger:hover {\n\t\tcolor: var(--danger-font-color);\n\t\tbackground-color: var(--danger-hover-color);\n\t\tborder-color: var(--danger-hover-color);\n\t}\n\n\t.btn-info {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-color);\n\t\tborder-color: var(--info-color);\n\t}\n\n\t.btn-info:focus,\n\t.btn-info.focus {\n\t\tbox-shadow: var(--info-shadow-color);\n\t}\n\n\t.btn-info:hover {\n\t\tcolor: var(--info-font-color);\n\t\tbackground-color: var(--info-hover-color);\n\t\tborder-color: var(--info-hover-color);\n\t}\n\n\t.btn-primary {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-color);\n\t\tborder-color: var(--primary-color);\n\t}\n\n\t.btn-primary:focus,\n\t.btn-primary.focus {\n\t\tbox-shadow: var(--primary-shadow-color);\n\t}\n\n\t.btn-primary:hover {\n\t\tcolor: var(--primary-font-color);\n\t\tbackground-color: var(--primary-hover-color);\n\t\tborder-color: var(--primary-hover-color);\n\t}\n\n\t.btn-secondary {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-color);\n\t\tborder-color: var(--secondary-color);\n\t}\n\n\t.btn-secondary:focus,\n\t.btn-secondary.focus {\n\t\tbox-shadow: var(--secondary-shadow-color);\n\t}\n\n\t.btn-secondary:hover {\n\t\tcolor: var(--secondary-font-color);\n\t\tbackground-color: var(--secondary-hover-color);\n\t\tborder-color: var(--secondary-hover-color);\n\t}\n\n\t.rio-select .rio-select-container {\n\t\tborder-radius: 12px !important;\n\t\tmin-height: 42px !important;\n\t\tborder-color: rgba(15, 23, 42, .1) !important;\n\t\tbox-shadow: inset 0 1px 0 rgba(255, 255, 255, .7);\n\t}\n\n\t.sticky-empty {\n\t\tbackground: rgba(23, 162, 184, .12);\n\t\tcolor: #0f4c75;\n\t\tborder: 1px solid rgba(23, 162, 184, .2);\n\t\tborder-radius: 12px;\n\t\tpadding: 12px;\n\t}\n\n\t.animate-rise {\n\t\tanimation: rise .5s ease;\n\t}\n\n\t@keyframes drift {\n\t\tfrom {\n\t\t\ttransform: translateY(0) translateX(0);\n\t\t}\n\t\tto {\n\t\t\ttransform: translateY(-30px) translateX(20px);\n\t\t}\n\t}\n\n\t@keyframes pulse {\n\t\t0% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t\t50% {\n\t\t\ttransform: scale(1.08);\n\t\t\topacity: .9;\n\t\t}\n\t\t100% {\n\t\t\ttransform: scale(1);\n\t\t\topacity: .6;\n\t\t}\n\t}\n\n\t@keyframes rise {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(12px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n</style>\n\n<div class="settings-shell">\n\t<div class="aurora aurora-one"></div>\n\t<div class="aurora aurora-two"></div>\n\t<form [formGroup]="form" novalidate (ngSubmit)="submitForm(form)">\n\t\t<div class="settings-hero glass-card animate-rise">\n\t\t\t<div class="hero-main">\n\t\t\t\t<div class="hero-chip">User Settings</div>\n\t\t\t\t<h2>Welcome {{ user?.fullname || user?.username || user?.email || \'back\' }}!</h2>\n\t\t\t\t<p>Shape {{ client || \'your workspace\' }} into something joyful, colorful and uniquely you.</p>\n\t\t\t\t<div class="hero-actions">\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="reset()">Reset to defaults</button>\n\t\t\t\t\t<button type="button" class="neon-btn" (click)="retakeTour()">Retake Tour</button>\n\t\t\t\t\t<div class="save-button">\n\t\t\t\t\t\t<form-button [form]="form" [disabled]="disableFormButton"></form-button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="hero-metrics">\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Entries / page</span>\n\t\t\t\t\t\t<strong>{{ form.controls.entries_per_page.value }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Font size</span>\n\t\t\t\t\t\t<strong>{{ form.controls.font_size.value }}px</strong>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="metric-pill">\n\t\t\t\t\t\t<span>Week starts</span>\n\t\t\t\t\t\t<strong>{{ form.controls.date_picker_day_start.value === \'M\' ? \'Monday\' : \'Sunday\' }}</strong>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="hero-preview">\n\t\t\t\t<div class="preview-card">\n\t\t\t\t\t<div class="preview-title">Live palette peek</div>\n\t\t\t\t\t<div class="swatch-row">\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.primary_color.value" [style.color]="form.controls.primary_font_color.value">\n\t\t\t\t\t\t\t<span>Primary buttons</span>\n\t\t\t\t\t\t\t{{ form.controls.primary_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\t<span>Success tone</span>\n\t\t\t\t\t\t\t{{ form.controls.success_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\t<span>Primary table</span>\n\t\t\t\t\t\t\t{{ form.controls.table_color.value }}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="preview-pulse"></div>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<div class="section-grid">\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Experience preferences</h3>\n\t\t\t\t\t<p>Tune how the app greets you each day.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="field-grid">\n\t\t\t\t\t<label class="field-card">\n\t\t\t\t\t\t<div class="field-label">Collapsable menu</div>\n\t\t\t\t\t\t<p class="field-hint">Keep navigation cozy when you want focus.</p>\n\t\t\t\t\t\t<div class="toggle">\n\t\t\t\t\t\t\t<input class="toggle-input" type="checkbox" formControlName="collapsable_menu" />\n\t\t\t\t\t\t\t<span class="toggle-track">\n\t\t\t\t\t\t\t\t<span class="toggle-thumb"></span>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<div class="toggle-state">\n\t\t\t\t\t\t\t\t@if (form.controls.collapsable_menu.value) {\n\t\t\t\t\t\t\t\t\tCompact\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\tOpen\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</label>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Default entries per page</div>\n\t\t\t\t\t\t<p class="field-hint">Pick your sweet spot for list density.</p>\n\t\t\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.entries_per_page.valid ? \'is-valid\' : \'is-invalid\']" formControlName="entries_per_page" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t\t\t<rio-option value="25">25</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="50">50</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="100">100</rio-option>\n\t\t\t\t\t\t\t\t\t<rio-option value="250">250</rio-option>\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (!form.controls.entries_per_page.valid) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Entries per page is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Select search style</div>\n\t\t\t\t\t\t<p class="field-hint">Decide if typing should be fuzzy or exact.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.rio_select_search_mode.valid ? \'is-valid\' : \'is-invalid\']" formControlName="rio_select_search_mode" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="fuzzy">Fuzzy (flexible matching)</rio-option>\n\t\t\t\t\t\t\t<rio-option value="exact">Exact (must contain the term)</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Font size</div>\n\t\t\t\t\t\t<p class="field-hint">We recommend between 11–14px for quick scanning.</p>\n\t\t\t\t\t\t<input class="input-bevel" [ngClass]="[form.controls.font_size.valid ? \'is-valid\' : \'is-invalid\']" type="number" formControlName="font_size" (keyup)="changePrimaryFontSize()" />\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'wholeNumbersGreaterThanZero\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size is invalid</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'maxValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not exceed 18</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@if (form.controls.font_size.hasError(\'minValue\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Font size can not be less than 8</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Week start (date picker)</div>\n\t\t\t\t\t\t<p class="field-hint">Pick where your planner begins.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.date_picker_day_start.valid ? \'is-valid\' : \'is-invalid\']" formControlName="date_picker_day_start" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option [value]="\'S\'">Sunday</rio-option>\n\t\t\t\t\t\t\t<rio-option [value]="\'M\'">Monday</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t@if (form.controls.date_picker_day_start.hasError(\'required\')) {\n\t\t\t\t\t\t\t<div class="text-danger mt-1">Week start is required</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Starting page</div>\n\t\t\t\t\t\t<p class="field-hint">Jump right into the view you love most.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.opening_route.valid ? \'is-valid\' : \'\']" formControlName="opening_route" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="/home">Home</rio-option>\n\t\t\t\t\t\t\t@for (view of views; track view.display) {\n\t\t\t\t\t\t\t\t<rio-option [value]="view.value">{{ view.display | titleCase }}</rio-option>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="field-card">\n\t\t\t\t\t\t<div class="field-label">Routing preference</div>\n\t\t\t\t\t\t<p class="field-hint">Leave as default to follow company behavior, or override just for your account.</p>\n\t\t\t\t\t\t<rio-select class="input-bevel" [ngClass]="[form.controls.routing_preference.valid ? \'is-valid\' : \'\']" formControlName="routing_preference" [clearable]="false" [searchable]="false">\n\t\t\t\t\t\t\t<rio-option value="">Use App Default</rio-option>\n\t\t\t\t\t\t\t<rio-option value="alwaysAsk">Always Ask</rio-option>\n\t\t\t\t\t\t\t<rio-option value="sameTab">Same Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newTab">New Tab</rio-option>\n\t\t\t\t\t\t\t<rio-option value="newWindow">New Window</rio-option>\n\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Table palette</h3>\n\t\t\t\t\t<p>Pick vibrant layers for your data rows.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="palette-preview">\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.table_color.value" [style.color]="form.controls.table_font_color.value">\n\t\t\t\t\t\t\tPrimary header\n\t\t\t\t\t\t\t<span>{{ form.controls.table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.secondary_table_color.value" [style.color]="form.controls.secondary_table_font_color.value">\n\t\t\t\t\t\t\tSecondary header\n\t\t\t\t\t\t\t<span>{{ form.controls.secondary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.tertiary_table_color.value" [style.color]="form.controls.tertiary_table_font_color.value">\n\t\t\t\t\t\t\tTertiary header\n\t\t\t\t\t\t\t<span>{{ form.controls.tertiary_table_font_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="preview-table">\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.warning_color.value" [style.color]="form.controls.warning_font_color.value">\n\t\t\t\t\t\t\tWarnings\n\t\t\t\t\t\t\t<span>{{ form.controls.warning_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.success_color.value" [style.color]="form.controls.success_font_color.value">\n\t\t\t\t\t\t\tSuccess\n\t\t\t\t\t\t\t<span>{{ form.controls.success_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="row-swatch" [style.background]="form.controls.info_color.value" [style.color]="form.controls.info_font_color.value">\n\t\t\t\t\t\t\tInfo\n\t\t\t\t\t\t\t<span>{{ form.controls.info_hover_color.value }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero row that anchors your data.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_color" (ngModelChange)="changePrimaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it crisp and readable.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="table_font_color" (ngModelChange)="changePrimaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for supporting sections.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_color" (ngModelChange)="changeSecondaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Match contrast with the new hue.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_table_font_color" (ngModelChange)="changeSecondaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table background</div>\n\t\t\t\t\t\t\t<div class="field-hint">For extra callouts.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_color" (ngModelChange)="changeTertiaryColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Tertiary table font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Balance brightness for legibility.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.tertiary_table_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="tertiary_table_font_color" (ngModelChange)="changeTertiaryFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Button glow-up</h3>\n\t\t\t\t\t<p>Make clicks feel friendly and intentional.</p>\n\t\t\t\t</div>\n\t\t\t\t<div class="button-demo">\n\t\t\t\t\t<button type="button" class="btn btn-success">Success</button>\n\t\t\t\t\t<button type="button" class="btn btn-warning">Warning</button>\n\t\t\t\t\t<button type="button" class="btn btn-danger">Danger</button>\n\t\t\t\t\t<button type="button" class="btn btn-info">Info</button>\n\t\t\t\t\t<button type="button" class="btn btn-primary">Primary</button>\n\t\t\t\t\t<button type="button" class="btn btn-secondary">Secondary</button>\n\t\t\t\t</div>\n\t\t\t\t<div class="color-grid">\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Celebrate wins.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_color" (ngModelChange)="changeSuccessColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it sharp.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_font_color" (ngModelChange)="changeSuccessFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Success hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">How the button greets hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.success_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="success_hover_color" (ngModelChange)="changeSuccessHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle but visible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_color" (ngModelChange)="changeWarningColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning font</div>\n\t\t\t\t\t\t\t<div class="field-hint">High contrast copy.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_font_color" (ngModelChange)="changeWarningFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Warning hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add motion to caution.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.warning_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="warning_hover_color" (ngModelChange)="changeWarningHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Clear stop signal.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_color" (ngModelChange)="changeDangerColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Stay readable on alert.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_font_color" (ngModelChange)="changeDangerFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Danger hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Softer on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.danger_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="danger_hover_color" (ngModelChange)="changeDangerHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Highlight helpful hints.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_color" (ngModelChange)="changeInfoColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep tips legible.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_font_color" (ngModelChange)="changeInfoFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Info hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Gentle motion on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.info_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="info_hover_color" (ngModelChange)="changeInfoHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">The hero action.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_color" (ngModelChange)="changePrimaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Strong contrast for CTA.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_font_color" (ngModelChange)="changePrimaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Primary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">A playful shift on hover.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.primary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="primary_hover_color" (ngModelChange)="changePrimaryButtonHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary background</div>\n\t\t\t\t\t\t\t<div class="field-hint">Great for subtle actions.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_color" (ngModelChange)="changeSecondaryButtonColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary font</div>\n\t\t\t\t\t\t\t<div class="field-hint">Keep it balanced.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_font_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_font_color" (ngModelChange)="changeSecondaryButtonFontColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="color-card">\n\t\t\t\t\t\t<div class="color-chip">\n\t\t\t\t\t\t\t<div class="color-name">Secondary hover</div>\n\t\t\t\t\t\t\t<div class="field-hint">Add a soft glow.</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<input type="color" class="color-input" [ngClass]="[form.controls.secondary_hover_color.value ? \'is-valid\' : \'is-invalid\']" formControlName="secondary_hover_color" (ngModelChange)="changeSecondaryHoverColor()" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class="section-card glass-card animate-rise sticky-section-card">\n\t\t\t\t<div class="section-heading">\n\t\t\t\t\t<h3>Sticky select defaults</h3>\n\t\t\t\t\t<p>Teach ResolveIO which choices you love.</p>\n\t\t\t\t</div>\n\t\t\t\t@if (!stickySelects.length) {\n\t\t\t\t\t<div class="sticky-empty">\n\t\t\t\t\t\tNo sticky selects saved yet. Add a stickyKey on a select to remember your favorite defaults.\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t@for (sticky of stickySelects; track sticky.key) {\n\t\t\t\t\t\t<div class="field-card sticky-select-card">\n\t\t\t\t\t\t\t<div class="field-label">{{ sticky.key }}</div>\n\t\t\t\t\t\t\t@if (sticky.options && sticky.options.length) {\n\t\t\t\t\t\t\t\t<rio-select\n\t\t\t\t\t\t\t\t\t[(ngModel)]="stickySelections[sticky.key]"\n\t\t\t\t\t\t\t\t\t[ngModelOptions]="{standalone: true}"\n\t\t\t\t\t\t\t\t\t[options]="sticky.options"\n\t\t\t\t\t\t\t\t\toptionValueKey="value"\n\t\t\t\t\t\t\t\t\toptionLabelKey="label"\n\t\t\t\t\t\t\t\t\t[searchable]="false"\n\t\t\t\t\t\t\t\t\tappendTo="body"\n\t\t\t\t\t\t\t\t\t[stickyAutoSave]="true"\n\t\t\t\t\t\t\t\t\t(ngModelChange)="updateStickyDefault(sticky.key, $event)">\n\t\t\t\t\t\t\t\t</rio-select>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t@if (!sticky.options || !sticky.options.length) {\n\t\t\t\t\t\t\t\t<div class="text-muted">No saved options yet.</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</form>\n</div>\n'}]}],ctorParameters:()=>[{type:AuthPermissionService},{type:UserSettingsService},{type:ProviderService},{type:DialogService},{type:CoreTourService},{type:void 0,decorators:[{type:Optional},{type:Inject,args:[RIO_SELECT_STICKY_ADAPTER]}]}]});const routes=[{path:"user-settings",component:UserSettingsComponent,children:[{path:"settings",component:UsersSettingsComponent},{path:"**",redirectTo:"settings"}]}],UserSettingsRouting=RouterModule.forChild(routes);class RioPaginationComponent{collectionSize=0;page=1;pageSize=25;maxSize=7;boundaryLinks=!0;directionLinks=!0;ellipses=!0;disabled=!1;pageChange=new EventEmitter;currentPage=1;totalPages=1;pageEntries=[1];ngOnChanges(){this.recalculate()}get canGoPrevious(){return!this.disabled&&this.currentPage>1}get canGoNext(){return!this.disabled&&this.currentPage<this.totalPages}goToFirst(t){this.goToPage(1,t)}goToPrevious(t){this.goToPage(this.currentPage-1,t)}goToNext(t){this.goToPage(this.currentPage+1,t)}goToLast(t){this.goToPage(this.totalPages,t)}goToPage(t,e){if(e?.preventDefault(),e?.stopPropagation(),this.disabled)return;const n=this.clampPage(t);n!==this.currentPage&&(this.currentPage=n,this.pageEntries=this.buildPageEntries(),this.pageChange.emit(this.currentPage))}isPageNumber(t){return"number"==typeof t}trackByEntry(t,e){return`${e}-${t}`}recalculate(){const t=this.toPositiveInt(this.pageSize,25),e=this.toNonNegativeInt(this.collectionSize,0);this.totalPages=Math.max(1,Math.ceil(e/t)),this.currentPage=this.clampPage(this.page),this.pageEntries=this.buildPageEntries()}buildPageEntries(){if(this.totalPages<=1)return[1];const t=Math.max(3,this.toPositiveInt(this.maxSize,7));if(this.totalPages<=t)return this.createRange(1,this.totalPages);if(!this.ellipses){let e=this.currentPage-Math.floor(t/2),n=e+t-1;return e<1&&(e=1,n=t),n>this.totalPages&&(n=this.totalPages,e=Math.max(1,n-t+1)),this.createRange(e,n)}const e=[1],n=Math.max(1,t-2);let o=this.currentPage-Math.floor(n/2),r=o+n-1;return o<2&&(o=2,r=o+n-1),r>this.totalPages-1&&(r=this.totalPages-1,o=Math.max(2,r-n+1)),o>2&&e.push("ellipsis-left"),e.push(...this.createRange(o,r)),r<this.totalPages-1&&e.push("ellipsis-right"),e.push(this.totalPages),e}createRange(t,e){const n=[];for(let o=t;o<=e;o++)n.push(o);return n}clampPage(t){const e=this.toPositiveInt(t,1);return Math.min(Math.max(1,e),this.totalPages)}toPositiveInt(t,e){const n="string"==typeof t?parseInt(t,10):t;return!Number.isFinite(n)||n<=0?e:Math.floor(n)}toNonNegativeInt(t,e){const n="string"==typeof t?parseInt(t,10):t;return!Number.isFinite(n)||n<0?e:Math.floor(n)}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationComponent,deps:[],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:RioPaginationComponent,isStandalone:!1,selector:"rio-pagination",inputs:{collectionSize:"collectionSize",page:"page",pageSize:"pageSize",maxSize:"maxSize",boundaryLinks:"boundaryLinks",directionLinks:"directionLinks",ellipses:"ellipses",disabled:"disabled"},outputs:{pageChange:"pageChange"},usesOnChanges:!0,ngImport:i0,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.rio-pagination {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 6px;\n\t}\n\n\t.rio-page-btn {\n\t\tmin-width: 36px;\n\t\theight: 36px;\n\t\tpadding: 0 10px;\n\t\tborder: 1px solid rgba(106, 129, 165, 0.4);\n\t\tborder-radius: 10px;\n\t\tbackground: linear-gradient(180deg, #ffffff, #eff4ff);\n\t\tcolor: #2f4d75;\n\t\tfont-size: 12px;\n\t\tfont-weight: 700;\n\t\tline-height: 1;\n\t\tletter-spacing: 0.02em;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\ttransition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;\n\t}\n\n\t.rio-page-btn:hover:not(:disabled) {\n\t\tborder-color: rgba(63, 112, 201, 0.7);\n\t\tbox-shadow: 0 4px 12px rgba(25, 67, 137, 0.18);\n\t\ttransform: translateY(-1px);\n\t}\n\n\t.rio-page-btn:focus-visible {\n\t\toutline: none;\n\t\tbox-shadow: 0 0 0 3px rgba(41, 110, 235, 0.25);\n\t}\n\n\t.rio-page-btn:disabled {\n\t\topacity: 0.45;\n\t\tcursor: not-allowed;\n\t\ttransform: none;\n\t\tbox-shadow: none;\n\t}\n\n\t.rio-page-btn.is-active {\n\t\tborder-color: rgba(23, 78, 181, 0.92);\n\t\tbackground: linear-gradient(180deg, #2b78eb, #1f58ba);\n\t\tcolor: #ffffff;\n\t\tbox-shadow: 0 8px 18px rgba(31, 88, 186, 0.3);\n\t}\n\n\t.rio-page-btn.rio-page-nav {\n\t\tmin-width: 44px;\n\t}\n\n\t.rio-page-btn.rio-page-nav.rio-page-boundary {\n\t\tmin-width: 48px;\n\t}\n\n\t.rio-page-ellipsis {\n\t\tmin-width: 24px;\n\t\ttext-align: center;\n\t\tcolor: #738bab;\n\t\tfont-weight: 700;\n\t\tuser-select: none;\n\t}\n\n\t.rio-pagination.rio-pagination-disabled .rio-page-btn {\n\t\tpointer-events: none;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.rio-pagination {\n\t\t\tjustify-content: flex-start;\n\t\t}\n\n\t\t.rio-page-btn {\n\t\t\tmin-width: 34px;\n\t\t\theight: 34px;\n\t\t\tfont-size: 11px;\n\t\t}\n\t}\n</style>\n\n<nav class="rio-pagination" [class.rio-pagination-disabled]="disabled" aria-label="Pagination">\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoPrevious" (click)="goToFirst($event)" aria-label="First page">«</button>\n\t}\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoPrevious" (click)="goToPrevious($event)" aria-label="Previous page">‹</button>\n\t}\n\n\t@for (entry of pageEntries; track trackByEntry($index, entry)) {\n\t\t@if (isPageNumber(entry)) {\n\t\t\t<button\n\t\t\t\ttype="button"\n\t\t\t\tclass="rio-page-btn"\n\t\t\t\t[class.is-active]="entry === currentPage"\n\t\t\t\t[attr.aria-current]="entry === currentPage ? \'page\' : null"\n\t\t\t\t[attr.aria-label]="\'Page \' + entry"\n\t\t\t\t[disabled]="disabled"\n\t\t\t\t(click)="goToPage(entry, $event)">\n\t\t\t\t{{ entry }}\n\t\t\t</button>\n\t\t}\n\t\t@else {\n\t\t\t<span class="rio-page-ellipsis" aria-hidden="true">…</span>\n\t\t}\n\t}\n\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoNext" (click)="goToNext($event)" aria-label="Next page">›</button>\n\t}\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoNext" (click)="goToLast($event)" aria-label="Last page">»</button>\n\t}\n</nav>\n',styles:[":host{display:block}.rio-pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:6px}.rio-page-btn{min-width:36px;height:36px;padding:0 10px;border:1px solid rgba(106,129,165,.4);border-radius:10px;background:linear-gradient(180deg,#fff,#eff4ff);color:#2f4d75;font-size:12px;font-weight:700;line-height:1;letter-spacing:.02em;display:inline-flex;align-items:center;justify-content:center;transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease,background-color .16s ease}.rio-page-btn:hover:not(:disabled){border-color:#3f70c9b3;box-shadow:0 4px 12px #1943892e;transform:translateY(-1px)}.rio-page-btn:focus-visible{outline:none;box-shadow:0 0 0 3px #296eeb40}.rio-page-btn:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}.rio-page-btn.is-active{border-color:#174eb5eb;background:linear-gradient(180deg,#2b78eb,#1f58ba);color:#fff;box-shadow:0 8px 18px #1f58ba4d}.rio-page-btn.rio-page-nav{min-width:44px}.rio-page-btn.rio-page-nav.rio-page-boundary{min-width:48px}.rio-page-ellipsis{min-width:24px;text-align:center;color:#738bab;font-weight:700;-webkit-user-select:none;user-select:none}.rio-pagination.rio-pagination-disabled .rio-page-btn{pointer-events:none}@media(max-width:768px){.rio-pagination{justify-content:flex-start}.rio-page-btn{min-width:34px;height:34px;font-size:11px}}\n"]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationComponent,decorators:[{type:Component,args:[{selector:"rio-pagination",standalone:!1,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.rio-pagination {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: flex-end;\n\t\tgap: 6px;\n\t}\n\n\t.rio-page-btn {\n\t\tmin-width: 36px;\n\t\theight: 36px;\n\t\tpadding: 0 10px;\n\t\tborder: 1px solid rgba(106, 129, 165, 0.4);\n\t\tborder-radius: 10px;\n\t\tbackground: linear-gradient(180deg, #ffffff, #eff4ff);\n\t\tcolor: #2f4d75;\n\t\tfont-size: 12px;\n\t\tfont-weight: 700;\n\t\tline-height: 1;\n\t\tletter-spacing: 0.02em;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\ttransition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease, background-color 0.16s ease;\n\t}\n\n\t.rio-page-btn:hover:not(:disabled) {\n\t\tborder-color: rgba(63, 112, 201, 0.7);\n\t\tbox-shadow: 0 4px 12px rgba(25, 67, 137, 0.18);\n\t\ttransform: translateY(-1px);\n\t}\n\n\t.rio-page-btn:focus-visible {\n\t\toutline: none;\n\t\tbox-shadow: 0 0 0 3px rgba(41, 110, 235, 0.25);\n\t}\n\n\t.rio-page-btn:disabled {\n\t\topacity: 0.45;\n\t\tcursor: not-allowed;\n\t\ttransform: none;\n\t\tbox-shadow: none;\n\t}\n\n\t.rio-page-btn.is-active {\n\t\tborder-color: rgba(23, 78, 181, 0.92);\n\t\tbackground: linear-gradient(180deg, #2b78eb, #1f58ba);\n\t\tcolor: #ffffff;\n\t\tbox-shadow: 0 8px 18px rgba(31, 88, 186, 0.3);\n\t}\n\n\t.rio-page-btn.rio-page-nav {\n\t\tmin-width: 44px;\n\t}\n\n\t.rio-page-btn.rio-page-nav.rio-page-boundary {\n\t\tmin-width: 48px;\n\t}\n\n\t.rio-page-ellipsis {\n\t\tmin-width: 24px;\n\t\ttext-align: center;\n\t\tcolor: #738bab;\n\t\tfont-weight: 700;\n\t\tuser-select: none;\n\t}\n\n\t.rio-pagination.rio-pagination-disabled .rio-page-btn {\n\t\tpointer-events: none;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.rio-pagination {\n\t\t\tjustify-content: flex-start;\n\t\t}\n\n\t\t.rio-page-btn {\n\t\t\tmin-width: 34px;\n\t\t\theight: 34px;\n\t\t\tfont-size: 11px;\n\t\t}\n\t}\n</style>\n\n<nav class="rio-pagination" [class.rio-pagination-disabled]="disabled" aria-label="Pagination">\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoPrevious" (click)="goToFirst($event)" aria-label="First page">«</button>\n\t}\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoPrevious" (click)="goToPrevious($event)" aria-label="Previous page">‹</button>\n\t}\n\n\t@for (entry of pageEntries; track trackByEntry($index, entry)) {\n\t\t@if (isPageNumber(entry)) {\n\t\t\t<button\n\t\t\t\ttype="button"\n\t\t\t\tclass="rio-page-btn"\n\t\t\t\t[class.is-active]="entry === currentPage"\n\t\t\t\t[attr.aria-current]="entry === currentPage ? \'page\' : null"\n\t\t\t\t[attr.aria-label]="\'Page \' + entry"\n\t\t\t\t[disabled]="disabled"\n\t\t\t\t(click)="goToPage(entry, $event)">\n\t\t\t\t{{ entry }}\n\t\t\t</button>\n\t\t}\n\t\t@else {\n\t\t\t<span class="rio-page-ellipsis" aria-hidden="true">…</span>\n\t\t}\n\t}\n\n\t@if (directionLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav" [disabled]="!canGoNext" (click)="goToNext($event)" aria-label="Next page">›</button>\n\t}\n\t@if (boundaryLinks) {\n\t\t<button type="button" class="rio-page-btn rio-page-nav rio-page-boundary" [disabled]="!canGoNext" (click)="goToLast($event)" aria-label="Last page">»</button>\n\t}\n</nav>\n'}]}],propDecorators:{collectionSize:[{type:Input}],page:[{type:Input}],pageSize:[{type:Input}],maxSize:[{type:Input}],boundaryLinks:[{type:Input}],directionLinks:[{type:Input}],ellipses:[{type:Input}],disabled:[{type:Input}],pageChange:[{type:Output}]}});class RioPaginationModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,declarations:[RioPaginationComponent],imports:[CommonModule],exports:[RioPaginationComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,imports:[CommonModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:RioPaginationModule,decorators:[{type:NgModule,args:[{imports:[CommonModule],declarations:[RioPaginationComponent],exports:[RioPaginationComponent]}]}]});class DatatableCellTemplateDirective{templateRef;key;constructor(t){this.templateRef=t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableCellTemplateDirective,deps:[{token:i0.TemplateRef}],target:i0.ɵɵFactoryTarget.Directive});static"ɵdir"=i0.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"21.1.2",type:DatatableCellTemplateDirective,isStandalone:!1,selector:"ng-template[dataTableCell]",inputs:{key:["dataTableCell","key"]},ngImport:i0})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableCellTemplateDirective,decorators:[{type:Directive,args:[{selector:"ng-template[dataTableCell]",standalone:!1}]}],ctorParameters:()=>[{type:i0.TemplateRef}],propDecorators:{key:[{type:Input,args:["dataTableCell"]}]}});const DATATABLE_DEFAULT_CONFIG=new InjectionToken("DATATABLE_DEFAULT_CONFIG");function provideDatatableDefaultConfig(t){return{provide:DATATABLE_DEFAULT_CONFIG,useValue:t}}class DatatableComponent extends BaseComponent{_services;_dialog;locale;datatableDefaultConfig;datatableDefaultConfigLegacy;jsonPipe;upperCasePipe;lowerCasePipe;titleCasePipe;urlClick="";columns=[];data=[];collapseSize=990;searchTitle="Search...";totalItems=1e3;entriesPerPageOptions=[25,50,100,250];searchBarAutoSearch=!0;searchDebounceMs=350;searchMinLength=2;searchDistinct=!0;IronBatchAssign=!1;tableFixed=!1;headerFixed=!1;stickyHeaders=!0;users=[];rowIdKey="_id";rowNavigationMode;returnIdUrls=["yardDashboard","acctManagerDashboard","fieldDashboard","salesDashboard"];showSearch=!0;showPaging=!0;showToolbar=!0;showEntriesControl=!0;showResultsSummary=!0;hideSearch=!1;hideFooter=!1;onChangeTableData=new EventEmitter;tableDataChange=new EventEmitter;cellAction=new EventEmitter;rowClick=new EventEmitter;rowSelected=new EventEmitter;returnId=new EventEmitter;onChangeRequested=new EventEmitter;onChangeTankLevels=new EventEmitter;onChangeCurrentRate=new EventEmitter;onChangeTankHistory=new EventEmitter;tableData;cellTemplateDirectives;cellTemplates=new Map;normalizedColumns=[];displayData=[];entriesPerPageSelectOptions=[];activeHeaderMenuKey=null;headerMenuStep="root";headerMenuTransitionClass="dt-header-menu-fade-in";headerFilterEditor=null;searchDebounceHandle=null;headerMenuTransitionHandle=null;lastAutoSearchValue="";templateChangesSubscription=null;constructor(t,e,n,o,r,i,a,s,l){super(t),this._services=t,this._dialog=e,this.locale=n,this.datatableDefaultConfig=o,this.datatableDefaultConfigLegacy=r,this.jsonPipe=i,this.upperCasePipe=a,this.lowerCasePipe=s,this.titleCasePipe=l}ngOnChanges(t){this.applyLegacyVisibilityAliases(),this.refreshEntriesPerPageOptions(),!t.tableData&&this.tableData||this.initializeTableData(),t.entriesPerPageOptions&&this.tableData&&(this.tableData.entriesPerPage=this.normalizeEntriesPerPage(this.tableData.entriesPerPage)),t.columns&&(this.refreshColumns(),this.activeHeaderMenuKey&&!this.normalizedColumns.some(t=>this.getSortKey(t)===this.activeHeaderMenuKey)&&this.closeHeaderMenu()),(t.data||t.tableData||t.columns)&&this.refreshDisplayData()}ngAfterContentInit(){this.applyLegacyVisibilityAliases(),this.refreshColumns(),this.refreshTemplateMap(),this.cellTemplateDirectives&&(this.templateChangesSubscription=this.cellTemplateDirectives.changes.subscribe(()=>this.refreshTemplateMap()))}applyLegacyVisibilityAliases(){this.hideSearch&&(this.showSearch=!1,this.showResultsSummary=!1,this.showToolbar=!1),this.hideFooter&&(this.showPaging=!1)}ngOnDestroy(){this.searchDebounceHandle&&(clearTimeout(this.searchDebounceHandle),this.searchDebounceHandle=null),this.headerMenuTransitionHandle&&(clearTimeout(this.headerMenuTransitionHandle),this.headerMenuTransitionHandle=null),this.templateChangesSubscription&&(this.templateChangesSubscription.unsubscribe(),this.templateChangesSubscription=null)}initializeTableData(){const t=this.tableData||{searchString:"",entriesPerPage:this.entriesPerPageOptions[0],pageNum:1,sortColumn:"",sortOrder:"desc",filters:{}};t.searchString=t.searchString||"",t.entriesPerPage=this.normalizeEntriesPerPage(t.entriesPerPage),t.pageNum=this.normalizePageNum(t.pageNum),t.sortColumn=t.sortColumn||"",t.sortOrder=t.sortOrder||"desc",t.filters=t.filters||{},this.isObjectMap(t.columnFilters)&&Object.keys(t.columnFilters).length||delete t.columnFilters,this.tableData=t}refreshDisplayData(){const t=Array.isArray(this.data)?this.data:[];this.displayData=this.applyColumnFilters(t)}refreshColumns(){const t=[];(this.columns||[]).forEach(e=>{Array.isArray(e)?e.forEach(e=>{e&&e.data&&t.push(e)}):e&&e.data&&t.push(e)}),this.normalizedColumns=t}refreshTemplateMap(){this.cellTemplates.clear(),this.cellTemplateDirectives&&this.cellTemplateDirectives.forEach(t=>{t&&t.key&&this.cellTemplates.set(t.key,t.templateRef)})}refreshEntriesPerPageOptions(){const t=(this.entriesPerPageOptions||[]).map(t=>{const e="string"==typeof t?parseInt(t,10):t;return{label:`${t}`,value:Number.isFinite(e)&&e>0?e:t}});this.entriesPerPageSelectOptions=t.length?t:[{label:"25",value:25}]}normalizeEntriesPerPage(t){if(null==t||""===t)return this.entriesPerPageOptions[0];const e="string"==typeof t?parseInt(t,10):t;return Number.isFinite(e)&&e>0?e:this.entriesPerPageOptions[0]}normalizePageNum(t){return!t||t<1?1:t}emitTableDataChange(){this.tableData.entriesPerPage=this.normalizeEntriesPerPage(this.tableData.entriesPerPage),this.tableData.pageNum=this.normalizePageNum(this.tableData.pageNum),this.sanitizeColumnFiltersState();const t={...this.tableData};this.isObjectMap(t.columnFilters)&&Object.keys(t.columnFilters).length||delete t.columnFilters,this.tableDataChange.emit(t),this.onChangeTableData.emit(t)}sanitizeColumnFiltersState(){this.tableData&&(this.isObjectMap(this.tableData.columnFilters)&&Object.keys(this.tableData.columnFilters).length||delete this.tableData.columnFilters)}isObjectMap(t){return!!t&&"object"==typeof t&&!Array.isArray(t)}changeTableData(){this.emitTableDataChange()}onSearchSubmit(){this.searchDebounceHandle&&(clearTimeout(this.searchDebounceHandle),this.searchDebounceHandle=null),this.lastAutoSearchValue=this.getSearchValue(),this.tableData.pageNum=1,this.changeTableData()}onSearchChange(){if(!this.searchBarAutoSearch)return;this.searchDebounceHandle&&(clearTimeout(this.searchDebounceHandle),this.searchDebounceHandle=null);const t=this.getSearchValue(),e=this.normalizeSearchMinLength(this.searchMinLength),n=t.trim().length;e>0&&n>0&&n<e||this.searchDistinct&&this.lastAutoSearchValue===t||(this.searchDebounceHandle=setTimeout(()=>{this.searchDebounceHandle=null;const t=this.getSearchValue(),n=t.trim().length;e>0&&n>0&&n<e||this.searchDistinct&&this.lastAutoSearchValue===t||(this.lastAutoSearchValue=t,this.tableData.pageNum=1,this.changeTableData())},Math.max(0,this.searchDebounceMs)))}getSearchValue(){const t=this.tableData?.searchString;return null==t?"":"string"==typeof t?t:String(t)}normalizeSearchMinLength(t){const e="string"==typeof t?parseInt(t,10):t;return Number.isFinite(e)?Math.max(0,e):0}onEntriesPerPageChange(t){void 0!==t&&(this.tableData.entriesPerPage=t),this.tableData.entriesPerPage=this.normalizeEntriesPerPage(this.tableData.entriesPerPage),this.tableData.pageNum=1,this.emitTableDataChange()}onPageChange(t){Number.isFinite(t)&&(this.tableData.pageNum=Math.max(1,t)),this.emitTableDataChange()}sortColumn(t,e){const n=this.getSortKey(t,e);n&&(this.tableData.sortColumn===n?"desc"===this.tableData.sortOrder?this.tableData.sortOrder="asc":this.tableData.sortOrder="desc":(this.tableData.sortOrder="asc",this.tableData.sortColumn=n),this.changeTableData())}sortColumnWithOrder(t,e,n){const o=this.getSortKey(t,n);o&&(this.tableData.sortColumn=o,this.tableData.sortOrder=e,this.tableData.pageNum=1,this.changeTableData())}hasHeaderMenuActions(t){return!!t&&(!1!==t.sortable||this.isFilterableColumn(t))}isHeaderMenuOpen(t){return!!t&&this.activeHeaderMenuKey===this.getSortKey(t)}onHeaderClick(t,e){if(!this.hasHeaderMenuActions(t))return;e.preventDefault(),e.stopPropagation();const n=this.getSortKey(t);n&&(this.activeHeaderMenuKey!==n?(this.activeHeaderMenuKey=n,this.setHeaderMenuStepImmediate("root")):this.closeHeaderMenu())}showSortMenu(t){t.preventDefault(),t.stopPropagation(),this.transitionHeaderMenuStep("sort")}showRootHeaderMenu(t){t.preventDefault(),t.stopPropagation(),this.transitionHeaderMenuStep("root")}sortFromHeaderMenu(t,e,n){n.preventDefault(),n.stopPropagation(),!1!==t.sortable&&(this.closeHeaderMenu(),this.sortColumnWithOrder(t,e))}openFilterFromHeaderMenu(t,e){e.preventDefault(),e.stopPropagation(),this.showFilterMenu(t)}closeHeaderMenu(){this.headerMenuTransitionHandle&&(clearTimeout(this.headerMenuTransitionHandle),this.headerMenuTransitionHandle=null),this.activeHeaderMenuKey=null,this.headerMenuStep="root",this.headerMenuTransitionClass="dt-header-menu-fade-in",this.headerFilterEditor=null}setHeaderMenuStepImmediate(t){this.headerMenuTransitionHandle&&(clearTimeout(this.headerMenuTransitionHandle),this.headerMenuTransitionHandle=null),this.headerMenuStep=t,this.headerMenuTransitionClass="dt-header-menu-fade-in"}transitionHeaderMenuStep(t){this.headerMenuStep!==t&&(this.headerMenuTransitionHandle&&(clearTimeout(this.headerMenuTransitionHandle),this.headerMenuTransitionHandle=null),this.headerMenuTransitionClass="dt-header-menu-fade-out",this.headerMenuTransitionHandle=setTimeout(()=>{this.headerMenuTransitionHandle=null,this.headerMenuStep=t,this.headerMenuTransitionClass="dt-header-menu-fade-in"},120))}shouldShowHeaderMenuBackButton(){return"root"!==this.headerMenuStep}getHeaderMenuTitle(t){return"sort"===this.headerMenuStep?`Sort ${t.name}`:"filter"===this.headerMenuStep?`Filter ${t.name}`:t.name||"Column"}showFilterMenu(t){this.isFilterableColumn(t)&&(this.initializeHeaderFilterEditor(t),this.transitionHeaderMenuStep("filter"))}initializeHeaderFilterEditor(t){const e=this.getColumnFilterType(t),n=this.getColumnFilterKey(t),o=this.normalizeColumnFilter(this.tableData?.columnFilters?.[n],e);let r=void 0!==o?.value?o.value:"",i=void 0!==o?.valueTo?o.valueTo:"";"boolean"===e&&(r=!0===r?"true":!1===r?"false":"",i=""),this.headerFilterEditor={key:n,type:e,operator:o?.operator||this.getDefaultFilterOperator(e),value:r,valueTo:i}}getHeaderFilterOperatorOptions(t){const e=this.headerFilterEditor?.type||this.getColumnFilterType(t);return this.getFilterOperatorOptions(e)}getHeaderFilterValueFieldType(t){const e=this.headerFilterEditor?.type||this.getColumnFilterType(t);return this.getColumnFilterDialogValueFieldType(e)}isHeaderFilterValueHidden(){const t=this.headerFilterEditor?.operator;return!t||"none"===t||"isEmpty"===t||"isNotEmpty"===t}isHeaderFilterSecondValueVisible(){return"between"===this.headerFilterEditor?.operator}applyHeaderMenuFilter(t,e){if(e.preventDefault(),e.stopPropagation(),!this.isFilterableColumn(t)||!this.headerFilterEditor)return;const n=this.parseColumnFilterEditorResult(this.headerFilterEditor.type,{operator:{value:this.headerFilterEditor.operator},value:{value:this.headerFilterEditor.value},value_to:{value:this.headerFilterEditor.valueTo}});if("invalid"!==n){if(null===n)return this.clearColumnFilterByKey(this.headerFilterEditor.key),void this.closeHeaderMenu();this.applyColumnFilter(this.headerFilterEditor.key,n),this.closeHeaderMenu()}}clearHeaderMenuFilter(t,e){e.preventDefault(),e.stopPropagation();const n=this.getColumnFilterKey(t);this.clearColumnFilterByKey(n),this.closeHeaderMenu()}hasHeaderFilter(t){return this.hasColumnFilter(t)}onDocumentClick(t){if(!this.activeHeaderMenuKey)return;const e=t.target;e&&(e.closest(".dt-header-menu")||e.closest(".dt-header-cell"))||this.closeHeaderMenu()}onDocumentEscape(){this.closeHeaderMenu()}getSortKey(t,e){if("string"==typeof t){const n=t.trim(),o=(e||"").trim();return o?`${n}.${o}`:n}const n=(t.data||"").trim(),o=(t.subData||"").trim();return o?`${n}.${o}`:n}isSortedColumn(t){return this.tableData.sortColumn===this.getSortKey(t)}getSortIcon(t){return this.isSortedColumn(t)?"asc"===this.tableData.sortOrder?"fa-caret-up":"fa-caret-down":""}isFilterableColumn(t){return!(!t||!t.data)&&(!(t.templateKey||t.button||t.buttons&&t.buttons.length||t.select||t.input||t.progress)&&("template"!==t.type&&"button"!==t.type&&"buttons"!==t.type&&"select"!==t.type&&"input"!==t.type&&"progress"!==t.type&&("file_key"!==t.data&&"files"!==t.data&&"button_deleted"!==t.data&&"actions"!==t.data)))}hasColumnFilter(t){if(!t)return!1;const e=this.getColumnFilterKey(t),n=this.tableData?.columnFilters?.[e];return!!this.normalizeColumnFilter(n,this.getColumnFilterType(t))}getColumnFilterSummary(t){const e=this.getColumnFilterKey(t),n=this.getColumnFilterType(t),o=this.normalizeColumnFilter(this.tableData?.columnFilters?.[e],n);if(!o)return`Filter ${t.name}`;const r=this.getFilterOperatorLabel(o.operator),i=this.getColumnFilterValueLabel(o,!0),a=this.getColumnFilterValueLabel(o,!1);return"between"===o.operator?`${t.name}: ${r} ${i} and ${a}`:"isEmpty"===o.operator||"isNotEmpty"===o.operator?`${t.name}: ${r}`:`${t.name}: ${r} ${i}`}getActiveColumnFilters(){if(!this.isObjectMap(this.tableData?.columnFilters))return[];const t=[];return Object.keys(this.tableData.columnFilters||{}).forEach(e=>{const n=this.normalizedColumns.find(t=>this.getColumnFilterKey(t)===e);n&&this.hasColumnFilter(n)&&t.push({key:e,columnName:n.name,summary:this.getColumnFilterSummary(n)})}),t}getActiveColumnFilterCount(){return this.getActiveColumnFilters().length}onColumnFilterClick(t,e){e&&(e.preventDefault(),e.stopPropagation()),this.openColumnFilterDialog(t)}openColumnFilterDialog(t){if(!this.isFilterableColumn(t))return;const e=this.getSortKey(t);e&&(this.activeHeaderMenuKey=e,this.initializeHeaderFilterEditor(t),this.setHeaderMenuStepImmediate("filter"))}clearAllColumnFilters(t){t&&(t.preventDefault(),t.stopPropagation()),this.closeHeaderMenu(),this.isObjectMap(this.tableData?.columnFilters)&&Object.keys(this.tableData.columnFilters).length&&(delete this.tableData.columnFilters,this.tableData.pageNum=1,this.refreshDisplayData(),this.changeTableData())}clearColumnFilterByKey(t){this.isObjectMap(this.tableData?.columnFilters)&&this.tableData.columnFilters[t]&&(delete this.tableData.columnFilters[t],Object.keys(this.tableData.columnFilters).length||delete this.tableData.columnFilters,this.tableData.pageNum=1,this.refreshDisplayData(),this.changeTableData())}applyColumnFilter(t,e){this.tableData||this.initializeTableData(),this.isObjectMap(this.tableData.columnFilters)||(this.tableData.columnFilters={}),this.tableData.columnFilters[t]=e,this.tableData.pageNum=1,this.refreshDisplayData(),this.changeTableData()}parseColumnFilterEditorResult(t,e){const n=e?.operator?.value,o=e?.value?.value,r=e?.value_to?.value;if(!n||"none"===n)return null;const i=this.parseFilterInputValue(o,t),a=this.parseFilterInputValue(r,t);if("isEmpty"!==n&&"isNotEmpty"!==n&&this.isFilterValueMissing(i,t))return this._services._alert.setAlert("warning","Filter value is required"),"invalid";if("between"===n&&this.isFilterValueMissing(a,t))return this._services._alert.setAlert("warning",'A second value is required for "Between"'),"invalid";if("between"===n&&"text"!==t){const e=this.toComparableValue(i,t),n=this.toComparableValue(a,t);if(null!==e&&null!==n&&e>n)return this._services._alert.setAlert("warning","Between filter requires the first value to be less than or equal to the second value"),"invalid"}const s={type:t,operator:n};return"isEmpty"!==n&&"isNotEmpty"!==n&&(s.value="in"===n?this.parseInFilterValues(i,t):i),"between"===n&&(s.valueTo=a),s}parseInFilterValues(t,e){if(Array.isArray(t))return t;const n=(null==t?"":String(t)).split(",").map(t=>t.trim()).filter(t=>""!==t);return"number"===e?n.map(t=>Number(t)).filter(t=>Number.isFinite(t)):n}parseFilterInputValue(t,e){if(null==t)return"";if("number"===e){if("number"==typeof t&&Number.isFinite(t))return t;const e=Number(t);return Number.isFinite(e)?e:""}return"boolean"===e?!0===t||"true"===t||"1"===t||1===t||!1!==t&&"false"!==t&&"0"!==t&&0!==t&&"":"date"===e?this.normalizeDateInput(t):String(t).trim()}normalizeDateInput(t){if(!t)return"";if("string"==typeof t){const e=t.trim();return e||""}if(t instanceof Date)return t.toISOString();const e=t?.date?t.date:t;if(e&&void 0!==e.year&&void 0!==e.month&&void 0!==e.day){const t=Number(e.year),n=Number(e.month),o=Number(e.day);if(Number.isFinite(t)&&Number.isFinite(n)&&Number.isFinite(o))return`${t.toString().padStart(4,"0")}-${n.toString().padStart(2,"0")}-${o.toString().padStart(2,"0")}`}return""}isFilterValueMissing(t,e){return"boolean"===e?!0!==t&&!1!==t:"number"===e?""===t||null==t||!Number.isFinite(Number(t)):""===t||null==t}getColumnFilterType(t){return"boolean"===t.type?"boolean":"number"===t.type||"currency"===t.type||"percent"===t.type||"progress"===t.type?"number":"date"===t.type||"datetime"===t.type||"dateShort"===t.type||this.isLikelyDateColumn(t.data)?"date":"text"}getDefaultFilterOperator(t){return"text"===t?"contains":"equals"}getColumnFilterDialogValueFieldType(t){return"number"===t?"number":"date"===t?"date":"text"}getColumnFilterKey(t){return this.getSortKey(t)}getFilterOperatorOptions(t){const e=[{value:"none",text:"No Filter"}];return"text"===t?e.concat([{value:"contains",text:"Contains"},{value:"equals",text:"Equals"},{value:"notEquals",text:"Not Equal"},{value:"startsWith",text:"Starts With"},{value:"endsWith",text:"Ends With"},{value:"in",text:"In (comma separated)"},{value:"isEmpty",text:"Is Empty"},{value:"isNotEmpty",text:"Is Not Empty"}]):"number"===t||"date"===t?e.concat([{value:"equals",text:"Equals"},{value:"notEquals",text:"Not Equal"},{value:"gt",text:"Greater Than"},{value:"gte",text:"Greater Than or Equal"},{value:"lt",text:"Less Than"},{value:"lte",text:"Less Than or Equal"},{value:"between",text:"Between"},{value:"isEmpty",text:"Is Empty"},{value:"isNotEmpty",text:"Is Not Empty"}]):e.concat([{value:"equals",text:"Equals"},{value:"notEquals",text:"Not Equal"},{value:"isEmpty",text:"Is Empty"},{value:"isNotEmpty",text:"Is Not Empty"}])}getFilterOperatorLabel(t){switch(t){case"equals":return"Equals";case"notEquals":return"Not Equal";case"contains":return"Contains";case"startsWith":return"Starts With";case"endsWith":return"Ends With";case"in":return"In";case"gt":return"Greater Than";case"gte":return"Greater Than or Equal";case"lt":return"Less Than";case"lte":return"Less Than or Equal";case"between":return"Between";case"isEmpty":return"Is Empty";case"isNotEmpty":return"Is Not Empty";default:return t}}getColumnFilterValueLabel(t,e){const n=e?t.value:t.valueTo;if(null==n||""===n)return"";if("date"===t.type){const t=new Date(n);if(!Number.isNaN(t.getTime()))return formatDate(t,"shortDate",this.locale)}return Array.isArray(n)?n.join(", "):String(n)}normalizeColumnFilter(t,e){if(null==t||""===t)return null;if("object"!=typeof t)return{type:e,operator:"equals",value:t};const n=t.operator;return n?{type:t.type||e,operator:n,value:t.value,valueTo:t.valueTo}:null}applyColumnFilters(t){if(!t.length)return t;const e=this.getNormalizedActiveColumnFilters();return e.length?t.filter(t=>e.every(e=>this.rowMatchesColumnFilter(t,e.key,e.filter))):t}getNormalizedActiveColumnFilters(){if(!this.isObjectMap(this.tableData?.columnFilters))return[];const t=this.tableData.columnFilters,e=Object.keys(t),n=[];return e.forEach(e=>{const o=this.normalizedColumns.find(t=>this.getColumnFilterKey(t)===e),r=o?this.getColumnFilterType(o):"text",i=this.normalizeColumnFilter(t[e],r);i&&n.push({key:e,filter:i})}),n}rowMatchesColumnFilter(t,e,n){const o=this.resolvePath(t,e);return"isEmpty"===n.operator?this.isEmptyValue(o):"isNotEmpty"===n.operator?!this.isEmptyValue(o):"text"===n.type?this.matchTextFilter(o,n):"boolean"===n.type?this.matchBooleanFilter(o,n):this.matchComparableFilter(o,n)}isEmptyValue(t){return null==t||("string"==typeof t?""===t.trim():!!Array.isArray(t)&&0===t.length)}matchTextFilter(t,e){const n=this.valueToString(t).toLowerCase(),o=this.valueToString(e.value).toLowerCase();if("contains"===e.operator)return n.indexOf(o)>=0;if("equals"===e.operator)return n===o;if("notEquals"===e.operator)return n!==o;if("startsWith"===e.operator)return n.startsWith(o);if("endsWith"===e.operator)return n.endsWith(o);if("in"===e.operator){return(Array.isArray(e.value)?e.value:this.parseInFilterValues(e.value,"text")).map(t=>this.valueToString(t).toLowerCase()).indexOf(n)>=0}if("between"===e.operator){const t=this.valueToString(e.valueTo).toLowerCase();return n>=o&&n<=t}return!0}matchBooleanFilter(t,e){const n=this.toBoolean(t),o=this.toBoolean(e.value);return null!==n&&null!==o&&("equals"===e.operator?n===o:"notEquals"!==e.operator||n!==o)}matchComparableFilter(t,e){const n=this.toComparableValue(t,e.type),o=this.toComparableValue(e.value,e.type),r=this.toComparableValue(e.valueTo,e.type);return null!==n&&null!==o&&("equals"===e.operator?n===o:"notEquals"===e.operator?n!==o:"gt"===e.operator?n>o:"gte"===e.operator?n>=o:"lt"===e.operator?n<o:"lte"===e.operator?n<=o:"between"!==e.operator||null!==r&&(n>=o&&n<=r))}toComparableValue(t,e){if(null==t||""===t)return null;if("number"===e){const e="object"==typeof t&&t&&void 0!==t.number?t.number:t,n=Number(e);return Number.isFinite(n)?n:null}if("date"===e){return this.toDateTimestamp(t)}return null}toDateTimestamp(t){if(null==t||""===t)return null;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.getTime();if("object"==typeof t&&t?.date)return this.toDateTimestamp(t.date);if("object"==typeof t&&void 0!==t.year&&void 0!==t.month&&void 0!==t.day){const e=Number(t.year),n=Number(t.month),o=Number(t.day),r=new Date(e,n-1,o);return Number.isNaN(r.getTime())?null:r.getTime()}const e=new Date(t);return Number.isNaN(e.getTime())?null:e.getTime()}toBoolean(t){return!0===t||"true"===t||1===t||"1"===t||!1!==t&&"false"!==t&&0!==t&&"0"!==t&&null}getPageSize(){const t="string"==typeof this.tableData.entriesPerPage?parseInt(this.tableData.entriesPerPage,10):this.tableData.entriesPerPage;return!Number.isFinite(t)||t<=0?25:t}getRowId(t,e){return t&&(t[this.rowIdKey]||t.loc_id||t._id||t.id)||e}onCellClick(t,e,n,o=0){if(e.stopRowClick)return;const r=this.getCellMode(e,t);if("button"===r||"buttons"===r||"select"===r||"input"===r||"files"===r)return;const i=this.getRowId(t,o),a=this.getCellValue(t,e);this.rowClick.emit({row:t,column:e,value:a}),this.rowSelected.emit({id:i,column:e.data,item:t}),this.urlClick&&i&&"file_key"!==e.data&&(this.urlClick&&this.returnIdUrls&&this.returnIdUrls.indexOf(this.urlClick)>=0?this.returnId.emit(i):this._services._router.url.startsWith("/certificate/list")&&t.link&&t.id_asset?this.navigateToUrl(t.link+t.id_asset):"/job/detail/"!==this.urlClick||!t.is_ct&&!t.isCT?this.navigateToUrl(this.urlClick+i):this.navigateToUrl("/job-ct/detail/"+i))}navigateToUrl(t){const e=this.resolveRowNavigationMode();"newTab"!==e?"newWindow"!==e?"settingsOrAsk"!==e?this._services._router.navigateByUrl(t):this._dialog.selectWithButtonsURL(t):window.open(t,"_blank","toolbar=1,location=1,menubar=1"):window.open(t,"_blank")}resolveRowNavigationMode(){const t=this.toNavigationMode(this.rowNavigationMode);if(t)return t;const e=this.toNavigationMode(this._services._account.getUser()?.settings?.routing_preference);if(e)return e;const n=this.toNavigationMode(this.datatableDefaultConfig?.rowNavigationMode||this.datatableDefaultConfigLegacy?.rowNavigationMode);return n||"sameTab"}toNavigationMode(t){return"sameTab"===t||"newTab"===t||"newWindow"===t||"settingsOrAsk"===t?t:"alwaysAsk"===t?"settingsOrAsk":null}openFile(t){this._services._socket.call("getSignedUrl",t,900,(e,n)=>{n?window.open(n):this._services._socket.call("insertErrorLog","Widgets-datatable - getsignedurl",[t,e])})}getCellValue(t,e){const n=this.resolvePath(t,e.data);if(null==n&&"est_qty_fill"===e.data){const e=Number(this.resolvePath(t,"tank_size")),n=Number(this.resolvePath(t,"estimated_quantity"));if(Number.isFinite(e))return e-(Number.isFinite(n)&&n>=0?n:0)}return e.subData?this.resolvePath(n,e.subData):n}setCellValue(t,e,n){t&&e&&e.data&&(e.subData?(t[e.data]&&"object"==typeof t[e.data]||(t[e.data]={}),t[e.data][e.subData]=n):t[e.data]=n)}resolvePath(t,e){if(!e)return t;const n=e.trim();return n?n.indexOf(".")<0?t?t[n]:void 0:n.split(".").reduce((t,e)=>null==t?void 0:t[e],t):t}getCellTemplate(t){return t?t.templateKey&&this.cellTemplates.has(t.templateKey)?this.cellTemplates.get(t.templateKey):this.cellTemplates.has(t.data)?this.cellTemplates.get(t.data):null:null}getCellMode(t,e){if(this.getCellTemplate(t))return"template";if(t.buttons&&t.buttons.length)return"buttons";if(t.button)return"button";if(t.select)return"select";if(t.input)return"input";if(this.getSelectConfig(t))return"select";if(this.getInputConfig(t)){if("gallons_requested"===t.data&&e?.consignment)return"text";if("current_rate"===t.data){const t=null!=e?.estimated_quantity,n=!!e?.estimated_percent?.on_plan,o=Array.isArray(e?.locations)&&1===e.locations.length;if(!t||!n||!o)return"text"}return"input"}if(t.progress||"progress"===t.type)return"progress";if("pre"===t.type)return"pre";if("boolean"===t.type)return"boolean";if("button"===t.type)return"button";if("buttons"===t.type)return"buttons";if("select"===t.type)return"select";if("input"===t.type)return"input";if("files"===t.data){const n=this.getCellValue(e,t);return Array.isArray(n)&&n.length?"files":"text"}return"button_deleted"===t.data?e?.deleted?"button":"text":"file_key"===t.data?"button":"wells"===t.data?"pre":this.isLegacyProgressColumn(t)?"progress":"boolean"==typeof this.getCellValue(e,t)?"boolean":"text"}isLegacyProgressColumn(t){return["estimated_percent","usage_progress","dated_progress","progress","total_progress","progress_percentage","estimated_percent_remaining","progressive"].indexOf(t.data)>=0}getCellClasses(t){const e=["dt-cell"];return t.cellClassName&&e.push(t.cellClassName),t.align&&e.push(`dt-align-${t.align}`),e}getHeaderClasses(t){const e=["dt-header-cell"];return t.headerClassName&&e.push(t.headerClassName),t.align&&e.push(`dt-align-${t.align}`),!1===t.sortable&&e.push("dt-no-sort"),this.hasHeaderMenuActions(t)||e.push("dt-no-menu"),this.hasColumnFilter(t)&&e.push("dt-has-filter"),e}getRowClasses(t){return{"dt-row-alert":!!t?.color_red}}getDisplayValue(t,e){const n=this.getCellValue(t,e),o=this.formatValueWithPipe(n,e);return null==o||""===o?e.emptyText||"":o}formatValueWithPipe(t,e){if(null==t)return"";const n=this.resolvePipeConfig(e);if("raw"===n.name)return this.valueToString(t);try{switch(n.name){case"currency":{const e=n.args?.[0]||"USD",o=n.args?.[1],r=n.args?.[2]||"1.2-2",i=this.resolveCurrencySymbol(e,o);return formatCurrency(Number(t)||0,this.locale,i,e,r)}case"number":{const e=n.args?.[0]||"1.0-2";return formatNumber(Number(t)||0,this.locale,e)}case"percent":{const e=n.args?.[0]||"1.0-2";return formatPercent(Number(t)||0,this.locale,e)}case"date":{const e=n.args?.[0]||"short",o=n.args?.length&&"string"==typeof n.args[1]?n.args[1]:void 0;return formatDate(t,e,this.locale,o)}case"uppercase":return this.upperCasePipe.transform(this.valueToString(t));case"lowercase":return this.lowerCasePipe.transform(this.valueToString(t));case"titlecase":return this.titleCasePipe.transform(this.valueToString(t));case"json":return this.jsonPipe.transform(t)||"";default:return this.valueToString(t)}}catch(e){return this.valueToString(t)}}resolvePipeConfig(t){return"string"==typeof t.pipe?{name:t.pipe,args:t.pipeArgs||[]}:t.pipe&&"object"==typeof t.pipe?{name:t.pipe.name,args:t.pipe.args||[]}:"currency"===t.type?{name:"currency",args:t.pipeArgs||["USD","symbol","1.2-2"]}:"number"===t.type?{name:"number",args:t.pipeArgs||["1.0-2"]}:"percent"===t.type?{name:"percent",args:t.pipeArgs||["1.0-2"]}:"date"===t.type?{name:"date",args:t.pipeArgs||["shortDate"]}:"datetime"===t.type?{name:"date",args:t.pipeArgs||["short"]}:"dateShort"===t.type?{name:"date",args:t.pipeArgs||["shortDate"]}:!this.isLikelyDateColumn(t.data)||t.type||t.pipe?!this.isLikelyCurrencyColumn(t.data)||t.type||t.pipe?!this.isLikelyNumberColumn(t.data)||t.type||t.pipe?{name:"raw",args:[]}:{name:"number",args:["1.0-2"]}:{name:"currency",args:["USD","symbol","1.2-2"]}:{name:"date",args:["short"]}}isLikelyDateColumn(t){return/(^date$|date_|_date$|createdAt$|updatedAt$|date$)/i.test(t)}isLikelyCurrencyColumn(t){return/(cost|price|subtotal|sub_total|grand_total|total_sales|tax|amount|payout|balance|quote|value|paid_total)/i.test(t)}isLikelyNumberColumn(t){return/(quantity|quantity_pounds|min_stock|max_stock|projectedQuantity|current_rate|amount_out|est_qty_fill|percent_remaining)/i.test(t)}valueToString(t){return null==t?"":"object"==typeof t?Array.isArray(t)?t.map(t=>this.valueToString(t)).join(", "):void 0!==t.number&&null!==t.number?String(t.number):this.jsonPipe.transform(t)||"":String(t)}resolveCurrencySymbol(t,e){return null==e||"symbol"===e||!0===e?getCurrencySymbol(t,"wide"):"symbol-narrow"===e?getCurrencySymbol(t,"narrow"):"code"===e||!1===e?t:"string"==typeof e?e:getCurrencySymbol(t,"wide")}getButtons(t,e){return t.buttons&&t.buttons.length?t.buttons:t.button?[t.button]:"file_key"===t.data?[{action:"openFile",label:"Open File",className:"btn-secondary"}]:"button_deleted"===t.data&&e?.deleted?[{action:"showDeletedReason",label:"View Deleted Reason",className:"btn-warning"}]:[]}isButtonDisabled(t,e){return!!t.disabled||!!t.disabledPath&&!!this.resolvePath(e,t.disabledPath)}onButtonAction(t,e,n,o){if(o.stopPropagation(),!this.isButtonDisabled(t,e)&&(!t.confirmMessage||window.confirm(t.confirmMessage))){if("openFile"===t.action){const t=this.getCellValue(e,n);t&&this.openFile(t)}else"showDeletedReason"===t.action&&this.showDeletedReason(e);this.emitAction(t.action,e,n,this.getCellValue(e,n))}}showDeletedReason(t){const e=t?.deleted&&"object"==typeof t.deleted?t.deleted:null,n=e?.reason||t?.deleted_reason||"Not provided",o=e?.user||t?.deleted_user||t?.user_deleted||"Unknown",r=e?.date||t?.deleted_date||"",i=`Deleted by: ${o}. Reason: ${n}${r?`. Date: ${r}`:""}`;this._services._alert.setAlert("warning",i)}getFileButtons(t,e){const n=this.getCellValue(t,e);return Array.isArray(n)?n.map((t,e)=>"string"==typeof t?{label:`Open File ${e+1}`,id:null,key:t}:{label:t?.name||t?.title||`Open File ${e+1}`,id:t?._id||t?.id_file||null,key:t?.key||t?.file_key||null}):[]}openFileById(t){this._services._socket.call("getSignedUrlWithId",t,900,(e,n)=>{n?window.open(n):this._services._socket.call("insertErrorLog","Widgets-datatable - getSignedUrlWithId",[t,e])})}onFileButtonClick(t,e){e.stopPropagation(),t.id?this.openFileById(t.id):t.key&&this.openFile(t.key)}getSelectConfig(t){return t.select?t.select:null}getSelectOptions(t,e){const n=this.getSelectConfig(t);if(!n)return[];if(n.options&&n.options.length)return n.options;const o=n.optionsPath?this.resolvePath(e,n.optionsPath):null,r=Array.isArray(o)?o:[],i=n.optionLabelKey||"label",a=n.optionValueKey||"value";return r.map(t=>({label:t[i],value:t[a],disabled:!!t.disabled}))}onSelectAction(t,e,n){this.setCellValue(e,n,t);const o=this.getSelectConfig(n);this.emitAction(o?.action||"select",e,n,t)}getInputConfig(t){return t.input?t.input:"gallons_requested"===t.data?{action:"adjustQtyRequested",type:"number",placeholder:"Gallons Requested",updateOn:"keyup"}:"tank_level"===t.data?{action:"adjustTankLevel",type:"number",placeholder:"Tank Level",updateOn:"keyup"}:"current_rate"===t.data?{action:"adjustCurrentRate",type:"number",placeholder:"Current Rate",updateOn:"change"}:"currentQuantity"===t.data?{action:"onChangeTankHistory",type:"number",placeholder:"Input Current Qty",updateOn:"change"}:null}onInputModelChange(t,e,n){this.setCellValue(e,n,t);const o=this.getInputConfig(n);"keyup"===o?.updateOn&&this.emitAction(o.action,e,n,t)}onInputChange(t,e,n){this.setCellValue(e,n,t);const o=this.getInputConfig(n);o&&"change"===o.updateOn&&this.emitAction(o.action,e,n,t)}getProgressConfig(t){return t.progress||{}}getProgressValue(t,e){const n=this.getProgressConfig(e),o=n.valuePath?this.resolvePath(t,n.valuePath):this.getCellValue(t,e);if("progressive"===e.data&&o?.steps&&Array.isArray(o.steps)&&o.steps.length){const t=o.steps.length>1?o.steps.length-1:o.steps.length,e=o.steps.some(t=>!t?.date)?o.steps.findIndex(t=>!t?.date):t;return t?round(e/t*100,2):0}if(o&&"object"==typeof o&&void 0!==o.number){const t=Number(o.number);return Number.isFinite(t)?t>=0&&t<=1?100*t:t:0}const r=Number(o);return Number.isFinite(r)?"progress_percentage"===e.data&&r>100?r-100:r>=0&&r<=1?100*r:r:0}getProgressType(t,e){const n=this.getProgressConfig(e);if(n.type)return n.type;const o=this.getProgressValue(t,e);if("progress_percentage"===e.data){return Number(this.getCellValue(t,e))<=100?"success":"danger"}return o<30?"danger":o<70?"warning":"success"}getProgressStriped(t){const e=this.getProgressConfig(t);return void 0!==e.striped&&e.striped}getProgressAnimated(t){const e=this.getProgressConfig(t);return void 0!==e.animated&&e.animated}getProgressShowValue(t){const e=this.getProgressConfig(t);return void 0===e.showValue||e.showValue}emitAction(t,e,n,o){const r={action:t,row:e,column:n,value:o};this.cellAction.emit(r),"adjustQtyRequested"===t?this.onChangeRequested.emit(e):"adjustTankLevel"===t?this.onChangeTankLevels.emit(e):"adjustCurrentRate"===t?this.onChangeCurrentRate.emit(e):"viewTankHistory"!==t&&"onChangeTankHistory"!==t||this.onChangeTankHistory.emit(e)}getSearchButtonLabel(){return this.IronBatchAssign?"Scan":"Search"}typeOf(t){return typeof t}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableComponent,deps:[{token:ProviderService},{token:DialogService},{token:LOCALE_ID},{token:DATATABLE_DEFAULT_CONFIG,optional:!0},{token:"DATATABLE_DEFAULT_CONFIG",optional:!0},{token:i3.JsonPipe},{token:i3.UpperCasePipe},{token:i3.LowerCasePipe},{token:i3.TitleCasePipe}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:DatatableComponent,isStandalone:!1,selector:"data-table",inputs:{urlClick:"urlClick",columns:"columns",data:"data",collapseSize:"collapseSize",searchTitle:"searchTitle",totalItems:"totalItems",entriesPerPageOptions:"entriesPerPageOptions",searchBarAutoSearch:"searchBarAutoSearch",searchDebounceMs:"searchDebounceMs",searchMinLength:"searchMinLength",searchDistinct:"searchDistinct",IronBatchAssign:"IronBatchAssign",tableFixed:"tableFixed",headerFixed:"headerFixed",stickyHeaders:"stickyHeaders",users:"users",rowIdKey:"rowIdKey",rowNavigationMode:"rowNavigationMode",returnIdUrls:"returnIdUrls",showSearch:"showSearch",showPaging:"showPaging",showToolbar:"showToolbar",showEntriesControl:"showEntriesControl",showResultsSummary:"showResultsSummary",hideSearch:"hideSearch",hideFooter:"hideFooter",tableData:"tableData"},outputs:{onChangeTableData:"onChangeTableData",tableDataChange:"tableDataChange",cellAction:"cellAction",rowClick:"rowClick",rowSelected:"rowSelected",returnId:"returnId",onChangeRequested:"onChangeRequested",onChangeTankLevels:"onChangeTankLevels",onChangeCurrentRate:"onChangeCurrentRate",onChangeTankHistory:"onChangeTankHistory"},host:{listeners:{"document:click":"onDocumentClick($event)","document:keydown.escape":"onDocumentEscape()"}},providers:[ProviderService,JsonPipe,UpperCasePipe,LowerCasePipe,TitleCasePipe],queries:[{propertyName:"cellTemplateDirectives",predicate:DatatableCellTemplateDirective}],usesInheritance:!0,usesOnChanges:!0,ngImport:i0,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.dt-shell {\n\t\tbackground: linear-gradient(180deg, rgba(248, 250, 255, 0.95), rgba(240, 245, 255, 0.92));\n\t\tborder: 1px solid rgba(107, 132, 174, 0.25);\n\t\tborder-radius: 14px;\n\t\tpadding: 14px;\n\t\tbox-shadow: 0 10px 28px rgba(26, 49, 84, 0.08);\n\t}\n\n\t.dt-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.dt-search-wrap {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tflex: 1 1 460px;\n\t\tmin-width: 280px;\n\t}\n\n\t.dt-search-button {\n\t\tmin-width: 88px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-search-input {\n\t\tmin-height: 40px;\n\t\tborder-radius: 10px;\n\t\tborder-color: rgba(117, 137, 170, 0.45);\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: inset 0 1px 2px rgba(17, 38, 62, 0.08);\n\t}\n\n\t.dt-summary {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #385981;\n\t\tletter-spacing: 0.02em;\n\t\twhite-space: nowrap;\n\t}\n\n\t.dt-table-wrap {\n\t\twidth: 100%;\n\t}\n\n\t.dt-table-wrap collapse-table .collapseTable,\n\t.dt-table-wrap collapse-table .collapseTable-sec,\n\t.dt-table-wrap collapse-table .collapseTable-tert {\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t}\n\n\t.dt-header-cell {\n\t\tuser-select: none;\n\t\tposition: relative;\n\t}\n\n\t.dt-header-cell {\n\t\tcursor: pointer;\n\t}\n\n\t.dt-header-cell.dt-no-menu {\n\t\tcursor: default;\n\t}\n\n\t.dt-header-cell .dt-header-inner {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-dot {\n\t\twidth: 7px;\n\t\theight: 7px;\n\t\tborder-radius: 999px;\n\t\tbackground: #0b5ed7;\n\t\tbox-shadow: 0 0 0 2px rgba(11, 94, 215, 0.18);\n\t}\n\n\t.dt-header-menu {\n\t\tposition: absolute;\n\t\ttop: calc(100% + 6px);\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\tz-index: 50;\n\t\tmin-width: 250px;\n\t\tmax-width: 280px;\n\t\tpadding: 8px;\n\t\tborder-radius: 10px;\n\t\tborder: 1px solid rgba(63, 92, 135, 0.22);\n\t\tbackground: rgba(255, 255, 255, 0.98);\n\t\tbox-shadow: 0 12px 24px rgba(16, 33, 56, 0.18);\n\t}\n\n\t.dt-header-menu-top {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmargin-bottom: 8px;\n\t\tmin-height: 24px;\n\t}\n\n\t.dt-header-menu-back {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tborder: 0;\n\t\tborder-radius: 999px;\n\t\tbackground: rgba(17, 59, 102, 0.09);\n\t\tcolor: #1c4c78;\n\t\tpadding: 0;\n\t}\n\n\t.dt-header-menu-back:hover {\n\t\tbackground: rgba(17, 59, 102, 0.18);\n\t}\n\n\t.dt-header-menu-title {\n\t\tflex: 1;\n\t\ttext-align: left;\n\t\tfont-size: 12px;\n\t\tfont-weight: 700;\n\t\tcolor: #27486d;\n\t}\n\n\t.dt-header-menu-stage {\n\t\tmin-height: 96px;\n\t}\n\n\t.dt-header-menu-fade-in {\n\t\tanimation: dtMenuFadeIn 0.16s ease;\n\t}\n\n\t.dt-header-menu-fade-out {\n\t\tanimation: dtMenuFadeOut 0.12s ease;\n\t}\n\n\t.dt-header-menu-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\t\tgap: 8px;\n\t}\n\n\t.dt-header-menu-grid > :only-child {\n\t\tgrid-column: 1 / -1;\n\t}\n\n\t.dt-header-menu-tile,\n\t.dt-header-menu-action {\n\t\twidth: 100%;\n\t\tbackground: rgba(23, 88, 169, 0.09);\n\t\tborder: 1px solid rgba(32, 91, 162, 0.18);\n\t\ttext-align: center;\n\t\tpadding: 10px 12px;\n\t\tborder-radius: 8px;\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #2c4d72;\n\t\ttransition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;\n\t}\n\n\t.dt-header-menu-tile:hover,\n\t.dt-header-menu-action:hover {\n\t\tbackground: rgba(18, 90, 184, 0.14);\n\t\tborder-color: rgba(18, 90, 184, 0.35);\n\t\tcolor: #113b66;\n\t}\n\n\t.dt-header-menu-stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n\n\t.dt-header-filter-form {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n\n\t.dt-header-filter-label {\n\t\tfont-size: 11px;\n\t\tfont-weight: 700;\n\t\tcolor: #36577d;\n\t\ttext-align: left;\n\t}\n\n\t.dt-header-filter-input,\n\t.dt-header-filter-select {\n\t\tmin-height: 34px;\n\t\tfont-size: 12px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid rgba(65, 106, 154, 0.28);\n\t\tpadding: 6px 8px;\n\t}\n\n\t.dt-header-filter-actions {\n\t\tdisplay: flex;\n\t\tgap: 8px;\n\t\tjustify-content: flex-end;\n\t\tmargin-top: 2px;\n\t}\n\n\t.dt-header-filter-actions .btn {\n\t\tmin-width: 72px;\n\t\tfont-size: 11px;\n\t\tfont-weight: 700;\n\t}\n\n\t@keyframes dtMenuFadeIn {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-4px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@keyframes dtMenuFadeOut {\n\t\tfrom {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t\tto {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(3px);\n\t\t}\n\t}\n\n\t.dt-filter-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t\tpadding: 8px 10px;\n\t\tborder: 1px solid rgba(117, 137, 170, 0.3);\n\t\tborder-radius: 10px;\n\t\tbackground: rgba(255, 255, 255, 0.7);\n\t}\n\n\t.dt-filter-chip-wrap {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tpadding: 3px 8px;\n\t\tborder-radius: 999px;\n\t\tbackground-color: rgba(11, 94, 215, 0.12);\n\t\tcolor: #0b5ed7;\n\t\tfont-size: 11px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-filter-clear {\n\t\tmin-width: 88px;\n\t}\n\n\t.dt-cell {\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t.dt-cell .dt-value {\n\t\twhite-space: pre-line;\n\t\tword-break: normal;\n\t\toverflow-wrap: normal;\n\t\thyphens: none;\n\t}\n\n\t.dt-align-left {\n\t\ttext-align: left !important;\n\t}\n\n\t.dt-align-center {\n\t\ttext-align: center !important;\n\t}\n\n\t.dt-align-right {\n\t\ttext-align: right !important;\n\t}\n\n\t.dt-row-alert td {\n\t\tbackground-color: rgba(255, 136, 84, 0.18) !important;\n\t}\n\n\t.dt-pre {\n\t\tmargin: 0;\n\t\twhite-space: pre-wrap;\n\t\tmax-height: 180px;\n\t\toverflow-y: auto;\n\t\ttext-align: left;\n\t}\n\n\t.dt-buttons {\n\t\tdisplay: inline-flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t\tjustify-content: center;\n\t}\n\n\t.dt-inline-input,\n\t.dt-inline-select {\n\t\tmin-width: 120px;\n\t}\n\n\t.dt-empty {\n\t\tpadding: 26px 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #5c7392;\n\t}\n\n\t.dt-footer {\n\t\tmargin-top: 12px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: flex-end;\n\t\tjustify-content: space-between;\n\t\tgap: 12px;\n\t}\n\n\t.dt-entries {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 6px;\n\t}\n\n\t.dt-entries label {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #35557f;\n\t\tmargin: 0;\n\t}\n\n\t.dt-page-size {\n\t\tmin-width: 120px;\n\t\twidth: 120px;\n\t}\n\n\t.dt-page-size rio-select {\n\t\twidth: 100%;\n\t}\n\n\t.dt-pagination-wrap {\n\t\tmargin-left: auto;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.dt-shell {\n\t\t\tpadding: 10px;\n\t\t\tborder-radius: 12px;\n\t\t}\n\n\t\t.dt-search-wrap {\n\t\t\tflex: 1 1 100%;\n\t\t}\n\n\t\t.dt-search-button {\n\t\t\tmin-width: 74px;\n\t\t}\n\n\t\t.dt-footer {\n\t\t\talign-items: stretch;\n\t\t}\n\n\t\t.dt-pagination-wrap {\n\t\t\tmargin-left: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n</style>\n\n<section class="dt-shell">\n\t@if (showToolbar) {\n\t\t<div class="dt-toolbar">\n\t\t\t@if (showSearch) {\n\t\t\t\t<div class="dt-search-wrap">\n\t\t\t\t\t<button class="btn btn-primary dt-search-button" type="button" (click)="onSearchSubmit()">{{ getSearchButtonLabel() }}</button>\n\t\t\t\t\t<input type="search" class="form-control dt-search-input" [placeholder]="searchTitle" [(ngModel)]="tableData.searchString" (keyup.enter)="onSearchSubmit()" (ngModelChange)="onSearchChange()" />\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showResultsSummary) {\n\t\t\t\t<div class="dt-summary">Showing {{ displayData?.length || 0 }} of {{ totalItems | number }} records</div>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (getActiveColumnFilterCount()) {\n\t\t<div class="dt-filter-toolbar">\n\t\t\t<div class="dt-filter-chip-wrap">\n\t\t\t\t@for (activeFilter of getActiveColumnFilters(); track activeFilter.key) {\n\t\t\t\t\t<span class="dt-filter-chip" [title]="activeFilter.summary">{{ activeFilter.columnName }}</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary dt-filter-clear" (click)="clearAllColumnFilters($event)">Clear Filters</button>\n\t\t</div>\n\t}\n\n\t<div class="dt-table-wrap">\n\t\t<collapse-table [collapseSize]="collapseSize" [headerFixed]="headerFixed" [stickyHeaders]="stickyHeaders" [tableFixed]="tableFixed">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t<th [ngClass]="getHeaderClasses(column)" [style.width]="column.width || null" (click)="onHeaderClick(column, $event)">\n\t\t\t\t\t\t\t<span class="dt-header-inner">\n\t\t\t\t\t\t\t\t{{ column.name }}\n\t\t\t\t\t\t\t\t@if (column.sortable !== false && isSortedColumn(column)) {\n\t\t\t\t\t\t\t\t\t<i class="fa" [ngClass]="getSortIcon(column)"></i>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@if (hasColumnFilter(column)) {\n\t\t\t\t\t\t\t\t\t<span class="dt-filter-dot" [title]="getColumnFilterSummary(column)"></span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t@if (isHeaderMenuOpen(column)) {\n\t\t\t\t\t\t\t\t<div class="dt-header-menu" (click)="$event.stopPropagation()">\n\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-top">\n\t\t\t\t\t\t\t\t\t\t@if (shouldShowHeaderMenuBackButton()) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-back" (click)="showRootHeaderMenu($event)" aria-label="Back">\n\t\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-arrow-left"></i>\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-title">{{ getHeaderMenuTitle(column) }}</div>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-stage" [ngClass]="headerMenuTransitionClass">\n\t\t\t\t\t\t\t\t\t\t@if (headerMenuStep === \'root\') {\n\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-grid">\n\t\t\t\t\t\t\t\t\t\t\t\t@if (column.sortable !== false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-tile" (click)="showSortMenu($event)">Sort</button>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t@if (isFilterableColumn(column)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-tile" (click)="openFilterFromHeaderMenu(column, $event)">Filter</button>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else if (headerMenuStep === \'sort\') {\n\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-stack">\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-action" (click)="sortFromHeaderMenu(column, \'asc\', $event)">Sort Ascending</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-action" (click)="sortFromHeaderMenu(column, \'desc\', $event)">Sort Descending</button>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else if (headerMenuStep === \'filter\') {\n\t\t\t\t\t\t\t\t\t\t\t@if (headerFilterEditor) {\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-filter-form">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">Operator</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<select class="dt-header-filter-select" [(ngModel)]="headerFilterEditor.operator">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@for (operatorOption of getHeaderFilterOperatorOptions(column); track operatorOption.value) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="operatorOption.value">{{ operatorOption.text }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (!isHeaderFilterValueHidden()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@if (headerFilterEditor.type === \'boolean\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">Value</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class="dt-header-filter-select" [(ngModel)]="headerFilterEditor.value">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value="">Select value</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value="true">True</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value="false">False</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">{{ headerFilterEditor.type === \'date\' ? \'Value (date)\' : \'Value\' }}</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class="dt-header-filter-input" [type]="getHeaderFilterValueFieldType(column)" [(ngModel)]="headerFilterEditor.value" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (isHeaderFilterSecondValueVisible()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">{{ headerFilterEditor.type === \'date\' ? \'Second value (date)\' : \'Second value\' }}</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class="dt-header-filter-input" [type]="getHeaderFilterValueFieldType(column)" [(ngModel)]="headerFilterEditor.valueTo" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-filter-actions">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@if (hasHeaderFilter(column)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="clearHeaderMenuFilter(column, $event)">Clear</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="applyHeaderMenuFilter(column, $event)">Apply</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t}\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t@if (displayData && displayData.length) {\n\t\t\t\t\t@for (item of displayData; track getRowId(item, $index); let rowIndex = $index) {\n\t\t\t\t\t\t<tr [ngClass]="getRowClasses(item)">\n\t\t\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t\t\t@let mode = getCellMode(column, item);\n\t\t\t\t\t\t\t\t<td [attr.data-label]="column.name" [ngClass]="getCellClasses(column)" [style.width]="column.width || null" (click)="onCellClick(item, column, $event, rowIndex)">\n\t\t\t\t\t\t\t\t\t@if (mode === \'template\') {\n\t\t\t\t\t\t\t\t\t\t<ng-container [ngTemplateOutlet]="getCellTemplate(column)" [ngTemplateOutletContext]="{ $implicit: item, row: item, column: column, value: getCellValue(item, column) }"></ng-container>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'buttons\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (button of getButtons(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'button\') {\n\t\t\t\t\t\t\t\t\t\t@let button = getButtons(column, item)[0];\n\t\t\t\t\t\t\t\t\t\t@if (button) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'select\') {\n\t\t\t\t\t\t\t\t\t\t@let selectConfig = getSelectConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (selectConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<select class="form-select form-select-sm dt-inline-select" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onSelectAction($event, item, column)">\n\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="null">{{ selectConfig.placeholder || \'Select...\' }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t@for (option of getSelectOptions(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="option.value" [disabled]="option.disabled">{{ option.label }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'input\') {\n\t\t\t\t\t\t\t\t\t\t@let inputConfig = getInputConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (inputConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<input class="form-control form-control-sm dt-inline-input" [type]="inputConfig.type || \'text\'" [attr.placeholder]="inputConfig.placeholder || null" [attr.min]="inputConfig.min ?? null" [attr.max]="inputConfig.max ?? null" [attr.step]="inputConfig.step ?? null" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onInputModelChange($event, item, column)" (change)="onInputChange(getCellValue(item, column), item, column)" />\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'progress\') {\n\t\t\t\t\t\t\t\t\t\t<ngb-progressbar [showValue]="getProgressShowValue(column)" [type]="getProgressType(item, column)" [value]="getProgressValue(item, column)" [striped]="getProgressStriped(column)" [animated]="getProgressAnimated(column)"></ngb-progressbar>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'files\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (fileRef of getFileButtons(item, column); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-secondary" (click)="onFileButtonClick(fileRef, $event)">{{ fileRef.label }}</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'pre\') {\n\t\t\t\t\t\t\t\t\t\t<pre class="dt-pre">{{ getDisplayValue(item, column) }}</pre>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'boolean\') {\n\t\t\t\t\t\t\t\t\t\t@if (getCellValue(item, column)) {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-check" style="color: green; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-times" style="color: red; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t<span class="dt-value" [title]="getDisplayValue(item, column)">{{ getDisplayValue(item, column) }}</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td [attr.colspan]="normalizedColumns?.length || 1">\n\t\t\t\t\t\t\t<div class="dt-empty">No results found.</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t}\n\t\t\t</tbody>\n\t\t</collapse-table>\n\t</div>\n\n\t@if (showPaging) {\n\t\t<div class="dt-footer">\n\t\t\t@if (showEntriesControl) {\n\t\t\t\t<div class="dt-entries">\n\t\t\t\t\t<label>Entries Per Page</label>\n\t\t\t\t\t<div class="dt-page-size">\n\t\t\t\t\t\t<rio-select [options]="entriesPerPageSelectOptions" optionLabelKey="label" optionValueKey="value" [clearable]="false" [searchable]="false" [ngModel]="tableData.entriesPerPage" (ngModelChange)="onEntriesPerPageChange($event)"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<div class="dt-pagination-wrap">\n\t\t\t\t<rio-pagination [collectionSize]="totalItems" [page]="tableData.pageNum" [pageSize]="getPageSize()" [maxSize]="6" [boundaryLinks]="true" [directionLinks]="true" [ellipses]="true" (pageChange)="onPageChange($event)"></rio-pagination>\n\t\t\t</div>\n\t\t</div>\n\t}\n</section>\n',styles:[":host{display:block}.dt-shell{background:linear-gradient(180deg,#f8fafff2,#f0f5ffeb);border:1px solid rgba(107,132,174,.25);border-radius:14px;padding:14px;box-shadow:0 10px 28px #1a315414}.dt-toolbar{display:flex;flex-wrap:wrap;gap:10px;align-items:center;justify-content:space-between;margin-bottom:12px}.dt-search-wrap{display:flex;align-items:center;gap:8px;flex:1 1 460px;min-width:280px}.dt-search-button{min-width:88px;font-weight:600}.dt-search-input{min-height:40px;border-radius:10px;border-color:#7589aa73;background-color:#fff;box-shadow:inset 0 1px 2px #11263e14}.dt-summary{font-size:12px;font-weight:600;color:#385981;letter-spacing:.02em;white-space:nowrap}.dt-table-wrap{width:100%}.dt-table-wrap collapse-table .collapseTable,.dt-table-wrap collapse-table .collapseTable-sec,.dt-table-wrap collapse-table .collapseTable-tert{width:100%;max-width:100%}.dt-header-cell{-webkit-user-select:none;user-select:none;position:relative}.dt-header-cell{cursor:pointer}.dt-header-cell.dt-no-menu{cursor:default}.dt-header-cell .dt-header-inner{display:flex;align-items:center;justify-content:center;gap:6px}.dt-filter-dot{width:7px;height:7px;border-radius:999px;background:#0b5ed7;box-shadow:0 0 0 2px #0b5ed72e}.dt-header-menu{position:absolute;top:calc(100% + 6px);left:50%;transform:translate(-50%);z-index:50;min-width:250px;max-width:280px;padding:8px;border-radius:10px;border:1px solid rgba(63,92,135,.22);background:#fffffffa;box-shadow:0 12px 24px #1021382e}.dt-header-menu-top{display:flex;align-items:center;gap:6px;margin-bottom:8px;min-height:24px}.dt-header-menu-back{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;border:0;border-radius:999px;background:#113b6617;color:#1c4c78;padding:0}.dt-header-menu-back:hover{background:#113b662e}.dt-header-menu-title{flex:1;text-align:left;font-size:12px;font-weight:700;color:#27486d}.dt-header-menu-stage{min-height:96px}.dt-header-menu-fade-in{animation:dtMenuFadeIn .16s ease}.dt-header-menu-fade-out{animation:dtMenuFadeOut .12s ease}.dt-header-menu-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.dt-header-menu-grid>:only-child{grid-column:1 / -1}.dt-header-menu-tile,.dt-header-menu-action{width:100%;background:#1758a917;border:1px solid rgba(32,91,162,.18);text-align:center;padding:10px 12px;border-radius:8px;font-size:12px;font-weight:600;color:#2c4d72;transition:background-color .12s ease,color .12s ease,border-color .12s ease}.dt-header-menu-tile:hover,.dt-header-menu-action:hover{background:#125ab824;border-color:#125ab859;color:#113b66}.dt-header-menu-stack,.dt-header-filter-form{display:flex;flex-direction:column;gap:8px}.dt-header-filter-label{font-size:11px;font-weight:700;color:#36577d;text-align:left}.dt-header-filter-input,.dt-header-filter-select{min-height:34px;font-size:12px;border-radius:8px;border:1px solid rgba(65,106,154,.28);padding:6px 8px}.dt-header-filter-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:2px}.dt-header-filter-actions .btn{min-width:72px;font-size:11px;font-weight:700}@keyframes dtMenuFadeIn{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}@keyframes dtMenuFadeOut{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(3px)}}.dt-filter-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:10px;padding:8px 10px;border:1px solid rgba(117,137,170,.3);border-radius:10px;background:#ffffffb3}.dt-filter-chip-wrap{display:flex;flex-wrap:wrap;gap:6px}.dt-filter-chip{display:inline-flex;align-items:center;padding:3px 8px;border-radius:999px;background-color:#0b5ed71f;color:#0b5ed7;font-size:11px;font-weight:600}.dt-filter-clear{min-width:88px}.dt-cell{transition:background-color .16s ease}.dt-cell .dt-value{white-space:pre-line;word-break:normal;overflow-wrap:normal;-webkit-hyphens:none;hyphens:none}.dt-align-left{text-align:left!important}.dt-align-center{text-align:center!important}.dt-align-right{text-align:right!important}.dt-row-alert td{background-color:#ff88542e!important}.dt-pre{margin:0;white-space:pre-wrap;max-height:180px;overflow-y:auto;text-align:left}.dt-buttons{display:inline-flex;flex-wrap:wrap;gap:6px;justify-content:center}.dt-inline-input,.dt-inline-select{min-width:120px}.dt-empty{padding:26px 12px;font-weight:600;color:#5c7392}.dt-footer{margin-top:12px;display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:12px}.dt-entries{display:flex;flex-direction:column;gap:6px}.dt-entries label{font-size:12px;font-weight:600;color:#35557f;margin:0}.dt-page-size{min-width:120px;width:120px}.dt-page-size rio-select{width:100%}.dt-pagination-wrap{margin-left:auto}@media(max-width:768px){.dt-shell{padding:10px;border-radius:12px}.dt-search-wrap{flex:1 1 100%}.dt-search-button{min-width:74px}.dt-footer{align-items:stretch}.dt-pagination-wrap{margin-left:0;width:100%}}\n"],dependencies:[{kind:"component",type:i1$2.NgbProgressbar,selector:"ngb-progressbar",inputs:["max","animated","ariaLabel","striped","showValue","textType","type","value","height"]},{kind:"directive",type:i2.NgSelectOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.ɵNgSelectMultipleOption,selector:"option",inputs:["ngValue","value"]},{kind:"directive",type:i2.DefaultValueAccessor,selector:"input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]"},{kind:"directive",type:i2.SelectControlValueAccessor,selector:"select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]",inputs:["compareWith"]},{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"directive",type:i3.NgClass,selector:"[ngClass]",inputs:["class","ngClass"]},{kind:"directive",type:i3.NgTemplateOutlet,selector:"[ngTemplateOutlet]",inputs:["ngTemplateOutletContext","ngTemplateOutlet","ngTemplateOutletInjector"]},{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:RioPaginationComponent,selector:"rio-pagination",inputs:["collectionSize","page","pageSize","maxSize","boundaryLinks","directionLinks","ellipses","disabled"],outputs:["pageChange"]},{kind:"pipe",type:i3.DecimalPipe,name:"number"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableComponent,decorators:[{type:Component,args:[{providers:[ProviderService,JsonPipe,UpperCasePipe,LowerCasePipe,TitleCasePipe],selector:"data-table",standalone:!1,template:'<style>\n\t:host {\n\t\tdisplay: block;\n\t}\n\n\t.dt-shell {\n\t\tbackground: linear-gradient(180deg, rgba(248, 250, 255, 0.95), rgba(240, 245, 255, 0.92));\n\t\tborder: 1px solid rgba(107, 132, 174, 0.25);\n\t\tborder-radius: 14px;\n\t\tpadding: 14px;\n\t\tbox-shadow: 0 10px 28px rgba(26, 49, 84, 0.08);\n\t}\n\n\t.dt-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 10px;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tmargin-bottom: 12px;\n\t}\n\n\t.dt-search-wrap {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tflex: 1 1 460px;\n\t\tmin-width: 280px;\n\t}\n\n\t.dt-search-button {\n\t\tmin-width: 88px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-search-input {\n\t\tmin-height: 40px;\n\t\tborder-radius: 10px;\n\t\tborder-color: rgba(117, 137, 170, 0.45);\n\t\tbackground-color: #ffffff;\n\t\tbox-shadow: inset 0 1px 2px rgba(17, 38, 62, 0.08);\n\t}\n\n\t.dt-summary {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #385981;\n\t\tletter-spacing: 0.02em;\n\t\twhite-space: nowrap;\n\t}\n\n\t.dt-table-wrap {\n\t\twidth: 100%;\n\t}\n\n\t.dt-table-wrap collapse-table .collapseTable,\n\t.dt-table-wrap collapse-table .collapseTable-sec,\n\t.dt-table-wrap collapse-table .collapseTable-tert {\n\t\twidth: 100%;\n\t\tmax-width: 100%;\n\t}\n\n\t.dt-header-cell {\n\t\tuser-select: none;\n\t\tposition: relative;\n\t}\n\n\t.dt-header-cell {\n\t\tcursor: pointer;\n\t}\n\n\t.dt-header-cell.dt-no-menu {\n\t\tcursor: default;\n\t}\n\n\t.dt-header-cell .dt-header-inner {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-dot {\n\t\twidth: 7px;\n\t\theight: 7px;\n\t\tborder-radius: 999px;\n\t\tbackground: #0b5ed7;\n\t\tbox-shadow: 0 0 0 2px rgba(11, 94, 215, 0.18);\n\t}\n\n\t.dt-header-menu {\n\t\tposition: absolute;\n\t\ttop: calc(100% + 6px);\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\tz-index: 50;\n\t\tmin-width: 250px;\n\t\tmax-width: 280px;\n\t\tpadding: 8px;\n\t\tborder-radius: 10px;\n\t\tborder: 1px solid rgba(63, 92, 135, 0.22);\n\t\tbackground: rgba(255, 255, 255, 0.98);\n\t\tbox-shadow: 0 12px 24px rgba(16, 33, 56, 0.18);\n\t}\n\n\t.dt-header-menu-top {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 6px;\n\t\tmargin-bottom: 8px;\n\t\tmin-height: 24px;\n\t}\n\n\t.dt-header-menu-back {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tborder: 0;\n\t\tborder-radius: 999px;\n\t\tbackground: rgba(17, 59, 102, 0.09);\n\t\tcolor: #1c4c78;\n\t\tpadding: 0;\n\t}\n\n\t.dt-header-menu-back:hover {\n\t\tbackground: rgba(17, 59, 102, 0.18);\n\t}\n\n\t.dt-header-menu-title {\n\t\tflex: 1;\n\t\ttext-align: left;\n\t\tfont-size: 12px;\n\t\tfont-weight: 700;\n\t\tcolor: #27486d;\n\t}\n\n\t.dt-header-menu-stage {\n\t\tmin-height: 96px;\n\t}\n\n\t.dt-header-menu-fade-in {\n\t\tanimation: dtMenuFadeIn 0.16s ease;\n\t}\n\n\t.dt-header-menu-fade-out {\n\t\tanimation: dtMenuFadeOut 0.12s ease;\n\t}\n\n\t.dt-header-menu-grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(2, minmax(0, 1fr));\n\t\tgap: 8px;\n\t}\n\n\t.dt-header-menu-grid > :only-child {\n\t\tgrid-column: 1 / -1;\n\t}\n\n\t.dt-header-menu-tile,\n\t.dt-header-menu-action {\n\t\twidth: 100%;\n\t\tbackground: rgba(23, 88, 169, 0.09);\n\t\tborder: 1px solid rgba(32, 91, 162, 0.18);\n\t\ttext-align: center;\n\t\tpadding: 10px 12px;\n\t\tborder-radius: 8px;\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #2c4d72;\n\t\ttransition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;\n\t}\n\n\t.dt-header-menu-tile:hover,\n\t.dt-header-menu-action:hover {\n\t\tbackground: rgba(18, 90, 184, 0.14);\n\t\tborder-color: rgba(18, 90, 184, 0.35);\n\t\tcolor: #113b66;\n\t}\n\n\t.dt-header-menu-stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n\n\t.dt-header-filter-form {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 8px;\n\t}\n\n\t.dt-header-filter-label {\n\t\tfont-size: 11px;\n\t\tfont-weight: 700;\n\t\tcolor: #36577d;\n\t\ttext-align: left;\n\t}\n\n\t.dt-header-filter-input,\n\t.dt-header-filter-select {\n\t\tmin-height: 34px;\n\t\tfont-size: 12px;\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid rgba(65, 106, 154, 0.28);\n\t\tpadding: 6px 8px;\n\t}\n\n\t.dt-header-filter-actions {\n\t\tdisplay: flex;\n\t\tgap: 8px;\n\t\tjustify-content: flex-end;\n\t\tmargin-top: 2px;\n\t}\n\n\t.dt-header-filter-actions .btn {\n\t\tmin-width: 72px;\n\t\tfont-size: 11px;\n\t\tfont-weight: 700;\n\t}\n\n\t@keyframes dtMenuFadeIn {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-4px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@keyframes dtMenuFadeOut {\n\t\tfrom {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t\tto {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(3px);\n\t\t}\n\t}\n\n\t.dt-filter-toolbar {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tgap: 8px;\n\t\tmargin-bottom: 10px;\n\t\tpadding: 8px 10px;\n\t\tborder: 1px solid rgba(117, 137, 170, 0.3);\n\t\tborder-radius: 10px;\n\t\tbackground: rgba(255, 255, 255, 0.7);\n\t}\n\n\t.dt-filter-chip-wrap {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t}\n\n\t.dt-filter-chip {\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t\tpadding: 3px 8px;\n\t\tborder-radius: 999px;\n\t\tbackground-color: rgba(11, 94, 215, 0.12);\n\t\tcolor: #0b5ed7;\n\t\tfont-size: 11px;\n\t\tfont-weight: 600;\n\t}\n\n\t.dt-filter-clear {\n\t\tmin-width: 88px;\n\t}\n\n\t.dt-cell {\n\t\ttransition: background-color 0.16s ease;\n\t}\n\n\t.dt-cell .dt-value {\n\t\twhite-space: pre-line;\n\t\tword-break: normal;\n\t\toverflow-wrap: normal;\n\t\thyphens: none;\n\t}\n\n\t.dt-align-left {\n\t\ttext-align: left !important;\n\t}\n\n\t.dt-align-center {\n\t\ttext-align: center !important;\n\t}\n\n\t.dt-align-right {\n\t\ttext-align: right !important;\n\t}\n\n\t.dt-row-alert td {\n\t\tbackground-color: rgba(255, 136, 84, 0.18) !important;\n\t}\n\n\t.dt-pre {\n\t\tmargin: 0;\n\t\twhite-space: pre-wrap;\n\t\tmax-height: 180px;\n\t\toverflow-y: auto;\n\t\ttext-align: left;\n\t}\n\n\t.dt-buttons {\n\t\tdisplay: inline-flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 6px;\n\t\tjustify-content: center;\n\t}\n\n\t.dt-inline-input,\n\t.dt-inline-select {\n\t\tmin-width: 120px;\n\t}\n\n\t.dt-empty {\n\t\tpadding: 26px 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #5c7392;\n\t}\n\n\t.dt-footer {\n\t\tmargin-top: 12px;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: flex-end;\n\t\tjustify-content: space-between;\n\t\tgap: 12px;\n\t}\n\n\t.dt-entries {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 6px;\n\t}\n\n\t.dt-entries label {\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t\tcolor: #35557f;\n\t\tmargin: 0;\n\t}\n\n\t.dt-page-size {\n\t\tmin-width: 120px;\n\t\twidth: 120px;\n\t}\n\n\t.dt-page-size rio-select {\n\t\twidth: 100%;\n\t}\n\n\t.dt-pagination-wrap {\n\t\tmargin-left: auto;\n\t}\n\n\t@media (max-width: 768px) {\n\t\t.dt-shell {\n\t\t\tpadding: 10px;\n\t\t\tborder-radius: 12px;\n\t\t}\n\n\t\t.dt-search-wrap {\n\t\t\tflex: 1 1 100%;\n\t\t}\n\n\t\t.dt-search-button {\n\t\t\tmin-width: 74px;\n\t\t}\n\n\t\t.dt-footer {\n\t\t\talign-items: stretch;\n\t\t}\n\n\t\t.dt-pagination-wrap {\n\t\t\tmargin-left: 0;\n\t\t\twidth: 100%;\n\t\t}\n\t}\n</style>\n\n<section class="dt-shell">\n\t@if (showToolbar) {\n\t\t<div class="dt-toolbar">\n\t\t\t@if (showSearch) {\n\t\t\t\t<div class="dt-search-wrap">\n\t\t\t\t\t<button class="btn btn-primary dt-search-button" type="button" (click)="onSearchSubmit()">{{ getSearchButtonLabel() }}</button>\n\t\t\t\t\t<input type="search" class="form-control dt-search-input" [placeholder]="searchTitle" [(ngModel)]="tableData.searchString" (keyup.enter)="onSearchSubmit()" (ngModelChange)="onSearchChange()" />\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t@if (showResultsSummary) {\n\t\t\t\t<div class="dt-summary">Showing {{ displayData?.length || 0 }} of {{ totalItems | number }} records</div>\n\t\t\t}\n\t\t</div>\n\t}\n\n\t@if (getActiveColumnFilterCount()) {\n\t\t<div class="dt-filter-toolbar">\n\t\t\t<div class="dt-filter-chip-wrap">\n\t\t\t\t@for (activeFilter of getActiveColumnFilters(); track activeFilter.key) {\n\t\t\t\t\t<span class="dt-filter-chip" [title]="activeFilter.summary">{{ activeFilter.columnName }}</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary dt-filter-clear" (click)="clearAllColumnFilters($event)">Clear Filters</button>\n\t\t</div>\n\t}\n\n\t<div class="dt-table-wrap">\n\t\t<collapse-table [collapseSize]="collapseSize" [headerFixed]="headerFixed" [stickyHeaders]="stickyHeaders" [tableFixed]="tableFixed">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t<th [ngClass]="getHeaderClasses(column)" [style.width]="column.width || null" (click)="onHeaderClick(column, $event)">\n\t\t\t\t\t\t\t<span class="dt-header-inner">\n\t\t\t\t\t\t\t\t{{ column.name }}\n\t\t\t\t\t\t\t\t@if (column.sortable !== false && isSortedColumn(column)) {\n\t\t\t\t\t\t\t\t\t<i class="fa" [ngClass]="getSortIcon(column)"></i>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t@if (hasColumnFilter(column)) {\n\t\t\t\t\t\t\t\t\t<span class="dt-filter-dot" [title]="getColumnFilterSummary(column)"></span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</span>\n\n\t\t\t\t\t\t\t@if (isHeaderMenuOpen(column)) {\n\t\t\t\t\t\t\t\t<div class="dt-header-menu" (click)="$event.stopPropagation()">\n\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-top">\n\t\t\t\t\t\t\t\t\t\t@if (shouldShowHeaderMenuBackButton()) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-back" (click)="showRootHeaderMenu($event)" aria-label="Back">\n\t\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-arrow-left"></i>\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-title">{{ getHeaderMenuTitle(column) }}</div>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-stage" [ngClass]="headerMenuTransitionClass">\n\t\t\t\t\t\t\t\t\t\t@if (headerMenuStep === \'root\') {\n\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-grid">\n\t\t\t\t\t\t\t\t\t\t\t\t@if (column.sortable !== false) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-tile" (click)="showSortMenu($event)">Sort</button>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t@if (isFilterableColumn(column)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-tile" (click)="openFilterFromHeaderMenu(column, $event)">Filter</button>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else if (headerMenuStep === \'sort\') {\n\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-menu-stack">\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-action" (click)="sortFromHeaderMenu(column, \'asc\', $event)">Sort Ascending</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="dt-header-menu-action" (click)="sortFromHeaderMenu(column, \'desc\', $event)">Sort Descending</button>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else if (headerMenuStep === \'filter\') {\n\t\t\t\t\t\t\t\t\t\t\t@if (headerFilterEditor) {\n\t\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-filter-form">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">Operator</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<select class="dt-header-filter-select" [(ngModel)]="headerFilterEditor.operator">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@for (operatorOption of getHeaderFilterOperatorOptions(column); track operatorOption.value) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="operatorOption.value">{{ operatorOption.text }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (!isHeaderFilterValueHidden()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@if (headerFilterEditor.type === \'boolean\') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">Value</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<select class="dt-header-filter-select" [(ngModel)]="headerFilterEditor.value">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value="">Select value</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value="true">True</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<option value="false">False</option>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">{{ headerFilterEditor.type === \'date\' ? \'Value (date)\' : \'Value\' }}</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class="dt-header-filter-input" [type]="getHeaderFilterValueFieldType(column)" [(ngModel)]="headerFilterEditor.value" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (isHeaderFilterSecondValueVisible()) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<label class="dt-header-filter-label">{{ headerFilterEditor.type === \'date\' ? \'Second value (date)\' : \'Second value\' }}</label>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<input class="dt-header-filter-input" [type]="getHeaderFilterValueFieldType(column)" [(ngModel)]="headerFilterEditor.valueTo" />\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div class="dt-header-filter-actions">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t@if (hasHeaderFilter(column)) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-outline-secondary" (click)="clearHeaderMenuFilter(column, $event)">Clear</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-primary" (click)="applyHeaderMenuFilter(column, $event)">Apply</button>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t}\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t@if (displayData && displayData.length) {\n\t\t\t\t\t@for (item of displayData; track getRowId(item, $index); let rowIndex = $index) {\n\t\t\t\t\t\t<tr [ngClass]="getRowClasses(item)">\n\t\t\t\t\t\t\t@for (column of normalizedColumns; track column.data + \'-\' + $index) {\n\t\t\t\t\t\t\t\t@let mode = getCellMode(column, item);\n\t\t\t\t\t\t\t\t<td [attr.data-label]="column.name" [ngClass]="getCellClasses(column)" [style.width]="column.width || null" (click)="onCellClick(item, column, $event, rowIndex)">\n\t\t\t\t\t\t\t\t\t@if (mode === \'template\') {\n\t\t\t\t\t\t\t\t\t\t<ng-container [ngTemplateOutlet]="getCellTemplate(column)" [ngTemplateOutletContext]="{ $implicit: item, row: item, column: column, value: getCellValue(item, column) }"></ng-container>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'buttons\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (button of getButtons(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'button\') {\n\t\t\t\t\t\t\t\t\t\t@let button = getButtons(column, item)[0];\n\t\t\t\t\t\t\t\t\t\t@if (button) {\n\t\t\t\t\t\t\t\t\t\t\t<button type="button" [ngClass]="[\'btn\', \'btn-sm\', button.className || \'btn-secondary\']" [disabled]="isButtonDisabled(button, item)" (click)="onButtonAction(button, item, column, $event)">\n\t\t\t\t\t\t\t\t\t\t\t\t@if (button.icon) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<i [ngClass]="button.icon"></i>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t{{ button.label }}\n\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'select\') {\n\t\t\t\t\t\t\t\t\t\t@let selectConfig = getSelectConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (selectConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<select class="form-select form-select-sm dt-inline-select" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onSelectAction($event, item, column)">\n\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="null">{{ selectConfig.placeholder || \'Select...\' }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t@for (option of getSelectOptions(column, item); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t<option [ngValue]="option.value" [disabled]="option.disabled">{{ option.label }}</option>\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'input\') {\n\t\t\t\t\t\t\t\t\t\t@let inputConfig = getInputConfig(column);\n\t\t\t\t\t\t\t\t\t\t@if (inputConfig) {\n\t\t\t\t\t\t\t\t\t\t\t<input class="form-control form-control-sm dt-inline-input" [type]="inputConfig.type || \'text\'" [attr.placeholder]="inputConfig.placeholder || null" [attr.min]="inputConfig.min ?? null" [attr.max]="inputConfig.max ?? null" [attr.step]="inputConfig.step ?? null" [ngModel]="getCellValue(item, column)" (click)="$event.stopPropagation()" (ngModelChange)="onInputModelChange($event, item, column)" (change)="onInputChange(getCellValue(item, column), item, column)" />\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'progress\') {\n\t\t\t\t\t\t\t\t\t\t<ngb-progressbar [showValue]="getProgressShowValue(column)" [type]="getProgressType(item, column)" [value]="getProgressValue(item, column)" [striped]="getProgressStriped(column)" [animated]="getProgressAnimated(column)"></ngb-progressbar>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'files\') {\n\t\t\t\t\t\t\t\t\t\t<div class="dt-buttons">\n\t\t\t\t\t\t\t\t\t\t\t@for (fileRef of getFileButtons(item, column); track $index) {\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-sm btn-secondary" (click)="onFileButtonClick(fileRef, $event)">{{ fileRef.label }}</button>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'pre\') {\n\t\t\t\t\t\t\t\t\t\t<pre class="dt-pre">{{ getDisplayValue(item, column) }}</pre>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else if (mode === \'boolean\') {\n\t\t\t\t\t\t\t\t\t\t@if (getCellValue(item, column)) {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-check" style="color: green; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t\t<i class="fa fa-times" style="color: red; font-size: 18px" aria-hidden="true"></i>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@else {\n\t\t\t\t\t\t\t\t\t\t<span class="dt-value" [title]="getDisplayValue(item, column)">{{ getDisplayValue(item, column) }}</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@else {\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td [attr.colspan]="normalizedColumns?.length || 1">\n\t\t\t\t\t\t\t<div class="dt-empty">No results found.</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t}\n\t\t\t</tbody>\n\t\t</collapse-table>\n\t</div>\n\n\t@if (showPaging) {\n\t\t<div class="dt-footer">\n\t\t\t@if (showEntriesControl) {\n\t\t\t\t<div class="dt-entries">\n\t\t\t\t\t<label>Entries Per Page</label>\n\t\t\t\t\t<div class="dt-page-size">\n\t\t\t\t\t\t<rio-select [options]="entriesPerPageSelectOptions" optionLabelKey="label" optionValueKey="value" [clearable]="false" [searchable]="false" [ngModel]="tableData.entriesPerPage" (ngModelChange)="onEntriesPerPageChange($event)"></rio-select>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t}\n\t\t\t<div class="dt-pagination-wrap">\n\t\t\t\t<rio-pagination [collectionSize]="totalItems" [page]="tableData.pageNum" [pageSize]="getPageSize()" [maxSize]="6" [boundaryLinks]="true" [directionLinks]="true" [ellipses]="true" (pageChange)="onPageChange($event)"></rio-pagination>\n\t\t\t</div>\n\t\t</div>\n\t}\n</section>\n'}]}],ctorParameters:()=>[{type:ProviderService},{type:DialogService},{type:void 0,decorators:[{type:Inject,args:[LOCALE_ID]}]},{type:void 0,decorators:[{type:Optional},{type:Inject,args:[DATATABLE_DEFAULT_CONFIG]}]},{type:void 0,decorators:[{type:Optional},{type:Inject,args:["DATATABLE_DEFAULT_CONFIG"]}]},{type:i3.JsonPipe},{type:i3.UpperCasePipe},{type:i3.LowerCasePipe},{type:i3.TitleCasePipe}],propDecorators:{urlClick:[{type:Input}],columns:[{type:Input}],data:[{type:Input}],collapseSize:[{type:Input}],searchTitle:[{type:Input}],totalItems:[{type:Input}],entriesPerPageOptions:[{type:Input}],searchBarAutoSearch:[{type:Input}],searchDebounceMs:[{type:Input}],searchMinLength:[{type:Input}],searchDistinct:[{type:Input}],IronBatchAssign:[{type:Input}],tableFixed:[{type:Input}],headerFixed:[{type:Input}],stickyHeaders:[{type:Input}],users:[{type:Input}],rowIdKey:[{type:Input}],rowNavigationMode:[{type:Input}],returnIdUrls:[{type:Input}],showSearch:[{type:Input}],showPaging:[{type:Input}],showToolbar:[{type:Input}],showEntriesControl:[{type:Input}],showResultsSummary:[{type:Input}],hideSearch:[{type:Input}],hideFooter:[{type:Input}],onChangeTableData:[{type:Output}],tableDataChange:[{type:Output}],cellAction:[{type:Output}],rowClick:[{type:Output}],rowSelected:[{type:Output}],returnId:[{type:Output}],onChangeRequested:[{type:Output}],onChangeTankLevels:[{type:Output}],onChangeCurrentRate:[{type:Output}],onChangeTankHistory:[{type:Output}],tableData:[{type:Input}],cellTemplateDirectives:[{type:ContentChildren,args:[DatatableCellTemplateDirective]}],onDocumentClick:[{type:HostListener,args:["document:click",["$event"]]}],onDocumentEscape:[{type:HostListener,args:["document:keydown.escape"]}]}});class DatatableModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,declarations:[DatatableComponent,DatatableCellTemplateDirective],imports:[NgbModule,FormsModule,CommonModule,RouterModule,CollapseTableModule,RioSelectModule,RioPaginationModule],exports:[DatatableComponent,DatatableCellTemplateDirective]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,imports:[NgbModule,FormsModule,CommonModule,RouterModule,CollapseTableModule,RioSelectModule,RioPaginationModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DatatableModule,decorators:[{type:NgModule,args:[{imports:[NgbModule,FormsModule,CommonModule,RouterModule,CollapseTableModule,RioSelectModule,RioPaginationModule],exports:[DatatableComponent,DatatableCellTemplateDirective],declarations:[DatatableComponent,DatatableCellTemplateDirective],providers:[]}]}]});class FileUploadComponent extends BaseComponent{_resize;_services;_ds;_http;constructor(t,e,n,o){super(e),this._resize=t,this._services=e,this._ds=n,this._http=o}files=[];allowDelete=!1;allowReplace=!1;showFileUpload=!0;filesChanged=new EventEmitter;fileAdded=new EventEmitter;fileRemoved=new EventEmitter;fileType;download_link;supportedFileTypes=["application/pdf","text/plain","image/gif","image/png","image/jpeg","image/bmp"];pdfSrc="";replaceFileIndex=0;isUploading=!1;progressMsg="";windowSize$;windowSize=0;ngOnInit(){this.windowSize$=this._resize.onResize$.subscribe(t=>{this.windowSize=t?t.innerWidth:window.innerWidth})}ngOnDestroy(){this.windowSize$.unsubscribe()}dragFileAccepted(t){this.supportedFileTypes.indexOf(t.type)>=0?this.uploadWithEmit(t,"misc").then(()=>{},t=>{this._ds.error("Could not upload file, incorrect type")}):this._ds.error("Invalid format, the supported file types are: "+this.supportedFileTypes)}upload(t,e,n,o,r){return new Promise((i,a)=>{this.progressMsg="Uploading "+(o||t.name),this._services._aws.uploadFile(t,e,n,o).then(a=>{const s={_id:a._id,name:o||t.name,size:t.size,status:r||"Uploaded",key:a.key,order:n||-1,type:e};this.isUploading=!1,this.files.push(s),this.files=this.files.sort((t,e)=>t.order-e.order),i(s)},t=>{this._ds.error("Could not upload file. "+t),a(t)}),this.isUploading=!0})}uploadWithEmit(t,e,n,o,r){return new Promise((i,a)=>{this.progressMsg="Uploading "+(o||t.name),this._services._aws.uploadFile(t,e,n,o).then(a=>{const s={_id:a._id,name:o||t.name,size:t.size,status:r||"Uploaded",key:a.key,order:n||-1,type:e};this.isUploading=!1,this.files=this.files.sort((t,e)=>t.order-e.order),this.fileAdded.emit(s),i(s)},t=>{this._ds.error("Could not upload file. "+t),a(t)}),this.isUploading=!0})}delete(t,e=!0){this.pdfSrc="",e?this._ds.confirm("Are you sure you want to delete this file?").then(e=>{this._services._aws.deleteFile(this.files[t].key,(e,n)=>{e&&(this._ds.error("Could not delete file"),this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e]))}),this.files.splice(t,1)},t=>{}):(this._services._aws.deleteFile(this.files[t].key,(e,n)=>{e&&this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e])}),this.files.splice(t,1))}deleteWithEmit(t,e=!0){this.pdfSrc="";let n=Object.assign({},this.files[t]);e?this._ds.confirm("Are you sure you want to delete this file?").then(e=>{this._services._aws.deleteFile(this.files[t].key,(e,o)=>{e&&(this._ds.error("Could not delete file"),this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e])),this.fileRemoved.emit(n)})},t=>{}):this._services._aws.deleteFile(this.files[t].key,(e,o)=>{e&&this._services._socket.call("insertErrorLog","Widgets.File-Upload - Delete File",[this.files[t].key,e]),this.fileRemoved.emit(n)})}deleteFileWithId(t){this.delete(this.files.map(t=>t._id).indexOf(t),!1)}open(t){this._services._socket.call("getSignedUrl",t.key,900,(e,n)=>{n?window.open(n):this._services._socket.call("insertErrorLog","Widgets-file - getsignedurl",[t.key,e])})}setPDFViewerSrc(t){this._services._socket.call("getSignedUrl",t.key,900,(e,n)=>{n?this.pdfSrc=n:(this._ds.error("Could not get signed url for file"),this._services._socket.call("insertErrorLog","Widgets-file - getsignedurl pdfviewer",[t.key,e]))})}onFileSelect(t){this.uploadWithEmit(t.target.files[0],this.fileType?this.fileType:"misc").then(()=>{},()=>{}),t.srcElement.value=""}onFileSelectReplace(t){if(t.target.files[0]){this.files[this.replaceFileIndex]._id;let e=this.files[this.replaceFileIndex].type,n=this.files[this.replaceFileIndex].order,o=this.files[this.replaceFileIndex].name.replace(/\.[^\.]+$/,"")+"."+t.target.files[0].name.split(".")[t.target.files[0].name.split(".").length-1],r=this.files[this.replaceFileIndex].status;this.deleteWithEmit(this.replaceFileIndex,!1),"Unsigned"===r?this._ds.confirm("Are you replacing this file with a signed copy?").then(r=>{this.uploadWithEmit(t.target.files[0],e,n,o,"Signed").then(t=>{t.key,t._id},t=>{})},r=>{this.uploadWithEmit(t.target.files[0],e,n,o).then(t=>{t.key,t._id},t=>{})}):this.uploadWithEmit(t.target.files[0],e,n,o).then(t=>{t.key,t._id},t=>{})}}userIsInRole(t){return this._services._account.isUserInView(t)}isMobile(){}downloadResource(t){return this._http.get(t,{responseType:"blob"}).toPromise()}download(t){this._services._socket.call("getSignedUrl",t.key,900,async(e,n)=>{if(n){const e=await this.downloadResource(n),o=window.URL.createObjectURL(e),r=this.download_link.nativeElement;r.href=o,r.download=t.name,r.click(),window.URL.revokeObjectURL(o)}else this._services._socket.call("insertErrorLog","Widgets-file - update bol",[e])})}email(t){this._ds.input("Email file to which address?",[{label:"Email Address",form:"email",data:"",validators:[Validators.required,this._services._vs.email],validatorErrors:["required","email"],validatorMsg:["Email is required","Email is invalid"],required:!0}]).then(e=>{this._services._socket.call("emailFile",t._id,e.email.value,(t,e)=>{t?this._ds.error("Could not send email: "+t):this._services._alert.setAlert("success","Email has been sent")})},t=>{})}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileUploadComponent,deps:[{token:ResizeService},{token:ProviderService},{token:DialogService},{token:i4.HttpClient}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:FileUploadComponent,isStandalone:!1,selector:"file-upload",inputs:{files:"files",allowDelete:"allowDelete",allowReplace:"allowReplace",showFileUpload:"showFileUpload",fileType:"fileType"},outputs:{filesChanged:"filesChanged",fileAdded:"fileAdded",fileRemoved:"fileRemoved"},viewQueries:[{propertyName:"download_link",first:!0,predicate:["download_link"],descendants:!0,static:!0}],usesInheritance:!0,ngImport:i0,template:'<style>\n\thtml,\n\tbody {\n\t\theight: 100%;\n\t}\n\n\tcollapse-table tr:hover {\n\t\tbackground-color: lightblue;\n\t\tcursor: pointer;\n\t}\n\n\tcollapse-table {\n\t\twidth: 100%;\n\t}\n\n\t/* Label container: */\n\t.file {\n\t\tdisplay: inline-block;\n\t\tpadding: 0 0 0 0.5em;\n\t\tcursor: pointer;\n\t\tposition: relative;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t}\n\n\t/* The pseudo input field: */\n\t.file::before {\n\t\tcontent: \'\';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tz-index: -1;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #fff;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t\t-webkit-box-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t\tbox-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t}\n\n\t/* The pseudo button: */\n\t.file::after {\n\t\tcontent: \'Browse\';\n\t\tdisplay: inline-block;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #eee;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0 0.25rem 0.25rem 0;\n\t\tpadding: 0.5rem 1rem;\n\t\tline-height: 1.5;\n\t\tcolor: #555;\n\t}\n\n\t.file input[type=\'file\'] {\n\t\tcursor: pointer;\n\t\tborder: 0 none;\n\t\twidth: 12em;\n\t}\n\n\t/* -webkit hide the button: */\n\t.file input[type=\'file\']::-webkit-file-upload-button {\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\twidth: 0;\n\t\tbackground: transparent;\n\t}\n\n\t/* IE10+ hide the button: */\n\t.file input[type=\'file\']::-ms-browse {\n\t\tpadding: 0;\n\t\tmargin: -1px;\n\t\twidth: 0;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t}\n\n\t.file input[type=\'file\']::-ms-value {\n\t\tbackground: #fff;\n\t\tborder: 0;\n\t}\n\n\tcard {\n\t\twidth: 100%;\n\t}\n</style>\n\n<a style="display: none" #download_link></a>\n<input hidden type="file" #fileInputReplace (change)="onFileSelectReplace($event)" />\n\n<div class="card">\n\t<div class="card-header">\n\t\t<strong class="pull-left">Files</strong>\n\t</div>\n\t<div class="card-block">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (showFileUpload) {\n\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t<div class="container">\n\t\t\t\t\t\t\t\t<div style="margin: 10px 0px; font-weight: bold">Upload File</div>\n\t\t\t\t\t\t\t\t<label class="file">\n\t\t\t\t\t\t\t\t\t<input type="file" #fileInput (change)="onFileSelect($event)" />\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<ngx-file-drop dropZoneLabel="Drop files here" style="width: 223px; height: 112px; border: 1px black dashed; border-radius: 5px; justify-content: center" class="vertical-align" (onFileDrop)="dragFileAccepted($event)"></ngx-file-drop>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t@if (isUploading) {\n\t\t\t\t\t\t\t\t<b>{{ progressMsg || \'N/A\' }}</b>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t@if (windowSize > 980) {\n\t\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t\t@if (pdfSrc) {\n\t\t\t\t\t\t\t\t<div style="text-align: center">\n\t\t\t\t\t\t\t\t\t<resolveio-client-lib-pdf-viewer [pdfSrc]="pdfSrc"></resolveio-client-lib-pdf-viewer>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (files && files.length) {\n\t\t\t\t\t<b>Uploaded Files</b>\n\t\t\t\t\t<div [style.max-height]="windowSize > 900 ? \'300px\' : \'\'" [style.overflow-y]="windowSize > 900 ? \'auto\' : \'\'">\n\t\t\t\t\t\t<collapse-table collapseSize="900">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th>File Name</th>\n\t\t\t\t\t\t\t\t\t<th>Size</th>\n\t\t\t\t\t\t\t\t\t<th>Type</th>\n\t\t\t\t\t\t\t\t\t<th>Actions</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t@for (file of files; track file._id; let i = $index) {\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td data-label="File Name" (click)="setPDFViewerSrc(file)">{{ file.name }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Size" (click)="setPDFViewerSrc(file)">{{ file.size / 1024 / 1024 | number: \'.2\' }} MB</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Type" (click)="setPDFViewerSrc(file)">{{ file.type }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Actions">\n\t\t\t\t\t\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-success" (click)="open(file)">Open</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="download(file)">Download</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="deleteWithEmit(i)">Delete</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="fileInputReplace.click(); replaceFileIndex = i">Replace</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-warning" (click)="email(file)">Email</button>\n\t\t\t\t\t\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!files || !files.length) {\n\t\t\t\t\t<b>No Uploaded Files</b>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n',styles:['html,body{height:100%}collapse-table tr:hover{background-color:#add8e6;cursor:pointer}collapse-table{width:100%}.file{display:inline-block;padding:0 0 0 .5em;cursor:pointer;position:relative;border:.075rem solid #ddd;border-radius:.25rem}.file:before{content:"";display:block;position:absolute;inset:0;z-index:-1;background-color:#fff;border:.075rem solid #ddd;border-radius:.25rem;-webkit-box-shadow:inset 0 .2rem .4rem rgba(0,0,0,.05);box-shadow:inset 0 .2rem .4rem #0000000d}.file:after{content:"Browse";display:inline-block;background-color:#eee;border:.075rem solid #ddd;border-radius:0 .25rem .25rem 0;padding:.5rem 1rem;line-height:1.5;color:#555}.file input[type=file]{cursor:pointer;border:0 none;width:12em}.file input[type=file]::-webkit-file-upload-button{border:0;padding:0;margin:0;width:0;background:transparent}.file input[type=file]::-ms-browse{padding:0;margin:-1px;width:0;border:0;background:transparent}.file input[type=file]::-ms-value{background:#fff;border:0}card{width:100%}\n'],dependencies:[{kind:"component",type:CollapseTableComponent,selector:"collapse-table",inputs:["collapseSize","tableFixed","headerFixed","stickyHeaders","secondaryColor","tertiaryColor"]},{kind:"component",type:ResponsiveButtonGroupComponent,selector:"responsive-button-group",inputs:["collapseSize"]},{kind:"component",type:i7$1.NgxFileDropComponent,selector:"ngx-file-drop",inputs:["accept","directory","multiple","dropZoneLabel","dropZoneClassName","useDragEnter","contentClassName","showBrowseBtn","browseBtnClassName","browseBtnLabel","disabled"],outputs:["onFileDrop","onFileOver","onFileLeave"]},{kind:"component",type:i8.PdfViewerComponent,selector:"resolveio-client-lib-pdf-viewer",inputs:["pdfSrc","fileName"]},{kind:"pipe",type:i3.DecimalPipe,name:"number"}]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileUploadComponent,decorators:[{type:Component,args:[{selector:"file-upload",standalone:!1,template:'<style>\n\thtml,\n\tbody {\n\t\theight: 100%;\n\t}\n\n\tcollapse-table tr:hover {\n\t\tbackground-color: lightblue;\n\t\tcursor: pointer;\n\t}\n\n\tcollapse-table {\n\t\twidth: 100%;\n\t}\n\n\t/* Label container: */\n\t.file {\n\t\tdisplay: inline-block;\n\t\tpadding: 0 0 0 0.5em;\n\t\tcursor: pointer;\n\t\tposition: relative;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t}\n\n\t/* The pseudo input field: */\n\t.file::before {\n\t\tcontent: \'\';\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\tleft: 0;\n\t\tright: 0;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tz-index: -1;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #fff;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0.25rem;\n\t\t-webkit-box-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t\tbox-shadow: inset 0 0.2rem 0.4rem rgba(0, 0, 0, 0.05);\n\t}\n\n\t/* The pseudo button: */\n\t.file::after {\n\t\tcontent: \'Browse\';\n\t\tdisplay: inline-block;\n\n\t\t/* Bootstrap appearance: */\n\t\tbackground-color: #eee;\n\t\tborder: 0.075rem solid #ddd;\n\t\tborder-radius: 0 0.25rem 0.25rem 0;\n\t\tpadding: 0.5rem 1rem;\n\t\tline-height: 1.5;\n\t\tcolor: #555;\n\t}\n\n\t.file input[type=\'file\'] {\n\t\tcursor: pointer;\n\t\tborder: 0 none;\n\t\twidth: 12em;\n\t}\n\n\t/* -webkit hide the button: */\n\t.file input[type=\'file\']::-webkit-file-upload-button {\n\t\tborder: 0;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\twidth: 0;\n\t\tbackground: transparent;\n\t}\n\n\t/* IE10+ hide the button: */\n\t.file input[type=\'file\']::-ms-browse {\n\t\tpadding: 0;\n\t\tmargin: -1px;\n\t\twidth: 0;\n\t\tborder: 0;\n\t\tbackground: transparent;\n\t}\n\n\t.file input[type=\'file\']::-ms-value {\n\t\tbackground: #fff;\n\t\tborder: 0;\n\t}\n\n\tcard {\n\t\twidth: 100%;\n\t}\n</style>\n\n<a style="display: none" #download_link></a>\n<input hidden type="file" #fileInputReplace (change)="onFileSelectReplace($event)" />\n\n<div class="card">\n\t<div class="card-header">\n\t\t<strong class="pull-left">Files</strong>\n\t</div>\n\t<div class="card-block">\n\t\t<div class="row">\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (showFileUpload) {\n\t\t\t\t\t<div class="row">\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t<div class="container">\n\t\t\t\t\t\t\t\t<div style="margin: 10px 0px; font-weight: bold">Upload File</div>\n\t\t\t\t\t\t\t\t<label class="file">\n\t\t\t\t\t\t\t\t\t<input type="file" #fileInput (change)="onFileSelect($event)" />\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<ngx-file-drop dropZoneLabel="Drop files here" style="width: 223px; height: 112px; border: 1px black dashed; border-radius: 5px; justify-content: center" class="vertical-align" (onFileDrop)="dragFileAccepted($event)"></ngx-file-drop>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="col-lg-6">\n\t\t\t\t\t\t\t@if (isUploading) {\n\t\t\t\t\t\t\t\t<b>{{ progressMsg || \'N/A\' }}</b>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t<div class="row" style="margin-top: 10px">\n\t\t\t\t\t@if (windowSize > 980) {\n\t\t\t\t\t\t<div class="col-lg-12">\n\t\t\t\t\t\t\t@if (pdfSrc) {\n\t\t\t\t\t\t\t\t<div style="text-align: center">\n\t\t\t\t\t\t\t\t\t<resolveio-client-lib-pdf-viewer [pdfSrc]="pdfSrc"></resolveio-client-lib-pdf-viewer>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="col-lg-6">\n\t\t\t\t@if (files && files.length) {\n\t\t\t\t\t<b>Uploaded Files</b>\n\t\t\t\t\t<div [style.max-height]="windowSize > 900 ? \'300px\' : \'\'" [style.overflow-y]="windowSize > 900 ? \'auto\' : \'\'">\n\t\t\t\t\t\t<collapse-table collapseSize="900">\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th>File Name</th>\n\t\t\t\t\t\t\t\t\t<th>Size</th>\n\t\t\t\t\t\t\t\t\t<th>Type</th>\n\t\t\t\t\t\t\t\t\t<th>Actions</th>\n\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t\t@for (file of files; track file._id; let i = $index) {\n\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t<td data-label="File Name" (click)="setPDFViewerSrc(file)">{{ file.name }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Size" (click)="setPDFViewerSrc(file)">{{ file.size / 1024 / 1024 | number: \'.2\' }} MB</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Type" (click)="setPDFViewerSrc(file)">{{ file.type }}</td>\n\t\t\t\t\t\t\t\t\t\t<td data-label="Actions">\n\t\t\t\t\t\t\t\t\t\t\t<responsive-button-group collapseSize="900">\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-success" (click)="open(file)">Open</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-primary" (click)="download(file)">Download</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="deleteWithEmit(i)">Delete</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button [hidden]="!allowDelete || (file.type !== \'misc\' && !userIsInRole(\'super-admin\'))" type="button" class="btn btn-danger" (click)="fileInputReplace.click(); replaceFileIndex = i">Replace</button>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type="button" class="btn btn-warning" (click)="email(file)">Email</button>\n\t\t\t\t\t\t\t\t\t\t\t</responsive-button-group>\n\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t</collapse-table>\n\t\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t\t@if (!files || !files.length) {\n\t\t\t\t\t<b>No Uploaded Files</b>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}]}],ctorParameters:()=>[{type:ResizeService},{type:ProviderService},{type:DialogService},{type:i4.HttpClient}],propDecorators:{files:[{type:Input}],allowDelete:[{type:Input}],allowReplace:[{type:Input}],showFileUpload:[{type:Input}],filesChanged:[{type:Output}],fileAdded:[{type:Output}],fileRemoved:[{type:Output}],fileType:[{type:Input}],download_link:[{type:ViewChild,args:["download_link",{static:!0}]}]}});class FileModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:FileModule,declarations:[FileUploadComponent],imports:[CommonModule,FormsModule,CollapseTableModule,NgbModule,ResponsiveButtonGroupModule,NgxFileDropModule,PdfViewerModule],exports:[FileUploadComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileModule,imports:[CommonModule,FormsModule,CollapseTableModule,NgbModule,ResponsiveButtonGroupModule,NgxFileDropModule,PdfViewerModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:FileModule,decorators:[{type:NgModule,args:[{imports:[CommonModule,FormsModule,CollapseTableModule,NgbModule,ResponsiveButtonGroupModule,NgxFileDropModule,PdfViewerModule],declarations:[FileUploadComponent],exports:[FileUploadComponent]}]}]});class UserSettingsModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,declarations:[UserSettingsComponent,UsersSettingsComponent],imports:[SharedModule,i1$1.RouterModule,DatatableModule,FileModule,NgbAccordionModule,NgbModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,providers:[UserSettingsService],imports:[SharedModule,UserSettingsRouting,DatatableModule,FileModule,NgbAccordionModule,NgbModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:UserSettingsModule,decorators:[{type:NgModule,args:[{imports:[SharedModule,UserSettingsRouting,DatatableModule,FileModule,NgbAccordionModule,NgbModule],declarations:[UserSettingsComponent,UsersSettingsComponent],providers:[UserSettingsService]}]}]});class CoreModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,imports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule,UserSettingsModule,CollapseTableModule],exports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,imports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule,UserSettingsModule,CollapseTableModule,CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:CoreModule,decorators:[{type:NgModule,args:[{imports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule,UserSettingsModule,CollapseTableModule],exports:[CoreShellModule,CoreAuthModule,CoreDialogModule,CoreLoggerModule]}]}]});let typeCache={};function type(t){if(typeCache[t])throw new Error(`Action type "${t}" is not unqiue"`);return typeCache[t]=!0,t}class DateShortcutComponent extends BaseComponent{_services;_cd;startDateObj;endDateObj;startDateObjForm;endDateObjForm;startDateObjChange=new EventEmitter;endDateObjChange=new EventEmitter;startDateObjFormChange=new EventEmitter;endDateObjFormChange=new EventEmitter;datesChanged=new EventEmitter;shortcutValue=null;shortcutValueChange=new EventEmitter;constructor(t,e){super(t),this._services=t,this._cd=e}ngOnInit(){this.onSelectShortcut()}reset(){this.shortcutValue=null,this.shortcutValueChange.emit(this.shortcutValue),this._cd.detectChanges()}onSelectShortcut(){if(this.shortcutValue){const t=this._services._app.environment.value?.TZ_CLIENT,e=momentTz(t);if(this.startDateObj&&this.endDateObj){let n=dateOnlyStartOfDayTz({year:this.startDateObj.year,month:this.startDateObj.month,day:this.startDateObj.day},t),o=dateOnlyStartOfDayTz({year:this.endDateObj.year,month:this.endDateObj.month,day:this.endDateObj.day},t);"Q1"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().startOf("year").quarter(2).subtract(1,"days").toDate()):"Q2"===this.shortcutValue?(n=e.clone().startOf("year").quarter(2).toDate(),o=e.clone().startOf("year").quarter(3).subtract(1,"days").toDate()):"Q3"===this.shortcutValue?(n=e.clone().startOf("year").quarter(3).toDate(),o=e.clone().startOf("year").quarter(4).subtract(1,"days").toDate()):"Q4"===this.shortcutValue?(n=e.clone().startOf("year").quarter(4).toDate(),o=e.clone().endOf("year").toDate()):"Last Q1"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(2).subtract(1,"days").toDate()):"Last Q2"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(2).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(3).subtract(1,"days").toDate()):"Last Q3"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(3).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(4).subtract(1,"days").toDate()):"Last Q4"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(4).toDate(),o=e.clone().endOf("year").subtract(1,"year").toDate()):"Today"===this.shortcutValue?(n=e.clone().startOf("day").toDate(),o=e.clone().toDate()):"Yesterday"===this.shortcutValue?(n=e.clone().subtract(1,"days").startOf("day").toDate(),o=e.clone().subtract(1,"days").endOf("day").toDate()):"Week"===this.shortcutValue?(n=e.clone().startOf("isoWeek").toDate(),o=e.clone().toDate()):"Last Week"===this.shortcutValue?(o=e.clone().startOf("isoWeek").subtract(1,"days").toDate(),n=momentTz(t,o).startOf("isoWeek").toDate()):"Month"===this.shortcutValue?(n=e.clone().startOf("month").toDate(),o=e.clone().toDate()):"Last Month"===this.shortcutValue?(o=e.clone().startOf("month").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("month").toDate()):"Last 30 Days"===this.shortcutValue?(o=e.clone().toDate(),n=e.clone().subtract(30,"days").startOf("day").toDate()):"Quarter"===this.shortcutValue?(n=e.clone().startOf("year").quarter(e.quarter()).toDate(),o=e.clone().toDate()):"Last Quarter"===this.shortcutValue?(o=e.clone().startOf("year").quarter(e.quarter()).subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("quarter").toDate()):"Year"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().toDate()):"Last Year"===this.shortcutValue?(o=e.clone().startOf("year").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("year").toDate()):"All"===this.shortcutValue&&(n=new Date(2017,0,1,0,0,0,0),o=e.clone().toDate()),this.startDateObj={year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()},this.endDateObj={year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()},this.startDateObjChange.emit(this.startDateObj),this.endDateObjChange.emit(this.endDateObj),this.datesChanged.emit([this.startDateObj,this.endDateObj])}else if(this.startDateObjForm&&this.endDateObjForm){let n=dateOnlyStartOfDayTz({year:this.startDateObjForm.value.year,month:this.startDateObjForm.value.month,day:this.startDateObjForm.value.day},t),o=dateOnlyStartOfDayTz({year:this.endDateObjForm.value.year,month:this.endDateObjForm.value.month,day:this.endDateObjForm.value.day},t);"Q1"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().startOf("year").quarter(2).subtract(1,"days").toDate()):"Q2"===this.shortcutValue?(n=e.clone().startOf("year").quarter(2).toDate(),o=e.clone().startOf("year").quarter(3).subtract(1,"days").toDate()):"Q3"===this.shortcutValue?(n=e.clone().startOf("year").quarter(3).toDate(),o=e.clone().startOf("year").quarter(4).subtract(1,"days").toDate()):"Q4"===this.shortcutValue?(n=e.clone().startOf("year").quarter(4).toDate(),o=e.clone().endOf("year").toDate()):"Last Q1"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(2).subtract(1,"days").toDate()):"Last Q2"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(2).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(3).subtract(1,"days").toDate()):"Last Q3"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(3).toDate(),o=e.clone().startOf("year").subtract(1,"year").quarter(4).subtract(1,"days").toDate()):"Last Q4"===this.shortcutValue?(n=e.clone().startOf("year").subtract(1,"year").quarter(4).toDate(),o=e.clone().endOf("year").subtract(1,"year").toDate()):"Today"===this.shortcutValue?(n=e.clone().startOf("day").toDate(),o=e.clone().toDate()):"Yesterday"===this.shortcutValue?(n=e.clone().subtract(1,"days").startOf("day").toDate(),o=e.clone().subtract(1,"days").endOf("day").toDate()):"Week"===this.shortcutValue?(n=e.clone().startOf("isoWeek").toDate(),o=e.clone().toDate()):"Last Week"===this.shortcutValue?(o=e.clone().startOf("isoWeek").subtract(1,"days").toDate(),n=momentTz(t,o).startOf("isoWeek").toDate()):"Month"===this.shortcutValue?(n=e.clone().startOf("month").toDate(),o=e.clone().toDate()):"Last Month"===this.shortcutValue?(o=e.clone().startOf("month").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("month").toDate()):"Last 30 Days"===this.shortcutValue?(o=e.clone().toDate(),n=e.clone().subtract(30,"days").startOf("day").toDate()):"Quarter"===this.shortcutValue?(n=e.clone().startOf("year").quarter(e.quarter()).toDate(),o=e.clone().toDate()):"Last Quarter"===this.shortcutValue?(o=e.clone().startOf("year").quarter(e.quarter()).subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("quarter").toDate()):"Year"===this.shortcutValue?(n=e.clone().startOf("year").toDate(),o=e.clone().toDate()):"Last Year"===this.shortcutValue?(o=e.clone().startOf("year").subtract(1,"days").endOf("day").toDate(),n=momentTz(t,o).startOf("year").toDate()):"All"===this.shortcutValue&&(n=new Date(2017,0,1,0,0,0,0),o=e.clone().toDate()),this.startDateObjForm.setValue({year:n.getFullYear(),month:n.getMonth()+1,day:n.getDate()}),this.endDateObjForm.setValue({year:o.getFullYear(),month:o.getMonth()+1,day:o.getDate()}),this.startDateObjFormChange.emit(this.startDateObjForm),this.endDateObjFormChange.emit(this.endDateObjForm),this.datesChanged.emit([this.startDateObjForm,this.endDateObjForm])}this.shortcutValueChange.emit(this.shortcutValue)}this._cd.detectChanges()}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutComponent,deps:[{token:ProviderService},{token:i0.ChangeDetectorRef}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"14.0.0",version:"21.1.2",type:DateShortcutComponent,isStandalone:!1,selector:"date-shortcut",inputs:{startDateObj:"startDateObj",endDateObj:"endDateObj",startDateObjForm:"startDateObjForm",endDateObjForm:"endDateObjForm",shortcutValue:"shortcutValue"},outputs:{startDateObjChange:"startDateObjChange",endDateObjChange:"endDateObjChange",startDateObjFormChange:"startDateObjFormChange",endDateObjFormChange:"endDateObjFormChange",datesChanged:"datesChanged",shortcutValueChange:"shortcutValueChange"},providers:[ProviderService],usesInheritance:!0,ngImport:i0,template:'\n\t\t<label class="form-control-label">Date Shortcuts</label>\n\t\t<rio-select [(ngModel)]="shortcutValue" (change)="onSelectShortcut()" placeholder="Select Shortcut" [clearable]="false">\n\t\t\t<rio-option value="Today">Today</rio-option>\n\t\t\t<rio-option value="Yesterday">Yesterday</rio-option>\n\t\t\t<rio-option value="Week">This Week</rio-option>\n\t\t\t<rio-option value="Last Week">Last Week</rio-option>\n\t\t\t<rio-option value="Month">This Month</rio-option>\n\t\t\t<rio-option value="Last Month">Last Month</rio-option>\n\t\t\t<rio-option value="Last 30 Days">Last 30 Days</rio-option>\n\t\t\t<rio-option value="Quarter">This Quarter</rio-option>\n\t\t\t<rio-option value="Last Quarter">Last Quarter</rio-option>\n\t\t\t<rio-option value="Year">This Year</rio-option>\n\t\t\t<rio-option value="Last Year">Last Year</rio-option>\n\t\t\t<rio-option value="Q1">Q1</rio-option>\n\t\t\t<rio-option value="Q2">Q2</rio-option>\n\t\t\t<rio-option value="Q3">Q3</rio-option>\n\t\t\t<rio-option value="Q4">Q4</rio-option>\n\t\t\t<rio-option value="Last Q1">Last Q1</rio-option>\n\t\t\t<rio-option value="Last Q2">Last Q2</rio-option>\n\t\t\t<rio-option value="Last Q3">Last Q3</rio-option>\n\t\t\t<rio-option value="Last Q4">Last Q4</rio-option>\n\t\t\t<rio-option value="All">All</rio-option>\n\t\t</rio-select>\n\t',isInline:!0,dependencies:[{kind:"directive",type:i2.NgControlStatus,selector:"[formControlName],[ngModel],[formControl]"},{kind:"directive",type:i2.NgModel,selector:"[ngModel]:not([formControlName]):not([formControl])",inputs:["name","disabled","ngModel","ngModelOptions"],outputs:["ngModelChange"],exportAs:["ngModel"]},{kind:"component",type:i5.RioSelectComponent,selector:"rio-select",inputs:["placeholder","multiple","panelMaxHeight","panelMaxViewportRatio","optionHeight","virtualBuffer","overlayZIndex","autoSizePanel","panelPosition","autoCenterPanel","viewportMargin","panelWidth","panelFullscreenWidth","clearable","templateLabelFromView","searchable","searchMinOptions","searchMatchMode","defaultSearch","textWrap","compareWith","options","optionLabelKey","optionLabelFn","optionValueKey","optionDisabledKey","optionIdKey","optionGroupKey","disabled","emitOptionObject","debugLog","stickyKey","stickyAutoSave"],outputs:["change"]},{kind:"component",type:i5.RioOptionComponent,selector:"rio-option",inputs:["value","disabled","label","id"]}],changeDetection:i0.ChangeDetectionStrategy.OnPush})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"date-shortcut",template:'\n\t\t<label class="form-control-label">Date Shortcuts</label>\n\t\t<rio-select [(ngModel)]="shortcutValue" (change)="onSelectShortcut()" placeholder="Select Shortcut" [clearable]="false">\n\t\t\t<rio-option value="Today">Today</rio-option>\n\t\t\t<rio-option value="Yesterday">Yesterday</rio-option>\n\t\t\t<rio-option value="Week">This Week</rio-option>\n\t\t\t<rio-option value="Last Week">Last Week</rio-option>\n\t\t\t<rio-option value="Month">This Month</rio-option>\n\t\t\t<rio-option value="Last Month">Last Month</rio-option>\n\t\t\t<rio-option value="Last 30 Days">Last 30 Days</rio-option>\n\t\t\t<rio-option value="Quarter">This Quarter</rio-option>\n\t\t\t<rio-option value="Last Quarter">Last Quarter</rio-option>\n\t\t\t<rio-option value="Year">This Year</rio-option>\n\t\t\t<rio-option value="Last Year">Last Year</rio-option>\n\t\t\t<rio-option value="Q1">Q1</rio-option>\n\t\t\t<rio-option value="Q2">Q2</rio-option>\n\t\t\t<rio-option value="Q3">Q3</rio-option>\n\t\t\t<rio-option value="Q4">Q4</rio-option>\n\t\t\t<rio-option value="Last Q1">Last Q1</rio-option>\n\t\t\t<rio-option value="Last Q2">Last Q2</rio-option>\n\t\t\t<rio-option value="Last Q3">Last Q3</rio-option>\n\t\t\t<rio-option value="Last Q4">Last Q4</rio-option>\n\t\t\t<rio-option value="All">All</rio-option>\n\t\t</rio-select>\n\t',changeDetection:ChangeDetectionStrategy.OnPush,standalone:!1}]}],ctorParameters:()=>[{type:ProviderService},{type:i0.ChangeDetectorRef}],propDecorators:{startDateObj:[{type:Input}],endDateObj:[{type:Input}],startDateObjForm:[{type:Input}],endDateObjForm:[{type:Input}],startDateObjChange:[{type:Output}],endDateObjChange:[{type:Output}],startDateObjFormChange:[{type:Output}],endDateObjFormChange:[{type:Output}],datesChanged:[{type:Output}],shortcutValue:[{type:Input}],shortcutValueChange:[{type:Output}]}});class DateShortcutModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,declarations:[DateShortcutComponent],imports:[FormsModule,CommonModule,RioSelectModule],exports:[DateShortcutComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,imports:[FormsModule,CommonModule,RioSelectModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:DateShortcutModule,decorators:[{type:NgModule,args:[{imports:[FormsModule,CommonModule,RioSelectModule],exports:[DateShortcutComponent],declarations:[DateShortcutComponent]}]}]});class SchedulerComponent extends BaseComponent{_services;today=new Date;over_forward=!1;over_backwards=!1;mouseDown=!1;mouseLastEvent=null;timer_sub=null;months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];size_svg={width:0,height:0};size_cell={width:30,height:30};svgChart;constructor(t){super(t),this._services=t}ngAfterViewInit(){this.size_svg.width=this.svgChart.nativeElement.clientWidth,this.size_svg.height=this.svgChart.nativeElement.clientHeight}ngOnDestroy(){this.timer_sub&&clearInterval(this.timer_sub)}onMouseup(){this.mouseDown=!1}onMousedown(t){this.mouseDown=!0,this.mouseLastEvent=t}onMousemove(t){if(this.mouseDown){let e=0;this.mouseLastEvent.clientX-t.clientX>1?e=Math.floor((this.mouseLastEvent.clientX-t.clientX)/15)>0?Math.floor((this.mouseLastEvent.clientX-t.clientX+5*(30-this.size_cell.width))/20):1:this.mouseLastEvent.clientX-t.clientX<-1&&(e=Math.floor((this.mouseLastEvent.clientX-t.clientX)/15)<0?Math.floor((this.mouseLastEvent.clientX-t.clientX-5*(30-this.size_cell.width))/20):-1),this.today=moment$1(this.today).add(e,"days").toDate(),this.mouseLastEvent=t}}onMouseLeave(t){this.mouseDown&&(this.mouseDown=!1)}buildDays(){let t=[];for(let e=0;e<Math.floor(this.size_svg.width/this.size_cell.width);e++)t.push({index:e,day:moment$1(this.today).add(e,"days").toDate().getDate()});return t}buildMonths(){let t=[{index_start:0,index_end:null,month:this.months[this.today.getMonth()]}];for(let e=1;e<Math.floor(this.size_svg.width/this.size_cell.width);e++)moment$1(this.today).add(e,"days").toDate().getMonth()!==moment$1(this.today).add(e-1,"days").toDate().getMonth()&&(t[t.length-1].index_end=e,t.push({index_start:e,index_end:null,month:this.months[moment$1(this.today).add(e,"days").toDate().getMonth()]}));return t[t.length-1].index_end=Math.floor(this.size_svg.width/this.size_cell.width),t}buildYears(){let t=[{index_start:0,index_end:null,year:this.today.getFullYear()}];for(let e=1;e<Math.floor(this.size_svg.width/this.size_cell.width);e++)moment$1(this.today).add(e,"days").toDate().getFullYear()!==moment$1(this.today).add(e-1,"days").toDate().getFullYear()&&(t[t.length-1].index_end=e,t.push({index_start:e,index_end:null,year:moment$1(this.today).add(e,"days").toDate().getFullYear()}));return t[t.length-1].index_end=Math.floor(this.size_svg.width/this.size_cell.width),t}decrementToday(){this.today=moment$1(this.today).subtract(1,"days").toDate()}incrementToday(){this.today=moment$1(this.today).add(1,"days").toDate()}overForward(){this.timer_sub=setInterval(()=>{this.incrementToday()},50)}leftForward(){clearInterval(this.timer_sub)}overBackwards(){this.timer_sub=setInterval(()=>{this.decrementToday()},50)}leftBackwards(){clearInterval(this.timer_sub)}zoomOut(){this.size_cell.width>10&&(this.size_cell.width-=10)}zoomIn(){this.size_cell.width+=10}static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerComponent,deps:[{token:ProviderService}],target:i0.ɵɵFactoryTarget.Component});static"ɵcmp"=i0.ɵɵngDeclareComponent({minVersion:"17.0.0",version:"21.1.2",type:SchedulerComponent,isStandalone:!1,selector:"scheduler",host:{listeners:{mouseup:"onMouseup()",mousedown:"onMousedown($event)",mousemove:"onMousemove($event)",mouseleave:"onMouseLeave($event)"}},providers:[ProviderService],viewQueries:[{propertyName:"svgChart",first:!0,predicate:["svgChart"],descendants:!0,static:!0}],usesInheritance:!0,ngImport:i0,template:'<style>\n\t.bar {\n\t\tfill: red; /* changes the background */\n\t\theight: 21px;\n\t\ttransition: fill 0.3s ease;\n\t\tcursor: pointer;\n\t\tfont-family: Helvetica, sans-serif;\n\t}\n\n\t.bar text {\n\t\tcolor: black;\n\t}\n\n\t.bar:hover,\n\t.bar:focus {\n\t\tfill: black;\n\t}\n\n\t.bar:hover text,\n\t.bar:focus text {\n\t\tfill: red;\n\t}\n\n\t.year {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.month {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.day {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.smallText {\n\t\tfont-size: 4px;\n\t}\n</style>\n\n<div class="scheduler">\n\t<button class="btn btn-warning" type="button" (mouseenter)="overBackwards()" (mouseleave)="leftBackwards()">Go Backwards</button>\n\t<button class="btn btn-success" type="button" (mouseenter)="overForward()" (mouseleave)="leftForward()">Go Forward</button>\n\n\t<button style="margin-left: 20px" class="btn btn-warning" type="button" (click)="zoomOut()">Zoom Out</button>\n\t<button class="btn btn-success" type="button" (click)="zoomIn()">Zoom In</button>\n\n\t<svg class="chart" width="100%" height="100%" aria-labelledby="title desc" role="img" #svgChart>\n\t\t<title id="title">Scheduler</title>\n\t\t<desc id="desc">Scheduler</desc>\n\n\t\t<g class="year">\n\t\t\t@for (year of buildYears(); track year;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width"></rect>\n\t\t\t\t\t<svg [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ year.year }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="month">\n\t\t\t@for (month of buildMonths(); track month;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height"></rect>\n\t\t\t\t\t<svg [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ month.month }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="day">\n\t\t\t@for (day of buildDays(); track day;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2"></rect>\n\t\t\t\t\t<svg [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" [style.font-size.px]="[size_cell.width > 10 ? 12 : 6]">{{ day.day }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\n\t\t\x3c!-- <g class="bar">\n\t<rect width="40" height="19"></rect>\n\t<text x="45" y="9.5" dy=".35em">4 apples</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="80" height="19" y="20"></rect>\n\t<text x="85" y="28" dy=".35em">8 bananas</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="150" height="19" y="40"></rect>\n\t<text x="150" y="48" dy=".35em">15 kiwis</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="160" height="19" y="60"></rect>\n\t<text x="161" y="68" dy=".35em">16 oranges</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="230" height="19" y="80"></rect>\n\t<text x="235" y="88" dy=".35em">23 lemons</text>\n\t</g> --\x3e\n\t</svg>\n</div>\n',styles:[".bar{fill:red;height:21px;transition:fill .3s ease;cursor:pointer;font-family:Helvetica,sans-serif}.bar text{color:#000}.bar:hover,.bar:focus{fill:#000}.bar:hover text,.bar:focus text{fill:red}.year,.month,.day{stroke:#000;fill:#fff}.smallText{font-size:4px}\n"]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerComponent,decorators:[{type:Component,args:[{providers:[ProviderService],selector:"scheduler",standalone:!1,template:'<style>\n\t.bar {\n\t\tfill: red; /* changes the background */\n\t\theight: 21px;\n\t\ttransition: fill 0.3s ease;\n\t\tcursor: pointer;\n\t\tfont-family: Helvetica, sans-serif;\n\t}\n\n\t.bar text {\n\t\tcolor: black;\n\t}\n\n\t.bar:hover,\n\t.bar:focus {\n\t\tfill: black;\n\t}\n\n\t.bar:hover text,\n\t.bar:focus text {\n\t\tfill: red;\n\t}\n\n\t.year {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.month {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.day {\n\t\tstroke: black;\n\t\tfill: white;\n\t}\n\n\t.smallText {\n\t\tfont-size: 4px;\n\t}\n</style>\n\n<div class="scheduler">\n\t<button class="btn btn-warning" type="button" (mouseenter)="overBackwards()" (mouseleave)="leftBackwards()">Go Backwards</button>\n\t<button class="btn btn-success" type="button" (mouseenter)="overForward()" (mouseleave)="leftForward()">Go Forward</button>\n\n\t<button style="margin-left: 20px" class="btn btn-warning" type="button" (click)="zoomOut()">Zoom Out</button>\n\t<button class="btn btn-success" type="button" (click)="zoomIn()">Zoom In</button>\n\n\t<svg class="chart" width="100%" height="100%" aria-labelledby="title desc" role="img" #svgChart>\n\t\t<title id="title">Scheduler</title>\n\t\t<desc id="desc">Scheduler</desc>\n\n\t\t<g class="year">\n\t\t\t@for (year of buildYears(); track year;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width"></rect>\n\t\t\t\t\t<svg [attr.width]="(year.index_end - year.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="year.index_start * size_cell.width">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ year.year }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="month">\n\t\t\t@for (month of buildMonths(); track month;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height"></rect>\n\t\t\t\t\t<svg [attr.width]="(month.index_end - month.index_start) * size_cell.width" [attr.height]="size_cell.height" [attr.x]="month.index_start * size_cell.width" [attr.y]="size_cell.height">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle">{{ month.month }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\t\t<g class="day">\n\t\t\t@for (day of buildDays(); track day;) {\n\t\t\t\t<ng-container>\n\t\t\t\t\t<rect [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2"></rect>\n\t\t\t\t\t<svg [attr.width]="size_cell.width" [attr.height]="size_cell.height" [attr.x]="day.index * size_cell.width" [attr.y]="size_cell.height * 2">\n\t\t\t\t\t\t<text x="50%" y="50%" alignment-baseline="middle" text-anchor="middle" [style.font-size.px]="[size_cell.width > 10 ? 12 : 6]">{{ day.day }}</text>\n\t\t\t\t\t</svg>\n\t\t\t\t</ng-container>\n\t\t\t}\n\t\t</g>\n\n\t\t\x3c!-- <g class="bar">\n\t<rect width="40" height="19"></rect>\n\t<text x="45" y="9.5" dy=".35em">4 apples</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="80" height="19" y="20"></rect>\n\t<text x="85" y="28" dy=".35em">8 bananas</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="150" height="19" y="40"></rect>\n\t<text x="150" y="48" dy=".35em">15 kiwis</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="160" height="19" y="60"></rect>\n\t<text x="161" y="68" dy=".35em">16 oranges</text>\n\t</g>\n\t<g class="bar">\n\t<rect width="230" height="19" y="80"></rect>\n\t<text x="235" y="88" dy=".35em">23 lemons</text>\n\t</g> --\x3e\n\t</svg>\n</div>\n'}]}],ctorParameters:()=>[{type:ProviderService}],propDecorators:{svgChart:[{type:ViewChild,args:["svgChart",{static:!0}]}],onMouseup:[{type:HostListener,args:["mouseup"]}],onMousedown:[{type:HostListener,args:["mousedown",["$event"]]}],onMousemove:[{type:HostListener,args:["mousemove",["$event"]]}],onMouseLeave:[{type:HostListener,args:["mouseleave",["$event"]]}]}});class SchedulerModule{static"ɵfac"=i0.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,deps:[],target:i0.ɵɵFactoryTarget.NgModule});static"ɵmod"=i0.ɵɵngDeclareNgModule({minVersion:"14.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,declarations:[SchedulerComponent],imports:[NgbModule,FormsModule,CommonModule,RouterModule],exports:[SchedulerComponent]});static"ɵinj"=i0.ɵɵngDeclareInjector({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,imports:[NgbModule,FormsModule,CommonModule,RouterModule]})}i0.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"21.1.2",ngImport:i0,type:SchedulerModule,decorators:[{type:NgModule,args:[{imports:[NgbModule,FormsModule,CommonModule,RouterModule],exports:[SchedulerComponent],declarations:[SchedulerComponent],providers:[]}]}]});const ReportBuilderModulePermission={name:"report-builder",gate:"report-builder",views:[{link:"/report-builder/list",label:"List"},{link:"/report-builder/new",label:"New"},{link:"/report-builder/scheduled-job",label:"Scheduled Job"},{link:"/report-builder/dashboard-builder",label:"Dashboard Builder"},{link:"/report-builder/detail",label:"Detail",has_parameter:!0},{link:"/report-builder/edit",label:"Edit",has_parameter:!0},{link:"/report-builder/delete",label:"Delete",has_parameter:!0}]},MongoExplorerModulePermission={name:"mongo-explorer",gate:"mongo-explorer",views:[{link:"/super-admin/mongo-explorer",label:"Mongo Explorer"}]},SuperAdminModulePermission={name:"super-admin",views:[{link:"/super-admin/dashboard",label:"Dashboard"},{link:"/super-admin/apm",label:"APM"},{link:"/super-admin/mongo",label:"Mongo"},{link:"/super-admin/mongo-explorer",label:"Mongo Explorer",gate:"mongo-explorer"},{link:"/super-admin/monitor",label:"Monitor"}]};export{AccountManagerService,AiAssistantComponent,AiFormAutoRegisterDirective,AiFormRegistryService,AiPageFormAdapterService,AiPageRouterService,AiTerminalComponent,AiTerminalModule,AiTerminalService,AlertService,Auth365Component,AuthGuard,AuthPermissionService,AuthService,AwsService,BaseComponent,CanDeactivateGuard,CollapseTableComponent,CollapseTableModule,CoreAuthModule,CoreComponent,CoreDialogModule,CoreLoggerModule,CoreModule,CoreService,CoreServicesModule,CoreShellModule,CoreTourService,DATATABLE_DEFAULT_CONFIG,DatatableCellTemplateDirective,DatatableComponent,DatatableModule,DateShortcutComponent,DateShortcutModule,DialogConfirmContent,DialogErrorContent,DialogInputContent,DialogLoginContent,DialogNotifyContent,DialogRegisterContent,DialogSelectArrayContent,DialogSelectArrayObjsContent,DialogSelectDataLabelsContent,DialogSelectDateTimeContent,DialogSelectWithButtonsURLContent,DialogService,DomSanitizorPipe,Draggable,DropEvent,Droppable,EnrollComponent,FeatureGateService,FileModule,FileUploadComponent,FilterEqualPipe,FilterNotEqualPipe,FocusDirective,ForgotPasswordComponent,FormButtonComponent,FormButtonModule,HomeComponent,HtmlDiffViewerComponent,JsonParsePipe,LoggerComponent,MinusCurrencyPipe,MongoExplorerModulePermission,NavbarMainComponent,NavbarModuleComponent,NgDragDropModule,NgDragDropService,OfflineManagerService,PhonePipe,PipeModule,ProviderService,ReportBuilderModulePermission,ResizeService,ResponsiveButtonGroupComponent,ResponsiveButtonGroupModule,ReversePipe,RioPaginationComponent,RioPaginationModule,SchedulerComponent,SchedulerModule,ScrollDirective,SharedModule,SocketManagerService,SocketService,SortTableDirective,SortTableHeaderComponent,SortTableModule,SortTableNgForComponent,Sortable as SortableJs,SortablejsDirective,SortablejsModule,StorageDB,SuperAdminModulePermission,TitleCaseAndUnderscorePipe,TokenManagerService,TourAnchorDirective,UserRoleComponent,UserRoleModule,ValidationService,WindowRefService,applyMongoUpdate,b64toBlobURL,blobToFile,dateOnlyEndOfDayTz,dateOnlyStartOfDayTz,dateReviver,deepCopy,deepDiffDetails,exportCsv,generateCronStringFromDate,isUpperCase,mergeDeep,momentTz,pad,provideDatatableDefaultConfig,rioDatePickerConfigFactory,round,s2ab,toDataURL,toTitleCase,type};
|