PageSourceSearch

https://app.appspector.com/assets/FilesystemRoot-1ad6af57.js

js appspector.com collected 2026-10-03 22:53:23 UTC 15,706 bytes, 251 lines download raw bytes

1import{s as u,d as p,aE as ee,T as te,B as ne,c8 as ge,aM as be,j as d,b as n,bD as ie,d7 as g,d8 as T,u as h,d9 as z,da as W,db as w,dc as K,n as xe,dd as V,de as Z,df as L,dg as oe,dh as re,di as Ce,O as B,aJ as we,L as Fe,aT as ke,dj as De,dk as q,aF as M,aG as G,aV as se,F,bw as J,dl as N,dm as Q,dn as ve,dp as X,ag as Se}from"./index-b179d21e.js";import{aq as Ie,d as a,h as I,ar as $e,as as Ee,at as Re,au as O,av as Pe,K as je}from"./vendor-89022aa0.js";import{s as Y}from"./file-saver-a141e6dc.js";import{T as Te}from"./TreeTable-882cc94e.js";import{C as U}from"./VirtualizedTable-7d72b847.js";import{S as Be}from"./splitPane-70368097.js";import"./noData-3dcce79c.js";import"./AutoSizer-def83ec3.js";var ae={exports:{}};(function(e,t){(function(o){e.exports=o()})(function(){return function(i,r){if(r||(r={}),!i)return"";var s=(/[^./\\]*$/.exec(i)||[""])[0];return r.preserveCase?s:s.toLowerCase()}})})(ae);var Ne=ae.exports;const ze=Ie(Ne),Le=u`
2  position: relative;
3  width: 552px;
4  display: flex;
5  flex-direction: column;
6  align-items: center;
7`,qe=u`
8  font-size: 24px;
9  font-weight: bold;
10  line-height: 1.5;
11  color: ${e=>e.theme.colors.title};
12  margin-top: 15px;
13`,Oe=p(ee)`
14  width: 100%;
15  height: 52px;
16`,Ue=p(te).attrs({buttonStyle:ne.ACTION})`
17  width: 100%;
18  height: 52px;
19  margin-top: 30px;
20`,He=ge`
21  text-align: left;
22  margin-top: 30px;
23  word-break: break-all;
24`,Me=e=>{const[t,o]=a.useState(""),i=a.useCallback(c=>{o(c.target.value)},[]),r=a.useCallback(()=>{t.length>0&&(e.onSubmit(t),e.resolve({source:"submit"}))},[t]),s=a.useCallback(c=>{c.keyCode===13&&r()},[r]);return d(Le,{children:[n(qe,{children:"Create new directory"}),d(He,{children:["Create new directory in ",e.selectedPath]}),n(Oe,{focusOnMount:!0,placeholder:"Enter directory name",value:t,textInputStyle:ie.DEFAULT,onChange:i,onKeyDown:s}),n(Ue,{disabled:t.length===0,onClick:r,children:"Create"})]})},Ge=(e,t)=>be(Me,{contentProps:{onSubmit:e,selectedPath:t}}),le=(e,t)=>e.length===0?"/":g(e,`${t.join(".children.")}.data.path`),Ae=e=>{const t=I(T),o=h(z),i=a.useCallback(()=>{if(!e)return;const r=g(t,`${e.join(".children.")}.data`);if(r.content){Y(new Blob([r.content]),r.name);return}const s=r.path;o.send(new z(s,e))},[t,e]);return a.useEffect(()=>{if(!o.result)return;const r=g(t,`${e&&e.join(".children.")}.data.name`);Y(new Blob([o.result.content]),r)},[o.result]),{saveFileCallback:i,isSaveFileActive:o.isActive}},We=(e,t)=>{const o=h(z),i=h(W);return{loadFileContent:a.useCallback(async()=>{if(!t)return;const s=g(e,`${t.join(".children.")}.data`);if(s.content)return;const c=s.path,l=await o.send(new z(c,t));l&&i.send(new W(t,l.content))},[t])}},Ke=()=>{const e=I(T),t=h(w);return{handleDisclosureClick:a.useCallback(i=>{if(!i)return;const r=g(e,i.join(".children.")),s=r.data.directory,c=r.children.length>0;if(!s||c)return;const l=le(e,i);t.send(new w(l,i))},[e])}},Ve=e=>{const t=I(T),o=h(w);return{handleRefresh:a.useCallback(()=>{const r=g(t,`${e.join(".children.")}.data.path`);o.send(new w(r,e))},[e])}},Ze=(e,t)=>{const o=I(T),i=h(K);return{deleteItem:a.useCallback(async()=>{if(!e)return;const s=g(o,`${e.join(".children.")}.data.path`);xe(`Do you really want to delete ${s}?`,()=>{i.send(new K(s,e)),t(null)})},[o,e]),isDeleteItemActive:i.isActive}},Je=()=>{const[e,t]=a.useState(null),o=a.useCallback(i=>{if(!i){t(null);return}if(e&&e.join(":")===i.join(":")){t(null);return}t(i)},[e]);return{selectedNodeAddress:e,setSelectedNodeAddress:o}},Qe=(e,t)=>{const o=a.useRef(null),i=h(V),r=h(w),s=t?g(e,`${t.join(".children.")}`):null,c=h(Z),[l,f]=a.useState(null),y=a.useCallback(m=>{const $=new FileReader;$.readAsArrayBuffer(m),$.onload=async k=>{if(!k.target)return;const{result:D}=k.target;
24if(!D||typeof D=="string"||!s)return;const{path:C}=s.data,E=t||[0];await i.send(new V(`${C}/${m.name}`,E,new Uint8Array(D))),r.send(new w(C,E))}},[s]);a.useEffect(()=>{if(l){if(l.size>5242880){c.send(new Z("File is too large. 5MB is max allowed size"));return}y(l)}},[l]);const b=a.useCallback(m=>{f(m.target.files[0])},[]),x=a.useCallback(()=>{o&&o.current&&o.current.click()},[]);return{fileInputRef:o,fileData:l,setFileData:b,triggerUpload:x,isFileUploadActive:i.isActive}},Xe=(e,t)=>{const o=h(L),i=h(w),r=t?g(e,`${t.join(".children.")}.data.path`):"/",s=a.useCallback(async l=>{if(!t){await o.send(new L(`/${l}`,[0]));return}await o.send(new L(r+`/${l}`,t)),i.send(new w(r,t))},[t]),c=a.useCallback(()=>{Ge(s,r)},[s]);return{onCreateFolderSubmit:s,showCreateFolderDialog:c,isCreateFolderActive:o.isActive}},Ye=(e,t,o)=>({requestCalculateFolderSize:a.useCallback(()=>{t&&o.send(new oe(e,t))},[t])}),_e=(e,t,o,i)=>{const[r,s]=a.useState(t),[c,l]=a.useState(!1),f=a.useCallback(m=>{m.target.value&&s(m.target.value)},[]),y=a.useCallback(()=>{l(!c)},[c]),b=a.useCallback(async()=>{o&&r!==t&&await i.send(new re(e,o,r))},[o,r,t]),x=m=>{m.keyCode===13?b():m.keyCode===27&&y()};return a.useEffect(()=>{l(!1),s(t)},[o,t]),a.useEffect(()=>{i.isFinished&&l(!1)},[i]),{isEditing:c,newName:r,onInputChange:f,toggleEdit:y,handleKeysPress:x,renameItemRequest:b}};var et="[object Number]";function ce(e){return typeof e=="number"||$e(e)&&Ee(e)==et}const tt=u`
25  display: flex;
26  align-items: center;
27`,nt=Ce`
28  50% {
29    opacity: 0.3;
30  }
31`,it=p(B)`
32  margin-right: ${({theme:e})=>e.indent.xs}px;
33  color: #6ecefa;
34`,ot=p(B)`
35  margin-right: ${({theme:e})=>e.indent.xs}px;
36  color: #9e9ea5;
37  animation: ${nt} 1.5s ease-in-out 0s infinite;
38`,rt=u`
39  height: calc(100vh - 70px);
40  display: flex;
41  flex-flow: column nowrap;
42  flex: auto;
43`,st=u`
44  border-left: 1px solid ${({theme:e})=>e.colors.border};
45  min-height: calc(100vh - 70px);
46`,at=u`
47  padding: 20px 32px;
48  width: 100%;
49  height: 296px;
50  display: flex;
51  justify-content: center;
52  align-items: center;
53`,lt=p(ee)`
54  height: 24px;
55  flex: 1;
56  margin-right: 4px;
57  display: flex;
58  align-items: center;
59`,ct=we`
60  max-width: 100%;
61  max-height: 100%;
62`,de=u`
63  height: 32px;
64  font-weight: bold;
65  font-size: 14px;
66  line-height: 30px;
67  color: ${({theme:e})=>e.colors.title};
68  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
69  border-top: 1px solid ${({theme:e})=>e.colors.border};
70  background-color: ${({theme:e})=>e.colors.darkGreySidebar};
71  padding: 0 ${({theme:e})=>e.indent.s}px;
72`,v=u`
73  height: 32px;
74  display: flex;
75  line-height: 30px;
76  border-bottom: 1px solid ${({theme:e})=>e.colors.border};
77  border-top: 1px solid ${({theme:e})=>e.colors.border};
78`,R=u`
79  width: 150px;
80  text-align: right;
81  color: ${({theme:e})=>e.colors.body};
82`,S=u`
83  padding: 0 ${({theme:e})=>e.indent.s}px;
84  text-align: left;
85  color: ${({theme:e})=>e.colors.title};
86  max-width: ${e=>e.maxWidth?`${e.maxWidth}px`:"375px"};
87  overflow-x: hidden;
88  word-break: break-all;
89  word-wrap: break-word;
90  white-space: nowrap;
91  text-overflow: ellipsis;
92`,dt=p(S)`
93  overflow: visible;
94  flex: 1;
95`,ut=p(B)`
96  width: 20px;
97  height: 20px;
98  margin-left: 4px;
99`,ht=u`
100  display: flex;
101  align-items: center;
102  flex: 1;
103  justify-content: start;
104
105  &:hover {
106    cursor: pointer;
107  }
108`,mt=u`
109  ${v}:nth-child(2n) {
110    background-color: rgba(75, 77, 91, 0.3);
111  }
112`,ft=u`
113  display: flex;
114  flex-wrap: wrap;
115  justify-content: space-between;
116  padding: ${({theme:e})=>e.indent.s}px;
117  min-height: 70px;
118  align-items: center;
119  background: ${e=>e.theme.colors.background};
120  border-bottom: 1px solid ${e=>e.theme.colors.border};
121`,j=p(te)`
122  width: 72px;
123  height: 36px;
124  margin-left: ${({theme:e})=>e.indent.s}px;
125`,pt=p(j)`
126  width: 36px;
127  padding: 0;
128  margin-left: ${({theme:e})=>e.indent.s}px;
129`,_=u`
130  display: flex;
131`,P=p(B)`
132  width: 22px;
133  height: 22px;
134`,yt=u`
135  display: flex;
136  flex: 1;
137  justify-content: space-between;
138  align-items: center;
139`,A=p(Fe).attrs({buttonStyle:ne.LINK})`
140  height: 30px;
141  font-size: 14px;
142  left: -11px;
143`,gt=p(A)`
144  color: ${({theme:e})=>e.colors.body};
145  &:hover:enabled {
146    color: ${({theme:e})=>ke(e.colors.body,.5)};
147  }
148`,bt=u`
149  display: flex;
150  justify-content: space-between;
151`,xt=u`
152  & {
153    font-size: 10px;
154    text-indent: -9999em;
155    width: 24px;
156    height: 24px;
157    border-radius: 50%;
158    background: conic-gradient(
159      from 0.25turn,
160      ${e=>e.theme.colors.darkGreySidebar},
161      ${e=>e.theme.colors.accent}
162    );
163    position: relative;
164    animation: load3 1.4s infinite linear;
165    transform: translateZ(0);
166  }
167  &:before {
168    width: 50%;
169    height: 50%;
170    border-radius: 100% 0 0 0;
171    position: absolute;
172    top: 0;
173    left: 0;
174    content: "";
175  }
176  &:after {
177    background: #333340;
178    width: 75%;
179    height: 75%;
180    border-radius: 50%;
181    content: "";
182    margin: auto;
183    position: absolute;
184    top: 0;
185    left: 0;
186    bottom: 0;
187    right: 0;
188  }
189  @-webkit-keyframes load3 {
190    0% {
191      -webkit-transform: rotate(0deg);
192      transform: rotate(0deg);
193    }
194    100% {
195      -webkit-transform: rotate(360deg);
196      transform: rotate(360deg);
197    }
198  }
199  @keyframes load3 {
200    0% {
201      -webkit-transform: rotate(0deg);
202      transform: rotate(0deg);
203    }
204    100% {
205      -webkit-transform: rotate(360deg);
206      transform: rotate(360deg);
207    }
208  }
209`,Ct=e=>{const{rowData:t}=e,o=!!t.data.directory,i=!!t.data.isLoading;return d(tt,{children:[n(i?ot:it,{width:24,height:24,icon:o?"folder-filled":"file-icon"}),`${t.data.name}`]})},wt=({rowData:e})=>e.data.modifiedDate&&M(e.data.modifiedDate,{format:G.DateShort}),Ft=({rowData:e})=>{const{data:{size:t}}=e;return ce(t)&&t>=0?se(t):null},kt=({data:e,onNodeClick:t,onNodeDisclosureClick:o,selectedNodeAddress:i})=>{const r=I(De),s=h(q),c=a.useCallback(l=>{o(l);const f=l.join(":");r.includes(f)?s.send(new q(r.filter(y=>f!==y))):s.send(new q([...r,f]))},[r,o]);return n(rt,{children:d(Te,{data:e,expandedNodes:r,onNodeClick:t,onNodeDisclosureClick:c,selectedNode:i||void 0,selectable:!0,children:[n(U,{id:"name",title:"NAME",cellRenderer:Ct,minWidth:370,sortable:!1,resizable:!0}),n(U,{id:"modified",title:"MODIFIED",cellRenderer:wt,minWidth:140,width:140,sortable:!1}),n(U,{id:"size",title:"SIZE",cellRenderer:Ft,minWidth:140,width:140,sortable:!1})]})})},Dt=kt,ue=({selectedNode:e,selectedNodeAddress:t,directoryPath:o})=>{const{name:i,createdDate:r,modifiedDate:s,permissions:c,size:l,path:f}=e.data,y=h(oe),{requestCalculateFolderSize:b}=Ye(f,t,y),x=h(re),{isEditing:m,renameItemRequest:$,newName:k,onInputChange:D,toggleEdit:C,handleKeysPress:E}
209=_e(f,i,t,x);return d(mt,{children:[d(v,{children:[n(R,{children:"Name:"}),n(ht,{children:m?d(F,{children:[n(dt,{children:n(lt,{focusOnMount:!0,placeholder:i,value:k,textInputStyle:ie.DEFAULT,onChange:D,onKeyDown:E})}),n(A,{disabled:k===i,pipe:x,progressTitle:"Renaming...",onClick:$,children:"Rename"}),n(gt,{onClick:C,children:"Cancel"})]}):d(F,{children:[n(S,{onClick:C,maxWidth:350,children:i}),n(ut,{onClick:C,icon:"edit"})]})})]}),d(v,{children:[n(J,{}),n(R,{children:"Directory:"}),n(S,{"data-tip":o,onMouseEnter:J.tooltipShow,children:o})]}),d(v,{children:[n(R,{children:"Created:"}),n(S,{children:r&&M(r,{format:G.DateTime})})]}),d(v,{children:[n(R,{children:"Modified:"}),n(S,{children:s&&M(s,{format:G.DateTime})})]}),d(v,{children:[n(R,{children:"Permissions:"}),n(S,{children:c})]}),d(v,{children:[n(R,{children:"Size:"}),n(S,{children:ce(l)&&l>=0?se(l):n(A,{pipe:y,progressTitle:"Calculating size...",onClick:b,children:"Calculate"})})]})]})},vt=e=>d(F,{children:[n(de,{children:"Directory properties"}),n(ue,{selectedNode:e.selectedNode,selectedNodeAddress:e.selectedNodeAddress,directoryPath:e.directoryPath})]}),St=e=>{const[t,o]=a.useState(""),{content:i}=e.selectedNode.data,r=a.useCallback(async s=>{if(!s)return;const c=await Re.fromBuffer(s),l=new Blob([s],{type:c&&c.mime});return(window.URL||window.webkitURL).createObjectURL(l)},[i]);return a.useEffect(()=>{r(i).then(s=>s&&o(s))},[i]),d(F,{children:[n(at,{children:t?n(ct,{src:t,alt:"Preview"}):n(B,{width:"100%",height:"100%",icon:"file-icon"})}),n(de,{children:"File properties"}),n(ue,{selectedNode:e.selectedNode,selectedNodeAddress:e.selectedNodeAddress,directoryPath:e.directoryPath})]})},It=({selectedNode:e,selectedNodeAddress:t,directoryPath:o})=>{const i=e.data.directory?vt:St;return n(st,{children:n(i,{selectedNode:e,selectedNodeAddress:t,directoryPath:o})})},$t=It,Et=e=>n(ft,{children:d(yt,{children:[n(_,{children:e.isDirectory&&d(F,{children:[n(j,{onClick:e.uploadItem,children:n(P,{icon:"upload"})}),n(j,{onClick:e.createFolder,children:n(P,{icon:"create-folder"})}),n(j,{onClick:e.refreshDirectory,children:n(P,{icon:"resend"})})]})}),n(_,{children:e.isNodeSelected&&d(F,{children:[!e.isDirectory&&n(j,{onClick:e.saveFile,children:n(P,{icon:"save-big"})}),n(j,{onClick:e.deleteItem,children:n(P,{icon:"delete"})}),n(pt,{onClick:e.closeSidebar,children:n(P,{icon:"show-sidebar"})})]})})]})}),Rt=Et,Pt=e=>{switch(e){case"Error":return N`
210        background-color: ${t=>t.theme.colors.accent};
211      `;case"Success":return N`
212        background-color: ${t=>t.theme.colors.darkGreySidebar};
213      `;case"Loading":return N`
214        background-color: ${t=>t.theme.colors.darkGreySidebar};
215      `;default:return N`
216        background-color: ${t=>t.theme.colors.accent};
217      `}},he=u`
218  position: relative;
219  z-index: 9999;
220  margin-right: 22px;
221  margin-bottom: 22px;
222  min-width: 240px;
223  min-height: 48px;
224  border-radius: 5px;
225  padding: 14px;
226  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
227  color: ${e=>e.theme.colors.title};
228  ${e=>Pt(e.type)};
229`,jt=u`
230  position: absolute;
231  right: 0;
232  top: 0;
233  bottom: 0;
234  left: auto;
235  width: calc(100% - 322px); /* 322 = sidebar(300) + padding(22) */
236  display: flex;
237  flex-direction: column;
238  align-items: flex-end;
239  justify-content: flex-end;
240`,Tt=e=>{const t=h(Q);a.useEffect(()=>{const o=setTimeout(()=>{t.send(new Q(e))},5e3);return()=>{clearTimeout(o)}},[e])},H=e=>n(he,{type:"Loading",children:d(bt,{children:[e.children,n(xt,{})]})}),Bt=e=>(Tt(e.id),n(he,{type:"Error",children:e.message})),Nt=e=>d(jt,{children:[e.isSaveFileActive&&n(H,{children:"Saving file..."}),e.isFileUploadActive&&n(H,{children:"Uploading file..."}),e.isCreatingFolder&&n(H,{children:"Creating directory..."}),e.errors.map(t=>n(Bt,{id:t.id,message:t.message},t.id))]}),zt=p(Be)`
241  display: flex;
242  &&& {
243    height: calc(100vh - 70px) !important;
244  }
245
246  .Pane2 {
247    min-width: 0;
248    max-width: 540px;
249    overflow-y: auto;
250  }
251`,Lt=e=>n("input",{id:"file",type:"file",ref:e.fileInputRef,onChange:e.onChange,hidden:!0},je()),Kt=()=>{const e=I(T),t=I(ve),o=h(X),{selectedNodeAddress:i,setSelectedNodeAddress:r}=Je(),{saveFileCallback:s,isSaveFileActive:c}=Ae(i),{handleDisclosureClick:l}=Ke(),{deleteItem:f,isDeleteItemActive:y}=Ze(i,r),{handleRefresh:b}=Ve(i),{fileInputRef:x,fileData:m,setFileData:$,triggerUpload:k,isFileUploadActive:D}=Qe(e,i),{showCreateFolderDialog:C,isCreateFolderActive:E}
251=Xe(e,i),{loadFileContent:me}=We(e,i),fe=a.useCallback(()=>{c||y||r(null)},[]);return a.useEffect(()=>{e.length===0&&o.send(new X)},[]),a.useEffect(()=>{if(!i)return;const pe=O(e,`${i.join(".children.")}.data.name`),ye=ze(pe);["jpg","jpeg","png","gif"].includes(ye)&&me()},[i]),d(F,{children:[n(Lt,{value:m,fileInputRef:x,onChange:$}),n(Nt,{isSaveFileActive:c,isFileUploadActive:D,isCreatingFolder:E,errors:t}),o.isActive?Se():d(F,{children:[n(Rt,{isNodeSelected:Pe(i),isDirectory:O(e,`${i&&i.join(".children.")}.data.directory`),closeSidebar:fe,uploadItem:k,deleteItem:f,saveFile:s,createFolder:C,refreshDirectory:b}),d(zt,{split:"vertical",defaultSize:i?"calc(100% - 540px)":"100%",children:[n(Dt,{data:e,onNodeClick:r,onNodeDisclosureClick:l,selectedNodeAddress:i}),i?n($t,{selectedNodeAddress:i,selectedNode:O(e,i.join(".children.")),directoryPath:le(e,i)}):n("div",{})]})]})]})};export{Kt as FilesystemRoot};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.