nucliadb-admin-assets 1.0.0.post2424__py3-none-any.whl → 1.0.0.post2528__py3-none-any.whl
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.
Potentially problematic release.
This version of nucliadb-admin-assets might be problematic. Click here for more details.
- nucliadb_admin_assets/555.92b9f6822a7de6c8.js +1 -0
- nucliadb_admin_assets/assets/connector-logos/sitefinity.svg +7 -0
- nucliadb_admin_assets/assets/deployment/app-config.json +1 -1
- nucliadb_admin_assets/assets/i18n/common/ca.json +96 -75
- nucliadb_admin_assets/assets/i18n/common/en.json +96 -88
- nucliadb_admin_assets/assets/i18n/common/es.json +96 -75
- nucliadb_admin_assets/assets/i18n/common/fr.json +96 -75
- nucliadb_admin_assets/assets/i18n/sync/ca.json +19 -5
- nucliadb_admin_assets/assets/i18n/sync/en.json +18 -4
- nucliadb_admin_assets/assets/i18n/sync/es.json +18 -4
- nucliadb_admin_assets/assets/i18n/sync/fr.json +18 -4
- nucliadb_admin_assets/index.html +1 -1
- nucliadb_admin_assets/main.dcd5944f38c06d0d.js +1 -0
- nucliadb_admin_assets/polyfills.9066651cc91e9048.js +1 -0
- nucliadb_admin_assets/runtime.cbd4b07776ed8d84.js +1 -0
- {nucliadb_admin_assets-1.0.0.post2424.dist-info → nucliadb_admin_assets-1.0.0.post2528.dist-info}/METADATA +1 -1
- {nucliadb_admin_assets-1.0.0.post2424.dist-info → nucliadb_admin_assets-1.0.0.post2528.dist-info}/RECORD +20 -19
- nucliadb_admin_assets/789.113e96194b0e7baf.js +0 -1
- nucliadb_admin_assets/main.84974ec55fca4b01.js +0 -1
- nucliadb_admin_assets/polyfills.07329d7acd49761e.js +0 -1
- nucliadb_admin_assets/runtime.f7592cfefe3b336c.js +0 -1
- {nucliadb_admin_assets-1.0.0.post2424.dist-info → nucliadb_admin_assets-1.0.0.post2528.dist-info}/WHEEL +0 -0
- {nucliadb_admin_assets-1.0.0.post2424.dist-info → nucliadb_admin_assets-1.0.0.post2528.dist-info}/top_level.txt +0 -0
- {nucliadb_admin_assets-1.0.0.post2424.dist-info → nucliadb_admin_assets-1.0.0.post2528.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunknucliadb_admin=self.webpackChunknucliadb_admin||[]).push([[555],{5555:(Qn,L,l)=>{l.r(L),l.d(L,{SYNC_ROUTES:()=>Jn});var c=l(2306),R=l(419),k=l(1413),ht=l(1584),v=l(5964),d=l(5558),E=l(6977);const F="assets/connector-logos";var $=function(o){return o.PENDING="PENDING",o.PROCESSING="PROCESSING",o.UPLOADED="UPLOADED",o.ERROR="ERROR",o}($||{}),M=l(4412),m=l(6354),gt=l(7468),_=l(6697),f=l(7673),x=l(8141),X=l(9437),b=l(4760);const yt={id:"sitemap",title:"Sitemap",logo:`${F}/sitemap.svg`,description:"Upload web pages from a sitemap.xml",permanentSyncOnly:!0,factory:()=>new _t};class _t{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"Sitemap",originalId:"SITEMAP",metadata:{},status:$.PENDING}]}getParametersSections(){return(0,f.of)([{id:"url",title:"sync.connectors.sitemap.url.section-title",fields:[{id:"sitemap",label:"sync.connectors.sitemap.url.label",type:"text",required:!0,pattern:/.+\.(ashx|xml)/,placeholder:"https://my-website.com/sitemap.xml"}]},{id:"restrict-indexation",title:"sync.connectors.common.restrict-indexation.title",description:"sync.connectors.common.restrict-indexation.description",badge:"generic.badge.optional",fields:[{id:"cssSelector",label:"sync.connectors.common.css.label",help:"sync.connectors.common.css.help",type:"text",required:!1,placeholder:".main-content"},{id:"xpathSelector",label:"sync.connectors.common.xpath.label",help:"sync.connectors.common.xpath.help",type:"text",required:!1,placeholder:'//div[@id="main"]'}]},{id:"web-scraping-helpers",title:"sync.connectors.common.web-scraping-helpers.title",description:"sync.connectors.common.web-scraping-helpers.description",badge:"generic.badge.advanced",fields:[{id:"localExtract",label:"sync.connectors.common.local-extract.label",help:"sync.connectors.common.local-extract.help",type:"boolean",required:!1},{id:"keepQueryString",label:"sync.connectors.common.keep-querystring.label",help:"sync.connectors.common.keep-querystring.help",type:"boolean",required:!1},{id:"headers",label:"sync.connectors.common.headers.label",help:"sync.connectors.common.headers.help",type:"table",required:!1},{id:"cookies",label:"sync.connectors.common.cookies.label",help:"sync.connectors.common.cookies.help",type:"table",required:!1},{id:"localstorage",label:"sync.connectors.common.localstorage.label",help:"sync.connectors.common.localstorage.help",type:"table",required:!1}]}])}handleParameters(s){}getParametersValues(){return{}}}const ft={id:"folder",title:"Folder",logo:`${F}/folder.svg`,description:"Upload a folder from your device",factory:()=>new Ct};class Ct{constructor(){this.hasServerSideAuth=!1,this.isExternal=!1,this.allowToSelectFolders=!1,this.files=[],this.path="",this.canSyncSecurityGroups=!1}getStaticFolders(){return this.path?[{uuid:"",title:this.path,originalId:this.path,metadata:{},status:$.PENDING}]:[]}getParametersSections(){return(0,f.of)([{id:"local-path",title:"sync.connectors.folder.local-path.title",description:"sync.connectors.folder.local-path.description",fields:[{id:"path",label:"sync.connectors.folder.local-path.field-label",placeholder:"/Users/alice/Documents or C:\\Users\\Alice\\Documents",type:"text",required:!0}]}])}handleParameters(s){s.path&&(this.path=s.path)}getParametersValues(){return{path:this.path}}}class D{constructor(s,i,e){this.hasServerSideAuth=!0,this.isExternal=!0,this.allowToSelectFolders=!1,this.resumable=!1,this.isCloud=!0,this.canSyncSecurityGroups="gdrive"===s,this.name=s,this.id=i,this.path=e}getParametersSections(){return(0,f.of)([{id:"folder",title:"sync.connectors.oauth.folder.title",fields:[{id:"sync_root_path",label:"sync.connectors.oauth.path.label",type:"text",required:!0}]}])}handleParameters(s){s.path&&(this.path=s.path)}getParametersValues(){return{path:this.path}}getStaticFolders(){return[]}}const J="SHAREPOINT_SITE_NAME";class bt extends D{constructor(s,i,e){super(s,i,e)}getParametersSections(){return(0,f.of)([{id:"account",title:"sync.connectors.sharepoint.account.title",fields:[{id:"site_name",label:"sync.connectors.sharepoint.site.label",type:"text",required:!0}]}])}handleParameters(s){localStorage.setItem(J,s.site_name)}getParametersValues(){return{...super.getParametersValues(),site_name:localStorage.getItem(J)}}}const vt={id:"confluence",title:"Confluence",logo:`${F}/confluence.svg`,description:"Collaboration platform developed by Atlassian",helpUrl:"https://docs.nuclia.dev/docs/docs/using/sync-agent#confluence-connector-usage",deprecated:!0,factory:()=>new St},Q="CONFLUENCE_TOKEN";class St{constructor(){this.hasServerSideAuth=!1,this.isExternal=!1,this.allowToSelectFolders=!0,this.canSyncSecurityGroups=!1}getParametersSections(){return(0,f.of)([{id:"account",title:"sync.connectors.confluence.account.title",description:"sync.connectors.confluence.account.description",fields:[{id:"url",label:"sync.connectors.confluence.url.label",type:"text",placeholder:"https://my-site.atlassian.net/wiki",required:!0},{id:"user",label:"sync.connectors.confluence.user.label",type:"text",placeholder:"me@mycompany.com",required:!0},{id:"token",label:"sync.connectors.confluence.token.label",type:"text",required:!0}]}])}handleParameters(s){localStorage.setItem(Q,s.token)}getParametersValues(){return{token:localStorage.getItem(Q)}}getStaticFolders(){return[]}}const xt={id:"rss",title:"RSS",logo:`${F}/rss.svg`,description:"Upload web pages from a RSS feed",permanentSyncOnly:!0,factory:()=>new Tt};class Tt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"RSS",originalId:"rss",metadata:{},status:$.PENDING}]}getParametersSections(){return(0,f.of)([{id:"url",title:"sync.connectors.rss.url.label",fields:[{id:"url",label:"sync.connectors.rss.url.label",type:"text",required:!0,placeholder:"https://rss-feed-url"}]},{id:"restrict-indexation",title:"sync.connectors.common.restrict-indexation.title",description:"sync.connectors.common.restrict-indexation.description",badge:"generic.badge.optional",fields:[{id:"cssSelector",label:"sync.connectors.common.css.label",help:"sync.connectors.common.css.help",type:"text",required:!1,placeholder:".main-content"},{id:"xpathSelector",label:"sync.connectors.common.xpath.label",help:"sync.connectors.common.xpath.help",type:"text",required:!1,placeholder:'//div[@id="main"]'}]},{id:"web-scraping-helpers",title:"sync.connectors.common.web-scraping-helpers.title",description:"sync.connectors.common.web-scraping-helpers.description",badge:"generic.badge.advanced",fields:[{id:"localExtract",label:"sync.connectors.common.local-extract.label",help:"sync.connectors.common.local-extract.help",type:"boolean",required:!1},{id:"headers",label:"sync.connectors.common.headers.label",help:"sync.connectors.common.headers.help",type:"table",required:!1},{id:"cookies",label:"sync.connectors.common.cookies.label",help:"sync.connectors.common.cookies.help",type:"table",required:!1},{id:"localstorage",label:"sync.connectors.common.localstorage.label",help:"sync.connectors.common.localstorage.help",type:"table",required:!1}]}])}handleParameters(s){}getParametersValues(){return{}}}var Ft=l(5512);const It={id:"sitefinity",title:"Sitefinity",logo:`${F}/sitefinity.svg`,description:"Progress Sitefinity CMS",permanentSyncOnly:!0,factory:()=>new Rt};class Rt{constructor(){this.hasServerSideAuth=!1,this.isExternal=!0,this.allowToSelectFolders=!1,this.canSyncSecurityGroups=!1}getStaticFolders(){return[{uuid:"",title:"Sitefinity",originalId:"SITEFINITY",metadata:{},status:$.PENDING}]}getParametersSections(){return(0,f.of)([{id:"url",title:"sync.connectors.sitefinity.url.section-title",fields:[{id:"url",label:"sync.connectors.sitefinity.url.label",type:"text",required:!0,placeholder:"https://my-website.com"},{id:"apikey",label:"sync.connectors.sitefinity.apikey.label",type:"text",required:!0,help:"sync.connectors.sitefinity.apikey.help",secret:!0},{id:"siteId",label:"sync.connectors.sitefinity.site-id.label",type:"text",required:!0,help:"sync.connectors.sitefinity.site-id.help"},{id:"extraContentTypes",label:"sync.connectors.sitefinity.extra.label",type:"text",required:!1,help:"sync.connectors.sitefinity.extra.help"},{id:"extraContentTypesOnly",label:"sync.connectors.sitefinity.extra-only.label",type:"boolean",required:!1,help:"sync.connectors.sitefinity.extra-only.help"}]}])}handleParameters(s){}getParametersValues(){return{}}}var Mt=l(9330);const W="http://localhost:8090",H="NUCLIA_SYNC_SERVER",z="NUCLIA_SYNC_SERVER_TYPE";let j=(()=>{var o;class s{constructor(e,n,r,a,h){this.sdk=e,this.http=n,this.config=r,this.notificationService=a,this.features=h,this.connectors={google_oauth:{definition:{id:"google_oauth",provider:"google_oauth",title:"Google Drive",logo:`${F}/gdrive.svg`,description:"File storage and synchronization service developed by Google",permanentSyncOnly:!0,cloud:!0,factory:g=>new D("google_oauth",g?.id||"",this.config.getOAuthServer())}},onedrive:{definition:{id:"onedrive",title:"One Drive",logo:`${F}/onedrive.svg`,description:"Microsoft OneDrive file hosting service",permanentSyncOnly:!0,deprecated:!0,factory:g=>new D("onedrive",g?.id||"",this.config.getOAuthServer())}},sharepoint:{definition:{id:"sharepoint",title:"SharePoint",logo:`${F}/sharepoint.svg`,description:"Microsoft Sharepoint service",permanentSyncOnly:!0,deprecated:!0,factory:g=>new bt("sharepoint",g?.id||"",this.config.getOAuthServer())}},dropbox:{definition:{id:"dropbox",title:"Dropbox",logo:`${F}/dropbox.svg`,description:"File storage and synchronization service developed by Dropbox",permanentSyncOnly:!0,deprecated:!0,factory:g=>new D("dropbox",g?.id||"",this.config.getOAuthServer())}},folder:{definition:ft},sitemap:{definition:yt},confluence:{definition:vt},rss:{definition:xt},sitefinity:{definition:It}},this.connectorsObs=new M.t(Object.values(this.connectors).map(g=>g.definition).filter(g=>!g.deprecated)).pipe((0,d.n)(g=>this.features.unstable.sitefinityConnector.pipe((0,m.T)(S=>g.filter(I=>S||"sitefinity"!==I.id))))),this._syncServer=new M.t({serverUrl:localStorage.getItem(H)||W,type:localStorage.getItem(z)||"desktop"}),this.syncServer=this._syncServer.asObservable(),this._isServerDown=new M.t(!0),this._currentSyncId=new M.t(null),this._syncCache=new M.t({}),this._cacheUpdated=new M.t((new Date).toISOString()),this._isSyncing=new M.t({}),this.isServerDown=this._isServerDown.asObservable(),this.currentSyncId=this._currentSyncId.asObservable(),this.serverHeaders={token:this.sdk.nuclia.auth.getToken(!0)},this.cacheUpdated=this._cacheUpdated.asObservable(),this.isSyncing=this._isSyncing.asObservable(),this._useCloudSync=new M.t(!1),this.useCloudSync=this._useCloudSync.asObservable(),(0,gt.p)([this.syncServer.pipe((0,_.s)(1)),this.features.unstable.cloudSyncService.pipe((0,_.s)(1))]).subscribe(([g,S])=>{"cloud"===g.type&&S&&this._useCloudSync.next(!0)})}getConnectorDefinition(e){return this.connectors[e]?.definition}getConnector(e,n){const r=this.connectors[e];r.instances||(r.instances={});const a=r.instances;return a[n]||(a[n]=r.definition.factory({id:n})),a[n]}getCurrentSync(){return this.currentSyncId.pipe((0,v.p)(e=>!!e),(0,d.n)(e=>this.getSync(e)))}syncConfigtoISyncEntity(e){return{id:e.id,title:e.name,connector:{name:e.external_connection.provider,parameters:e},lastSyncGMT:void 0,disabled:!1,isCloud:!0}}getSync(e){const n=this._syncCache.getValue();return n[e]?(0,f.of)(n[e]):this._useCloudSync.getValue()?this.sdk.currentKb.pipe((0,_.s)(1),(0,d.n)(r=>r.syncManager.getConfig(e)),(0,m.T)(r=>({...this.syncConfigtoISyncEntity(r),kbId:r.kb_id,connectorId:r.external_connection.provider}))):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{headers:this.serverHeaders}).pipe((0,x.M)(r=>{n[e]=r,this._syncCache.next(n)}))}addSync(e){return this.sdk.currentKb.pipe((0,_.s)(1),(0,d.n)(n=>this.sdk.nuclia.options.standalone?(0,f.of)({...e,kb:{...this.sdk.nuclia.options,knowledgeBox:n.id}}):this.getNucliaKey(n).pipe((0,m.T)(r=>({...e,kb:{zone:this.sdk.nuclia.options.zone,backend:this.sdk.nuclia.options.backend,knowledgeBox:r.kbid,apiKey:r.token}})))),(0,d.n)(n=>this.http.post(`${this._syncServer.getValue().serverUrl}/sync`,n,{headers:this.serverHeaders})),(0,x.M)(()=>{const n=this._syncCache.getValue();n[e.id]=e,this._syncCache.next(n),this._cacheUpdated.next((new Date).toISOString())}),(0,m.T)(()=>{}))}getOAuthUrl(e){return this.sdk.currentKb.pipe((0,_.s)(1),(0,d.n)(n=>n.syncManager.createExternalConnection(e)),(0,m.T)(n=>n.authorize_url))}addCloudSync(e){return this.sdk.currentKb.pipe((0,_.s)(1),(0,d.n)(n=>n.syncManager.createConfig(e)),(0,x.M)(n=>{const r=this._syncCache.getValue();r[n.id]=this.syncConfigtoISyncEntity(n),this._syncCache.next(r),this._cacheUpdated.next((new Date).toISOString())}))}updateSync(e,n,r){return this.http.patch(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{...n,lastSyncGMT:r?"1970-01-01":void 0},{headers:this.serverHeaders}).pipe((0,x.M)(()=>{const a=this._syncCache.getValue();a[e]={...a[e],...n},this._syncCache.next(a),this._cacheUpdated.next((new Date).toISOString())}))}deleteSync(e){return(this._useCloudSync.getValue()?this.sdk.currentKb.pipe((0,_.s)(1),(0,d.n)(n=>n.syncManager.deleteConfig(e))):this.http.delete(`${this._syncServer.getValue().serverUrl}/sync/${e}`,{headers:this.serverHeaders})).pipe((0,x.M)(()=>{const n=this._syncCache.getValue();delete n[e],this._syncCache.next(n),this._cacheUpdated.next((new Date).toISOString())}))}getSyncsForKB(e,n){return n?this.sdk.currentKb.pipe((0,_.s)(1),(0,d.n)(r=>r.syncManager.getConfigs().pipe((0,m.T)(a=>a.filter(h=>h.kb_id===e).map(h=>({id:h.id,kbId:h.kb_id,title:h.name,connectorId:h.external_connection.provider,connector:this.getConnector(h.external_connection.provider,h.id),lastSyncGMT:void 0,disabled:!1})))))):this.isServerDown.pipe((0,d.n)(r=>r?(0,f.of)([]):this.http.get(`${this._syncServer.getValue().serverUrl}/sync/kb/${e}`).pipe((0,m.T)(a=>a.map(h=>({...h,kbId:e,connectorId:h.connector,connector:this.getConnector(h.connector,"")})).filter(h=>h.kbId===e)))))}getFiles(e){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/files/search${e?`?query=${e}`:""}`)}getFolders(e){return this.http.get(`${this._syncServer.getValue().serverUrl}/sync/${this.getCurrentSyncId()}/folders`,{headers:this.serverHeaders})}canSelectFiles(e){const n=this._syncCache.getValue()[e];return n&&!("sitemap"===n.connector.name||"folder"===n.connector.name||"rss"===n.connector.name)}getNucliaKey(e){return e.createKeyForService({title:"Sync",role:"SCONTRIBUTOR"},this.getExpirationDate()).pipe((0,m.T)(n=>({...n,kbid:e.id})))}getExpirationDate(){const e=new Date;return e.setFullYear(e.getFullYear()+1),Math.floor(e.getTime()/1e3).toString()}serverStatus(e){return this.useCloudSync.pipe((0,d.n)(n=>n?(0,f.of)({running:!0}):this.http.get(`${e}/status`).pipe((0,X.W)(()=>(0,f.of)({running:!1,logs:["Server down"]})),(0,m.T)(r=>((r.logs||[]).forEach(a=>console.log("[SERVER]",a)),{running:r.running})))))}setSyncServer(e,n){localStorage.setItem(H,e||""),localStorage.setItem(z,n),this._syncServer.next({serverUrl:e||"",type:n}),e&&this.serverStatus(e).subscribe(r=>{this.setServerStatus(!r.running)})}getCurrentSyncId(){return this._currentSyncId.getValue()}setCurrentSyncId(e){this._currentSyncId.next(e)}clearCurrentSourceId(){this._currentSyncId.next(null)}getLogs(e,n){return this.http.get(`${this._syncServer.getValue().serverUrl}/logs${e?"/"+e:""}${n?"/"+n:""}`).pipe((0,m.T)(r=>r.sort((a,h)=>{const g=(0,Ft.T)(a.createdAt,h.createdAt);return 0===g?a.action.startsWith("start")?1:-1:g})))}clearLogs(){return this.http.delete(`${this._syncServer.getValue().serverUrl}/logs`)}getSyncServer(){return this._syncServer.getValue().serverUrl}setServerStatus(e){e&&!this._isServerDown.value&&this.notificationService.pushNotifications([{type:"sync-server",data:[],timestamp:(new Date).toISOString(),unread:!0,failure:!0}]),this._isServerDown.next(e)}triggerSync(e,n=!1){return this._isSyncing.next({...this._isSyncing.value,[e]:!0}),(n?this.updateSync(e,{},!0).pipe((0,m.T)(()=>!0)):(0,f.of)(!0)).pipe((0,d.n)(()=>this.http.get(`${this._syncServer.getValue().serverUrl}/sync/execute/${e}`)),(0,x.M)(()=>this._isSyncing.next({...this._isSyncing.value,[e]:!1})),(0,X.W)(a=>(console.warn("Trigger sync failed:",a),this._isSyncing.next({...this._isSyncing.value,[e]:!1}),(0,f.of)())))}updateUseCloudSync(e){this._useCloudSync.next(e)}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)(c.KVO(b.ok),c.KVO(Mt.Qq),c.KVO(b.M),c.KVO(b.JE),c.KVO(b.Dr))},this.\u0275prov=c.jDH({token:s,factory:s.\u0275fac,providedIn:"root"}))}return o(),s})();var t=l(2898);let kt=(()=>{var o;class s{constructor(){this.unsubscribeAll=new k.B,this.syncService=(0,c.WQX)(j)}ngOnInit(){let e=!1,n=0;(0,ht.O)(0,5e3).pipe((0,v.p)(()=>{const a=n>=(e?12:0);return n++,a}),(0,d.n)(()=>this.syncService.serverStatus(this.syncService.getSyncServer())),(0,E.Q)(this.unsubscribeAll)).subscribe(r=>{e=r.running,n=0,this.syncService.setServerStatus(!e)})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["ng-component"]],decls:1,vars:0,template:function(n,r){1&n&&t.nrm(0,"router-outlet")},dependencies:[R.n3],encapsulation:2,changeDetection:0}))}return o(),s})();var P=l(7705),p=l(8743),$t=l(9874),G=l(4929);let Pt=(()=>{var o;class s{constructor(){this.title="",this.logo="",this.disabled=!1,this.selectConnector=new t.bkB}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["nsy-connector"]],inputs:{title:"title",logo:"logo",disabled:[2,"disabled","disabled",P.L39]},outputs:{selectConnector:"selectConnector"},decls:5,vars:3,consts:[[3,"cardClick","disabled"],[1,"connector"],["size","large",3,"path"]],template:function(n,r){1&n&&(t.j41(0,"pa-card",0),t.bIt("cardClick",function(h){return r.selectConnector.emit(h)}),t.j41(1,"div",1),t.nrm(2,"pa-icon",2),t.j41(3,"div"),t.EFF(4),t.k0s()()()),2&n&&(t.Y8G("disabled",r.disabled),t.R7$(2),t.Y8G("path",r.logo),t.R7$(2),t.JRh(r.title))},dependencies:[p.ALJ,$t.i,p.V3x,G.R],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.connector[_ngcontent-%COMP%]{align-items:center;display:flex;flex-direction:column;gap:.5rem;width:6rem}'],changeDetection:0}))}return o(),s})();var T=l(2200),u=l(9417),K=l(4825),C=l(8018),y=l(4795),Z=l(4572),w=l(3606),Et=l(820),q=l(6812),N=l(3085),A=l(4899),jt=l(7481),Gt=l(3257),wt=l(6010),tt=l(5472),et=l(9435),nt=l(3107),Ot=l(7839),Vt=l(4099),ot=l(4684),Xt=l(9122);const Dt=()=>({section:"activity"}),it=(o,s)=>s.id;function Nt(o,s){1&o&&(t.j41(0,"div",8)(1,"pa-radio",16),t.nI1(2,"translate"),t.j41(3,"span",10),t.EFF(4),t.nI1(5,"translate"),t.k0s()()(),t.nrm(6,"div",11)),2&o&&(t.R7$(),t.Y8G("help",t.bMT(2,2,"sync.home-page.setup-server.on-cloud.radio-help")),t.R7$(3),t.JRh(t.bMT(5,4,"sync.home-page.setup-server.on-cloud.radio-label")))}function At(o,s){1&o&&(t.j41(0,"nsi-dropdown-button",18),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"sync.home-page.setup-server.on-desktop.download-dropdown")," "))}function Bt(o,s){if(1&o&&(t.j41(0,"nsi-badge"),t.EFF(1),t.nI1(2,"translate"),t.k0s(),t.nVh(3,At,3,3,"nsi-dropdown-button",18)),2&o){const i=t.XpG(2);t.R7$(),t.JRh(t.bMT(2,2,"sync.badge.inactive")),t.R7$(2),t.vxM(i.downloadSyncAgentFeature?3:-1)}}function Ut(o,s){1&o&&(t.j41(0,"nsi-badge",17),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.active")))}function Yt(o,s){if(1&o&&(t.nVh(0,Bt,4,4),t.nI1(1,"async"),t.vZN(2,Ut,3,3,"nsi-badge",17)),2&o){const i=t.XpG();t.vxM(t.bMT(1,1,i.inactiveServer)?0:2)}}function Lt(o,s){1&o&&(t.j41(0,"nsi-badge"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.inactive")))}function Jt(o,s){1&o&&(t.j41(0,"nsi-badge",17),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.badge.active")))}function Qt(o,s){if(1&o&&(t.j41(0,"div",13),t.nVh(1,Lt,3,3,"nsi-badge"),t.nI1(2,"async"),t.vZN(3,Jt,3,3,"nsi-badge",17),t.j41(4,"pa-input",19),t.EFF(5," Server URL "),t.k0s(),t.j41(6,"pa-button",20),t.EFF(7),t.nI1(8,"translate"),t.k0s()()),2&o){const i=t.XpG();t.R7$(),t.vxM(t.bMT(2,3,i.inactiveServer)?1:3),t.R7$(5),t.Y8G("disabled",!i.serverUrlChanged),t.R7$(),t.SpI(" ",t.bMT(8,5,"generic.save")," ")}}function Wt(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsy-connector",21),t.nI1(1,"async"),t.nI1(2,"translate"),t.nI1(3,"async"),t.bIt("selectConnector",function(){const n=c.eBV(i).$implicit,r=t.XpG();return c.Njj(r.onSelectConnector(n))}),t.k0s()}if(2&o){const i=s.$implicit,e=t.XpG();t.Y8G("paTooltip",t.bMT(2,6,"cloud"!==e.syncAgentTypeControl.value&&t.bMT(1,4,e.inactiveServer)?"sync.home-page.add-sources.disabled-source-tooltip":""))("disabled","cloud"!==e.syncAgentTypeControl.value&&t.bMT(3,8,e.inactiveServer))("title",i.title)("logo",i.logo)}}function Ht(o,s){1&o&&(t.j41(0,"nsi-info-card",22),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.JRh(t.bMT(2,1,"sync.home-page.sync-list.empty-info")))}function zt(o,s){if(1&o&&(t.j41(0,"div",26),t.nrm(1,"pa-icon",34),t.EFF(2),t.k0s()),2&o){const i=s;t.R7$(),t.Y8G("path",i.logo),t.R7$(),t.SpI(" ",i.title," ")}}function Kt(o,s){if(1&o){const i=t.RV6();t.j41(0,"pa-toggle",35),t.bIt("valueChange",function(n){c.eBV(i);const r=t.XpG().$implicit,a=t.XpG(3);return c.Njj(a.toggleSync(r.id,n))}),t.EFF(1),t.k0s()}if(2&o){const i=t.XpG().$implicit;t.Y8G("value",!i.disabled),t.R7$(),t.SpI(" ",i.disabled?"Off":"On"," ")}}function Zt(o,s){if(1&o&&t.nrm(0,"pa-datetime",29),2&o){const i=t.XpG().$implicit;t.Y8G("datetime",i.lastSyncGMT)}}function qt(o,s){1&o&&t.EFF(0," \u2013 ")}function te(o,s){if(1&o&&(t.j41(0,"pa-option",31),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const i=t.XpG().$implicit;t.Y8G("routerLink","./"+i.id+"/edit"),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.home-page.sync-list.menu.edit-folders")," ")}}function ee(o,s){if(1&o&&(t.j41(0,"pa-option",32),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const i=t.XpG().$implicit;t.Y8G("routerLink","./"+i.id)("queryParams",t.lJ4(5,Dt)),t.R7$(),t.SpI(" ",t.bMT(2,3,"sync.home-page.sync-list.menu.activity-logs")," ")}}function ne(o,s){if(1&o){const i=t.RV6();t.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"a",25),t.EFF(3),t.k0s()(),t.j41(4,"pa-table-cell"),t.nVh(5,zt,3,2,"div",26),t.k0s(),t.j41(6,"pa-table-cell")(7,"div",27),t.EFF(8),t.k0s()(),t.j41(9,"pa-table-cell"),t.nVh(10,Kt,2,2,"pa-toggle",28),t.nI1(11,"async"),t.k0s(),t.j41(12,"pa-table-cell")(13,"div",27),t.nVh(14,Zt,1,1,"pa-datetime",29)(15,qt,1,0),t.k0s()(),t.j41(16,"pa-table-cell-menu")(17,"pa-button",30),t.EFF(18," Menu "),t.k0s(),t.j41(19,"pa-dropdown",null,0)(21,"pa-option",31),t.EFF(22),t.nI1(23,"translate"),t.k0s(),t.nVh(24,te,3,4,"pa-option",31),t.nVh(25,ee,3,6,"pa-option",32),t.nI1(26,"async"),t.j41(27,"pa-option",33),t.bIt("selectOption",function(){const n=c.eBV(i).$implicit,r=t.XpG(3);return c.Njj(r.deleteSync(n))}),t.EFF(28),t.nI1(29,"translate"),t.k0s()()()()}if(2&o){let i;const e=s.$implicit,n=t.sdS(20),r=t.XpG(3);t.R7$(2),t.Y8G("routerLink","./"+e.id),t.R7$(),t.SpI(" ",e.title," "),t.R7$(2),t.vxM((i=null==r.connectors[e.connectorId]?null:r.connectors[e.connectorId].definition)?5:-1,i),t.R7$(3),t.JRh(e.totalSyncedResources),t.R7$(2),t.vxM(t.bMT(11,12,r.useCloudSync)?-1:10),t.R7$(4),t.vxM("1970-01-01"!==e.lastSyncGMT?14:15),t.R7$(3),t.Y8G("paPopup",n),t.R7$(4),t.Y8G("routerLink","./"+e.id+"/edit"),t.R7$(),t.SpI(" ",t.bMT(23,14,"sync.home-page.sync-list.menu.edit-settings")," "),t.R7$(2),t.vxM(e.connector.allowToSelectFolders?24:-1),t.R7$(),t.vxM(t.bMT(26,16,r.useCloudSync)?-1:25),t.R7$(3),t.SpI(" ",t.bMT(29,18,"sync.home-page.sync-list.menu.delete")," ")}}function oe(o,s){if(1&o&&(t.j41(0,"pa-table",23),t.nrm(1,"pa-table-sortable-header",24),t.Z7z(2,ne,30,20,"pa-table-row",null,it),t.k0s()),2&o){const i=t.XpG(),e=t.XpG();t.R7$(),t.Y8G("cells",e.syncTableHeader),t.R7$(),t.Dyx(i)}}function ie(o,s){1&o&&t.nVh(0,Ht,3,3,"nsi-info-card",22)(1,oe,4,1,"pa-table",23),2&o&&t.vxM(0===s.length?0:1)}let se=(()=>{var o;class s{constructor(){this.router=(0,c.WQX)(R.Ix),this.currentRoute=(0,c.WQX)(R.nX),this.syncService=(0,c.WQX)(j),this.sdk=(0,c.WQX)(b.ok),this.toaster=(0,c.WQX)(y._g),this.modalService=(0,c.WQX)(y.w8),this.translate=(0,c.WQX)(C.c$),this.features=(0,c.WQX)(b.Dr),this.unsubscribeAll=new k.B,this.downloadSyncAgentFeature=!1,this.hasCloudSync=this.features.unstable.cloudSyncService,this.useCloudSync=this.syncService.useCloudSync,this.inactiveServer=this.syncService.isServerDown,this.syncAgentForm=new u.gE({type:new u.MJ("desktop",{nonNullable:!0}),serverUrl:new u.MJ("",{nonNullable:!0,validators:[u.k0.required]})}),this.connectors=this.syncService.connectors,this._connectorList=this.syncService.connectorsObs.pipe((0,m.T)(e=>e.sort((n,r)=>n.title.localeCompare(r.title)))),this.connectorList=this._connectorList.pipe((0,m.T)(e=>e.filter(n=>!n.cloud))),this.cloudConnectorList=this._connectorList.pipe((0,m.T)(e=>e.filter(n=>n.cloud))),this.serverUrlBackup="",this.syncs=(0,Z.z)([this.syncService.cacheUpdated,this.syncService.useCloudSync.pipe((0,_.s)(1))]).pipe((0,d.n)(([,e])=>this.sdk.currentKb.pipe((0,m.T)(n=>({kb:n,useCloud:e})))),(0,d.n)(({kb:e,useCloud:n})=>this.syncService.getSyncsForKB(e.id,n))),this.syncTableHeader=[new p.A3f({id:"name",label:"sync.home-page.sync-list.table-columns.name"}),new p.A3f({id:"connector",label:"sync.home-page.sync-list.table-columns.connector"}),new p.A3f({id:"resources",label:"sync.home-page.sync-list.table-columns.resources"}),new p.A3f({id:"sync",label:"sync.home-page.sync-list.table-columns.sync"}),new p.A3f({id:"latest-sync",label:"sync.home-page.sync-list.table-columns.latest-sync",sortable:!0}),new p.A3f({id:"actions",label:"sync.home-page.sync-list.table-columns.actions"})]}get syncAgentOnServer(){return"server"===this.syncAgentForm.controls.type.value}get syncAgentTypeControl(){return this.syncAgentForm.controls.type}get syncServerUrl(){return this.syncAgentForm.controls.serverUrl.value}get serverUrlChanged(){return this.serverUrlBackup!==this.syncServerUrl}ngOnInit(){this.syncService.syncServer.pipe((0,_.s)(1)).subscribe(e=>{this.syncAgentForm.patchValue(e),this.serverUrlBackup=e.serverUrl}),this.syncAgentTypeControl.valueChanges.pipe((0,E.Q)(this.unsubscribeAll)).subscribe(()=>this.saveSyncServer())}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}saveSyncServer(){if(this.syncService.updateUseCloudSync("cloud"===this.syncAgentTypeControl.value),this.syncAgentForm.valid){const e=this.syncAgentForm.getRawValue();this.syncService.setSyncServer("server"===e.type?e.serverUrl:W,e.type)}}onSelectConnector(e){this.router.navigate(["./add",e.id],{relativeTo:this.currentRoute})}deleteSync(e){this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:e.title}),description:"sync.confirm.deletion.description",isDestructive:!0,confirmLabel:"generic.delete"}).onClose.pipe((0,v.p)(n=>!!n),(0,d.n)(()=>this.syncService.deleteSync(e.id))).subscribe({error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}toggleSync(e,n){this.syncService.updateSync(e,{disabled:!n}).subscribe({error:()=>this.toaster.error(n?"sync.details.toast.activating-failed":"sync.details.toast.disabling-failed")})}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["ng-component"]],decls:59,vars:49,consts:[["syncMenu",""],[1,"page-spacing"],[1,"page-title"],[1,"page-description"],[1,"section-description"],[1,"title-l"],[1,"setup-sync-agent",3,"ngSubmit","formGroup"],["formControlName","type"],[1,"radio-config-row"],["value","desktop",3,"help"],[1,"title-m"],[1,"separator-line"],["value","server",3,"help"],[1,"inline-form"],[1,"connector-list"],[3,"paTooltip","disabled","title","logo"],["value","cloud",3,"help"],["kind","success"],["aspect","basic"],["formControlName","serverUrl",1,"server-url"],["type","submit",3,"disabled"],[3,"selectConnector","paTooltip","disabled","title","logo"],["icon","info"],["border","","columns","repeat(5, 1fr) 96px"],[3,"cells"],[1,"body-m","black-link",3,"routerLink"],[1,"logo-title"],[1,"body-s"],["labelOnRight","",3,"value"],[3,"datetime"],["icon","more-vertical","aspect","basic","size","small",3,"paPopup"],[3,"routerLink"],[3,"routerLink","queryParams"],["destructive","",3,"selectOption"],["size","small",3,"path"],["labelOnRight","",3,"valueChange","value"]],template:function(n,r){if(1&n&&(t.j41(0,"div",1)(1,"div")(2,"h1",2),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"p",3),t.EFF(6),t.nI1(7,"translate"),t.k0s()(),t.j41(8,"section")(9,"div",4)(10,"div",5),t.EFF(11),t.nI1(12,"translate"),t.k0s(),t.j41(13,"div",3),t.EFF(14),t.nI1(15,"translate"),t.k0s()(),t.j41(16,"form",6),t.bIt("ngSubmit",function(){return r.saveSyncServer()}),t.j41(17,"pa-radio-group",7),t.nVh(18,Nt,7,6),t.nI1(19,"async"),t.j41(20,"div",8)(21,"pa-radio",9),t.nI1(22,"translate"),t.j41(23,"span",10),t.EFF(24),t.nI1(25,"translate"),t.k0s()(),t.nVh(26,Yt,3,3),t.k0s(),t.nrm(27,"div",11),t.j41(28,"div",8)(29,"pa-radio",12),t.nI1(30,"translate"),t.j41(31,"span",10),t.EFF(32),t.nI1(33,"translate"),t.k0s()(),t.nVh(34,Qt,9,7,"div",13),t.k0s()()()(),t.nrm(35,"div",11),t.j41(36,"section")(37,"div",4)(38,"div",5),t.EFF(39),t.nI1(40,"translate"),t.k0s(),t.j41(41,"div",3),t.EFF(42),t.nI1(43,"translate"),t.k0s()(),t.j41(44,"div",14),t.Z7z(45,Wt,4,10,"nsy-connector",15,it),t.nI1(47,"async"),t.nI1(48,"async"),t.k0s()(),t.j41(49,"section")(50,"div",4)(51,"div",5),t.EFF(52),t.nI1(53,"translate"),t.k0s(),t.j41(54,"div",3),t.EFF(55),t.nI1(56,"translate"),t.k0s()(),t.nVh(57,ie,2,1),t.nI1(58,"async"),t.k0s()()),2&n){let a;t.R7$(3),t.JRh(t.bMT(4,17,"navbar.sync")),t.R7$(3),t.JRh(t.bMT(7,19,"sync.home-page.description")),t.R7$(5),t.JRh(t.bMT(12,21,"sync.home-page.setup-server.title")),t.R7$(3),t.JRh(t.bMT(15,23,"sync.home-page.setup-server.description")),t.R7$(2),t.Y8G("formGroup",r.syncAgentForm),t.R7$(2),t.vxM(t.bMT(19,25,r.hasCloudSync)?18:-1),t.R7$(3),t.Y8G("help",t.bMT(22,27,"sync.home-page.setup-server.on-desktop.radio-help")),t.R7$(3),t.JRh(t.bMT(25,29,"sync.home-page.setup-server.on-desktop.radio-label")),t.R7$(2),t.vxM(r.syncAgentOnServer?-1:26),t.R7$(3),t.Y8G("help",t.bMT(30,31,"sync.home-page.setup-server.on-server.radio-help")),t.R7$(3),t.JRh(t.bMT(33,33,"sync.home-page.setup-server.on-server.radio-label")),t.R7$(2),t.vxM(r.syncAgentOnServer?34:-1),t.R7$(5),t.JRh(t.bMT(40,35,"sync.home-page.add-sources.title")),t.R7$(3),t.JRh(t.bMT(43,37,"sync.home-page.add-sources.description")),t.R7$(3),t.Dyx("cloud"!==r.syncAgentTypeControl.value?t.bMT(47,39,r.connectorList):t.bMT(48,41,r.cloudConnectorList)),t.R7$(7),t.JRh(t.bMT(53,43,"sync.home-page.sync-list.title")),t.R7$(3),t.JRh(t.bMT(56,45,"sync.home-page.sync-list.description")),t.R7$(2),t.vxM((a=t.bMT(58,47,r.syncs))?57:-1,a)}},dependencies:[T.MD,T.Jj,y.nS,Pt,y.vY,p.Ymm,w.Q,p.Rx2,Et.P,q.P,p.XgI,N.S,p.rkm,A.a,jt.v,Gt.u,p.tml,wt.d,u.X1,u.qT,u.BC,u.cb,u.j4,u.JD,C.h,C.D9,p.EGN,tt.O,et.e,nt.U,Ot.N,Vt.V,K.Wk,p.V3x,G.R,p.Pa6,ot.Z,y.IA,p.OgD,Xt.w],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}section[_ngcontent-%COMP%] .section-description[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%]{border:1px solid var(--color-neutral-lighter, hsl(207, 17%, 91%));border-radius:.5rem;padding:1.5rem}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .radio-config-row[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem;justify-content:space-between}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .radio-config-row[_ngcontent-%COMP%] pa-radio[_ngcontent-%COMP%]{flex:1 0 auto;background:none}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] .inline-form[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end}section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] pa-input.server-url[_ngcontent-%COMP%] .pa-field-control{width:20rem}@media (min-width: 1440px){section[_ngcontent-%COMP%] .setup-sync-agent[_ngcontent-%COMP%] pa-input.server-url[_ngcontent-%COMP%] .pa-field-control{width:26.5rem}}section[_ngcontent-%COMP%] .separator-line[_ngcontent-%COMP%]{margin:1.5rem 0}section[_ngcontent-%COMP%] .connector-list[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap;gap:1rem}section[_ngcontent-%COMP%] .logo-title[_ngcontent-%COMP%]{font-size:.75rem;line-height:1.25rem;letter-spacing:0;font-weight:400;align-items:center;display:flex;gap:.5rem}section[_ngcontent-%COMP%] pa-table-cell[_ngcontent-%COMP%] pa-toggle[_ngcontent-%COMP%] .pa-toggle-context{gap:.5rem}section[_ngcontent-%COMP%] pa-table-sortable-header[_ngcontent-%COMP%] .pa-table-grid--header{z-index:1}'],changeDetection:0}))}return o(),s})();var re=l(3129),ce=l(292),le=l(3728),ae=l(6851),de=l(2071),pe=l(5814),ue=l(9285),st=l(6420);const he=()=>[],rt=(o,s)=>s.id,me=(o,s)=>s.value;function ge(o,s){if(1&o&&(t.j41(0,"pa-input",6),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const i=t.XpG().$implicit;t.Y8G("formControlName",i.id)("placeholder",i.placeholder)("type",i.secret?"password":"text")("help",i.help),t.R7$(),t.SpI(" ",t.bMT(2,5,i.label)," ")}}function ye(o,s){if(1&o&&(t.j41(0,"pa-toggle",7),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const i=t.XpG().$implicit;t.Y8G("formControlName",i.id)("help",i.help),t.R7$(),t.SpI(" ",t.bMT(2,3,i.label)," ")}}function _e(o,s){if(1&o&&(t.j41(0,"pa-option",10),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const i=s.$implicit;t.Y8G("disabled",i.disabled)("value",i.value),t.R7$(),t.SpI(" ",t.bMT(2,3,i.label)," ")}}function fe(o,s){if(1&o&&(t.j41(0,"pa-select",8),t.Z7z(1,_e,3,5,"pa-option",10,me),t.k0s()),2&o){const i=t.XpG().$implicit;t.Y8G("formControlName",i.id)("label",i.label)("help",i.help),t.R7$(),t.Dyx(i.options)}}function Ce(o,s){if(1&o&&(t.j41(0,"pa-textarea",7),t.EFF(1),t.k0s()),2&o){const i=t.XpG().$implicit;t.Y8G("formControlName",i.id)("help",i.help),t.R7$(),t.SpI(" ",i.label," ")}}function be(o,s){if(1&o&&(t.j41(0,"p"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o){const i=t.XpG(2).$implicit;t.R7$(),t.JRh(t.bMT(2,1,i.help))}}function ve(o,s){1&o&&(t.j41(0,"nsi-info-card",12),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"sync.form-validation.extra-parameters-incomplete")," "))}function Se(o,s){if(1&o){const i=t.RV6();t.j41(0,"div",9)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,be,3,3,"p"),t.j41(5,"app-parameters-table",11),t.bIt("valuesChange",function(n){c.eBV(i);const r=t.XpG().$implicit,a=t.XpG(3);return c.Njj(a.updateTable(r.id,n))}),t.k0s(),t.nVh(6,ve,3,3,"nsi-info-card",12),t.k0s()}if(2&o){const i=t.XpG().$implicit,e=t.XpG(3);t.R7$(2),t.JRh(t.bMT(3,4,i.label)),t.R7$(2),t.vxM(i.help?4:-1),t.R7$(),t.Y8G("values",e.tables[i.id]||t.lJ4(6,he)),t.R7$(),t.vxM(e.invalidTables.includes(i.id)?6:-1)}}function xe(o,s){if(1&o&&t.nVh(0,ge,3,7,"pa-input",6)(1,ye,3,5,"pa-toggle",7)(2,fe,3,3,"pa-select",8)(3,Ce,2,3,"pa-textarea",7)(4,Se,7,7,"div",9),2&o){let i;t.vxM("text"===(i=s.$implicit.type)?0:"boolean"===i?1:"select"===i?2:"textarea"===i?3:"table"===i?4:-1)}}function Te(o,s){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",5)(1,"div",2),t.Z7z(2,xe,5,1,null,null,rt),t.k0s()()),2&o){const i=s.$implicit;t.Y8G("badge",i.badge)("itemTitle",i.title)("description",i.description||""),t.R7$(2),t.Dyx(i.fields)}}function Fe(o,s){1&o&&(t.j41(0,"nsi-two-columns-configuration-item",16)(1,"div",14)(2,"pa-toggle",37),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()),2&o&&(t.R7$(3),t.SpI(" ",t.bMT(4,1,"sync.add-page.security-group.toggle-label")," "))}function Ie(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsi-label",38),t.bIt("removeLabel",function(){const n=c.eBV(i).$implicit,r=t.XpG(3);return c.Njj(r.removeLabel(n))}),t.EFF(1),t.k0s()}if(2&o){const i=s.$implicit;t.Y8G("color",i.color),t.R7$(),t.SpI(" ",i.label," ")}}function Re(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsi-label",39),t.bIt("removeLabel",function(){const n=c.eBV(i).$implicit,r=t.XpG(3);return c.Njj(r.removeExtension(n))}),t.EFF(1),t.k0s()}if(2&o){const i=s.$implicit;t.R7$(),t.SpI(" ",i," ")}}function Me(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsi-two-columns-configuration-item",13)(1,"div",14)(2,"app-extraction-select",15),t.bIt("extractConfigChange",function(n){c.eBV(i);const r=t.XpG(2);return c.Njj(r.updateExtractStrategy(n))}),t.k0s()()(),t.nVh(3,Fe,5,3,"nsi-two-columns-configuration-item",16),t.j41(4,"nsi-two-columns-configuration-item",17)(5,"div",2)(6,"div",18)(7,"app-label-dropdown",19),t.nI1(8,"async"),t.nI1(9,"async"),t.bIt("selectionChange",function(n){c.eBV(i);const r=t.XpG(2);return c.Njj(r.updateLabelSelection(n))}),t.EFF(10),t.nI1(11,"translate"),t.k0s(),t.j41(12,"span",20),t.EFF(13),t.nI1(14,"translate"),t.k0s(),t.j41(15,"pa-button",21),t.bIt("click",function(){c.eBV(i);const n=t.XpG(2);return c.Njj(n.createLabelSet())}),t.EFF(16),t.nI1(17,"translate"),t.k0s()(),t.j41(18,"div",22),t.Z7z(19,Ie,2,2,"nsi-label",23,t.fX1),t.k0s()(),t.j41(21,"div",24)(22,"pa-toggle",25),t.EFF(23),t.nI1(24,"translate"),t.k0s()()(),t.j41(25,"nsi-two-columns-configuration-item",26)(26,"div",2)(27,"nsi-info-card"),t.EFF(28),t.nI1(29,"translate"),t.k0s(),t.j41(30,"div",27)(31,"div",28)(32,"pa-select",29)(33,"pa-option",30),t.EFF(34),t.nI1(35,"translate"),t.k0s(),t.j41(36,"pa-option",31),t.EFF(37),t.nI1(38,"translate"),t.k0s()(),t.j41(39,"pa-input",32),t.EFF(40),t.nI1(41,"translate"),t.k0s()(),t.j41(42,"div",22),t.Z7z(43,Re,2,1,"nsi-label",33,t.fX1),t.k0s(),t.j41(45,"div",34)(46,"label"),t.EFF(47),t.nI1(48,"translate"),t.k0s(),t.j41(49,"div",28),t.nrm(50,"pa-date-picker",35),t.nI1(51,"translate"),t.nrm(52,"pa-date-picker",36),t.nI1(53,"translate"),t.k0s()()()()()}if(2&o){const i=t.XpG(2);t.R7$(2),t.Y8G("onlyExtract",!0)("extractConfig",i.extractStrategy),t.R7$(),t.vxM(i.connector.canSyncSecurityGroups?3:-1),t.R7$(4),t.Y8G("labelSets",t.bMT(8,17,i.labelSets))("selection",i.labelSelection)("disabled",!1===t.bMT(9,19,i.hasLabelSet)),t.R7$(3),t.SpI(" ",t.bMT(11,21,"sync.add-page.add-labels.select-labels")," "),t.R7$(3),t.JRh(t.bMT(14,23,"generic.or")),t.R7$(3),t.SpI(" ",t.bMT(17,25,"sync.add-page.add-labels.create-labelset")," "),t.R7$(3),t.Dyx(i.labelSelection),t.R7$(4),t.SpI(" ",t.bMT(24,27,"sync.add-page.preserve-labels.toggle-label")," "),t.R7$(5),t.JRh(t.bMT(29,29,"sync.add-page.filter-resources.file-extension.info")),t.R7$(6),t.SpI(" ",t.bMT(35,31,"sync.add-page.filter-resources.file-extension.include")," "),t.R7$(3),t.SpI(" ",t.bMT(38,33,"sync.add-page.filter-resources.file-extension.exclude")," "),t.R7$(3),t.SpI(" ",t.bMT(41,35,"sync.add-page.filter-resources.file-extension.label")," "),t.R7$(3),t.Dyx(i.extensionList),t.R7$(4),t.JRh(t.bMT(48,37,"sync.add-page.filter-resources.modification-date.label")),t.R7$(3),t.Y8G("label",t.bMT(51,39,"sync.add-page.filter-resources.modification-date.from")),t.R7$(2),t.Y8G("label",t.bMT(53,41,"sync.add-page.filter-resources.modification-date.to"))}}function ke(o,s){if(1&o&&(t.j41(0,"form",0)(1,"nsi-two-columns-configuration-item",1)(2,"div",2)(3,"pa-input",3),t.EFF(4),t.nI1(5,"translate"),t.k0s()()(),t.qex(6,4),t.Z7z(7,Te,4,3,"nsi-two-columns-configuration-item",5,rt),t.nI1(9,"async"),t.bVm(),t.nVh(10,Me,54,43),t.k0s()),2&o){const i=t.XpG();t.Y8G("formGroup",i.form),t.R7$(),t.Y8G("noTopBorder",i.noTopBorder),t.R7$(3),t.JRh(t.bMT(5,4,"sync.add-page.connector-name.field-label")),t.R7$(3),t.Dyx(t.bMT(9,6,i.connector.getParametersSections())),t.R7$(3),t.vxM(i.isCloud?-1:10)}}const $e=new RegExp(/[^a-z0-9_-]/g);let ct=(()=>{var o;class s{constructor(){this.labelService=(0,c.WQX)(b.xQ),this.modalService=(0,c.WQX)(y.w8),this.cdr=(0,c.WQX)(P.gRc),this.unsubscribeAll=new k.B,this.isCloud=!1,this.noTopBorder=!1,this.validForm=new t.bkB,this.configurationChange=new t.bkB,this.form=new u.gE({name:new u.MJ("",{nonNullable:!0,validators:[u.k0.required]}),syncSecurityGroups:new u.MJ(null),preserveLabels:new u.MJ(null),filterResources:new u.gE({extensions:new u.MJ("",{updateOn:"blur"}),extensionUsage:new u.MJ("include",{nonNullable:!0}),from:new u.MJ(""),to:new u.MJ("")}),extra:new u.gE({})}),this.labelSets=this.labelService.resourceLabelSets,this.hasLabelSet=this.labelService.hasResourceLabelSets,this.labelSelection=[],this.extensionList=[],this.tables={},this.invalidTables=[],this.extractStrategy="",this._extra={}}set sync(e){if(e){this.connectorParametersBackup=e.connector.parameters;const n={extensions:e.filters?.fileExtensions?.extensions||"",extensionUsage:e.filters?.fileExtensions?.exclude?"exclude":"include",from:e.filters?.modified?.from||"",to:e.filters?.modified?.to||""};this.form.patchValue({name:e.title,syncSecurityGroups:e.syncSecurityGroups,filterResources:n,preserveLabels:e.preserveLabels}),this.labelSelection=e.labels||[],this.extensionList=this.formatExtensionList(n.extensions),e.extract_strategy&&(this.extractStrategy=e.extract_strategy),e.connector.parameters&&Object.entries(e.connector.parameters).forEach(([r,a])=>{"object"!=typeof a?this._extra[r]=a:this.tables[r]=a})}}get extensionsControl(){return this.form.controls.filterResources.controls.extensions}ngOnInit(){this.connector&&this.connector.getParametersSections().subscribe(e=>{e.forEach(n=>n.fields.forEach(r=>{"table"!==r.type&&this.form.controls.extra.addControl(r.id,new u.MJ("",{nonNullable:!0,validators:r.required?[u.k0.required]:[]}))})),Object.keys(this._extra).length>0&&this.form.patchValue({extra:this._extra})}),this.extensionsControl.valueChanges.pipe((0,E.Q)(this.unsubscribeAll)).subscribe(e=>this.extensionList=this.formatExtensionList(e)),this.form.valueChanges.pipe((0,E.Q)(this.unsubscribeAll)).subscribe(()=>{this.validForm.emit(this.form.valid),this.emitSyncEntity()})}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete()}updateTable(e,n){this.tables[e]=n,n.some(r=>!(r.value.trim()&&r.key.trim()||!r.value.trim()&&!r.key.trim()))?this.invalidTables.includes(e)||this.invalidTables.push(e):this.invalidTables.includes(e)&&(this.invalidTables=this.invalidTables.filter(r=>r!==e)),this.cdr.markForCheck(),this.emitSyncEntity()}createLabelSet(){this.modalService.openModal(b.Tv,new p.S6u({data:{kind:ce.po.RESOURCES}}))}updateLabelSelection(e){this.labelSets.pipe((0,_.s)(1),(0,v.p)(n=>!!n),(0,m.T)(n=>n)).subscribe(n=>{this.labelSelection=e.map(r=>({...r,color:n[r.labelset]?.color})),this.emitSyncEntity()})}removeExtension(e){const n=this.extensionList.filter(r=>r!==e);this.extensionsControl.patchValue(n.join(", "))}removeLabel(e){this.labelSelection=this.labelSelection.filter(n=>!(n.labelset===e.labelset&&n.label===e.label)),this.emitSyncEntity()}formatExtensionList(e){return e&&e.length>0?e.split(",").map(n=>n.trim()).filter(n=>!!n):[]}emitSyncEntity(){if(!this.connectorId)return;const e=this.form.getRawValue(),n=e.name,r=(Math.random()+1).toString(36).substring(7),a=`${this.kbId}-${n?.toLowerCase().replace($e,"-")}-${r}`,h={fileExtensions:e.filterResources.extensions?{extensions:e.filterResources.extensions,exclude:"exclude"===e.filterResources.extensionUsage}:void 0,modified:e.filterResources.from||e.filterResources.to?{from:e.filterResources.from||void 0,to:e.filterResources.to||void 0}:void 0},g=Object.entries(e.extra||{}).reduce((O,[V,Y])=>({...O,[V]:Y}),{}),S=Object.entries(this.tables).reduce((O,[V,Y])=>(O[V]=Y.filter(ut=>!(!ut.key.trim()||!ut.value.trim())),O),{}),I={id:a,title:n,labels:this.labelSelection,preserveLabels:e.preserveLabels||!1,filters:h,connector:{name:this.connectorId,parameters:{...this.connectorParametersBackup,...S,...g}}};null!==e.syncSecurityGroups&&(I.syncSecurityGroups=e.syncSecurityGroups),I.extract_strategy=this.extractStrategy,this.configurationChange.emit(I)}updateExtractStrategy(e){this.extractStrategy=e,this.validForm.emit(this.form.valid),this.emitSyncEntity()}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["nsy-configuration-form"]],inputs:{connector:"connector",connectorId:"connectorId",kbId:"kbId",isCloud:"isCloud",sync:"sync",noTopBorder:[2,"noTopBorder","noTopBorder",P.L39]},outputs:{validForm:"validForm",configurationChange:"configurationChange"},decls:1,vars:1,consts:[[3,"formGroup"],["itemTitle","sync.add-page.connector-name.title","description","sync.add-page.connector-name.description",3,"noTopBorder"],[1,"form-container"],["formControlName","name"],["formGroupName","extra"],[3,"badge","itemTitle","description"],[3,"formControlName","placeholder","type","help"],[3,"formControlName","help"],[3,"formControlName","label","help"],[1,"table-container"],[3,"disabled","value"],[3,"valuesChange","values"],["type","warning","icon","warning"],["itemTitle","sync.add-page.extract-config.title","description","sync.add-page.extract-config.description","badge","generic.badge.advanced"],[1,"form-container","toggle-container"],[3,"extractConfigChange","onlyExtract","extractConfig"],["itemTitle","sync.add-page.security-group.title","description","sync.add-page.security-group.description","badge","generic.badge.advanced"],["badge","generic.badge.optional","itemTitle","sync.add-page.add-labels.title","description","sync.add-page.add-labels.description"],[1,"inline-form","full-width"],["displayRadioForNonMultiple","","aspect","basic","fullWidth","",3,"selectionChange","labelSets","selection","disabled"],[1,"separator-word","body-s"],["icon","circle-plus","aspect","basic","iconAndText","",1,"full-width",3,"click"],[1,"inline-form","small-gap"],[3,"color"],[1,"toggle-container"],["formControlName","preserveLabels"],["badge","generic.badge.optional","itemTitle","sync.add-page.filter-resources.title","description","sync.add-page.filter-resources.description"],["formGroupName","filterResources",1,"form-container"],[1,"inline-form","full-width","small-gap"],["formControlName","extensionUsage"],["value","include"],["value","exclude"],["id","extension","placeholder",".pdf,.docx","formControlName","extensions"],["neutral",""],[1,"label-field-container"],["formControlName","from",3,"label"],["formControlName","to",3,"label"],["withBackground","","formControlName","syncSecurityGroups"],[3,"removeLabel","color"],["neutral","",3,"removeLabel"]],template:function(n,r){1&n&&t.nVh(0,ke,11,8,"form",0),2&n&&t.vxM(r.connector?0:-1)},dependencies:[T.MD,T.Jj,y.IA,y._8,u.X1,u.qT,u.BC,u.cb,u.j4,u.JD,u.$R,p.XgI,N.S,ae.w,de.Q,q.P,b.Qy,b.Bo,pe.L,p.Ymm,w.Q,C.h,C.D9,p.OYn,ue.I,y.OE,st.U,p.rkm,A.a,le.RxD],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.toggle-container[_ngcontent-%COMP%] pa-toggle[_ngcontent-%COMP%] .pa-toggle-context{justify-content:space-between}.table-container[_ngcontent-%COMP%] nsi-info-card[_ngcontent-%COMP%]{margin-top:.75rem}'],changeDetection:0}))}return o(),s})();var Pe=l(1943),lt=l(7670);const Ee=o=>({total:o}),je=o=>({count:o});function Ge(o,s){1&o&&t.nrm(0,"nsi-spinner")}function we(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsi-folder-tree",3),t.bIt("selectionChange",function(n){c.eBV(i);const r=t.XpG(2);return c.Njj(r.updateSelection(n))}),t.k0s()}if(2&o){const i=t.XpG(2);t.Y8G("selection",i.selection)("folderTree",i.folders)}}function Oe(o,s){if(1&o&&t.nrm(0,"nsi-folder-list",2),2&o){const i=t.XpG(2);t.Y8G("folders",i.selectedPaths)}}function Ve(o,s){if(1&o&&t.nVh(0,we,1,2,"nsi-folder-tree",1)(1,Oe,1,1,"nsi-folder-list",2),2&o){const i=t.XpG();t.vxM(i.seeAll?0:1)}}let B=(()=>{var o;class s{constructor(){this.syncService=(0,c.WQX)(j),this.toaster=(0,c.WQX)(y._g),this.cdr=(0,c.WQX)(P.gRc),this.selectedSyncItems=new t.bkB,this.searchQuery=new u.MJ("",{nonNullable:!0}),this.totalFolders=0,this.selectionCount=0,this.loading=!1,this.seeAll=!0,this.selection=[],this.selectedPaths=[],this.syncItems=[],this.selectedIds=[]}ngOnInit(){this.updateSelection((this.sync.foldersToSync||[]).map(e=>({id:e.uuid,path:e.metadata.path}))),this.loadFolders()}updateView(e){this.seeAll="left"===e}updateSelection(e){this.selection=e,this.selectedPaths=e.map(n=>n.path),this.selectedIds=e.map(n=>n.id),this.selectionCount=e.length,this.selectedSyncItems.emit(this.syncItems.filter(n=>this.selectedIds.includes(n.uuid))),this.cdr.markForCheck()}loadFolders(e){this.loading=!0,this.syncService.getFolders(e?.value||"").pipe((0,X.W)(n=>(n&&this.toaster.error("string"==typeof n?n:n.error?.message||n.error||n.message||"An error occurred"),(0,f.of)({items:[],nextPage:void 0}))),(0,Pe.S)((n,r)=>n.concat(r.items),[]),(0,m.T)(n=>[{uuid:"root",originalId:"/",title:"/",status:$.PENDING,metadata:{path:"/"}},...n]),(0,m.T)(n=>n.sort((r,a)=>r.metadata.path.localeCompare(a.metadata.path))),(0,x.M)(n=>{this.totalFolders=n.length,this.syncItems=n}),(0,m.T)(n=>this.getFolderTreeFromSyncItems(n))).subscribe({next:n=>{this.loading=!1,this.folders=n,this.cdr.markForCheck()}})}getFolderTreeFromSyncItems(e){const n={id:"root",path:"/",title:"/",expanded:!0,children:{}};return e.filter(r=>"root"!==r.uuid).forEach(r=>{const a=r.metadata.path,h=r.originalId,g={id:h,title:r.title,path:a,displayPath:r.metadata.displayPath||a,children:{}};if("/"===a)n.children[h]=g;else{let I,S=n;a.split("/").slice(1,-1).forEach(V=>{S&&(I=S.children?.[V],I&&(S=I))}),S.children?S.children[h]=g:S.children={[h]:g}}}),n}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["nsy-folder-selection"]],inputs:{sync:"sync"},outputs:{selectedSyncItems:"selectedSyncItems"},decls:7,vars:14,consts:[[3,"activeChange","leftButton","rightButton"],[3,"selection","folderTree"],[3,"folders"],[3,"selectionChange","selection","folderTree"]],template:function(n,r){1&n&&(t.j41(0,"header"),t.nrm(1,"div"),t.j41(2,"nsi-segmented-buttons",0),t.nI1(3,"translate"),t.nI1(4,"translate"),t.bIt("activeChange",function(h){return r.updateView(h)}),t.k0s()(),t.nVh(5,Ge,1,0,"nsi-spinner"),t.nVh(6,Ve,2,1)),2&n&&(t.R7$(2),t.Y8G("leftButton",t.i5U(3,4,"sync.folder-selection.see-all",t.eq3(10,Ee,r.totalFolders)))("rightButton",t.i5U(4,7,"sync.folder-selection.see-selection",t.eq3(12,je,r.selectionCount))),t.R7$(3),t.vxM(r.loading?5:-1),t.R7$(),t.vxM(r.folders?6:-1))},dependencies:[y.Sq,y.sH,p.Ymm,p.XgI,u.X1,y.vI,y.J4,lt.t,C.h,C.D9],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}header[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{width:30rem}'],changeDetection:0}))}return o(),s})();const Xe=o=>({connector:o}),De=(o,s)=>({index:o,total:s});function Ne(o,s){if(1&o&&(t.j41(0,"div")(1,"h1",2),t.nrm(2,"pa-icon",3),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"p",4),t.EFF(6),t.nI1(7,"translate"),t.k0s()()),2&o){const i=s,e=t.XpG();t.R7$(2),t.Y8G("path",i.logo),t.R7$(),t.SpI(" ",t.i5U(4,3,"sync.add-page.title",t.eq3(8,Xe,i.title))," "),t.R7$(3),t.JRh(t.bMT(7,6,"sync.add-page.description."+e))}}function Ae(o,s){if(1&o&&(t.nVh(0,Ne,8,10,"div"),t.nI1(1,"async")),2&o){let i;const e=t.XpG();t.vxM((i=t.bMT(1,1,e.connectorDefinition))?0:-1,i)}}function Be(o,s){1&o&&t.nrm(0,"nsi-spinner")}function Ue(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsy-configuration-form",6),t.nI1(1,"async"),t.nI1(2,"async"),t.nI1(3,"async"),t.bIt("configurationChange",function(n){c.eBV(i);const r=t.XpG(3);return c.Njj(r.updateConfiguration(n))})("validForm",function(n){c.eBV(i);const r=t.XpG(3);return c.Njj(r.validForm=n)}),t.k0s()}if(2&o){let i;const e=t.XpG(2),n=t.XpG();t.Y8G("sync",n.sync)("kbId",t.bMT(1,5,n.kbId))("connector",e)("connectorId",t.bMT(2,7,n.connectorId))("isCloud",null==(i=t.bMT(3,9,n.connectorDefinition))?null:i.cloud)}}function Ye(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsy-folder-selection",8),t.bIt("selectedSyncItems",function(n){c.eBV(i);const r=t.XpG(4);return c.Njj(r.updateSelection(n))}),t.k0s()}if(2&o){const i=t.XpG(4);t.Y8G("sync",i.sync)}}function Le(o,s){if(1&o&&t.nVh(0,Ye,1,1,"nsy-folder-selection",7),2&o){const i=t.XpG(3);t.vxM(i.sync?0:-1)}}function Je(o,s){if(1&o&&(t.EFF(0),t.nI1(1,"translate")),2&o){const i=t.XpG(),e=t.XpG(3);t.SpI(" ",t.i5U(1,1,"sync.add-page.footer.steps",t.l_i(4,De,e.step(),i.length))," ")}}function Qe(o,s){if(1&o){const i=t.RV6();t.j41(0,"pa-button",12),t.bIt("click",function(){c.eBV(i);const n=t.XpG(4);return c.Njj(n.cancel())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"generic.cancel")," "))}function We(o,s){if(1&o){const i=t.RV6();t.j41(0,"pa-button",12),t.bIt("click",function(){c.eBV(i);const n=t.XpG(4);return c.Njj(n.goBack())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}2&o&&(t.R7$(),t.SpI(" ",t.bMT(2,1,"generic.back")," "))}function He(o,s){if(1&o){const i=t.RV6();t.j41(0,"pa-button",13),t.bIt("click",function(){c.eBV(i);const n=t.XpG(4);return c.Njj(n.goNext())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const i=t.XpG(4);t.Y8G("disabled",!i.validForm||i.saving),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.add-page.footer.folder-selection-button")," ")}}function ze(o,s){if(1&o){const i=t.RV6();t.j41(0,"pa-button",13),t.bIt("click",function(){c.eBV(i);const n=t.XpG(4);return c.Njj(n.save())}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const i=t.XpG(3),e=t.XpG();t.Y8G("disabled",!e.validForm||i.allowToSelectFolders&&0===e.folderSelection.length||e.saving),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.add-page.footer.save-button")," ")}}function Ke(o,s){if(1&o&&(t.j41(0,"nsi-sticky-footer")(1,"div",9),t.nVh(2,Je,2,7),t.k0s(),t.nVh(3,Qe,3,3,"pa-button",10)(4,We,3,3,"pa-button",10),t.nVh(5,He,3,4,"pa-button",11)(6,ze,3,4,"pa-button",11),t.k0s()),2&o){const i=s,e=t.XpG(3);t.R7$(2),t.vxM(i.length>1?2:-1),t.R7$(),t.vxM(1===e.step()?3:4),t.R7$(2),t.vxM(i.length>1&&e.step()<i.length?5:6)}}function Ze(o,s){if(1&o&&(t.nVh(0,Ue,4,11,"nsy-configuration-form",5)(1,Le,1,1),t.nVh(2,Ke,7,3,"nsi-sticky-footer"),t.nI1(3,"async")),2&o){let i,e;const n=t.XpG(2);t.vxM(1===(i=n.step())?0:2===i?1:-1),t.R7$(2),t.vxM((e=t.bMT(3,2,n.steps))?2:-1,e)}}function qe(o,s){if(1&o&&(t.j41(0,"div"),t.nVh(1,Be,1,0,"nsi-spinner")(2,Ze,4,4),t.k0s()),2&o){const i=t.XpG();t.R7$(),t.vxM(i.loading?1:2)}}const U="PENDING_NEW_CONNECTOR";let at=(()=>{var o;class s{constructor(){this.router=(0,c.WQX)(R.Ix),this.currentRoute=(0,c.WQX)(R.nX),this.sdk=(0,c.WQX)(b.ok),this.syncService=(0,c.WQX)(j),this.modalService=(0,c.WQX)(y.w8),this.translate=(0,c.WQX)(C.c$),this.toaster=(0,c.WQX)(y._g),this.connectorId=this.currentRoute.params.pipe((0,v.p)(e=>e.connector),(0,m.T)(e=>e.connector)),this.connectorDefinition=this.connectorId.pipe((0,m.T)(e=>this.syncService.getConnectorDefinition(e))),this.connector=this.connectorId.pipe((0,m.T)(e=>this.syncService.getConnector(e,""))),this.kbId=this.sdk.currentKb.pipe((0,m.T)(e=>e.id)),this.steps=this.connector.pipe((0,m.T)(e=>e.allowToSelectFolders?["configuration","folder-selection"]:["configuration"])),this.stepIndex=(0,c.vPA)(0),this.step=(0,re.EW)(()=>this.stepIndex()+1),this.validForm=!1,this.folderSelection=[],this.loading=!1,this.saving=!1}get backPath(){return this.syncId?"../../..":"../.."}ngOnInit(){this.currentRoute.params.pipe((0,v.p)(e=>!!e.syncId),(0,_.s)(1),(0,d.n)(e=>{const n=JSON.parse(localStorage.getItem(U)||"{}");return n.name&&n.sync_root_path?this.syncService.addCloudSync({name:n.name,sync_root_path:n.sync_root_path,external_connection_id:e.syncId}).pipe((0,d.n)(r=>(localStorage.removeItem(U),this.syncId=r.id,this._syncCreationDone(r.id)))):(0,f.of)(void 0)})).subscribe()}goBack(){this.stepIndex()>0&&this.stepIndex.update(e=>e-1)}goNext(){if(!this.configuration)return;const e=this.configuration;this.syncId?this._goNext():this.connectorDefinition.pipe((0,_.s)(1),(0,d.n)(n=>this.modalService.openConfirm({title:this.translate.instant("sync.add-page.confirm-authenticate.title",{connector:n.title}),description:this.translate.instant("sync.add-page.confirm-authenticate.description"),confirmLabel:this.translate.instant("sync.add-page.confirm-authenticate.confirm-button")}).onClose),(0,v.p)(n=>!!n),(0,d.n)(()=>this._createSync(e)),(0,d.n)(({connector:n,authorize_url:r})=>this._onSuccessfulCreation(n,e,r))).subscribe({error:n=>{console.warn(n),this.toaster.error("sync.add-page.toast.generic-error")}})}cancel(){this.syncId?this.modalService.openConfirm({title:"sync.confirm.cancel-oauth.title",description:"sync.confirm.cancel-oauth.description",isDestructive:!0,confirmLabel:"sync.confirm.cancel-oauth.confirm-label",cancelLabel:"sync.confirm.cancel-oauth.cancel-label"}).onClose.pipe((0,v.p)(e=>!!e),(0,d.n)(()=>this.syncService.deleteSync(this.syncId))).subscribe({next:()=>this.router.navigate([this.backPath],{relativeTo:this.currentRoute})}):this.router.navigate([this.backPath],{relativeTo:this.currentRoute})}save(){if(!this.configuration)return;this.saving=!0;const e=this.configuration;if(this.syncId){if(this.folderSelection.length>0){const n=this.syncId;this.syncService.updateSync(n,{foldersToSync:this.folderSelection},!0).pipe((0,d.n)(()=>this._syncCreationDone(n))).subscribe({error:r=>this._errorHandler(r)})}}else this._createSync(e).pipe((0,d.n)(({connector:n,authorize_url:r})=>this._onSuccessfulCreation(n,e,r))).subscribe({error:n=>this._errorHandler(n)})}updateConfiguration(e){this.configuration=e}updateSelection(e){this.folderSelection=e}_goNext(){this.steps.pipe((0,_.s)(1)).subscribe(e=>{this.stepIndex()<e.length&&this.stepIndex.update(n=>n+1)})}_createSync(e){return this.connectorDefinition.pipe((0,_.s)(1),(0,d.n)(n=>{const r=n.cloud;return(r&&n.provider?this.syncService.getOAuthUrl(n.provider):this.syncService.addSync(e).pipe((0,m.T)(()=>""))).pipe((0,x.M)(()=>this.syncService.setCurrentSyncId(e.id)),(0,d.n)(h=>{r&&localStorage.setItem(U,JSON.stringify({redirect:location.href,name:e.title,sync_root_path:e.connector.parameters.sync_root_path}));const g=this.syncService.getConnector(e.connector.name,e.id);return g.allowToSelectFolders||r?(0,f.of)({connector:g,authorize_url:h}):("function"==typeof g.handleParameters&&g.handleParameters(e.connector.parameters),this.syncService.updateSync(e.id,{foldersToSync:g.getStaticFolders()}).pipe((0,m.T)(()=>({connector:this.syncService.getConnector(e.connector.name,e.id),authorize_url:h}))))}))}))}_onSuccessfulCreation(e,n,r){return e.hasServerSideAuth?(this.performOAuth(r),(0,f.of)()):this._syncCreationDone(n.id)}performOAuth(e){e&&(window.location.href=e)}_syncCreationDone(e){return(0,f.of)(!0).pipe((0,x.M)(()=>{this.router.navigate([this.syncId?`../../../${e}`:`../../${e}`],{relativeTo:this.currentRoute})}),(0,d.n)(()=>this.syncService.useCloudSync),(0,_.s)(1),(0,d.n)(n=>n?(0,f.of)():(this.toaster.success("sync.details.toast.triggering-sync-success"),this.syncService.triggerSync(e).pipe((0,X.W)(()=>(this.toaster.error("sync.details.toast.triggering-sync-failed"),(0,f.of)()))))))}_errorHandler(e){this.saving=!1,console.warn(e),this.toaster.error("sync.add-page.toast.generic-error")}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["nsy-add-sync-page"]],decls:8,vars:10,consts:[[1,"page-spacing"],[3,"link"],[1,"page-title"],["size","large",3,"path"],[1,"page-description"],[3,"sync","kbId","connector","connectorId","isCloud"],[3,"configurationChange","validForm","sync","kbId","connector","connectorId","isCloud"],[3,"sync"],[3,"selectedSyncItems","sync"],["footerNote",""],["aspect","basic"],["kind","primary",3,"disabled"],["aspect","basic",3,"click"],["kind","primary",3,"click","disabled"]],template:function(n,r){if(1&n&&(t.j41(0,"div",0)(1,"nsi-back-button",1),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,Ae,2,3),t.nI1(5,"async"),t.nVh(6,qe,3,1,"div"),t.nI1(7,"async"),t.k0s()),2&n){let a,h;t.R7$(),t.Y8G("link",r.backPath),t.R7$(),t.SpI(" ",t.bMT(3,4,"sync.add-page.back-button")," "),t.R7$(2),t.vxM((a=t.bMT(5,6,r.connectorId))?4:-1,a),t.R7$(2),t.vxM((h=t.bMT(7,8,r.connector))?6:-1,h)}},dependencies:[T.MD,T.Jj,y.Xp,p.Ymm,w.Q,p.V3x,G.R,y.o3,C.h,C.D9,ct,B,y.J4,lt.t],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}.inline-form[_ngcontent-%COMP%] pa-select[_ngcontent-%COMP%]{flex:0 0 auto;min-width:8rem;width:fit-content}.inline-form[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{max-width:unset}'],changeDetection:0}))}return o(),s})();var tn=l(2885);const en=["activitySection"],dt=(o,s)=>s.id;function nn(o,s){if(1&o&&(t.j41(0,"div",3)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"div",14),t.EFF(5),t.nI1(6,"translate"),t.k0s()(),t.nrm(7,"div",10)),2&o){const i=t.XpG(2);t.R7$(2),t.JRh(t.bMT(3,2,"sync.details.settings.synchronize-security-groups")),t.R7$(3),t.SpI(" ",t.bMT(6,4,i.sync.syncSecurityGroups?"sync.details.settings.boolean.true":"sync.details.settings.boolean.false")," ")}}function on(o,s){if(1&o&&(t.j41(0,"nsi-label",12),t.EFF(1),t.k0s()),2&o){const i=s.$implicit;t.Y8G("color",i.color),t.R7$(),t.SpI(" ",i.label," ")}}function sn(o,s){1&o&&t.EFF(0," \u2013 ")}function rn(o,s){if(1&o&&(t.j41(0,"nsi-label",15),t.EFF(1),t.k0s()),2&o){const i=s.$implicit;t.R7$(),t.SpI(" ",i," ")}}function cn(o,s){1&o&&t.EFF(0," \u2013 ")}function ln(o,s){1&o&&(t.j41(0,"div",11),t.Z7z(1,rn,2,1,"nsi-label",15,t.fX1,!1,cn,1,0),t.k0s()),2&o&&(t.R7$(),t.Dyx(s.extensions.split(", ")))}function an(o,s){1&o&&t.EFF(0," \u2013 ")}function dn(o,s){if(1&o&&(t.EFF(0),t.nI1(1,"translate"),t.nrm(2,"pa-datetime",16),t.EFF(3),t.nI1(4,"translate"),t.nrm(5,"pa-datetime",16)),2&o){const i=s;t.SpI(" ",t.bMT(1,4,"sync.details.settings.modification-date.from")," "),t.R7$(2),t.Y8G("datetime",i.from),t.R7$(),t.SpI(" ",t.bMT(4,6,"sync.details.settings.modification-date.to")," "),t.R7$(2),t.Y8G("datetime",i.to)}}function pn(o,s){1&o&&t.EFF(0," \u2013 ")}function un(o,s){if(1&o&&(t.nrm(0,"div",10),t.nVh(1,nn,8,6),t.j41(2,"div",3)(3,"label"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"div",11),t.Z7z(7,on,2,2,"nsi-label",12,t.fX1,!1,sn,1,0),t.k0s()(),t.nrm(10,"div",10),t.j41(11,"label"),t.EFF(12),t.nI1(13,"translate"),t.k0s(),t.j41(14,"div",3),t.nVh(15,ln,4,1,"div",11)(16,an,1,0),t.k0s(),t.nrm(17,"div",10),t.j41(18,"label"),t.EFF(19),t.nI1(20,"translate"),t.k0s(),t.j41(21,"div",13),t.nVh(22,dn,6,8)(23,pn,1,0),t.k0s()),2&o){let i,e;const n=t.XpG();t.R7$(),t.vxM(null!=n.connector&&n.connector.canSyncSecurityGroups?1:-1),t.R7$(3),t.JRh(t.bMT(5,7,"sync.details.settings.labels")),t.R7$(3),t.Dyx(n.coloredLabels),t.R7$(5),t.SpI(" ",t.bMT(13,9,null!=n.sync.filters&&null!=n.sync.filters.fileExtensions&&n.sync.filters.fileExtensions.exclude?"sync.details.settings.file-extensions.excluded":"sync.details.settings.file-extensions.included")," "),t.R7$(3),t.vxM((i=null==n.sync.filters?null:n.sync.filters.fileExtensions)?15:16,i),t.R7$(4),t.JRh(t.bMT(20,11,"sync.details.settings.modification-date.label")),t.R7$(3),t.vxM((e=null==n.sync.filters?null:n.sync.filters.modified)?22:23,e)}}function hn(o,s){1&o&&(t.j41(0,"div"),t.EFF(1,"*****"),t.k0s())}function mn(o,s){if(1&o&&(t.j41(0,"div"),t.EFF(1),t.k0s()),2&o){const i=t.XpG(2).$implicit,e=t.XpG(3);t.R7$(),t.JRh(e.sync.connector.parameters[i.id]||"_")}}function gn(o,s){if(1&o&&t.nVh(0,hn,2,0,"div")(1,mn,2,1,"div"),2&o){const i=t.XpG().$implicit;t.vxM(i.secret?0:1)}}function yn(o,s){if(1&o&&t.nrm(0,"app-parameters-table",18),2&o){const i=t.XpG().$implicit,e=t.XpG(3);t.Y8G("values",e.sync.connector.parameters[i.id])}}function _n(o,s){1&o&&t.EFF(0," \u2013 ")}function fn(o,s){1&o&&t.nrm(0,"div",10)}function Cn(o,s){if(1&o&&(t.j41(0,"div",3)(1,"label"),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.nVh(4,gn,2,1)(5,yn,1,1,"app-parameters-table",18)(6,_n,1,0),t.k0s(),t.nVh(7,fn,1,0,"div",10)),2&o){const i=s.$implicit,e=s.$index,n=s.$count,r=t.XpG(3);t.R7$(2),t.JRh(t.bMT(3,3,i.label)),t.R7$(2),t.vxM("table"!==i.type?4:(null==r.sync.connector.parameters[i.id]?null:r.sync.connector.parameters[i.id].length)>0?5:6),t.R7$(3),t.vxM(e!==n-1?7:-1)}}function bn(o,s){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",17)(1,"div",2),t.Z7z(2,Cn,8,5,null,null,dt),t.k0s()()),2&o){const i=s.$implicit;t.Y8G("itemTitle",i.title)("description",i.description||""),t.R7$(2),t.Dyx(i.fields)}}function vn(o,s){if(1&o&&(t.Z7z(0,bn,4,2,"nsi-two-columns-configuration-item",17,dt),t.nI1(2,"async")),2&o){const i=t.XpG();t.Dyx(t.bMT(2,0,i.connector.getParametersSections()))}}function Sn(o,s){if(1&o&&(t.j41(0,"nsi-two-columns-configuration-item",4)(1,"div"),t.EFF(2),t.k0s()()),2&o){const i=t.XpG();t.R7$(2),t.JRh(i.extractStrategy)}}function xn(o,s){1&o&&t.nrm(0,"pa-icon",20)}function Tn(o,s){1&o&&t.nrm(0,"pa-icon",21)}function Fn(o,s){1&o&&t.nrm(0,"pa-icon",22)}function In(o,s){if(1&o&&(t.j41(0,"pa-table-row")(1,"pa-table-cell")(2,"div",19),t.nVh(3,xn,1,0,"pa-icon",20)(4,Tn,1,0,"pa-icon",21)(5,Fn,1,0,"pa-icon",22),t.EFF(6),t.k0s()(),t.j41(7,"pa-table-cell")(8,"div",23),t.nrm(9,"pa-datetime",24),t.k0s()()()),2&o){let i;const e=s.$implicit;t.R7$(3),t.vxM("high"===(i=e.level)?3:"medium"===i?4:"low"===i?5:-1),t.R7$(3),t.SpI(" ",e.message," "),t.R7$(3),t.Y8G("datetime",e.createdAt)}}function Rn(o,s){1&o&&(t.j41(0,"pa-table-row",9)(1,"pa-table-cell")(2,"div",23),t.EFF(3),t.nI1(4,"translate"),t.k0s()()()),2&o&&(t.R7$(3),t.JRh(t.bMT(4,1,"sync.details.activity-log.no-activity")))}let Mn=(()=>{var o;class s{constructor(){this.labelService=(0,c.WQX)(b.xQ),this.cdr=(0,c.WQX)(P.gRc),this.currentRoute=(0,c.WQX)(R.nX),this.sdk=(0,c.WQX)(b.ok),this.connector=null,this._logs=[],this.labelSets={},this.coloredLabels=[],this.extractStrategy=""}set logs(e){e&&(this._logs=e)}get logs(){return this._logs}ngAfterViewInit(){this.currentRoute.queryParams.pipe((0,v.p)(e=>e.section),(0,m.T)(e=>e.section),(0,_.s)(1)).subscribe({next:e=>{setTimeout(()=>{"activity"===e&&this.activitySection&&this.activitySection.nativeElement.scrollIntoView({behavior:"smooth"})},300)}})}ngOnInit(){this.labelService.resourceLabelSets.pipe((0,_.s)(1),(0,v.p)(n=>!!n),(0,m.T)(n=>n)).subscribe(n=>{this.labelSets=n,this.coloredLabels=this.sync.labels?.map(r=>({...r,color:this.labelSets[r.labelset]?.color}))||[],this.cdr.detectChanges()});const e=this.sync.extract_strategy;e&&this.sdk.currentKb.pipe((0,_.s)(1),(0,d.n)(n=>n.getExtractStrategies())).subscribe(n=>{this.extractStrategy=n[e]?.name||"",this.cdr.markForCheck()})}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["nsy-sync-settings"]],viewQuery:function(n,r){if(1&n&&t.GBs(en,5),2&n){let a;t.mGM(a=t.lsd())&&(r.activitySection=a.first)}},inputs:{sync:"sync",connector:"connector",logs:"logs"},decls:25,vars:14,consts:[["activitySection",""],["noTopBorder","","itemTitle","sync.details.settings.title","description","sync.details.settings.description"],[1,"sync-settings-container"],[1,"body-s","settings-item"],["itemTitle","sync.add-page.extract-config.title","description","sync.add-page.extract-config.description"],["itemTitle","sync.details.activity-log.title","description","sync.details.activity-log.description"],[1,"activity-logs-container"],["border","","columns","2fr 1fr"],["header",""],["last",""],[1,"separator-line"],[1,"row-container"],["readonly","",3,"color"],[1,"body-s","row-container"],[2,"text-transform","capitalize"],["readonly","","neutral",""],["dateOnly","",3,"datetime"],[3,"itemTitle","description"],["readonly","",3,"values"],[1,"body-s","icon-and-text"],["size","small","name","circle-cross",1,"error"],["size","small","name","warning",1,"warning"],["size","small","name","circle-check",1,"success"],[1,"body-s"],[3,"datetime"]],template:function(n,r){1&n&&(t.j41(0,"nsi-two-columns-configuration-item",1)(1,"div",2)(2,"div",3)(3,"label"),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.j41(6,"div"),t.EFF(7),t.k0s()(),t.nVh(8,un,24,13),t.k0s()(),t.nVh(9,vn,3,2),t.nVh(10,Sn,3,1,"nsi-two-columns-configuration-item",4),t.j41(11,"nsi-two-columns-configuration-item",5)(12,"div",6,0)(14,"pa-table",7)(15,"pa-table-header")(16,"pa-table-cell",8),t.EFF(17),t.nI1(18,"translate"),t.k0s(),t.j41(19,"pa-table-cell",8),t.EFF(20),t.nI1(21,"translate"),t.k0s()(),t.Z7z(22,In,10,3,"pa-table-row",null,t.fX1,!1,Rn,5,3,"pa-table-row",9),t.k0s()()()),2&n&&(t.R7$(4),t.JRh(t.bMT(5,8,"sync.details.settings.name")),t.R7$(3),t.JRh(r.sync.title),t.R7$(),t.vxM(r.sync.isCloud?-1:8),t.R7$(),t.vxM(r.connector?9:-1),t.R7$(),t.vxM(r.extractStrategy?10:-1),t.R7$(7),t.JRh(t.bMT(18,10,"sync.details.activity-log.table-header.message")),t.R7$(3),t.JRh(t.bMT(21,12,"sync.details.activity-log.table-header.date")),t.R7$(2),t.Dyx(r.logs))},dependencies:[T.MD,T.Jj,y._8,C.h,C.D9,y.OE,st.U,p.Pa6,ot.Z,p.EGN,tt.O,et.e,nt.U,tn.Bz,p.V3x,G.R,b.Qy],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.sync-settings-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.75rem}.sync-settings-container[_ngcontent-%COMP%] .settings-item[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.sync-settings-container[_ngcontent-%COMP%] .body-s[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{color:var(--color-neutral-regular, hsl(207, 17%, 58%));font-weight:600}.sync-settings-container[_ngcontent-%COMP%] .row-container[_ngcontent-%COMP%]{align-items:center;display:flex;flex-wrap:wrap;gap:.5rem}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.25rem}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] pa-icon[_ngcontent-%COMP%]{display:flex}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .error[_ngcontent-%COMP%], .activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .warning[_ngcontent-%COMP%]{color:var(--color-secondary-stronger, hsl(7, 90%, 35%))}.activity-logs-container[_ngcontent-%COMP%] .icon-and-text[_ngcontent-%COMP%] .success[_ngcontent-%COMP%]{color:var(--color-primary-strong)}'],changeDetection:0}))}return o(),s})();const kn=o=>({count:o});function $n(o,s){if(1&o){const i=t.RV6();t.j41(0,"header")(1,"pa-input",1),t.EFF(2),t.nI1(3,"translate"),t.k0s(),t.j41(4,"pa-button",2),t.bIt("click",function(){c.eBV(i);const n=t.XpG();return c.Njj(n.editing=!0)}),t.EFF(5),t.nI1(6,"translate"),t.k0s()(),t.j41(7,"div",3),t.EFF(8),t.nI1(9,"translate"),t.k0s(),t.nrm(10,"nsi-folder-list",4)}if(2&o){const i=t.XpG();t.R7$(),t.Y8G("formControl",i.queryControl),t.R7$(),t.SpI(" ",t.bMT(3,6,"sync.folder-selection.search-input-label")," "),t.R7$(3),t.JRh(t.bMT(6,8,"sync.folder-selection.edit-folders-button")),t.R7$(3),t.JRh(t.bMT(9,10,"sync.folder-selection.current-selection")),t.R7$(2),t.Y8G("filtered",!!i.query)("folders",i.selectedFolders)}}function Pn(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsy-folder-selection",5),t.bIt("selectedSyncItems",function(n){c.eBV(i);const r=t.XpG();return c.Njj(r.updateSelection(n))}),t.k0s(),t.j41(1,"nsi-sticky-footer")(2,"div",6),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.j41(5,"pa-button",7),t.bIt("click",function(){c.eBV(i);const n=t.XpG();return c.Njj(n.editing=!1)}),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"pa-button",8),t.bIt("click",function(){c.eBV(i);const n=t.XpG();return c.Njj(n.saveSelection())}),t.EFF(9),t.nI1(10,"translate"),t.k0s()()}if(2&o){const i=t.XpG();t.Y8G("sync",i.sync),t.R7$(3),t.SpI(" ",t.i5U(4,4,"sync.folder-selection.footer.selection-count",t.eq3(11,kn,i.selectionCount))," "),t.R7$(3),t.SpI(" ",t.bMT(7,7,"generic.cancel")," "),t.R7$(3),t.SpI(" ",t.bMT(10,9,"sync.folder-selection.footer.save-changes")," ")}}let En=(()=>{var o;class s{constructor(){this.cdr=(0,c.WQX)(P.gRc),this._unsubscribeAll=new k.B,this.selectionChange=new t.bkB,this.editing=!1,this.selection=[],this.selectionCount=0,this.queryControl=new u.MJ("")}set sync(e){this._sync=e,this.updateSelection(e.foldersToSync||[])}get sync(){return this._sync}get selectedFolders(){const e=this.selection.map(r=>r.metadata.displayPath||r.metadata.path)||[],n=this.query?this.query.toLocaleLowerCase():"";return n?e.filter(r=>r.toLocaleLowerCase().includes(n)):e}get query(){return this.queryControl.value}updateSelection(e){this.selection=e,this.selectionCount=this.selection.length,this.cdr.detectChanges()}saveSelection(){this.selectionChange.emit(this.selection),this.editing=!1,this.cdr.markForCheck()}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["nsy-folders-tab"]],inputs:{sync:"sync"},outputs:{selectionChange:"selectionChange"},decls:3,vars:1,consts:[[1,"folders-tab"],["icon","search",3,"formControl"],[3,"click"],[1,"title-xxs"],[3,"filtered","folders"],[3,"selectedSyncItems","sync"],["footerNote","",1,"title-xs"],["aspect","basic",3,"click"],["kind","primary",3,"click"]],template:function(n,r){1&n&&(t.j41(0,"div",0),t.nVh(1,$n,11,12)(2,Pn,11,13),t.k0s()),2&n&&(t.R7$(),t.vxM(r.editing?r.sync?2:-1:1))},dependencies:[B,p.XgI,N.S,p.Ymm,w.Q,C.h,C.D9,p.V3x,y.Sq,y.o3,u.X1,u.BC,u.l_],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.folders-tab[_ngcontent-%COMP%]{position:relative}.folders-tab[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;margin-bottom:1rem}.folders-tab[_ngcontent-%COMP%] header[_ngcontent-%COMP%] pa-input[_ngcontent-%COMP%]{width:30rem}'],changeDetection:0}))}return o(),s})();var jn=l(7725),Gn=l(3515);function wn(o,s){if(1&o){const i=t.RV6();t.j41(0,"div",10)(1,"pa-toggle",11),t.bIt("valueChange",function(n){c.eBV(i);const r=t.XpG(4);return c.Njj(r.toggleSync(n))}),t.EFF(2),t.nI1(3,"translate"),t.k0s()(),t.j41(4,"pa-button",12),t.nI1(5,"async"),t.bIt("click",function(){c.eBV(i);const n=t.XpG(4);return c.Njj(n.triggerSync())}),t.EFF(6),t.nI1(7,"translate"),t.k0s(),t.j41(8,"pa-button",13),t.EFF(9),t.nI1(10,"translate"),t.k0s()}if(2&o){const i=t.XpG(3),e=t.XpG();t.R7$(),t.Y8G("value",!i.disabled),t.R7$(),t.SpI(" ",t.bMT(3,5,i.disabled?"sync.badge.inactive":"sync.badge.active")," "),t.R7$(2),t.Y8G("disabled",t.bMT(5,7,e.isSyncing)),t.R7$(2),t.SpI(" ",t.bMT(7,9,"sync.details.buttons.sync-now")," "),t.R7$(3),t.SpI(" ",t.bMT(10,11,"sync.details.buttons.edit-settings")," ")}}function On(o,s){if(1&o){const i=t.RV6();t.j41(0,"div",8),t.nVh(1,wn,11,13),t.j41(2,"pa-button",9),t.bIt("click",function(){c.eBV(i);const n=t.XpG(3);return c.Njj(n.deleteSync())}),t.EFF(3),t.nI1(4,"translate"),t.k0s()()}if(2&o){const i=t.XpG(2);t.R7$(),t.vxM(i.isCloud?-1:1),t.R7$(2),t.SpI(" ",t.bMT(4,2,"sync.details.buttons.delete")," ")}}function Vn(o,s){if(1&o&&(t.j41(0,"div",2)(1,"h1",6),t.nrm(2,"pa-icon",7),t.EFF(3),t.k0s(),t.nVh(4,On,5,4,"div",8),t.nI1(5,"async"),t.k0s()),2&o){const i=t.XpG(),e=t.XpG();t.R7$(2),t.Y8G("path",s.logo),t.R7$(),t.SpI(" ",i.title," "),t.R7$(),t.vxM(!1===t.bMT(5,3,e.editMode)?4:-1)}}function Xn(o,s){if(1&o){const i=t.RV6();t.j41(0,"pa-tab",14),t.bIt("click",function(){c.eBV(i);const n=t.XpG(2);return c.Njj(n.activeTab="folders")}),t.EFF(1),t.nI1(2,"translate"),t.k0s()}if(2&o){const i=t.XpG(2);t.Y8G("active","folders"===i.activeTab),t.R7$(),t.SpI(" ",t.bMT(2,2,"sync.details.tabs.folders")," ")}}function Dn(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsy-configuration-form",19),t.nI1(1,"async"),t.nI1(2,"async"),t.nI1(3,"async"),t.bIt("configurationChange",function(n){c.eBV(i);const r=t.XpG(3);return c.Njj(r.updateConfiguration(n))})("validForm",function(n){c.eBV(i);const r=t.XpG(3);return c.Njj(r.validForm=n)}),t.k0s()}if(2&o){let i;const e=t.XpG(2),n=t.XpG();t.Y8G("sync",e)("kbId",t.bMT(1,4,n.kbId))("connector",t.bMT(2,6,n.connector))("connectorId",null==(i=t.bMT(3,8,n.connectorDef))?null:i.id)}}function Nn(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsy-folder-selection",20),t.bIt("selectedSyncItems",function(n){c.eBV(i);const r=t.XpG(3);return c.Njj(r.updateSelection(n))}),t.k0s()}if(2&o){const i=t.XpG(2);t.Y8G("sync",i)}}function An(o,s){if(1&o){const i=t.RV6();t.j41(0,"div"),t.nVh(1,Dn,4,10,"nsy-configuration-form",15)(2,Nn,1,1,"nsy-folder-selection",16),t.j41(3,"nsi-sticky-footer")(4,"pa-button",17),t.EFF(5),t.nI1(6,"translate"),t.k0s(),t.j41(7,"pa-button",18),t.bIt("click",function(){c.eBV(i);const n=t.XpG(2);return c.Njj(n.saveChanges())}),t.EFF(8),t.nI1(9,"translate"),t.k0s()()()}if(2&o){let i;const e=t.XpG(2);t.R7$(),t.vxM("settings"===(i=e.activeTab)?1:"folders"===i?2:-1),t.R7$(4),t.SpI(" ",t.bMT(6,3,"generic.cancel")," "),t.R7$(3),t.SpI(" ",t.bMT(9,5,"sync.details.buttons.save-changes")," ")}}function Bn(o,s){if(1&o&&(t.nrm(0,"nsy-sync-settings",21),t.nI1(1,"async"),t.nI1(2,"async")),2&o){const i=t.XpG(2),e=t.XpG();t.Y8G("sync",i)("connector",t.bMT(1,3,e.connector))("logs",t.bMT(2,5,e.activityLogs))}}function Un(o,s){if(1&o){const i=t.RV6();t.j41(0,"nsy-folders-tab",22),t.bIt("selectionChange",function(n){c.eBV(i);const r=t.XpG(3);return c.Njj(r.updateFolders(n))}),t.k0s()}if(2&o){const i=t.XpG(2);t.Y8G("sync",i)}}function Yn(o,s){if(1&o&&t.nVh(0,Bn,3,7,"nsy-sync-settings",21)(1,Un,1,1,"nsy-folders-tab",16),2&o){let i;const e=t.XpG(2);t.vxM("settings"===(i=e.activeTab)?0:"folders"===i?1:-1)}}function Ln(o,s){if(1&o){const i=t.RV6();t.nVh(0,Vn,6,5,"div",2),t.nI1(1,"async"),t.j41(2,"pa-tabs",3)(3,"pa-tab",4),t.bIt("click",function(){c.eBV(i);const n=t.XpG();return c.Njj(n.activeTab="settings")}),t.EFF(4),t.nI1(5,"translate"),t.k0s(),t.nVh(6,Xn,3,4,"pa-tab",5),t.nI1(7,"async"),t.k0s(),t.nVh(8,An,10,7,"div"),t.nI1(9,"async"),t.vZN(10,Yn,2,1)}if(2&o){let i,e;const n=t.XpG();t.vxM((i=t.bMT(1,5,n.connectorDef))?0:-1,i),t.R7$(3),t.Y8G("active","settings"===n.activeTab),t.R7$(),t.SpI(" ",t.bMT(5,7,"sync.details.tabs.settings")," "),t.R7$(2),t.vxM(null!=(e=t.bMT(7,9,n.connector))&&e.allowToSelectFolders?6:-1),t.R7$(2),t.vxM(t.bMT(9,11,n.editMode)?8:10)}}let pt=(()=>{var o;class s{constructor(){this.router=(0,c.WQX)(R.Ix),this.currentRoute=(0,c.WQX)(R.nX),this.syncService=(0,c.WQX)(j),this.toaster=(0,c.WQX)(y._g),this.sdk=(0,c.WQX)(b.ok),this.modalService=(0,c.WQX)(y.w8),this.translate=(0,c.WQX)(C.c$),this.unsubscribeAll=new k.B,this.isDeleted=new k.B,this.kbId=this.sdk.currentKb.pipe((0,m.T)(e=>e.id)),this.syncId=this.currentRoute.params.pipe((0,v.p)(e=>!!e.syncId),(0,m.T)(e=>e.syncId),(0,x.M)(e=>this.syncService.setCurrentSyncId(e))),this.sync=this.syncService.cacheUpdated.pipe((0,d.n)(()=>this.syncId),(0,d.n)(e=>this.syncService.getSync(e)),(0,E.Q)(this.isDeleted)),this.connectorDef=this.sync.pipe((0,m.T)(e=>this.syncService.connectors[e.connector.name].definition)),this.connector=this.connectorDef.pipe((0,m.T)(e=>this.syncService.getConnector(e.id,""))),this.activityLogs=this.syncId.pipe((0,d.n)(e=>this.syncService.getLogs(e))),this.activeTab="settings",this.editMode=this.currentRoute.url.pipe((0,m.T)(e=>e.length>1&&"edit"===e[1].path)),this.validForm=!1,this.isSyncing=(0,Z.z)([this.syncId,this.syncService.isSyncing]).pipe((0,m.T)(([e,n])=>n[e]||!1))}ngOnDestroy(){this.unsubscribeAll.next(),this.unsubscribeAll.complete(),this.isDeleted.next(),this.isDeleted.complete()}toggleSync(e){this.syncId.pipe((0,_.s)(1),(0,d.n)(n=>this.syncService.updateSync(n,{disabled:!e}))).subscribe({error:()=>this.toaster.error(e?"sync.details.toast.activating-failed":"sync.details.toast.disabling-failed")})}triggerSync(){this.modalService.openConfirm({title:this.translate.instant("sync.details.modal.title"),description:"sync.details.modal.description",confirmLabel:"sync.details.modal.sync-new",cancelLabel:"sync.details.modal.re-sync-all"}).onClose.pipe((0,d.n)(e=>this.syncId.pipe((0,_.s)(1),(0,d.n)(n=>this.syncService.triggerSync(n,!e))))).subscribe({next:()=>this.toaster.success("sync.details.toast.triggering-sync-success"),error:()=>this.toaster.error("sync.details.toast.triggering-sync-failed")})}deleteSync(){this.sync.pipe((0,d.n)(e=>this.modalService.openConfirm({title:this.translate.instant("sync.confirm.deletion.title",{title:e.title}),description:"sync.confirm.deletion.description",isDestructive:!0,confirmLabel:"generic.delete"}).onClose.pipe((0,v.p)(n=>!!n),(0,x.M)(()=>this.isDeleted.next()),(0,d.n)(()=>this.syncService.deleteSync(e.id))))).subscribe({next:()=>this.router.navigate([".."],{relativeTo:this.currentRoute}),error:()=>this.toaster.error("sync.details.toast.deletion-failed")})}updateConfiguration(e){this.updatedConfig=e}updateSelection(e){this.updatedSelection=e}saveChanges(){!this.updatedConfig&&!this.updatedSelection||this.syncId.pipe((0,_.s)(1),(0,d.n)(e=>{const n={...this.updatedConfig};return this.updatedSelection&&(n.foldersToSync=this.updatedSelection),this.syncService.updateSync(e,n)})).subscribe({next:()=>{this.toaster.success("sync.details.toast.modification-success"),this.router.navigate([".."],{relativeTo:this.currentRoute})},error:()=>this.toaster.error("sync.details.toast.modification-failed")})}updateFolders(e){this.syncId.pipe((0,_.s)(1),(0,d.n)(n=>this.syncService.updateSync(n,{foldersToSync:e}))).subscribe({error:()=>this.toaster.error("sync.details.toast.modification-failed")})}static#t=o=()=>(this.\u0275fac=function(n){return new(n||s)},this.\u0275cmp=t.VBU({type:s,selectors:[["nsy-sync-details-page"]],decls:7,vars:9,consts:[[1,"page-spacing"],[3,"link"],[1,"details-header"],["notFullWidth",""],["data-cy","settings-tab",3,"click","active"],["data-cy","folders-tab",3,"active"],[1,"page-title"],["size","large",3,"path"],[1,"cta-container"],["kind","destructive","data-cy","delete",3,"click"],[1,"toggle-container"],["withBackground","","data-cy","active-toggle",3,"valueChange","value"],["aspect","basic","data-cy","sync-now",3,"click","disabled"],["aspect","basic","routerLink","./edit"],["data-cy","folders-tab",3,"click","active"],["noTopBorder","",3,"sync","kbId","connector","connectorId"],[3,"sync"],["aspect","basic","routerLink",".."],["kind","primary",3,"click"],["noTopBorder","",3,"configurationChange","validForm","sync","kbId","connector","connectorId"],[3,"selectedSyncItems","sync"],[3,"sync","connector","logs"],[3,"selectionChange","sync"]],template:function(n,r){if(1&n&&(t.j41(0,"div",0)(1,"nsi-back-button",1),t.nI1(2,"async"),t.EFF(3),t.nI1(4,"translate"),t.k0s(),t.nVh(5,Ln,11,13),t.nI1(6,"async"),t.k0s()),2&n){let a;t.R7$(),t.Y8G("link",t.bMT(2,3,r.editMode)?"../..":".."),t.R7$(2),t.SpI(" ",t.bMT(4,5,"sync.add-page.back-button")," "),t.R7$(2),t.vxM((a=t.bMT(6,7,r.sync))?5:-1,a)}},dependencies:[T.MD,T.Jj,y.Xp,C.h,C.D9,p.V3x,G.R,p.Ymm,w.Q,p.rkm,A.a,p.aT,jn.Q,Gn.w,Mn,En,K.Wk,y.o3,ct,B],styles:['@import"https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap";@charset "UTF-8";@font-face{font-family:Source Code Pro;font-style:normal;font-weight:400;src:url(source-code-pro-v14-latin-regular.e7bb30b550ed09e8.woff2) format("woff2"),url(source-code-pro-v14-latin-regular.c54f7f16da733fd8.woff) format("woff")}[_ngcontent-%COMP%]:root{--color-dark-stronger: #000;--color-light-stronger: #fff;--color-neutral-regular: var(--custom-color-neutral-regular, hsl(0, 0%, 44%));--color-neutral-light: var(--custom-color-neutral-light, hsl(0, 0%, 77%));--color-neutral-lighter: var(--custom-color-neutral-lighter, hsl(0, 0%, 90%));--color-neutral-lightest: var(--custom-color-neutral-lightest, hsl(240, 7%, 97%));--color-primary-stronger: var(--custom-color-primary-stronger, hsl(252, 100%, 24%));--color-primary-strong: var(--custom-color-primary-strong, hsl(223.74, 100%, 39.8%));--color-primary-regular: var(--custom-color-primary-regular, hsl(223.2, 100%, 50.98%));--color-primary-light: var(--custom-color-primary-light, hsl(252, 100%, 73%));--color-primary-lighter: var(--custom-color-primary-lighter, hsl(212.57, 100%, 93.14%));--color-primary-lightest: var(--custom-color-primary-lightest, hsl(215.29, 100%, 96.67%));--color-secondary-stronger: hsl(49, 100%, 30%);--color-secondary-strong: hsl(49, 100%, 40%);--color-secondary-regular: hsl(49, 100%, 60%);--color-secondary-light: hsl(49, 100%, 80%);--color-secondary-lighter: hsl(49, 100%, 90%);--color-secondary-lightest: hsl(49, 100%, 95%);--color-tertiary-stronger: hsl(2251, 100%, 24%);--color-tertiary-strong: hsl(2251, 100%, 40%);--color-tertiary-regular: hsl(2251, 100%, 50%);--color-tertiary-light: hsl(2251, 100%, 65%);--color-tertiary-lighter: hsl(2251, 100%, 92%);--color-tertiary-lightest: hsl(2251, 100%, 96%)}.page-spacing[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2rem}.page-title[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}.details-header[_ngcontent-%COMP%]{align-items:center;display:flex;justify-content:space-between}.cta-container[_ngcontent-%COMP%]{align-items:center;display:flex;gap:.5rem}'],changeDetection:0}))}return o(),s})();const Jn=[{path:"",component:kt,children:[{path:"",component:se},{path:"add/:connector",component:at},{path:"add/:connector/:syncId",component:at},{path:":syncId/edit",component:pt},{path:":syncId",component:pt}]}]}}]);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg version="1.2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1446 1546" width="1446" height="1546">
|
|
2
|
+
<title>progress-svg</title>
|
|
3
|
+
<style>
|
|
4
|
+
.s0 { fill: #5ce500 }
|
|
5
|
+
</style>
|
|
6
|
+
<path id="Layer" fill-rule="evenodd" class="s0" d="m1445.3 440v771.9c-0.3 4.7-1.1 9.3-2.4 13.7-1.3 4.5-3.2 8.8-5.5 12.8-2.3 4.1-5.1 7.8-8.3 11.2-3.2 3.4-6.8 6.4-10.7 8.9l-25.3 15.2-192.5 111.2-129.9 75.7-27 15.1v-834.9l-722.5-417.7 343.2-197.8 31.6-18.1c4.2-2.1 8.6-3.7 13.1-4.8 4.5-1 9.2-1.6 13.9-1.6 4.6 0 9.3 0.6 13.8 1.6 4.5 1.1 8.9 2.7 13.1 4.8l475.7 274.9 219.5 126.8c0 0 0 31.1 0.2 31.1zm-562.3 865.8c-0.2 4.6-1 9.2-2.4 13.7-1.3 4.4-3.1 8.7-5.5 12.8-2.3 4-5.1 7.8-8.3 11.1-3.2 3.4-6.8 6.4-10.7 9l-27.1 15.1-307.1 177.6v-602.9l-521.9-301.4 26.8-15.6 307.6-177.7c4.2-2 8.6-3.6 13.1-4.7 4.5-1 9.2-1.6 13.8-1.6 4.7 0 9.3 0.6 13.9 1.6 4.5 1.1 8.9 2.7 13.1 4.7l346.6 200.3 148.1 85.7zm-522-271v417.5l-361-208.6z"/>
|
|
7
|
+
</svg>
|