@duplicati/ngclient 0.0.23 → 0.0.24
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.
- package/assets/backgrounds/base-bg.svg +9 -0
- package/assets/duplicati/duplicati-dark.svg +40 -0
- package/assets/duplicati/duplicati.svg +40 -0
- package/assets/duplicati/pattern.svg +45 -0
- package/assets/noise/auth-noise.svg +57 -0
- package/chunk-2653SOTQ.js +1 -0
- package/chunk-2EGLLTER.js +1 -0
- package/chunk-2MDIWOW5.js +1 -0
- package/chunk-3UHRO33D.js +1 -0
- package/{chunk-4EODC7AQ.js → chunk-3XQGPHYU.js} +1 -1
- package/chunk-4C6SJEAP.js +1 -0
- package/chunk-4HGECFGT.js +1 -0
- package/chunk-4JYRDCTW.js +1 -0
- package/chunk-4NLCRQLQ.js +1 -0
- package/chunk-637GTPYL.js +1 -0
- package/chunk-67JGZ4NF.js +7 -0
- package/chunk-AEQ7QJXE.js +1 -0
- package/chunk-BTF6XTSM.js +1 -0
- package/chunk-C3SI6ECZ.js +1 -0
- package/chunk-CESPRUJX.js +1 -0
- package/{chunk-N6REZCKW.js → chunk-CUYURNCB.js} +1 -1
- package/{chunk-EEZT434V.js → chunk-EOYIT7GV.js} +1 -1
- package/chunk-GO7CLBZY.js +1 -0
- package/chunk-GTGXQQJJ.js +1 -0
- package/chunk-HJUBM7Q5.js +1 -0
- package/chunk-JE2I63Y6.js +2 -0
- package/chunk-JRKR54DW.js +1 -0
- package/chunk-KJQLPHGM.js +1 -0
- package/chunk-KV674FA2.js +1 -0
- package/{chunk-6GOAPINI.js → chunk-MJCUB3L3.js} +1 -1
- package/chunk-NAPR7ILQ.js +1 -0
- package/chunk-NAZLO3UY.js +1 -0
- package/chunk-NILUA3YB.js +1 -0
- package/chunk-NVZUM7FG.js +1 -0
- package/chunk-NYFN2CT6.js +6 -0
- package/chunk-OSB5J6SK.js +1 -0
- package/chunk-P6347OTT.js +1 -0
- package/chunk-RHGRQONA.js +1 -0
- package/chunk-RNJMBZB7.js +1 -0
- package/chunk-SGZGAY7X.js +1 -0
- package/chunk-SRW3NRX3.js +1 -0
- package/{chunk-SFRGISK2.js → chunk-SRX3KYGO.js} +1 -1
- package/chunk-T2ZGAXWS.js +1 -0
- package/chunk-TNE7LVPH.js +1 -0
- package/chunk-VA5L4XPW.js +1 -0
- package/chunk-VJDUCP4Z.js +1 -0
- package/chunk-VXKI3RQB.js +1 -0
- package/chunk-X2IPCPJN.js +1 -0
- package/chunk-YBWO6L26.js +1 -0
- package/{chunk-PFVXGEM7.js → chunk-Z3RCJ5NZ.js} +1 -1
- package/chunk-ZLOKN5SO.js +1 -0
- package/index.html +1 -1
- package/main-WZ7WTPZS.js +1 -0
- package/package.json +1 -1
- package/chunk-22ZYSOTR.js +0 -1
- package/chunk-37USSSCL.js +0 -1
- package/chunk-3ZEBM2Q6.js +0 -1
- package/chunk-5AC7O5ME.js +0 -1
- package/chunk-6RIA76HG.js +0 -1
- package/chunk-73UOOUBD.js +0 -1
- package/chunk-AIWAOXTQ.js +0 -1
- package/chunk-BHQV6I5A.js +0 -1
- package/chunk-C6XNKGG2.js +0 -1
- package/chunk-CLHK3WG3.js +0 -1
- package/chunk-CLPPNSLN.js +0 -1
- package/chunk-EZH4RUS3.js +0 -1
- package/chunk-FRD2BVV6.js +0 -6
- package/chunk-GQQ7YXKJ.js +0 -1
- package/chunk-ICNC6KVB.js +0 -1
- package/chunk-IEVRQDB6.js +0 -1
- package/chunk-IXLTPP72.js +0 -1
- package/chunk-JNQHJPEL.js +0 -1
- package/chunk-LFGIPWCL.js +0 -1
- package/chunk-LZSE733H.js +0 -1
- package/chunk-ORCLDJSO.js +0 -1
- package/chunk-OVWWCW76.js +0 -1
- package/chunk-Q76L4VLC.js +0 -1
- package/chunk-QHJTF3V4.js +0 -8
- package/chunk-RWFWLGB7.js +0 -1
- package/chunk-TKY4PPEK.js +0 -1
- package/chunk-UVFVZQCU.js +0 -1
- package/chunk-VC4GI7EV.js +0 -1
- package/chunk-VOS5UL4W.js +0 -1
- package/chunk-VUEDXCG5.js +0 -1
- package/chunk-WSTPDNCJ.js +0 -1
- package/chunk-X53IGCHF.js +0 -1
- package/chunk-XDYHN4IQ.js +0 -2
- package/chunk-XGBLG5PU.js +0 -1
- package/chunk-Z7GRCDAT.js +0 -1
- package/chunk-ZPJ6YV7Y.js +0 -1
- package/chunk-ZSOWH34L.js +0 -1
- package/main-KQJXLVHZ.js +0 -1
package/chunk-ZSOWH34L.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as re}from"./chunk-73UOOUBD.js";import{a as I,f as ae,k as ce,l as de,t as pe}from"./chunk-IEVRQDB6.js";import{a as le}from"./chunk-LZSE733H.js";import{Db as K,E as j,Eb as ie,Fb as Q,Gb as m,Ib as U,Oa as d,Ob as B,Qb as D,Rb as ne,Ua as T,Va as R,W as Y,Wb as oe,Xa as Z,Y as O,ab as _,cb as $,db as z,eb as C,ec as V,ga as k,gc as M,ha as F,hb as b,jb as ee,kb as te,lb as r,mb as a,qb as q,qc as se,rb as E,sa as L,sb as y,ta as g,tb as c,ub as A,v as X,vb as S}from"./chunk-QHJTF3V4.js";import{a as x,b as P}from"./chunk-7CGTOI24.js";var Ce=["treeContainer"],ve=["formRef"],be=[[["label"]],[["label"]],[["input"]]],xe=["label","label","input"],Pe=(n,t)=>t.id,Te=n=>({children:n,level:0}),ue=n=>({$implicit:n}),ye=(n,t)=>({children:n,level:t});function Se(n,t){if(n&1){let e=E();r(0,"spk-button-group")(1,"button",9),y("click",function(){k(e);let s=c();return F(s.pathDiscoveryMethod.set("browse"))}),m(2," Browser path "),a(),r(3,"button",9),y("click",function(){k(e);let s=c();return F(s.pathDiscoveryMethod.set("path"))}),m(4," Manually type path "),a()()}if(n&2){let e=c();d(),C("active",e.pathDiscoveryMethod()==="browse"),d(2),C("active",e.pathDiscoveryMethod()==="path")}}function we(n,t){n&1&&(r(0,"spk-icon",12),m(1,"folder-open"),a())}function ke(n,t){n&1&&(r(0,"spk-icon"),m(1,"file"),a())}function Fe(n,t){n&1&&(r(0,"spk-icon",12),m(1,"folder"),a())}function Me(n,t){if(n&1&&_(0,we,2,0,"spk-icon",12)(1,ke,2,0,"spk-icon")(2,Fe,2,0,"spk-icon",12),n&2){let e=c(2).$implicit;b(e.children.length?0:e.cls==="file"?1:2)}}function Ne(n,t){n&1&&(r(0,"spk-icon",12),m(1,"desktop-tower"),a())}function Oe(n,t){n&1&&q(0)}function Ee(n,t){if(n&1&&_(0,Oe,1,0,"ng-container",6),n&2){let e=c(2).$implicit,i=c().$implicit;c();let s=Q(6);$("ngTemplateOutlet",s)("ngTemplateOutletContext",D(5,ue,ne(2,ye,e.children,i.level+1)))}}function Ae(n,t){if(n&1){let e=E();r(0,"div",10,3),y("click",function(){k(e);let s=c().$implicit,l=c(2);return F(l.toggleNode(s.id,s))}),r(2,"div",11),_(3,Me,3,1)(4,Ne,2,0,"spk-icon",12),a(),r(5,"div",13),y("click",function(s){k(e);let l=c().$implicit,o=c(2);return F(o.toggleSelectedNode(s,l))}),m(6),a()(),_(7,Ee,1,7,"ng-container")}if(n&2){let e=c().$implicit;C("accepted",e.accepted===!0)("active",e.isSelected)("open",e.children.length)("usually-hidden",e.hidden),d(3),b(e.id!=="/"?3:4),d(3),U(" ",e.text," "),d(),b(e.children.length>0?7:-1)}}function Be(n,t){if(n&1&&_(0,Ae,8,11),n&2){let e=t.$implicit,i=c(2);b(e.hidden&&i._showHiddenNodes()||!e.hidden?0:-1)}}function De(n,t){if(n&1&&(r(0,"spk-list"),ee(1,Be,1,1,null,null,Pe),a()),n&2){let e=t.$implicit;z("padding-left",e.level*.5,"rem"),d(),te(e.children)}}function Ve(n,t){n&1&&q(0)}function Ie(n,t){if(n&1){let e=E();r(0,"spk-toggle",14),y("click",function(){k(e);let s=c();return F(s._showHiddenNodes.set(!s._showHiddenNodes()))}),m(1),a()}if(n&2){let e=c();C("active",e._showHiddenNodes()),d(),U(" Show hidden ",e.showFiles()?"files":"folders"," ")}}var G=class n{#t=Y(le);multiSelect=g(!1);disabled=g(!1);showFiles=g(!1);selectFiles=g(!1);accepts=g(null);startingPath=g(null);rootPath=g(void 0);backupSettings=g(null);showHiddenNodes=g(!1);includes=L();excludes=L();_showHiddenNodes=T(!1);showHiddenNodesEffect=M(()=>this._showHiddenNodes.set(this.showHiddenNodes()),{allowSignalWrites:!0});treeContainerRef=R("treeContainer");formRef=R("formRef");pathDiscoveryMethod=T("browse");isLoading=T(!1);currentPath=T("/");#e=T(null);treeSearchQuery=T("");treeNodes=T([]);isByBackupSettings=V(()=>this.rootPath()&&this.backupSettings()?.id&&this.backupSettings()?.time);searchableTreeNodes=V(()=>{let t=this.treeSearchQuery();return t?this.treeNodes().filter(e=>e.text?.toLowerCase().includes(t.toLowerCase())):this.treeNodes()});treeStructure=V(()=>{let t=this.searchableTreeNodes(),e=new Map,i=this.rootPath(),s=this.accepts(),l=i?{id:i,resolvedpath:i,text:i?.replaceAll("/",""),parentPath:"",children:[],isSelected:!1,cls:"folder"}:{id:"/",resolvedpath:"/",text:"Computer",parentPath:"",children:[],isSelected:!1};s&&(l.accepted=!0),e.set("/",l);for(let o of t){let p=o.id.replace(i??"","").split("/").filter(Boolean),u="",f=l;for(let N of p){if(u+="/"+N,!e.has(u)){let v={id:o.id,isSelected:o.isSelected,parentPath:u,resolvedpath:o.id?.startsWith("%")?o.resolvedpath+"/":u,hidden:o.hidden,text:o.text,cls:o.cls,children:[]};s&&(v.accepted=this.matchAccepts(s,v)),e.set(u,v),f.children.push(v)}f=e.get(u)}}return[l]});pathDiscoveryMethodEffect=M(()=>{let t=this.pathDiscoveryMethod(),e=this.#e();if(t==="browse"&&e)if(this.multiSelect()){let i=e.value.split("\0");this.treeNodes.update(s=>s.map(l=>P(x({},l),{isSelected:typeof l.id=="string"&&i.includes(l.id)})))}else this.treeNodes.update(i=>i.map(s=>P(x({},s),{isSelected:s.id===e.value})))},{allowSignalWrites:!0});matchAccepts(t,e){if(!t||e.cls==="folder"||e.id==="/")return!0;let i=t.split(",");if(i.length===0)return!0;let s="."+e.id.slice(e.id.indexOf("."));return s?i.some(l=>s.endsWith(l)):!1}#a(){let t=this.treeContainerRef()?.nativeElement.querySelectorAll(".active");t&&t.length>0&&t[0].scrollIntoView({behavior:"smooth",block:"center"})}currentPathEffect=M(()=>{let t=this.#e();t&&(t.value=this.currentPath(),t.dispatchEvent(new Event("input")))},{allowSignalWrites:!0});selectedPathsEffect=M(()=>{if(this.multiSelect()){let t=this.treeNodes().filter(o=>o.isSelected),e=this.treeNodes().filter(o=>!o.isSelected&&t.some(h=>o.id?.startsWith(h.id))),i=t.filter(o=>!t.some(h=>o.id!==h.id&&o.id?.startsWith(h.id))).map(o=>o.id),s=e.filter(o=>!e.some(h=>o.id!==h.id&&o.id?.startsWith(h.id))).map(o=>`-${o.id}`);this.excludes.emit(s);let l=[...i,...s];this.currentPath.set(l.join("\0"))}else{let t=this.treeNodes().find(i=>i.isSelected),e=t?.resolvedpath;this.currentPath.set(t?.id??"")}},{allowSignalWrites:!0});inputValueChangeAbortController=null;inputRefEffect=M(()=>{let t=this.formRef()?.nativeElement?.querySelector("input");t&&(this.#o(t),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,t.addEventListener("inputValueChanged",e=>{this.currentPath.set(e.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#e.set(t),t.autocomplete="off")},{allowSignalWrites:!0});ngOnInit(){let t=this.startingPath();t?(this.currentPath.set(t),this.#r(t)):this.#n(null,this.rootPath())}toggleSelectedNode(t,e){if(e.id==="/")return;if(t.stopPropagation(),this.selectFiles()&&e.cls==="folder"){this.toggleNode(e.id,e);return}this.accepts()&&!e.accepted||(this.multiSelect()?this.treeNodes.update(s=>s.map(l=>l.id?.startsWith(e.id)?P(x({},l),{isSelected:!e.isSelected}):l)):this.treeNodes.update(s=>s.map(l=>l.id===e.id?P(x({},l),{isSelected:!e.isSelected}):P(x({},l),{isSelected:!1}))))}toggleNode(t,e=null){e?.cls==="folder"&&(e?.children.length?this.treeNodes.update(i=>i.filter(s=>!s.id?.startsWith(e.id)||s.id===e.id)):this.#n(e,t))}#o(t){return Object.defineProperty(t,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(e){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,e),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:e}})),e}}),t}#s(t){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:t},onlyFolders:!this.showFiles()})}#l(t){let e=this.backupSettings(),i={id:e.id,time:e.time,prefixOnly:!1,folderContents:!0};return t&&(i.filter="@"+t),this.#t.getApiV1BackupByIdFiles(i)}#i(t){return this.isByBackupSettings()?this.#l(t):this.#s(t)}#r(t){let e=t.split("\0").filter(o=>o.startsWith("-")).map(o=>o.slice(1,-1)),i=t.split("\0").filter(o=>!o.startsWith("-")).filter(Boolean),s=i.map(o=>o.split("/").filter(Boolean)),l=[this.rootPath()??"/"];s.forEach(o=>{o.forEach((h,p)=>{let u=o.slice(0,p+1).join("/"),f=u.startsWith("%")?u:"/"+u;l.includes(f)||l.push(f)})}),this.isLoading.set(!0),X([...l.map(o=>this.#i(o))]).pipe(j(()=>this.isLoading.set(!1))).subscribe({next:o=>{this.treeNodes.update(h=>{let p=o.flatMap(f=>f.map(N=>{let v=N.id,W=v&&v.split("/").filter(Boolean).slice(0,-1).join("/"),H="/"+(v&&v.split("/").filter(Boolean).join("/")),he=i.findIndex(w=>this.multiSelect()?H.startsWith(w):H===w)>-1,ge=i.findIndex(w=>w===v)>-1,me=e.findIndex(w=>w===H)>-1;return P(x({},N),{parentPath:W.startsWith("%")?W:"/"+W,isSelected:he&&!me||ge})}));return[...new Map([...h,...p].map(f=>[f.resolvedpath??f.id,f])).values()]})}})}#n(t=null,e="/"){this.isLoading.set(!0),this.#i(e).pipe(j(()=>this.isLoading.set(!1))).subscribe({next:i=>{let s=this.isByBackupSettings()?i.Files.map(l=>({text:l.Path.split("/").filter(o=>o!=="").pop(),id:l.Path,cls:l.Path.endsWith("/")?"folder":"file",leaf:t!==null,resolvedpath:l.Path,hidden:!1})):i;this.treeNodes.update(l=>{let o=s.map(p=>{let u=p.id.startsWith("%")&&p.id.endsWith("%")||p.id.endsWith("/")?"folder":"file";return P(x({},p),{cls:u,parentPath:e,isSelected:(this.multiSelect()&&t?.isSelected)??!1})});return[...new Map([...l,...o].map(p=>[p.resolvedpath??p.id,p])).values()]})}})}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-file-tree"]],viewQuery:function(e,i){e&1&&(K(i.treeContainerRef,Ce,5),K(i.formRef,ve,5)),e&2&&ie(2)},hostVars:2,hostBindings:function(e,i){e&2&&C("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],selectFiles:[1,"selectFiles"],accepts:[1,"accepts"],startingPath:[1,"startingPath"],rootPath:[1,"rootPath"],backupSettings:[1,"backupSettings"],showHiddenNodes:[1,"showHiddenNodes"]},outputs:{includes:"includes",excludes:"excludes"},standalone:!0,features:[B],ngContentSelectors:xe,decls:14,vars:14,consts:[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],[1,"section"],[1,"browse-files"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"primary","raised","browse-files-toggle",3,"active"],[1,"form-field"],["type","button",3,"click"],["action","",3,"click"],[1,"icon"],[1,"spk-primary"],[1,"text",3,"click"],[1,"primary","raised","browse-files-toggle",3,"click"]],template:function(e,i){if(e&1&&(A(be),_(0,Se,5,4,"spk-button-group"),r(1,"div",4),S(2,0,["ngProjectAs","label",5,["label"]]),r(3,"div",5,0),_(5,De,3,2,"ng-template",null,1,oe)(7,Ve,1,0,"ng-container",6),a(),_(8,Ie,2,3,"spk-toggle",7),a(),r(9,"div",8,2)(11,"spk-form-field"),S(12,1,["ngProjectAs","label",5,["label"]]),S(13,2,["ngProjectAs","input",5,["input"]]),a()()),e&2){let s=Q(6);b(i.multiSelect()?-1:0),d(),C("hidden",i.pathDiscoveryMethod()!=="browse"),d(2),C("visualize-accepted",i.accepts()),d(4),$("ngTemplateOutlet",s)("ngTemplateOutletContext",D(12,ue,D(10,Te,i.treeStructure()))),d(),b(i.accepts()?-1:8),d(),C("hidden",i.pathDiscoveryMethod()!=="path")}},dependencies:[ae,pe,I,ce,de,se,re],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.form-field.hidden[_ngcontent-%COMP%]{display:none}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);overflow:auto;resize:vertical;background:var(--base-level-10)}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]:not(.accepted){opacity:.5}.browse-files.visualize-accepted[_ngcontent-%COMP%] [action].accepted[_ngcontent-%COMP%]{opacity:1}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-level-30);gap:.125rem;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%]{padding:0;gap:.25rem;border:1px solid transparent}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].active[_ngcontent-%COMP%]{border-color:var(--base-level-40)}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [action][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-level-60R)}.hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var We=[[["","title",""]],"*"],He=["[title]","*"];function je(n,t){n&1&&m(0,"Title")}function Le(n,t){n&1&&(r(0,"spk-icon"),m(1,"caret-down"),a())}var J=class n{isActive=Z(!1);disallowToggle=g(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=O({type:n,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(e,i){e&2&&C("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},standalone:!0,features:[B],ngContentSelectors:He,decls:6,vars:1,consts:[[3,"click"],[1,"content"]],template:function(e,i){e&1&&(A(We),r(0,"h3",0),y("click",function(){return i.disallowToggle()||i.toggle()}),S(1,0,null,je,1,0),_(3,Le,2,0,"spk-icon"),a(),r(4,"div",1),S(5,1),a()),e&2&&(d(3),b(i.disallowToggle()?-1:3))},dependencies:[I],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-level-20)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);padding:1rem;cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}.content[_ngcontent-%COMP%]:empty{display:none}"],changeDetection:0})};export{G as a,J as b};
|
package/main-KQJXLVHZ.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-SFRGISK2.js";import{a as w}from"./chunk-Q76L4VLC.js";import{a as S}from"./chunk-VC4GI7EV.js";import{b as oe}from"./chunk-6GOAPINI.js";import{c as te}from"./chunk-IEVRQDB6.js";import{a as _,b as Z,c as R,f as Q,g as X}from"./chunk-22ZYSOTR.js";import{a as q}from"./chunk-JNQHJPEL.js";import{d as Y}from"./chunk-LZSE733H.js";import{Ac as G,Bc as z,Cc as B,E as C,J as L,L as j,N as P,Ob as U,Q as h,T as W,Ua as c,W as s,Y as F,ac as D,d as x,gc as J,m as A,nb as H,x as V,xc as K,y as E,yc as $}from"./chunk-QHJTF3V4.js";import"./chunk-7CGTOI24.js";var ne={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var m=new W("ENVIRONMENT");var I=class o{#o=s(Y);isLoaded=c(!1);webmodules=c(null);preload(e=!1){let t=this.#o.getApiV1Webmodules().pipe(P(n=>this.webmodules.set(n)),C(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=h({token:o,factory:o.\u0275fac,providedIn:"root"})};var re=[{path:"",children:[{path:"login",canActivate:[()=>s(w).token()!==null?s(R).navigate(["/"]):!0],loadComponent:()=>import("./chunk-BHQV6I5A.js")},{path:"logout",loadComponent:()=>import("./chunk-XDYHN4IQ.js")},{path:"",canActivate:[()=>V(s(ee).preload(!0),s(I).preload(!0))],loadComponent:()=>import("./chunk-37USSSCL.js"),children:[{path:"",loadComponent:()=>import("./chunk-OVWWCW76.js")},{path:"add-backup",loadComponent:()=>import("./chunk-VUEDXCG5.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-XGBLG5PU.js")},{path:"backup/import",loadComponent:()=>import("./chunk-VOS5UL4W.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-RWFWLGB7.js"),loadChildren:()=>import("./chunk-6RIA76HG.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-RWFWLGB7.js"),loadChildren:()=>import("./chunk-6RIA76HG.js")},{path:"restore",loadComponent:()=>import("./chunk-WSTPDNCJ.js")},{path:"restore-flow/:id",loadComponent:()=>import("./chunk-IXLTPP72.js"),children:[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"select-files",loadComponent:()=>import("./chunk-ORCLDJSO.js")},{path:"options",loadComponent:()=>import("./chunk-C6XNKGG2.js")}]},{path:"settings",loadComponent:()=>import("./chunk-CLHK3WG3.js")},{path:"about",loadComponent:()=>import("./chunk-CLPPNSLN.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-EEZT434V.js")},{path:"changelog",loadComponent:()=>import("./chunk-ICNC6KVB.js")},{path:"libraries",loadComponent:()=>import("./chunk-Z7GRCDAT.js")},{path:"system-info",loadComponent:()=>import("./chunk-ZPJ6YV7Y.js")},{path:"logs",loadComponent:()=>import("./chunk-TKY4PPEK.js")}]}]}]}];var M=null,se=(o,e)=>{let t=s(w),n=s(R),p=s(m),i=s(te),l=o;return t.token()&&o.url.startsWith(p.baseUrl)&&(l=o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)})),e(l).pipe(E(r=>{if(i.error(r.message),r.status===401&&!M&&(M=t.refreshToken().pipe(L())),r.status===401)return M.pipe(j(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))),E(g=>(n.navigate(["/logout"]),A(()=>g))),C(()=>M=null));let a=`Error Code: ${r.status}, Message: ${r.message}`;return A(()=>({error:r,message:a}))}))};var ce="1.0.0",ie="portal-proxy-client",le=1,T=class o{#o=1e3;#n=s(m);#e=c("disconnected");#l=c(this.#o);#i=c(!1);#r=c(!1);#a=c(null);isConnectedToMachineServer=this.#r.asReadonly();wsState=this.#e.asReadonly();#p=[];#s={};#t=null;#m=new TextDecoder("utf-8");#c=null;#d=J(()=>{let e=this.#i(),t=this.#l(),n=this.#a();if(!n||!e||!t||t<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),p=>p.charCodeAt(0)),n=this.#m.decode(t);return n?JSON.parse(n):null}connectToMachineServer(e,t){let n=t?.reconnect??!1;this.#t&&this.wsState()==="authenticated"&&!n||(this.#t&&this.wsState()!=="authenticated"&&this.#t.close(),this.#t=new WebSocket(this.#n.machineServerUrl),this.#t.onopen=()=>{this.#e.set("connect"),this.#r.set(!0),this.#i.set(!1),this.#a.set(null)},this.#t.onclose=()=>{this.#e.set("disconnected"),this.#r.set(!1),this.#a.set(e),this.#i.set(!0)},this.#t.onerror=()=>{this.#e.set("error")},this.#t.onmessage=p=>{let i=JSON.parse(p.data);if(this.wsState()==="connect"){if(i.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${i.type}'`);return}let r={token:e,publicKey:"",clientVersion:ce,protocolVersion:le},a=this.createResponse(i,"authportal",r);this.#e.set("welcome"),this.#t?.send(a)}else if(this.wsState()==="welcome"){if(i.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${i.type}'`);return}var l=JSON.parse(i.payload??"");if(l.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#e.set("authenticated"),this.#r.set(!0);this.#p.length>0;){let r=this.#p.pop();r&&this.#s[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(i.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${i.type}'`);return}let r=this.#s[i.messageId];if(r){if(i.errorMessage){r.reject(i.errorMessage);return}else{let a=JSON.parse(i.payload??"");a.body=a?.body==null?null:this.utf8Atob(a.body),r.resolve(a)}delete this.#s[i.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#t?.close(),this.#t=null,this.#e.set("disconnected"),this.#r.set(!1)}createResponse(e,t,n){let p={from:ie,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(p)}sendCommand(e,t,n,p,i,l,r=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((a,g)=>{let d=crypto.randomUUID(),y={from:ie,to:t,type:"command",messageId:d,payload:JSON.stringify({method:n,path:p,body:i,headers:l})},b={resolve:a,reject:g,timer:window.setTimeout(()=>{let v=this.#s[d];v&&(delete this.#s[d],v.reject("Timeout"))},r)};this.#s[d]=b,this.#r()?this.activateCommand(y):this.#p.push(y)})}activateCommand(e){this.#t?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=h({token:o,factory:o.\u0275fac,providedIn:"root"})};var f=class o{#o=c(null);config=this.#o.asReadonly();parentIframeListner=null;parentOrigin="*";fetchConfig(){this.#e(),this.parentIframeListner=new AbortController,this.#n("connected"),window.addEventListener("message",e=>{if(e.data.startsWith("access:")){let t=e.data.replace("access:",""),n=JSON.parse(t);if(!n?.accessToken||!n?.clientId){this.#n("error:invalid-config");return}if(typeof n.clientId!="string"){this.#n("error:invalid-config");return}if(typeof n.accessToken!="string"){this.#n("error:invalid-config");return}console.info("postMessage config set"),this.#o.set(n)}},{signal:this.parentIframeListner.signal})}#n(e){window.parent.postMessage(e,"*")}#e(){this.parentIframeListner&&(this.parentIframeListner.abort(),this.parentIframeListner=null)}setConfig(e){this.#o.set(e)}clearConfig(){this.#o.set(null)}static \u0275fac=function(t){return new(t||o)};static \u0275prov=h({token:o,factory:o.\u0275fac,providedIn:"root"})};function me(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}var ae=(o,e)=>{let n=s(f).config(),p=s(m);if(n===null)return e(o);let i=s(T),l=me(o.body),r={};o.headers.keys().forEach(u=>{r[u]=o.headers.get(u)??""});let a=o.headers.get("timeout"),g=a!==null?parseInt(a):p.defaultTimeout,d=i.sendCommand(n.accessToken,n.clientId,o.method,o.url,l,r,g);return new x(u=>{d.then(y=>{let b=new K;r!=null&&Object.keys(r).forEach(N=>{b.set(N,r[N])});let v=new $({body:y.body,status:y.code,statusText:"OK",headers:b});u.next(v),u.complete()})})};var pe={providers:[D(),Q(re,X()),G(B(),z([ae,se])),S,{provide:m,useValue:ne},oe]};var k=class o{#o=s(S);#n=s(_);#e=s(f);sub=null;ngOnInit(){this.#e.fetchConfig(),this.sub=this.#n.queryParams.subscribe(({accessToken:e,clientId:t})=>{e?.length&&t?.length&&this.#e.setConfig({accessToken:e,clientId:t})}),this.#o.clearAllNotCurrentVersion()}ngOnDestroy(){this.sub?.unsubscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=F({type:o,selectors:[["app-root"]],standalone:!0,features:[U],decls:1,vars:0,template:function(t,n){t&1&&H(0,"router-outlet")},dependencies:[Z],encapsulation:2})};q(k,pe).catch(o=>console.error(o));
|