@ehfuse/file-viewer 0.2.0 → 0.2.2

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.
@@ -11,5 +11,5 @@ export interface FileTypeIconProps {
11
11
  mime?: string;
12
12
  size?: number;
13
13
  }
14
- /** 파일명/MIME 으로 종류를 정해 아이콘을 그린다. */
14
+ /** 파일명/MIME 으로 종류를 정해 아이콘을 그린다(압축 파일은 뷰어 타입이 없어 확장자로 따로 본다). */
15
15
  export declare function FileTypeIcon({ fileName, mime, size }: FileTypeIconProps): ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
@@ -0,0 +1,2 @@
1
+ import type React from "react";
2
+ export declare function ZipIcon(props: React.SVGProps<SVGSVGElement>): React.JSX.Element;
@@ -1,4 +1,5 @@
1
1
  export { ImageIcon } from "./ImageIcon";
2
2
  export { PdfIcon } from "./PdfIcon";
3
3
  export { HtmlIcon } from "./HtmlIcon";
4
+ export { ZipIcon } from "./ZipIcon";
4
5
  export { FileTypeIcon, getFileTypeIcon, type FileTypeIconProps } from "./FileTypeIcon";
package/dist/icons.esm.js CHANGED
@@ -1 +1 @@
1
- import{jsx as o,jsxs as m}from"react/jsx-runtime";function l(t){return m("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:t.width||"22px",...t,children:[o("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),o("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),o("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),o("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),m("g",{children:[o("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),o("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}import{jsx as c,jsxs as p}from"react/jsx-runtime";function n(t){return c("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:t.width||"28px",...t,children:p("g",{children:[c("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),c("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),p("g",{children:[p("g",{children:[c("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),c("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),c("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),c("g",{children:c("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),c("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),c("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),c("g",{children:c("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}import{jsx as h}from"react/jsx-runtime";function a(t){return h("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:t.width||"22px",fill:t.fill||"#E91E63",...t,children:h("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}import u from"@mui/icons-material/TextSnippet";import v from"@mui/icons-material/VideoFile";import w from"@mui/icons-material/AudioFile";import y from"@mui/icons-material/Description";import F from"@mui/icons-material/InsertDriveFile";import V from"@mui/icons-material/Code";import I from"@mui/icons-material/TableView";var d=t=>{let e=t.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(e)?"image":e==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(e)?"text":["csv","xls","xlsx"].includes(e)?"spreadsheet":["html","htm"].includes(e)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(e)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(e)?"video":["mp3","wav","ogg","m4a","aac"].includes(e)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(e)?"office":"unsupported"},x=t=>{let e=(t||"").toLowerCase().split(";")[0].trim();return e?e.startsWith("image/")?"image":e==="application/pdf"?"pdf":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":e==="text/html"?"html":e==="text/csv"||e==="application/vnd.ms-excel"||e==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":e.startsWith("text/")||e==="application/json"||e==="application/xml"?"text":"unsupported":"unsupported"},f=(t,e)=>{let i=d(t);return i!=="unsupported"?i:x(e)};import{jsx as s}from"react/jsx-runtime";function g(t,e=22){let i=`${e}px`,r={fontSize:e};switch(t){case"image":return s(l,{width:i,height:i});case"pdf":return s(n,{width:i,height:i});case"html":return s(a,{width:i,height:i});case"text":return s(u,{sx:{...r,color:"#66BB6A"}});case"spreadsheet":return s(I,{sx:{...r,color:"#4CAF50"}});case"code":return s(V,{sx:{...r,color:"#2196F3"}});case"video":return s(v,{sx:{...r,color:"#AB47BC"}});case"audio":return s(w,{sx:{...r,color:"#FF7043"}});case"office":return s(y,{sx:{...r,color:"#FFA726"}});default:return s(F,{sx:{...r,color:"#78909C"}})}}function M({fileName:t,mime:e,size:i=22}){return g(f(t,e??""),i)}export{M as FileTypeIcon,a as HtmlIcon,l as ImageIcon,n as PdfIcon,g as getFileTypeIcon};
1
+ import{jsx as l,jsxs as d}from"react/jsx-runtime";function p(t){return d("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:t.width||"22px",...t,children:[l("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),l("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),l("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),l("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),d("g",{children:[l("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),l("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}import{jsx as i,jsxs as n}from"react/jsx-runtime";function a(t){return i("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:t.width||"28px",...t,children:n("g",{children:[i("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),i("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),n("g",{children:[n("g",{children:[i("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),i("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),i("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),i("g",{children:i("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),i("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),i("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),i("g",{children:i("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}import{jsx as f}from"react/jsx-runtime";function h(t){return f("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:t.width||"22px",fill:t.fill||"#E91E63",...t,children:f("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}import{jsx as o,jsxs as v}from"react/jsx-runtime";function m(t){return v("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:t.width||"22px",fill:t.fill||"#B45309",...t,children:[o("path",{d:"M475.095,131.992c-0.032-2.526-0.833-5.021-2.568-6.993L366.324,3.694c-0.021-0.034-0.053-0.045-0.084-0.076 c-0.633-0.707-1.36-1.29-2.141-1.804c-0.232-0.15-0.465-0.285-0.707-0.422c-0.686-0.366-1.393-0.67-2.131-0.892 c-0.2-0.058-0.379-0.14-0.58-0.192C359.87,0.114,359.047,0,358.203,0H97.2C85.292,0,75.6,9.693,75.6,21.601v507.6 c0,11.913,9.692,21.601,21.6,21.601H453.6c11.918,0,21.601-9.688,21.601-21.601V133.202 C475.2,132.796,475.137,132.398,475.095,131.992z M243.599,523.494H141.75v-15.936l62.398-89.797v-0.785h-56.565v-24.484h95.051 v17.106l-61.038,88.636v0.771h62.002V523.494z M292.021,523.494h-29.744V392.492h29.744V523.494z M399.705,463.44 c-10.104,9.524-25.069,13.796-42.566,13.796c-3.893,0-7.383-0.19-10.104-0.58v46.849h-29.352V394.242 c9.134-1.561,21.958-2.721,40.036-2.721c18.277,0,31.292,3.491,40.046,10.494c8.354,6.607,13.996,17.486,13.996,30.322 C411.761,445.163,407.479,456.053,399.705,463.44z M97.2,366.752V21.601h129.167v-3.396h32.756v3.396h88.28v110.515 c0,5.961,4.831,10.8,10.8,10.8H453.6l0.011,223.836H97.2z"}),o("path",{d:"M359.279,413.87c-6.033,0-10.114,0.586-12.245,1.171v38.676c2.521,0.585,5.632,0.785,9.914,0.785 c15.736,0,25.46-7.979,25.46-21.378C382.408,421.063,374.045,413.87,359.279,413.87z"}),o("rect",{x:"259.124",y:"39.918",width:"32.756",height:"13.516"}),o("rect",{x:"226.368",y:"21.601",width:"32.756",height:"10.125"}),o("rect",{x:"226.368",y:"60.146",width:"32.756",height:"13.516"}),o("rect",{x:"259.124",y:"82.274",width:"32.756",height:"13.518"}),o("rect",{x:"259.124",y:"124.983",width:"32.756",height:"13.516"}),o("rect",{x:"226.368",y:"103.275",width:"32.756",height:"13.516"}),o("path",{d:"M259.124,149.537c-23.193,0-34.225,18.792-34.225,41.99l-7.765,70.348c0,23.198,18.792,42.003,41.984,42.003 c23.19,0,41.974-18.805,41.974-42.003l-7.741-70.348C293.361,168.334,282.318,149.537,259.124,149.537z M273.04,285.431h-27.799 v-58.728h27.799V285.431z"})]})}import y from"@mui/icons-material/TextSnippet";import F from"@mui/icons-material/VideoFile";import V from"@mui/icons-material/AudioFile";import z from"@mui/icons-material/Description";import M from"@mui/icons-material/InsertDriveFile";import I from"@mui/icons-material/Code";import C from"@mui/icons-material/TableView";var w=t=>{let e=t.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(e)?"image":e==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(e)?"text":["csv","xls","xlsx"].includes(e)?"spreadsheet":["html","htm"].includes(e)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(e)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(e)?"video":["mp3","wav","ogg","m4a","aac"].includes(e)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(e)?"office":"unsupported"},u=t=>{let e=(t||"").toLowerCase().split(";")[0].trim();return e?e.startsWith("image/")?"image":e==="application/pdf"?"pdf":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":e==="text/html"?"html":e==="text/csv"||e==="application/vnd.ms-excel"||e==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":e.startsWith("text/")||e==="application/json"||e==="application/xml"?"text":"unsupported":"unsupported"},x=(t,e)=>{let c=w(t);return c!=="unsupported"?c:u(e)};import{jsx as r}from"react/jsx-runtime";function g(t,e=22){let c=`${e}px`,s={fontSize:e};switch(t){case"image":return r(p,{width:c,height:c});case"pdf":return r(a,{width:c,height:c});case"html":return r(h,{width:c,height:c});case"archive":return r(m,{width:c,height:c});case"text":return r(y,{sx:{...s,color:"#66BB6A"}});case"spreadsheet":return r(C,{sx:{...s,color:"#4CAF50"}});case"code":return r(I,{sx:{...s,color:"#2196F3"}});case"video":return r(F,{sx:{...s,color:"#AB47BC"}});case"audio":return r(V,{sx:{...s,color:"#FF7043"}});case"office":return r(z,{sx:{...s,color:"#FFA726"}});default:return r(M,{sx:{...s,color:"#78909C"}})}}var H=new Set(["zip","rar","7z","gz","tgz","tar","bz2","xz","alz","egg"]);function E({fileName:t,mime:e,size:c=22}){let s=t.includes(".")?t.slice(t.lastIndexOf(".")+1).toLowerCase():"";return H.has(s)?g("archive",c):g(x(t,e??""),c)}export{E as FileTypeIcon,h as HtmlIcon,p as ImageIcon,a as PdfIcon,m as ZipIcon,g as getFileTypeIcon};
package/dist/icons.js CHANGED
@@ -1 +1 @@
1
- "use strict";var z=Object.create;var n=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var H=(t,e)=>{for(var c in e)n(t,c,{get:e[c],enumerable:!0})},d=(t,e,c,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let p of b(e))!E.call(t,p)&&p!==c&&n(t,p,{get:()=>e[p],enumerable:!(r=C(e,p))||r.enumerable});return t};var l=(t,e,c)=>(c=t!=null?z(T(t)):{},d(e||!t||!t.__esModule?n(c,"default",{value:t,enumerable:!0}):c,t)),B=t=>d(n({},"__esModule",{value:!0}),t);var A={};H(A,{FileTypeIcon:()=>M,HtmlIcon:()=>h,ImageIcon:()=>a,PdfIcon:()=>m,getFileTypeIcon:()=>g});module.exports=B(A);var o=require("react/jsx-runtime");function a(t){return(0,o.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:t.width||"22px",...t,children:[(0,o.jsx)("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),(0,o.jsx)("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),(0,o.jsx)("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),(0,o.jsx)("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),(0,o.jsxs)("g",{children:[(0,o.jsx)("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),(0,o.jsx)("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}var i=require("react/jsx-runtime");function m(t){return(0,i.jsx)("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:t.width||"28px",...t,children:(0,i.jsxs)("g",{children:[(0,i.jsx)("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),(0,i.jsx)("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),(0,i.jsxs)("g",{children:[(0,i.jsxs)("g",{children:[(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),(0,i.jsx)("g",{children:(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),(0,i.jsx)("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),(0,i.jsx)("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),(0,i.jsx)("g",{children:(0,i.jsx)("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}var f=require("react/jsx-runtime");function h(t){return(0,f.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:t.width||"22px",fill:t.fill||"#E91E63",...t,children:(0,f.jsx)("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}var u=l(require("@mui/icons-material/TextSnippet"),1),v=l(require("@mui/icons-material/VideoFile"),1),w=l(require("@mui/icons-material/AudioFile"),1),y=l(require("@mui/icons-material/Description"),1),F=l(require("@mui/icons-material/InsertDriveFile"),1),V=l(require("@mui/icons-material/Code"),1),I=l(require("@mui/icons-material/TableView"),1);var S=t=>{let e=t.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(e)?"image":e==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(e)?"text":["csv","xls","xlsx"].includes(e)?"spreadsheet":["html","htm"].includes(e)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(e)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(e)?"video":["mp3","wav","ogg","m4a","aac"].includes(e)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(e)?"office":"unsupported"},j=t=>{let e=(t||"").toLowerCase().split(";")[0].trim();return e?e.startsWith("image/")?"image":e==="application/pdf"?"pdf":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":e==="text/html"?"html":e==="text/csv"||e==="application/vnd.ms-excel"||e==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":e.startsWith("text/")||e==="application/json"||e==="application/xml"?"text":"unsupported":"unsupported"},x=(t,e)=>{let c=S(t);return c!=="unsupported"?c:j(e)};var s=require("react/jsx-runtime");function g(t,e=22){let c=`${e}px`,r={fontSize:e};switch(t){case"image":return(0,s.jsx)(a,{width:c,height:c});case"pdf":return(0,s.jsx)(m,{width:c,height:c});case"html":return(0,s.jsx)(h,{width:c,height:c});case"text":return(0,s.jsx)(u.default,{sx:{...r,color:"#66BB6A"}});case"spreadsheet":return(0,s.jsx)(I.default,{sx:{...r,color:"#4CAF50"}});case"code":return(0,s.jsx)(V.default,{sx:{...r,color:"#2196F3"}});case"video":return(0,s.jsx)(v.default,{sx:{...r,color:"#AB47BC"}});case"audio":return(0,s.jsx)(w.default,{sx:{...r,color:"#FF7043"}});case"office":return(0,s.jsx)(y.default,{sx:{...r,color:"#FFA726"}});default:return(0,s.jsx)(F.default,{sx:{...r,color:"#78909C"}})}}function M({fileName:t,mime:e,size:c=22}){return g(x(t,e??""),c)}
1
+ "use strict";var H=Object.create;var a=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var c in t)a(e,c,{get:t[c],enumerable:!0})},v=(e,t,c,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of b(t))!S.call(e,n)&&n!==c&&a(e,n,{get:()=>t[n],enumerable:!(r=E(t,n))||r.enumerable});return e};var p=(e,t,c)=>(c=e!=null?H(T(e)):{},v(t||!e||!e.__esModule?a(c,"default",{value:e,enumerable:!0}):c,e)),R=e=>v(a({},"__esModule",{value:!0}),e);var k={};B(k,{FileTypeIcon:()=>C,HtmlIcon:()=>g,ImageIcon:()=>h,PdfIcon:()=>m,ZipIcon:()=>d,getFileTypeIcon:()=>f});module.exports=R(k);var l=require("react/jsx-runtime");function h(e){return(0,l.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:e.width||"22px",...e,children:[(0,l.jsx)("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),(0,l.jsx)("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),(0,l.jsx)("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),(0,l.jsx)("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),(0,l.jsxs)("g",{children:[(0,l.jsx)("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),(0,l.jsx)("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}var i=require("react/jsx-runtime");function m(e){return(0,i.jsx)("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:e.width||"28px",...e,children:(0,i.jsxs)("g",{children:[(0,i.jsx)("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),(0,i.jsx)("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),(0,i.jsxs)("g",{children:[(0,i.jsxs)("g",{children:[(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),(0,i.jsx)("g",{children:(0,i.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),(0,i.jsx)("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),(0,i.jsx)("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),(0,i.jsx)("g",{children:(0,i.jsx)("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}var x=require("react/jsx-runtime");function g(e){return(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:e.width||"22px",fill:e.fill||"#E91E63",...e,children:(0,x.jsx)("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}var s=require("react/jsx-runtime");function d(e){return(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:e.width||"22px",fill:e.fill||"#B45309",...e,children:[(0,s.jsx)("path",{d:"M475.095,131.992c-0.032-2.526-0.833-5.021-2.568-6.993L366.324,3.694c-0.021-0.034-0.053-0.045-0.084-0.076 c-0.633-0.707-1.36-1.29-2.141-1.804c-0.232-0.15-0.465-0.285-0.707-0.422c-0.686-0.366-1.393-0.67-2.131-0.892 c-0.2-0.058-0.379-0.14-0.58-0.192C359.87,0.114,359.047,0,358.203,0H97.2C85.292,0,75.6,9.693,75.6,21.601v507.6 c0,11.913,9.692,21.601,21.6,21.601H453.6c11.918,0,21.601-9.688,21.601-21.601V133.202 C475.2,132.796,475.137,132.398,475.095,131.992z M243.599,523.494H141.75v-15.936l62.398-89.797v-0.785h-56.565v-24.484h95.051 v17.106l-61.038,88.636v0.771h62.002V523.494z M292.021,523.494h-29.744V392.492h29.744V523.494z M399.705,463.44 c-10.104,9.524-25.069,13.796-42.566,13.796c-3.893,0-7.383-0.19-10.104-0.58v46.849h-29.352V394.242 c9.134-1.561,21.958-2.721,40.036-2.721c18.277,0,31.292,3.491,40.046,10.494c8.354,6.607,13.996,17.486,13.996,30.322 C411.761,445.163,407.479,456.053,399.705,463.44z M97.2,366.752V21.601h129.167v-3.396h32.756v3.396h88.28v110.515 c0,5.961,4.831,10.8,10.8,10.8H453.6l0.011,223.836H97.2z"}),(0,s.jsx)("path",{d:"M359.279,413.87c-6.033,0-10.114,0.586-12.245,1.171v38.676c2.521,0.585,5.632,0.785,9.914,0.785 c15.736,0,25.46-7.979,25.46-21.378C382.408,421.063,374.045,413.87,359.279,413.87z"}),(0,s.jsx)("rect",{x:"259.124",y:"39.918",width:"32.756",height:"13.516"}),(0,s.jsx)("rect",{x:"226.368",y:"21.601",width:"32.756",height:"10.125"}),(0,s.jsx)("rect",{x:"226.368",y:"60.146",width:"32.756",height:"13.516"}),(0,s.jsx)("rect",{x:"259.124",y:"82.274",width:"32.756",height:"13.518"}),(0,s.jsx)("rect",{x:"259.124",y:"124.983",width:"32.756",height:"13.516"}),(0,s.jsx)("rect",{x:"226.368",y:"103.275",width:"32.756",height:"13.516"}),(0,s.jsx)("path",{d:"M259.124,149.537c-23.193,0-34.225,18.792-34.225,41.99l-7.765,70.348c0,23.198,18.792,42.003,41.984,42.003 c23.19,0,41.974-18.805,41.974-42.003l-7.741-70.348C293.361,168.334,282.318,149.537,259.124,149.537z M273.04,285.431h-27.799 v-58.728h27.799V285.431z"})]})}var u=p(require("@mui/icons-material/TextSnippet"),1),y=p(require("@mui/icons-material/VideoFile"),1),F=p(require("@mui/icons-material/AudioFile"),1),V=p(require("@mui/icons-material/Description"),1),z=p(require("@mui/icons-material/InsertDriveFile"),1),M=p(require("@mui/icons-material/Code"),1),I=p(require("@mui/icons-material/TableView"),1);var j=e=>{let t=e.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(t)?"image":t==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(t)?"text":["csv","xls","xlsx"].includes(t)?"spreadsheet":["html","htm"].includes(t)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(t)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(t)?"video":["mp3","wav","ogg","m4a","aac"].includes(t)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(t)?"office":"unsupported"},A=e=>{let t=(e||"").toLowerCase().split(";")[0].trim();return t?t.startsWith("image/")?"image":t==="application/pdf"?"pdf":t.startsWith("video/")?"video":t.startsWith("audio/")?"audio":t==="text/html"?"html":t==="text/csv"||t==="application/vnd.ms-excel"||t==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":t.startsWith("text/")||t==="application/json"||t==="application/xml"?"text":"unsupported":"unsupported"},w=(e,t)=>{let c=j(e);return c!=="unsupported"?c:A(t)};var o=require("react/jsx-runtime");function f(e,t=22){let c=`${t}px`,r={fontSize:t};switch(e){case"image":return(0,o.jsx)(h,{width:c,height:c});case"pdf":return(0,o.jsx)(m,{width:c,height:c});case"html":return(0,o.jsx)(g,{width:c,height:c});case"archive":return(0,o.jsx)(d,{width:c,height:c});case"text":return(0,o.jsx)(u.default,{sx:{...r,color:"#66BB6A"}});case"spreadsheet":return(0,o.jsx)(I.default,{sx:{...r,color:"#4CAF50"}});case"code":return(0,o.jsx)(M.default,{sx:{...r,color:"#2196F3"}});case"video":return(0,o.jsx)(y.default,{sx:{...r,color:"#AB47BC"}});case"audio":return(0,o.jsx)(F.default,{sx:{...r,color:"#FF7043"}});case"office":return(0,o.jsx)(V.default,{sx:{...r,color:"#FFA726"}});default:return(0,o.jsx)(z.default,{sx:{...r,color:"#78909C"}})}}var P=new Set(["zip","rar","7z","gz","tgz","tar","bz2","xz","alz","egg"]);function C({fileName:e,mime:t,size:c=22}){let r=e.includes(".")?e.slice(e.lastIndexOf(".")+1).toLowerCase():"";return P.has(r)?f("archive",c):f(w(e,t??""),c)}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export { FileViewer, default as FileViewerDefault } from "./FileViewer";
2
2
  export type { ViewerFile, FileViewerProps, ViewerFileType } from "./types";
3
3
  export { getFileType, getFileTypeFromMime, resolveFileType, isFileViewerPreviewable, ensureFileExtension, getEditorLanguage, } from "./utils/fileType";
4
4
  export { saveBlobAsFile } from "./utils/download";
5
- export { ImageIcon, PdfIcon, HtmlIcon, FileTypeIcon, getFileTypeIcon, type FileTypeIconProps } from "./icons";
5
+ export { ImageIcon, PdfIcon, HtmlIcon, ZipIcon, FileTypeIcon, getFileTypeIcon, type FileTypeIconProps } from "./icons";
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
- import{useState as u,useEffect as V,useMemo as dr,useCallback as v,useRef as g}from"react";import{Dialog as ur,DialogTitle as mr,DialogContent as pr,Drawer as fr,IconButton as E,Box as d,Typography as F,Tooltip as D,Button as oo,Tabs as hr,Tab as gr,Menu as xr,MenuItem as ke,Snackbar as yr,ListItemIcon as Le,ListItemText as Fe,useMediaQuery as br,useTheme as vr}from"@mui/material";import wr from"@mui/icons-material/Close";import Mr from"@mui/icons-material/Menu";import Tr from"@mui/icons-material/MoreHoriz";import ro from"@mui/icons-material/Download";import Cr from"@mui/icons-material/Add";import Ir from"@mui/icons-material/Remove";import no from"@mui/icons-material/RotateLeft";import io from"@mui/icons-material/RotateRight";import ao from"@mui/icons-material/FitScreen";import kr from"@mui/icons-material/KeyboardArrowLeft";import Lr from"@mui/icons-material/KeyboardArrowRight";import Fr from"@mui/icons-material/TextSnippet";import Rr from"@mui/icons-material/VideoFile";import Pr from"@mui/icons-material/AudioFile";import Er from"@mui/icons-material/Description";import Dr from"@mui/icons-material/InsertDriveFile";import so from"@mui/icons-material/Code";import Sr from"@mui/icons-material/TableView";import{Document as co,Page as lo,pdfjs as Br}from"react-pdf";import uo from"@monaco-editor/react";import Hr from"react-spreadsheet";import*as se from"xlsx";import{LoadingProgress as mo}from"@ehfuse/mui-fadeout-loading-progress";var Qe=c=>{let l=c.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(l)?"image":l==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(l)?"text":["csv","xls","xlsx"].includes(l)?"spreadsheet":["html","htm"].includes(l)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(l)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(l)?"video":["mp3","wav","ogg","m4a","aac"].includes(l)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(l)?"office":"unsupported"},Qt=c=>{let l=(c||"").toLowerCase().split(";")[0].trim();return l?l.startsWith("image/")?"image":l==="application/pdf"?"pdf":l.startsWith("video/")?"video":l.startsWith("audio/")?"audio":l==="text/html"?"html":l==="text/csv"||l==="application/vnd.ms-excel"||l==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":l.startsWith("text/")||l==="application/json"||l==="application/xml"?"text":"unsupported":"unsupported"},M=(c,l)=>{let a=Qe(c);return a!=="unsupported"?a:Qt(l)},rr=new Set(["image","pdf","text","code","html","spreadsheet","video","audio"]),nr=c=>rr.has(Qe(c)),ir={"image/jpeg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/svg+xml":"svg","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-excel":"xls","text/csv":"csv","text/plain":"txt","application/json":"json","text/xml":"xml","application/xml":"xml","text/html":"html","video/mp4":"mp4","video/webm":"webm","audio/mpeg":"mp3","audio/wav":"wav"},ar=(c,l)=>{let a=(c??"").trim()||"\uCCA8\uBD80\uD30C\uC77C";if(/\.[a-z0-9]+$/i.test(a))return a;let m=(l??"").trim().toLowerCase().split(";")[0],X=ir[m]??"";return X?`${a}.${X}`:a},Je=c=>{let l=c.split(".").pop()?.toLowerCase()||"";return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",scss:"scss",sass:"scss",less:"less",json:"json",xml:"xml",php:"php",py:"python",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",swift:"swift",kt:"kotlin",scala:"scala",sql:"sql",sh:"shell",bash:"shell",bat:"bat",ps1:"powershell",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",conf:"ini",md:"markdown",markdown:"markdown",txt:"plaintext",log:"plaintext",csv:"plaintext"}[l]||"plaintext"};var sr=c=>(c||"").replace(/[\\/:*?"<>|\r\n]/g,"_").trim()||"download",et=(c,l)=>{let a=URL.createObjectURL(c),m=document.createElement("a");m.href=a,m.download=sr(l),m.rel="noopener",document.body.appendChild(m),m.click(),m.remove(),window.setTimeout(()=>URL.revokeObjectURL(a),6e4)};var Jt=async c=>{let l=URL.createObjectURL(c);try{let a=await new Promise((S,h)=>{let A=new Image;A.onload=()=>S(A),A.onerror=()=>h(new Error("\uC774\uBBF8\uC9C0\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")),A.src=l}),m=document.createElement("canvas");m.width=a.naturalWidth||a.width||1024,m.height=a.naturalHeight||a.height||1024;let X=m.getContext("2d");if(!X)throw new Error("\uCE94\uBC84\uC2A4\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return X.drawImage(a,0,0,m.width,m.height),await new Promise((S,h)=>{m.toBlob(A=>A?S(A):h(new Error("PNG \uBCC0\uD658 \uC2E4\uD328")),"image/png")})}finally{URL.revokeObjectURL(l)}};import{useMediaQuery as cr,useTheme as lr}from"@mui/material";function eo(){let c=lr();return!cr(c.breakpoints.up("lg"))}import{jsx as Z,jsxs as to}from"react/jsx-runtime";function Q(c){return to("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:c.width||"22px",...c,children:[Z("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),Z("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),Z("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),Z("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),to("g",{children:[Z("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),Z("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}import{jsx as L,jsxs as tt}from"react/jsx-runtime";function J(c){return L("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:c.width||"28px",...c,children:tt("g",{children:[L("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),L("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),tt("g",{children:[tt("g",{children:[L("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),L("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),L("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),L("g",{children:L("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),L("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),L("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),L("g",{children:L("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}import{Fragment as ae,jsx as r,jsxs as f}from"react/jsx-runtime";var Vr="/pdfjs",po=32,fo=240,zr=8192,ot=.25,rt=8,nt=80,ho=80,Ar=c=>{switch(c){case"image":return r(Q,{});case"pdf":return r(J,{});case"text":return r(Fr,{sx:{mr:1,color:"#66BB6A"}});case"spreadsheet":return r(Sr,{sx:{mr:1,color:"#4CAF50"}});case"html":return r(so,{sx:{mr:1,color:"#E91E63"}});case"code":return r(so,{sx:{mr:1,color:"#2196F3"}});case"video":return r(Rr,{sx:{mr:1,color:"#AB47BC"}});case"audio":return r(Pr,{sx:{mr:1,color:"#FF7043"}});case"office":return r(Er,{sx:{mr:1,color:"#FFA726"}});default:return r(Dr,{sx:{mr:1,color:"#78909C"}})}},go=c=>typeof c?.rotate=="number"?c.rotate:typeof c?._pageInfo?.rotate=="number"?c._pageInfo.rotate:0,xo=({open:c,onClose:l,file:a,loadFile:m,onDownload:X,pdfAssetBase:S=Vr})=>{let h=eo(),A=vr(),ee=br(A.breakpoints.down("sm")),[ce,Pe]=u(!0),[Ee,at]=u(!1),[w,De]=u(""),[T,B]=u(1),[_,te]=u(0),[st,le]=u(""),[C,ct]=u(""),[lt,de]=u(""),[oe,ue]=u(14),[Se,me]=u(""),[Be,dt]=u("preview"),[He,re]=u([]),[ut,mt]=u([]),[vo,Ve]=u(""),[ze,pt]=u(null),[ft,pe]=u(!1),[wo,Ae]=u(!0),[ht,fe]=u(""),[I,gt]=u(),[k,Y]=u(1),[Mo,We]=u(!1),[xt,$]=u(null),[he,yt]=u("portrait"),[To,bt]=u(0),[Xe,vt]=u(0),[ne,wt]=u({width:0,height:0}),Mt=g([]),_e=g(null),O=g(null),je=g(null),Ye=g(null),Co=v(e=>{if(je.current?.disconnect(),Ye.current?.(),Ye.current=null,O.current=e,!e){je.current=null;return}let t=i=>{i.touches.length>=2&&i.preventDefault()};e.addEventListener("touchmove",t,{passive:!1}),Ye.current=()=>e.removeEventListener("touchmove",t);let o=new ResizeObserver(i=>{let s=i[0]?.contentRect;s&&wt({width:s.width,height:s.height})});o.observe(e),je.current=o;let n=e.getBoundingClientRect();wt({width:n.width,height:n.height})},[]),[ge,Tt]=u(!1),[Oe,Io]=u({x:0,y:0}),[Ue,ko]=u({x:0,y:0}),Lo=v(async(e,t)=>{let o=URL.createObjectURL(e);De(o),ct(e.type||"");let n=M(t,e.type||"");if(n==="text"||n==="code"){let s=await e.text();de(s);return}if(n==="html"){let s=await e.text();me(s);return}if(n!=="spreadsheet")return;let i=t.split(".").pop()?.toLowerCase()||"";if(i==="csv"){let p=(await e.text()).split(`
2
- `).map(b=>b.split(",").map(P=>({value:P.trim()})));re(p);return}if(i==="xls"||i==="xlsx"){pe(!0),Ae(!0);let s=await e.arrayBuffer(),p=se.read(s,{type:"array"});mt(p.SheetNames),pt(p);let b=p.SheetNames[0];Ve(b),qe(p,b)}},[]),xe=g(null),Ct=v(async e=>{if(e.blob)return e.blob;if(m)return await m(e);if(e.url){let t=await fetch(e.url);if(!t.ok)throw new Error("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return await t.blob()}throw new Error("\uD30C\uC77C \uB370\uC774\uD130 \uC18C\uC2A4(blob/url/loadFile)\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")},[m]);V(()=>(a&&c?Eo():(w&&URL.revokeObjectURL(w),xe.current=null,De(""),de(""),me(""),re([]),ue(14),B(1),te(0)),()=>{w&&URL.revokeObjectURL(w)}),[a,c]);let Fo=({numPages:e})=>{gt(e),Y(1),Ce.current=!0},Ro=e=>{let{width:t,height:o}=Po(e);bt(go(e)),t>0&&o>0&&vt(t/o);let n=t>o?"landscape":"portrait";yt(n)},Po=e=>{let t=e?.width||0,o=e?.height||0,n=go(e);try{if(typeof e?.getViewport=="function"){let i=e.getViewport({scale:1,rotation:n});t=i.width,o=i.height}}catch(i){console.warn("[FileViewer] getViewport \uC2E4\uD328 - \uAE30\uBCF8 width/height\uB85C \uB300\uCCB4",i)}return{width:t,height:o}},ye=v(()=>{Y(e=>Math.max(e-1,1))},[]),be=v(()=>{Y(e=>Math.min(e+1,I||1))},[I]),It=dr(()=>({cMapUrl:`${S}/cmaps/`,cMapPacked:!0,standardFontDataUrl:`${S}/standard_fonts/`,wasmUrl:`${S}/wasm/`}),[S]);V(()=>{typeof window>"u"||(Br.GlobalWorkerOptions.workerSrc=`${S}/pdf.worker.min.mjs`)},[S]),V(()=>{if(!c||M(a?.name||"",C)!=="pdf")return;let e=o=>{switch(o.key){case"ArrowLeft":case"ArrowUp":o.preventDefault(),ye();break;case"ArrowRight":case"ArrowDown":o.preventDefault(),be();break;case"Home":o.preventDefault(),Y(1);break;case"End":o.preventDefault(),I&&Y(I);break}},t=o=>{o.ctrlKey||Math.abs(o.deltaY)>50&&(o.preventDefault(),o.deltaY>0?be():ye())};return document.addEventListener("keydown",e),document.addEventListener("wheel",t,{passive:!1}),()=>{document.removeEventListener("keydown",e),document.removeEventListener("wheel",t)}},[c,a,C,ye,be,I]),V(()=>{if(!I||!c||M(a?.name||"",C)!=="pdf")return;if(k===1&&_e.current){_e.current.scrollTo({top:0,behavior:"smooth"});return}let e=Mt.current[k-1];e&&e.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[c,a,C,I,k]),V(()=>{ce&&at(!0)},[ce,Ee]);let Eo=async()=>{if(a){Pe(!0),le(""),ct(""),de(""),me(""),re([]);try{let e=await Ct(a);xe.current=e,await Lo(e,a.name)}catch(e){console.error("\uD30C\uC77C \uB85C\uB4DC \uC624\uB958:",e),le("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}finally{Pe(!1)}}},kt=async()=>{if(a)try{if(X){await X(a);return}let e=xe.current??await Ct(a);et(e,a.name)}catch(e){console.error("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC624\uB958:",e)}},Do=()=>{let e=a?M(a.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?ue(t=>Math.min(t+2,24)):B(e==="pdf"?t=>Math.min(t+.25,rt):t=>Math.min(t+.25,3))},So=()=>{let e=a?M(a.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?ue(t=>Math.max(t-2,10)):B(e==="pdf"?t=>Math.max(t-.25,ot):t=>Math.max(t-.25,.25))},x=g(new Map),Bo=e=>Math.min(Math.max(e,.25),3),Ho=e=>Math.min(Math.max(e,ot),rt),Ne=g(null),ve=g(null),W=g({scale:1,tx:0,ty:0,rotation:0}),j=g(0),G=g(null),we=g(null),Me=v((e,t,o,n)=>{let i=Ne.current,s=ve.current;if(!i||!s)return{tx:t,ty:o};let p=s.offsetWidth,b=s.offsetHeight,P=(Math.round(n/90)%4+4)%4;if(P===1||P===3){let or=p;p=b,b=or}let H=p*e,qt=b*e,Kt=H>i.clientWidth?(H+i.clientWidth)/2-ho:0,Zt=qt>i.clientHeight?(qt+i.clientHeight)/2-ho:0;return{tx:Math.min(Kt,Math.max(-Kt,t)),ty:Math.min(Zt,Math.max(-Zt,o))}},[]),Lt=v((e,t)=>{let o=Ne.current,n=ve.current;if(!o||!n)return e>1;let i=(Math.round(t/90)%4+4)%4,s=i===1||i===3,p=s?n.offsetHeight:n.offsetWidth,b=s?n.offsetWidth:n.offsetHeight;return p*e>o.clientWidth+1||b*e>o.clientHeight+1},[]),U=v(e=>{let t=ve.current;if(!t)return;let{scale:o,tx:n,ty:i,rotation:s}=W.current;t.style.transition=e?"transform 0.25s ease":"none",t.style.transform=`translate(${n}px, ${i}px) scale(${o}) rotate(${s}deg)`},[]),Ft=v(()=>{let e=W.current,t=Me(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,!j.current&&(j.current=requestAnimationFrame(()=>{j.current=0,U(!1)}))},[U,Me]),Rt=v(()=>{j.current&&(cancelAnimationFrame(j.current),j.current=0),x.current.clear(),G.current=null,we.current=null},[]),Vo=v(e=>{ve.current=e,e&&(W.current={scale:1,tx:0,ty:0,rotation:0},U(!1))},[U]);V(()=>{if(M(a?.name||"",C)!=="image")return;let e=W.current;e.scale=T,e.rotation=_;let t=Me(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,U(!0)},[T,_,a,C,w,U,Me]),V(()=>()=>{j.current&&cancelAnimationFrame(j.current)},[]);let zo=e=>{e.currentTarget.setPointerCapture?.(e.pointerId),x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...x.current.values()],o=W.current;if(t.length===2){G.current=null;let n=e.currentTarget.getBoundingClientRect();we.current={startDist:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)||1,baseScale:o.scale,baseTx:o.tx,baseTy:o.ty,startMidX:(t[0].x+t[1].x)/2,startMidY:(t[0].y+t[1].y)/2,centerX:n.left+n.width/2,centerY:n.top+n.height/2}}else t.length===1&&Lt(o.scale,o.rotation)&&(G.current={startX:e.clientX,startY:e.clientY,baseTx:o.tx,baseTy:o.ty})},Ao=e=>{if(!x.current.has(e.pointerId))return;x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=W.current,o=we.current,n=[...x.current.values()];if(o&&n.length>=2){let s=Math.hypot(n[0].x-n[1].x,n[0].y-n[1].y),p=(n[0].x+n[1].x)/2,b=(n[0].y+n[1].y)/2,P=Bo(o.baseScale*s/o.startDist),H=P/o.baseScale;t.scale=P,t.tx=p-o.centerX-H*(o.startMidX-o.centerX-o.baseTx),t.ty=b-o.centerY-H*(o.startMidY-o.centerY-o.baseTy),Ft();return}let i=G.current;i&&n.length===1&&(t.tx=i.baseTx+(e.clientX-i.startX),t.ty=i.baseTy+(e.clientY-i.startY),Ft())},Pt=e=>{if(!x.current.has(e.pointerId))return;x.current.delete(e.pointerId),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId);let t=W.current;if(x.current.size<2&&(we.current=null,Math.abs(t.scale-T)>.001&&B(t.scale)),x.current.size===0)G.current=null;else if(x.current.size===1&&Lt(t.scale,t.rotation)){let o=[...x.current.values()][0];G.current={startX:o.x,startY:o.y,baseTx:t.tx,baseTy:t.ty}}},Et=v(async()=>{if(w)try{let t=await(await fetch(w)).blob(),o=t.type==="image/png"?t:await Jt(t);await navigator.clipboard.write([new ClipboardItem({"image/png":o})]),fe("\uC774\uBBF8\uC9C0\uB97C \uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")}catch(e){console.error("\uC774\uBBF8\uC9C0 \uBCF5\uC0AC \uC624\uB958:",e),fe("\uC774\uBBF8\uC9C0\uB97C \uBCF5\uC0AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}},[w]);V(()=>{if(!c||M(a?.name||"",C)!=="image")return;let e=t=>{if(!(t.ctrlKey||t.metaKey)||t.key.toLowerCase()!=="c")return;let o=t.target,n=o?.tagName;n==="INPUT"||n==="TEXTAREA"||o?.isContentEditable||(t.preventDefault(),Et())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[c,a,C,Et]);let q=g(null),R=g(0),ie=g(null),K=g(null),N=()=>O.current?.querySelector(".react-pdf__Page")??null,Te=g(null),Dt=g(null),Wo=()=>{let e=Dt.current,t=N()?.querySelector("canvas");if(!e||!t||!t.width||!t.height)return!1;let o=document.createElement("canvas");o.width=t.width,o.height=t.height;let n=o.getContext("2d");if(!n)return!1;n.drawImage(t,0,0);let i=t.getBoundingClientRect(),s=e.getBoundingClientRect();return Object.assign(o.style,{position:"absolute",left:`${i.left-s.left}px`,top:`${i.top-s.top}px`,width:`${i.width}px`,height:`${i.height}px`,pointerEvents:"none",zIndex:"1"}),e.appendChild(o),Te.current=o,!0},St=()=>{Te.current?.remove(),Te.current=null;let e=N();e&&(e.style.visibility="")},Xo=()=>{R.current||(R.current=requestAnimationFrame(()=>{R.current=0;let e=q.current,t=N();!e||!t||(t.style.transition="none",t.style.transformOrigin="top left",t.style.transform=`translate(${e.tx}px, ${e.ty}px) scale(${e.k})`,ie.current={k:e.k,tx:e.tx,ty:e.ty,midX:e.lastMidX,midY:e.lastMidY})}))},Bt=()=>{R.current&&(cancelAnimationFrame(R.current),R.current=0),q.current=null,K.current=null,ie.current=null,St();let e=N();e&&(e.style.transform="",e.style.willChange="auto")},Ht=e=>{let t=N(),o=O.current;if(!t||!o)return;t.style.transform&&(t.style.transform="");let n=t.getBoundingClientRect(),i=o.getBoundingClientRect(),s=(e[0].x+e[1].x)/2,p=(e[0].y+e[1].y)/2;q.current={startDist:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)||1,rectLeft:n.left,rectTop:n.top,pageW:n.width,pageH:n.height,viewerL:i.left,viewerT:i.top,viewerR:i.right,viewerB:i.bottom,startMidX:s,startMidY:p,lastMidX:s,lastMidY:p,k:1,tx:0,ty:0},ie.current={k:1,tx:0,ty:0,midX:s,midY:p},t.style.willChange="transform"},_o=e=>{if(e.pointerType!=="touch")return;x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...x.current.values()];if(t.length===2){if(K.current||Te.current)return;Ht(t)}},jo=e=>{if(!x.current.has(e.pointerId))return;x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=q.current,o=[...x.current.values()];if(t&&o.length>=2){e.preventDefault();let n=Math.hypot(o[0].x-o[1].x,o[0].y-o[1].y),i=Math.min(Math.max(n/t.startDist,ot/(T||1)),rt/(T||1)),s=(o[0].x+o[1].x)/2,p=(o[0].y+o[1].y)/2,b=s-t.rectLeft-i*(t.startMidX-t.rectLeft),P=p-t.rectTop-i*(t.startMidY-t.rectTop),H=nt;b=Math.min(t.viewerR-H-t.rectLeft,Math.max(t.viewerL+H-t.rectLeft-i*t.pageW,b)),P=Math.min(t.viewerB-H-t.rectTop,Math.max(t.viewerT+H-t.rectTop-i*t.pageH,P)),t.k=i,t.tx=b,t.ty=P,t.lastMidX=s,t.lastMidY=p,Xo()}},Vt=e=>{if(x.current.delete(e.pointerId),x.current.size>=2)return;let t=q.current;if(q.current=null,!t)return;R.current&&(cancelAnimationFrame(R.current),R.current=0);let o=ie.current??{k:1,tx:0,ty:0,midX:t.startMidX,midY:t.startMidY};ie.current=null;let n=Ho(T*o.k);if(Math.abs(n-T)<.001){let s=O.current;Bt(),s&&(s.scrollLeft-=o.tx,s.scrollTop-=o.ty);return}let i=O.current;if(i){let s=i.getBoundingClientRect();K.current={u:(o.midX-t.rectLeft-o.tx)/o.k,v:(o.midY-t.rectTop-o.ty)/o.k,offX:o.midX-s.left,offY:o.midY-s.top,factor:n/(T||1)}}if(Wo()){let s=N();s&&(s.style.transform="",s.style.visibility="hidden")}B(n),Math.round(Math.min(Ke*n,Nt))===Ze&&requestAnimationFrame(()=>At())},Ce=g(!0),$e=g(null),zt=()=>{let e=O.current;e&&(e.scrollLeft=(e.scrollWidth-e.clientWidth)/2,e.scrollTop=(e.scrollHeight-e.clientHeight)/2)},At=()=>{let e=K.current;if(!e)return;K.current=null;let t=O.current,o=N();if(!t||!o)return;St(),o.style.transform="",o.style.willChange="auto";let n=o.getBoundingClientRect(),i=t.getBoundingClientRect();t.scrollLeft+=n.left-i.left+e.u*e.factor-e.offX,t.scrollTop+=n.top-i.top+e.v*e.factor-e.offY;let s=[...x.current.values()];s.length>=2&&Ht(s)},Wt=()=>{let e=`${k}:${_}`;if(K.current){$e.current=e,At();return}(Ce.current||$e.current!==e)&&(Ce.current=!1,$e.current=e,zt())};V(()=>()=>{R.current&&cancelAnimationFrame(R.current)},[]);let Xt=()=>{te(e=>e-90)},_t=()=>{te(e=>e+90)},jt=()=>{let e=M(a?.name||"",C);Bt(),e==="text"||e==="html"||e==="code"||e==="spreadsheet"?ue(14):e==="pdf"?(B(1),T===1&&_===0?zt():Ce.current=!0):(Rt(),W.current={scale:1,tx:0,ty:0,rotation:0},U(!0),B(1)),te(0)},Yt=(e,t)=>{Tt(!0),Io({x:e.clientX,y:e.clientY}),ko({x:t.scrollLeft,y:t.scrollTop}),e.preventDefault()},Ot=v((e,t)=>{if(!ge)return;let o=e.clientX-Oe.x,n=e.clientY-Oe.y;t.scrollLeft=Ue.x-o,t.scrollTop=Ue.y-n,e.preventDefault()},[ge,Oe,Ue]),Ge=v(()=>{Tt(!1),document.body.style.cursor="default"},[]);V(()=>{if(ge){let e=t=>{document.querySelectorAll(".draggable-scroll").forEach(n=>{Ot(t,n)})};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",Ge),document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",Ge),document.body.style.userSelect="",document.body.style.webkitUserSelect=""}}},[ge,Ot,Ge]);let Yo=v(()=>{Pe(!1),at(!1)},[]),qe=v(async(e,t)=>{pe(!0),Ae(!0);try{await new Promise(p=>setTimeout(p,500));let o=e.Sheets[t],n=se.utils.decode_range(o["!ref"]||"A1");console.debug("Excel range:",n);let s=se.utils.sheet_to_json(o,{header:1,range:n,defval:""}).map(p=>p.map(b=>({value:b!=null?String(b):""})));re(s),await new Promise(p=>setTimeout(p,200))}catch(o){console.error("\uC6CC\uD06C\uC2DC\uD2B8 \uB85C\uB4DC \uC624\uB958:",o)}finally{Ae(!1)}},[]),Oo=v(()=>{pe(!1)},[]),Uo=v(e=>{ze&&(Ve(e),qe(ze,e))},[ze,qe]),Ut=()=>{Rt(),W.current={scale:1,tx:0,ty:0,rotation:0},fe(""),w&&URL.revokeObjectURL(w),xe.current=null,De(""),de(""),me(""),re([]),mt([]),Ve(""),pt(null),pe(!1),B(1),te(0),le(""),gt(void 0),Y(1),yt("portrait"),bt(0),vt(0),l()};if(!a)return null;let y=M(a.name,C),No=((To+_)%360+360)%360,Ie=_%180===0?Xe:Xe>0?1/Xe:0,$o=Math.max(ne.width-po,fo),Go=Math.max(ne.height-po,fo),Ke=ne.width>0&&Ie>0?Math.min($o,Go*Ie):he==="portrait"?600:800,qo=typeof window<"u"&&window.devicePixelRatio||1,Nt=zr/qo*(Ie>0?Math.min(1,Ie):1),Ze=Math.round(Math.min(Ke*T,Nt)),$t=Math.round(Ke*T),Ko=$t>Ze,Zo=Math.max(16,Math.round(ne.width)-nt),Qo=Math.max(16,Math.round(ne.height)-nt),Jo=he==="landscape"?"200px":"150px",er=he==="landscape"?.18:.17,Gt=()=>I?r(d,{ref:_e,sx:{width:Jo,height:"100%",backgroundColor:"grey.200",borderRight:"1px solid",borderColor:"grey.300",overflow:"auto",p:2},children:Array.from({length:I},(e,t)=>f(d,{ref:o=>{Mt.current[t]=o},children:[r(d,{sx:{mb:0,p:1,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:k===t+1?"2px solid":"1px solid",borderColor:k===t+1?"primary.main":"grey.400",borderRadius:1,overflow:"hidden",backgroundColor:"white","&:hover":{borderColor:"primary.main"},aspectRatio:he==="landscape"?"4 / 3":"3 / 4"},onClick:()=>{Y(t+1),h&&We(!1)},children:r(co,{file:w,options:It,loading:r("div",{style:{display:"none"}}),children:r(lo,{pageNumber:t+1,scale:er,loading:r("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1})})}),r(F,{variant:"caption",sx:{display:"block",textAlign:"center",p:.5,mb:1,color:k===t+1?"primary.main":"",fontWeight:k===t+1?"bold":"normal"},children:t+1})]},t+1))}):null,tr=()=>{let e=M(a?.name||"",C);if(Ee&&!(e==="spreadsheet"))return r(d,{sx:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},children:r(mo,{visible:ce,exitDelay:100,onComplete:Yo})});if(st)return f(d,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[r(F,{color:"error",variant:"h6",children:st}),r(F,{color:"text.secondary",variant:"body2",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]});if(!w)return null;switch(e){case"image":return r(d,{ref:Ne,"data-allow-pinch":"true",onPointerDown:zo,onPointerMove:Ao,onPointerUp:Pt,onPointerCancel:Pt,sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"hidden",height:"100%",backgroundColor:"grey.100",p:2,touchAction:"none",overscrollBehavior:"contain",userSelect:"none","&:active":{cursor:"grabbing"}},children:r("img",{ref:Vo,src:w,alt:a.name,draggable:!1,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",transform:"translate(0px, 0px) scale(1) rotate(0deg)",transformOrigin:"center center",pointerEvents:"none"}})});case"pdf":return f(ae,{children:[f(d,{ref:Dt,sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",backgroundColor:"grey.100",position:"relative",overflow:"hidden"},children:[!h&&Gt(),r(d,{ref:Co,className:"draggable-scroll",onMouseDown:o=>{let n=o.currentTarget;Yt(o,n)},"data-allow-pinch":"true",onPointerDown:_o,onPointerMove:jo,onPointerUp:Vt,onPointerCancel:Vt,sx:{flex:1,display:"flex",flexDirection:"column",overflow:"auto",height:"100%",py:h?0:2,overflowAnchor:"none",touchAction:"pan-x pan-y","& > .react-pdf__Document":{m:"auto",...h&&{px:`${Zo}px`,py:`${Qo}px`},...Ko&&{"& .react-pdf__Page__canvas":{width:`${$t}px !important`,height:"auto !important"}}}},children:r(co,{file:w,onLoadSuccess:Fo,onLoadError:o=>{console.error("PDF \uB85C\uB4DC \uC624\uB958:",o),le("PDF \uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")},loading:r("div",{style:{display:"none"}}),error:f(d,{sx:{textAlign:"center",p:4},children:[r(F,{color:"error",variant:"h6",sx:{mb:2},children:"PDF\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}),r(F,{color:"text.secondary",variant:"body2",children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]}),options:It,children:r(lo,{pageNumber:k,width:Ze,rotate:_===0?void 0:No,loading:r("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1,onLoadSuccess:Ro,onRenderSuccess:Wt,onRenderError:Wt})})})]}),h&&r(fr,{anchor:"left",open:Mo,onClose:()=>We(!1),sx:{zIndex:o=>o.zIndex.modal+2},children:Gt()})]});case"text":case"code":return r(d,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column"},children:lt?r(d,{sx:{flex:1,height:"100%",overflow:"hidden"},children:r(uo,{height:"100%",language:Je(a.name),value:lt,theme:"vs-dark",loading:!1,options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,formatOnPaste:!0,formatOnType:!0,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:oe,lineHeight:Math.round(oe*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(o,n)=>{o.onDidAttemptReadOnlyEdit(()=>{});let i=o.getDomNode();if(i){let s=document.createElement("style");s.textContent=`
1
+ import{useState as p,useEffect as B,useMemo as co,useCallback as w,useRef as g}from"react";import{Dialog as wr,DialogTitle as Mr,DialogContent as Cr,Drawer as Tr,IconButton as R,Box as c,Typography as E,Tooltip as P,Button as uo,Tabs as Ir,Tab as kr,Menu as Lr,MenuItem as Se,Snackbar as Fr,ListItemIcon as De,ListItemText as Be,useMediaQuery as Rr,useTheme as Er}from"@mui/material";import Pr from"@mui/icons-material/Close";import Sr from"@mui/icons-material/Menu";import Dr from"@mui/icons-material/MoreHoriz";import mo from"@mui/icons-material/Download";import Br from"@mui/icons-material/Add";import Hr from"@mui/icons-material/Remove";import po from"@mui/icons-material/RotateLeft";import ho from"@mui/icons-material/RotateRight";import fo from"@mui/icons-material/FitScreen";import go from"@mui/icons-material/KeyboardArrowLeft";import xo from"@mui/icons-material/KeyboardArrowRight";import zr from"@mui/icons-material/TextSnippet";import Vr from"@mui/icons-material/VideoFile";import Ar from"@mui/icons-material/AudioFile";import Wr from"@mui/icons-material/Description";import Xr from"@mui/icons-material/InsertDriveFile";import yo from"@mui/icons-material/Code";import _r from"@mui/icons-material/TableView";import{Document as bo,Page as vo,pdfjs as jr}from"react-pdf";import wo from"@monaco-editor/react";import Yr from"react-spreadsheet";import*as me from"xlsx";import{LoadingProgress as Mo}from"@ehfuse/mui-fadeout-loading-progress";var at=i=>{let s=i.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(s)?"image":s==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(s)?"text":["csv","xls","xlsx"].includes(s)?"spreadsheet":["html","htm"].includes(s)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(s)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(s)?"video":["mp3","wav","ogg","m4a","aac"].includes(s)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(s)?"office":"unsupported"},io=i=>{let s=(i||"").toLowerCase().split(";")[0].trim();return s?s.startsWith("image/")?"image":s==="application/pdf"?"pdf":s.startsWith("video/")?"video":s.startsWith("audio/")?"audio":s==="text/html"?"html":s==="text/csv"||s==="application/vnd.ms-excel"||s==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":s.startsWith("text/")||s==="application/json"||s==="application/xml"?"text":"unsupported":"unsupported"},T=(i,s)=>{let d=at(i);return d!=="unsupported"?d:io(s)},hr=new Set(["image","pdf","text","code","html","spreadsheet","video","audio"]),fr=i=>hr.has(at(i)),gr={"image/jpeg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/svg+xml":"svg","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-excel":"xls","text/csv":"csv","text/plain":"txt","application/json":"json","text/xml":"xml","application/xml":"xml","text/html":"html","video/mp4":"mp4","video/webm":"webm","audio/mpeg":"mp3","audio/wav":"wav"},xr=(i,s)=>{let d=(i??"").trim()||"\uCCA8\uBD80\uD30C\uC77C";if(/\.[a-z0-9]+$/i.test(d))return d;let m=(s??"").trim().toLowerCase().split(";")[0],j=gr[m]??"";return j?`${d}.${j}`:d},lt=i=>{let s=i.split(".").pop()?.toLowerCase()||"";return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",scss:"scss",sass:"scss",less:"less",json:"json",xml:"xml",php:"php",py:"python",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",swift:"swift",kt:"kotlin",scala:"scala",sql:"sql",sh:"shell",bash:"shell",bat:"bat",ps1:"powershell",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",conf:"ini",md:"markdown",markdown:"markdown",txt:"plaintext",log:"plaintext",csv:"plaintext"}[s]||"plaintext"};var yr=i=>(i||"").replace(/[\\/:*?"<>|\r\n]/g,"_").trim()||"download",st=(i,s)=>{let d=URL.createObjectURL(i),m=document.createElement("a");m.href=d,m.download=yr(s),m.rel="noopener",document.body.appendChild(m),m.click(),m.remove(),window.setTimeout(()=>URL.revokeObjectURL(d),6e4)};var ao=async i=>{let s=URL.createObjectURL(i);try{let d=await new Promise((U,q)=>{let I=new Image;I.onload=()=>U(I),I.onerror=()=>q(new Error("\uC774\uBBF8\uC9C0\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")),I.src=s}),m=document.createElement("canvas");m.width=d.naturalWidth||d.width||1024,m.height=d.naturalHeight||d.height||1024;let j=m.getContext("2d");if(!j)throw new Error("\uCE94\uBC84\uC2A4\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return j.drawImage(d,0,0,m.width,m.height),await new Promise((U,q)=>{m.toBlob(I=>I?U(I):q(new Error("PNG \uBCC0\uD658 \uC2E4\uD328")),"image/png")})}finally{URL.revokeObjectURL(s)}};import{useMediaQuery as br,useTheme as vr}from"@mui/material";function lo(){let i=vr();return!br(i.breakpoints.up("lg"))}import{jsx as te,jsxs as so}from"react/jsx-runtime";function oe(i){return so("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:i.width||"22px",...i,children:[te("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),te("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),te("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),te("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),so("g",{children:[te("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),te("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}import{jsx as D,jsxs as ct}from"react/jsx-runtime";function re(i){return D("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:i.width||"28px",...i,children:ct("g",{children:[D("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),D("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),ct("g",{children:[ct("g",{children:[D("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),D("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),D("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),D("g",{children:D("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),D("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),D("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),D("g",{children:D("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}import{Fragment as ue,jsx as r,jsxs as h}from"react/jsx-runtime";var Or="/pdfjs",Co=32,To=240,Ur=8192,dt=.25,ut=8,mt=80,Io=80,Nr=i=>{switch(i){case"image":return r(oe,{});case"pdf":return r(re,{});case"text":return r(zr,{sx:{mr:1,color:"#66BB6A"}});case"spreadsheet":return r(_r,{sx:{mr:1,color:"#4CAF50"}});case"html":return r(yo,{sx:{mr:1,color:"#E91E63"}});case"code":return r(yo,{sx:{mr:1,color:"#2196F3"}});case"video":return r(Vr,{sx:{mr:1,color:"#AB47BC"}});case"audio":return r(Ar,{sx:{mr:1,color:"#FF7043"}});case"office":return r(Wr,{sx:{mr:1,color:"#FFA726"}});default:return r(Xr,{sx:{mr:1,color:"#78909C"}})}},ko=i=>typeof i?.rotate=="number"?i.rotate:typeof i?._pageInfo?.rotate=="number"?i._pageInfo.rotate:0,Lo=({open:i,onClose:s,file:d,files:m=null,initialIndex:j=0,loadFile:U,onDownload:q,pdfAssetBase:I=Or})=>{let x=lo(),Eo=Er(),ne=Rr(Eo.breakpoints.down("sm")),S=co(()=>m&&m.length>0?m:[],[m]),[pe,ie]=p(0);B(()=>{i&&ie(S.length>0?Math.min(Math.max(j,0),S.length-1):0)},[i,j,S]);let u=S.length>0?S[pe]??d:d,[he,Ae]=p(!0),[We,pt]=p(!1),[M,Xe]=p(""),[k,A]=p(1),[Y,ae]=p(0),[ht,fe]=p(""),[C,ft]=p(""),[gt,ge]=p(""),[le,xe]=p(14),[_e,ye]=p(""),[je,xt]=p("preview"),[Ye,se]=p([]),[yt,bt]=p([]),[Po,Oe]=p(""),[Ue,vt]=p(null),[wt,be]=p(!1),[So,Ne]=p(!0),[Mt,ve]=p(""),[L,Ct]=p(),[F,N]=p(1),[Do,$e]=p(!1),[Tt,Z]=p(null),[we,It]=p("portrait"),[Bo,kt]=p(0),[Ge,Lt]=p(0),[ce,Ft]=p({width:0,height:0}),Rt=g([]),Ke=g(null),$=g(null),qe=g(null),Ze=g(null),Ho=w(e=>{if(qe.current?.disconnect(),Ze.current?.(),Ze.current=null,$.current=e,!e){qe.current=null;return}let t=a=>{a.touches.length>=2&&a.preventDefault()};e.addEventListener("touchmove",t,{passive:!1}),Ze.current=()=>e.removeEventListener("touchmove",t);let o=new ResizeObserver(a=>{let l=a[0]?.contentRect;l&&Ft({width:l.width,height:l.height})});o.observe(e),qe.current=o;let n=e.getBoundingClientRect();Ft({width:n.width,height:n.height})},[]),[Me,Et]=p(!1),[Qe,zo]=p({x:0,y:0}),[Je,Vo]=p({x:0,y:0}),Ao=w(async(e,t)=>{let o=URL.createObjectURL(e);Xe(o),ft(e.type||"");let n=T(t,e.type||"");if(n==="text"||n==="code"){let l=await e.text();ge(l);return}if(n==="html"){let l=await e.text();ye(l);return}if(n!=="spreadsheet")return;let a=t.split(".").pop()?.toLowerCase()||"";if(a==="csv"){let f=(await e.text()).split(`
2
+ `).map(v=>v.split(",").map(z=>({value:z.trim()})));se(f);return}if(a==="xls"||a==="xlsx"){be(!0),Ne(!0);let l=await e.arrayBuffer(),f=me.read(l,{type:"array"});bt(f.SheetNames),vt(f);let v=f.SheetNames[0];Oe(v),rt(f,v)}},[]),Ce=g(null),Pt=w(async e=>{if(e.blob)return e.blob;if(U)return await U(e);if(e.url){let t=await fetch(e.url);if(!t.ok)throw new Error("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return await t.blob()}throw new Error("\uD30C\uC77C \uB370\uC774\uD130 \uC18C\uC2A4(blob/url/loadFile)\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")},[U]);B(()=>(u&&i?jo():(M&&URL.revokeObjectURL(M),Ce.current=null,Xe(""),ge(""),ye(""),se([]),xe(14),A(1),ae(0)),()=>{M&&URL.revokeObjectURL(M)}),[u,i]);let Wo=({numPages:e})=>{Ct(e),N(1),Ee.current=!0},Xo=e=>{let{width:t,height:o}=_o(e);kt(ko(e)),t>0&&o>0&&Lt(t/o);let n=t>o?"landscape":"portrait";It(n)},_o=e=>{let t=e?.width||0,o=e?.height||0,n=ko(e);try{if(typeof e?.getViewport=="function"){let a=e.getViewport({scale:1,rotation:n});t=a.width,o=a.height}}catch(a){console.warn("[FileViewer] getViewport \uC2E4\uD328 - \uAE30\uBCF8 width/height\uB85C \uB300\uCCB4",a)}return{width:t,height:o}},Te=w(()=>{N(e=>Math.max(e-1,1))},[]),Ie=w(()=>{N(e=>Math.min(e+1,L||1))},[L]),St=co(()=>({cMapUrl:`${I}/cmaps/`,cMapPacked:!0,standardFontDataUrl:`${I}/standard_fonts/`,wasmUrl:`${I}/wasm/`}),[I]);B(()=>{typeof window>"u"||(jr.GlobalWorkerOptions.workerSrc=`${I}/pdf.worker.min.mjs`)},[I]),B(()=>{if(!i||S.length<=1||T(u?.name||"",C)==="pdf")return;let e=t=>{t.key==="ArrowLeft"?(t.preventDefault(),ie(o=>Math.max(o-1,0))):t.key==="ArrowRight"&&(t.preventDefault(),ie(o=>Math.min(o+1,S.length-1)))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i,S.length,u?.name,C]),B(()=>{if(!i||T(u?.name||"",C)!=="pdf")return;let e=o=>{switch(o.key){case"ArrowLeft":case"ArrowUp":o.preventDefault(),Te();break;case"ArrowRight":case"ArrowDown":o.preventDefault(),Ie();break;case"Home":o.preventDefault(),N(1);break;case"End":o.preventDefault(),L&&N(L);break}},t=o=>{o.ctrlKey||Math.abs(o.deltaY)>50&&(o.preventDefault(),o.deltaY>0?Ie():Te())};return document.addEventListener("keydown",e),document.addEventListener("wheel",t,{passive:!1}),()=>{document.removeEventListener("keydown",e),document.removeEventListener("wheel",t)}},[i,u,C,Te,Ie,L]),B(()=>{if(!L||!i||T(u?.name||"",C)!=="pdf")return;if(F===1&&Ke.current){Ke.current.scrollTo({top:0,behavior:"smooth"});return}let e=Rt.current[F-1];e&&e.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[i,u,C,L,F]),B(()=>{he&&pt(!0)},[he,We]);let jo=async()=>{if(u){Ae(!0),fe(""),ft(""),ge(""),ye(""),se([]);try{let e=await Pt(u);Ce.current=e,await Ao(e,u.name)}catch(e){console.error("\uD30C\uC77C \uB85C\uB4DC \uC624\uB958:",e),fe("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}finally{Ae(!1)}}},Dt=async()=>{if(u)try{if(q){await q(u);return}let e=Ce.current??await Pt(u);st(e,u.name)}catch(e){console.error("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC624\uB958:",e)}},Yo=()=>{let e=u?T(u.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?xe(t=>Math.min(t+2,24)):A(e==="pdf"?t=>Math.min(t+.25,ut):t=>Math.min(t+.25,3))},Oo=()=>{let e=u?T(u.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?xe(t=>Math.max(t-2,10)):A(e==="pdf"?t=>Math.max(t-.25,dt):t=>Math.max(t-.25,.25))},y=g(new Map),Uo=e=>Math.min(Math.max(e,.25),3),No=e=>Math.min(Math.max(e,dt),ut),et=g(null),ke=g(null),X=g({scale:1,tx:0,ty:0,rotation:0}),O=g(0),Q=g(null),Le=g(null),Fe=w((e,t,o,n)=>{let a=et.current,l=ke.current;if(!a||!l)return{tx:t,ty:o};let f=l.offsetWidth,v=l.offsetHeight,z=(Math.round(n/90)%4+4)%4;if(z===1||z===3){let pr=f;f=v,v=pr}let W=f*e,oo=v*e,ro=W>a.clientWidth?(W+a.clientWidth)/2-Io:0,no=oo>a.clientHeight?(oo+a.clientHeight)/2-Io:0;return{tx:Math.min(ro,Math.max(-ro,t)),ty:Math.min(no,Math.max(-no,o))}},[]),Bt=w((e,t)=>{let o=et.current,n=ke.current;if(!o||!n)return e>1;let a=(Math.round(t/90)%4+4)%4,l=a===1||a===3,f=l?n.offsetHeight:n.offsetWidth,v=l?n.offsetWidth:n.offsetHeight;return f*e>o.clientWidth+1||v*e>o.clientHeight+1},[]),G=w(e=>{let t=ke.current;if(!t)return;let{scale:o,tx:n,ty:a,rotation:l}=X.current;t.style.transition=e?"transform 0.25s ease":"none",t.style.transform=`translate(${n}px, ${a}px) scale(${o}) rotate(${l}deg)`},[]),Ht=w(()=>{let e=X.current,t=Fe(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,!O.current&&(O.current=requestAnimationFrame(()=>{O.current=0,G(!1)}))},[G,Fe]),zt=w(()=>{O.current&&(cancelAnimationFrame(O.current),O.current=0),y.current.clear(),Q.current=null,Le.current=null},[]),$o=w(e=>{ke.current=e,e&&(X.current={scale:1,tx:0,ty:0,rotation:0},G(!1))},[G]);B(()=>{if(T(u?.name||"",C)!=="image")return;let e=X.current;e.scale=k,e.rotation=Y;let t=Fe(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,G(!0)},[k,Y,u,C,M,G,Fe]),B(()=>()=>{O.current&&cancelAnimationFrame(O.current)},[]);let Go=e=>{e.currentTarget.setPointerCapture?.(e.pointerId),y.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...y.current.values()],o=X.current;if(t.length===2){Q.current=null;let n=e.currentTarget.getBoundingClientRect();Le.current={startDist:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)||1,baseScale:o.scale,baseTx:o.tx,baseTy:o.ty,startMidX:(t[0].x+t[1].x)/2,startMidY:(t[0].y+t[1].y)/2,centerX:n.left+n.width/2,centerY:n.top+n.height/2}}else t.length===1&&Bt(o.scale,o.rotation)&&(Q.current={startX:e.clientX,startY:e.clientY,baseTx:o.tx,baseTy:o.ty})},Ko=e=>{if(!y.current.has(e.pointerId))return;y.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=X.current,o=Le.current,n=[...y.current.values()];if(o&&n.length>=2){let l=Math.hypot(n[0].x-n[1].x,n[0].y-n[1].y),f=(n[0].x+n[1].x)/2,v=(n[0].y+n[1].y)/2,z=Uo(o.baseScale*l/o.startDist),W=z/o.baseScale;t.scale=z,t.tx=f-o.centerX-W*(o.startMidX-o.centerX-o.baseTx),t.ty=v-o.centerY-W*(o.startMidY-o.centerY-o.baseTy),Ht();return}let a=Q.current;a&&n.length===1&&(t.tx=a.baseTx+(e.clientX-a.startX),t.ty=a.baseTy+(e.clientY-a.startY),Ht())},Vt=e=>{if(!y.current.has(e.pointerId))return;y.current.delete(e.pointerId),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId);let t=X.current;if(y.current.size<2&&(Le.current=null,Math.abs(t.scale-k)>.001&&A(t.scale)),y.current.size===0)Q.current=null;else if(y.current.size===1&&Bt(t.scale,t.rotation)){let o=[...y.current.values()][0];Q.current={startX:o.x,startY:o.y,baseTx:t.tx,baseTy:t.ty}}},At=w(async()=>{if(M)try{let t=await(await fetch(M)).blob(),o=t.type==="image/png"?t:await ao(t);await navigator.clipboard.write([new ClipboardItem({"image/png":o})]),ve("\uC774\uBBF8\uC9C0\uB97C \uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")}catch(e){console.error("\uC774\uBBF8\uC9C0 \uBCF5\uC0AC \uC624\uB958:",e),ve("\uC774\uBBF8\uC9C0\uB97C \uBCF5\uC0AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}},[M]);B(()=>{if(!i||T(u?.name||"",C)!=="image")return;let e=t=>{if(!(t.ctrlKey||t.metaKey)||t.key.toLowerCase()!=="c")return;let o=t.target,n=o?.tagName;n==="INPUT"||n==="TEXTAREA"||o?.isContentEditable||(t.preventDefault(),At())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i,u,C,At]);let J=g(null),H=g(0),de=g(null),ee=g(null),K=()=>$.current?.querySelector(".react-pdf__Page")??null,Re=g(null),Wt=g(null),qo=()=>{let e=Wt.current,t=K()?.querySelector("canvas");if(!e||!t||!t.width||!t.height)return!1;let o=document.createElement("canvas");o.width=t.width,o.height=t.height;let n=o.getContext("2d");if(!n)return!1;n.drawImage(t,0,0);let a=t.getBoundingClientRect(),l=e.getBoundingClientRect();return Object.assign(o.style,{position:"absolute",left:`${a.left-l.left}px`,top:`${a.top-l.top}px`,width:`${a.width}px`,height:`${a.height}px`,pointerEvents:"none",zIndex:"1"}),e.appendChild(o),Re.current=o,!0},Xt=()=>{Re.current?.remove(),Re.current=null;let e=K();e&&(e.style.visibility="")},Zo=()=>{H.current||(H.current=requestAnimationFrame(()=>{H.current=0;let e=J.current,t=K();!e||!t||(t.style.transition="none",t.style.transformOrigin="top left",t.style.transform=`translate(${e.tx}px, ${e.ty}px) scale(${e.k})`,de.current={k:e.k,tx:e.tx,ty:e.ty,midX:e.lastMidX,midY:e.lastMidY})}))},_t=()=>{H.current&&(cancelAnimationFrame(H.current),H.current=0),J.current=null,ee.current=null,de.current=null,Xt();let e=K();e&&(e.style.transform="",e.style.willChange="auto")},jt=e=>{let t=K(),o=$.current;if(!t||!o)return;t.style.transform&&(t.style.transform="");let n=t.getBoundingClientRect(),a=o.getBoundingClientRect(),l=(e[0].x+e[1].x)/2,f=(e[0].y+e[1].y)/2;J.current={startDist:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)||1,rectLeft:n.left,rectTop:n.top,pageW:n.width,pageH:n.height,viewerL:a.left,viewerT:a.top,viewerR:a.right,viewerB:a.bottom,startMidX:l,startMidY:f,lastMidX:l,lastMidY:f,k:1,tx:0,ty:0},de.current={k:1,tx:0,ty:0,midX:l,midY:f},t.style.willChange="transform"},Qo=e=>{if(e.pointerType!=="touch")return;y.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...y.current.values()];if(t.length===2){if(ee.current||Re.current)return;jt(t)}},Jo=e=>{if(!y.current.has(e.pointerId))return;y.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=J.current,o=[...y.current.values()];if(t&&o.length>=2){e.preventDefault();let n=Math.hypot(o[0].x-o[1].x,o[0].y-o[1].y),a=Math.min(Math.max(n/t.startDist,dt/(k||1)),ut/(k||1)),l=(o[0].x+o[1].x)/2,f=(o[0].y+o[1].y)/2,v=l-t.rectLeft-a*(t.startMidX-t.rectLeft),z=f-t.rectTop-a*(t.startMidY-t.rectTop),W=mt;v=Math.min(t.viewerR-W-t.rectLeft,Math.max(t.viewerL+W-t.rectLeft-a*t.pageW,v)),z=Math.min(t.viewerB-W-t.rectTop,Math.max(t.viewerT+W-t.rectTop-a*t.pageH,z)),t.k=a,t.tx=v,t.ty=z,t.lastMidX=l,t.lastMidY=f,Zo()}},Yt=e=>{if(y.current.delete(e.pointerId),y.current.size>=2)return;let t=J.current;if(J.current=null,!t)return;H.current&&(cancelAnimationFrame(H.current),H.current=0);let o=de.current??{k:1,tx:0,ty:0,midX:t.startMidX,midY:t.startMidY};de.current=null;let n=No(k*o.k);if(Math.abs(n-k)<.001){let l=$.current;_t(),l&&(l.scrollLeft-=o.tx,l.scrollTop-=o.ty);return}let a=$.current;if(a){let l=a.getBoundingClientRect();ee.current={u:(o.midX-t.rectLeft-o.tx)/o.k,v:(o.midY-t.rectTop-o.ty)/o.k,offX:o.midX-l.left,offY:o.midY-l.top,factor:n/(k||1)}}if(qo()){let l=K();l&&(l.style.transform="",l.style.visibility="hidden")}A(n),Math.round(Math.min(nt*n,Jt))===it&&requestAnimationFrame(()=>Ut())},Ee=g(!0),tt=g(null),Ot=()=>{let e=$.current;e&&(e.scrollLeft=(e.scrollWidth-e.clientWidth)/2,e.scrollTop=(e.scrollHeight-e.clientHeight)/2)},Ut=()=>{let e=ee.current;if(!e)return;ee.current=null;let t=$.current,o=K();if(!t||!o)return;Xt(),o.style.transform="",o.style.willChange="auto";let n=o.getBoundingClientRect(),a=t.getBoundingClientRect();t.scrollLeft+=n.left-a.left+e.u*e.factor-e.offX,t.scrollTop+=n.top-a.top+e.v*e.factor-e.offY;let l=[...y.current.values()];l.length>=2&&jt(l)},Nt=()=>{let e=`${F}:${Y}`;if(ee.current){tt.current=e,Ut();return}(Ee.current||tt.current!==e)&&(Ee.current=!1,tt.current=e,Ot())};B(()=>()=>{H.current&&cancelAnimationFrame(H.current)},[]);let $t=()=>{ae(e=>e-90)},Gt=()=>{ae(e=>e+90)},Kt=()=>{let e=T(u?.name||"",C);_t(),e==="text"||e==="html"||e==="code"||e==="spreadsheet"?xe(14):e==="pdf"?(A(1),k===1&&Y===0?Ot():Ee.current=!0):(zt(),X.current={scale:1,tx:0,ty:0,rotation:0},G(!0),A(1)),ae(0)},qt=(e,t)=>{Et(!0),zo({x:e.clientX,y:e.clientY}),Vo({x:t.scrollLeft,y:t.scrollTop}),e.preventDefault()},Zt=w((e,t)=>{if(!Me)return;let o=e.clientX-Qe.x,n=e.clientY-Qe.y;t.scrollLeft=Je.x-o,t.scrollTop=Je.y-n,e.preventDefault()},[Me,Qe,Je]),ot=w(()=>{Et(!1),document.body.style.cursor="default"},[]);B(()=>{if(Me){let e=t=>{document.querySelectorAll(".draggable-scroll").forEach(n=>{Zt(t,n)})};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",ot),document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",ot),document.body.style.userSelect="",document.body.style.webkitUserSelect=""}}},[Me,Zt,ot]);let er=w(()=>{Ae(!1),pt(!1)},[]),rt=w(async(e,t)=>{be(!0),Ne(!0);try{await new Promise(f=>setTimeout(f,500));let o=e.Sheets[t],n=me.utils.decode_range(o["!ref"]||"A1");console.debug("Excel range:",n);let l=me.utils.sheet_to_json(o,{header:1,range:n,defval:""}).map(f=>f.map(v=>({value:v!=null?String(v):""})));se(l),await new Promise(f=>setTimeout(f,200))}catch(o){console.error("\uC6CC\uD06C\uC2DC\uD2B8 \uB85C\uB4DC \uC624\uB958:",o)}finally{Ne(!1)}},[]),tr=w(()=>{be(!1)},[]),or=w(e=>{Ue&&(Oe(e),rt(Ue,e))},[Ue,rt]),Qt=()=>{zt(),X.current={scale:1,tx:0,ty:0,rotation:0},ve(""),M&&URL.revokeObjectURL(M),Ce.current=null,Xe(""),ge(""),ye(""),se([]),bt([]),Oe(""),vt(null),be(!1),A(1),ae(0),fe(""),Ct(void 0),N(1),It("portrait"),kt(0),Lt(0),s()};if(!u)return null;let b=T(u.name,C),rr=((Bo+Y)%360+360)%360,Pe=Y%180===0?Ge:Ge>0?1/Ge:0,nr=Math.max(ce.width-Co,To),ir=Math.max(ce.height-Co,To),nt=ce.width>0&&Pe>0?Math.min(nr,ir*Pe):we==="portrait"?600:800,ar=typeof window<"u"&&window.devicePixelRatio||1,Jt=Ur/ar*(Pe>0?Math.min(1,Pe):1),it=Math.round(Math.min(nt*k,Jt)),eo=Math.round(nt*k),lr=eo>it,sr=Math.max(16,Math.round(ce.width)-mt),cr=Math.max(16,Math.round(ce.height)-mt),dr=we==="landscape"?"200px":"150px",ur=we==="landscape"?.18:.17,to=()=>L?r(c,{ref:Ke,sx:{width:dr,height:"100%",backgroundColor:"grey.200",borderRight:"1px solid",borderColor:"grey.300",overflow:"auto",p:2},children:Array.from({length:L},(e,t)=>h(c,{ref:o=>{Rt.current[t]=o},children:[r(c,{sx:{mb:0,p:1,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:F===t+1?"2px solid":"1px solid",borderColor:F===t+1?"primary.main":"grey.400",borderRadius:1,overflow:"hidden",backgroundColor:"white","&:hover":{borderColor:"primary.main"},aspectRatio:we==="landscape"?"4 / 3":"3 / 4"},onClick:()=>{N(t+1),x&&$e(!1)},children:r(bo,{file:M,options:St,loading:r("div",{style:{display:"none"}}),children:r(vo,{pageNumber:t+1,scale:ur,loading:r("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1})})}),r(E,{variant:"caption",sx:{display:"block",textAlign:"center",p:.5,mb:1,color:F===t+1?"primary.main":"",fontWeight:F===t+1?"bold":"normal"},children:t+1})]},t+1))}):null,mr=()=>{let e=T(u?.name||"",C);if(We&&!(e==="spreadsheet"))return r(c,{sx:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},children:r(Mo,{visible:he,exitDelay:100,onComplete:er})});if(ht)return h(c,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[r(E,{color:"error",variant:"h6",children:ht}),r(E,{color:"text.secondary",variant:"body2",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]});if(!M)return null;switch(e){case"image":return r(c,{ref:et,"data-allow-pinch":"true",onPointerDown:Go,onPointerMove:Ko,onPointerUp:Vt,onPointerCancel:Vt,sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"hidden",height:"100%",backgroundColor:"grey.100",p:2,touchAction:"none",overscrollBehavior:"contain",userSelect:"none","&:active":{cursor:"grabbing"}},children:r("img",{ref:$o,src:M,alt:u.name,draggable:!1,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",transform:"translate(0px, 0px) scale(1) rotate(0deg)",transformOrigin:"center center",pointerEvents:"none"}})});case"pdf":return h(ue,{children:[h(c,{ref:Wt,sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",backgroundColor:"grey.100",position:"relative",overflow:"hidden"},children:[!x&&to(),r(c,{ref:Ho,className:"draggable-scroll",onMouseDown:o=>{let n=o.currentTarget;qt(o,n)},"data-allow-pinch":"true",onPointerDown:Qo,onPointerMove:Jo,onPointerUp:Yt,onPointerCancel:Yt,sx:{flex:1,display:"flex",flexDirection:"column",overflow:"auto",height:"100%",py:x?0:2,overflowAnchor:"none",touchAction:"pan-x pan-y","& > .react-pdf__Document":{m:"auto",...x&&{px:`${sr}px`,py:`${cr}px`},...lr&&{"& .react-pdf__Page__canvas":{width:`${eo}px !important`,height:"auto !important"}}}},children:r(bo,{file:M,onLoadSuccess:Wo,onLoadError:o=>{console.error("PDF \uB85C\uB4DC \uC624\uB958:",o),fe("PDF \uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")},loading:r("div",{style:{display:"none"}}),error:h(c,{sx:{textAlign:"center",p:4},children:[r(E,{color:"error",variant:"h6",sx:{mb:2},children:"PDF\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}),r(E,{color:"text.secondary",variant:"body2",children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]}),options:St,children:r(vo,{pageNumber:F,width:it,rotate:Y===0?void 0:rr,loading:r("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1,onLoadSuccess:Xo,onRenderSuccess:Nt,onRenderError:Nt})})})]}),x&&r(Tr,{anchor:"left",open:Do,onClose:()=>$e(!1),sx:{zIndex:o=>o.zIndex.modal+2},children:to()})]});case"text":case"code":return r(c,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column"},children:gt?r(c,{sx:{flex:1,height:"100%",overflow:"hidden"},children:r(wo,{height:"100%",language:lt(u.name),value:gt,theme:"vs-dark",loading:!1,options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,formatOnPaste:!0,formatOnType:!0,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:le,lineHeight:Math.round(le*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(o,n)=>{o.onDidAttemptReadOnlyEdit(()=>{});let a=o.getDomNode();if(a){let l=document.createElement("style");l.textContent=`
3
3
  .monaco-editor .margin-view-overlays {
4
4
  border-right: 1px solid #3c3c3c;
5
5
  }
@@ -27,7 +27,7 @@ import{useState as u,useEffect as V,useMemo as dr,useCallback as v,useRef as g}f
27
27
  .monaco-editor .overlay.cursor-layer {
28
28
  padding-left: 15px !important;
29
29
  }
30
- `,i.appendChild(s)}}})}):r(d,{sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:r(F,{color:"text.secondary",children:"\uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"html":return r(d,{sx:{width:"100%",height:"calc(100vh - 60px)",overflow:"hidden",borderRadius:1},children:Se?f(d,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[f(d,{sx:{display:"flex",gap:1,p:1,borderBottom:"1px solid",borderColor:"grey.300",backgroundColor:"grey.50"},children:[r(oo,{variant:Be==="preview"?"contained":"outlined",size:"small",onClick:()=>dt("preview"),children:"\uBBF8\uB9AC\uBCF4\uAE30"}),r(oo,{variant:Be==="source"?"contained":"outlined",size:"small",onClick:()=>dt("source"),children:"\uC18C\uC2A4\uCF54\uB4DC"})]}),Be==="preview"?r(d,{sx:{flex:1,overflow:"auto",backgroundColor:"white",border:"1px solid",borderColor:"grey.300",fontSize:`${oe}px`,p:2},dangerouslySetInnerHTML:{__html:Se}}):r(d,{sx:{flex:1,height:"100%",overflow:"hidden"},children:r(uo,{height:"100%",language:"html",value:Se,theme:"vs-dark",options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:oe,lineHeight:Math.round(oe*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(o,n)=>{o.onDidAttemptReadOnlyEdit(()=>{});let i=o.getDomNode();if(i){let s=document.createElement("style");s.textContent=`
30
+ `,a.appendChild(l)}}})}):r(c,{sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:r(E,{color:"text.secondary",children:"\uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"html":return r(c,{sx:{width:"100%",height:"calc(100vh - 60px)",overflow:"hidden",borderRadius:1},children:_e?h(c,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[h(c,{sx:{display:"flex",gap:1,p:1,borderBottom:"1px solid",borderColor:"grey.300",backgroundColor:"grey.50"},children:[r(uo,{variant:je==="preview"?"contained":"outlined",size:"small",onClick:()=>xt("preview"),children:"\uBBF8\uB9AC\uBCF4\uAE30"}),r(uo,{variant:je==="source"?"contained":"outlined",size:"small",onClick:()=>xt("source"),children:"\uC18C\uC2A4\uCF54\uB4DC"})]}),je==="preview"?r(c,{sx:{flex:1,overflow:"auto",backgroundColor:"white",border:"1px solid",borderColor:"grey.300",fontSize:`${le}px`,p:2},dangerouslySetInnerHTML:{__html:_e}}):r(c,{sx:{flex:1,height:"100%",overflow:"hidden"},children:r(wo,{height:"100%",language:"html",value:_e,theme:"vs-dark",options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:le,lineHeight:Math.round(le*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(o,n)=>{o.onDidAttemptReadOnlyEdit(()=>{});let a=o.getDomNode();if(a){let l=document.createElement("style");l.textContent=`
31
31
  .monaco-editor .margin-view-overlays {
32
32
  border-right: 1px solid #3c3c3c;
33
33
  }
@@ -55,4 +55,4 @@ import{useState as u,useEffect as V,useMemo as dr,useCallback as v,useRef as g}f
55
55
  .monaco-editor .overlay.cursor-layer {
56
56
  padding-left: 15px !important;
57
57
  }
58
- `,i.appendChild(s)}}})})]}):r(d,{sx:{backgroundColor:"white",p:2,borderRadius:1,border:"1px solid",borderColor:"grey.300",minHeight:"400px",display:"flex",alignItems:"center",justifyContent:"center"},children:r(F,{color:"text.secondary",children:"HTML \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"video":return r(d,{className:"draggable-scroll",onMouseDown:o=>{let n=o.currentTarget;Yt(o,n)},sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"auto"},children:r("video",{src:w,controls:!0,style:{maxWidth:"100%",maxHeight:"70vh",transform:`scale(${T}) rotate(${_}deg)`,transition:"transform 0.3s ease",pointerEvents:T>1?"none":"auto"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uBE44\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})});case"spreadsheet":return f(d,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[He.length>0||ft?f(d,{sx:{flex:1,position:"relative",overflow:"scroll",backgroundColor:"white",minHeight:"400px",minWidth:"100%","&::-webkit-scrollbar":{width:"18px",height:"18px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f1f1f1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"10px",border:"2px solid #f1f1f1","&:hover":{backgroundColor:"#555"}},"&::-webkit-scrollbar-corner":{backgroundColor:"#f1f1f1"}},children:[He.length>0&&r(d,{sx:{minWidth:"max-content",minHeight:"max-content"},children:r(Hr,{data:He,darkMode:!1})}),ft&&r(d,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",zIndex:1e3},children:r(mo,{visible:wo,exitDelay:200,fadeoutDuration:300,onComplete:Oo})})]}):r(d,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:r(F,{color:"text.secondary",children:"\uC2A4\uD504\uB808\uB4DC\uC2DC\uD2B8 \uB370\uC774\uD130\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})}),ut.length>1&&r(d,{sx:{borderTop:1,borderColor:"divider",backgroundColor:"#e0e0e0",padding:"0 8px 8px 8px"},children:r(hr,{value:vo,onChange:(o,n)=>Uo(n),variant:"scrollable",scrollButtons:"auto",sx:{minHeight:"36px","& .MuiTabs-flexContainer":{gap:"6px"},"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{minHeight:"32px",fontSize:"0.875rem",textTransform:"none",padding:"6px 16px",margin:"0",backgroundColor:"white",border:"1px solid #d0d0d0",borderRadius:"0 0 4px 4px",color:"#666",minWidth:"80px",transition:"all 0.2s ease","&:hover":{backgroundColor:"#f8f8f8",color:"#333"},"&.Mui-selected":{backgroundColor:"primary.main",color:"white",border:"1px solid",borderColor:"primary.dark",fontWeight:600,"&:hover":{backgroundColor:"primary.dark"}}}},children:ut.map(o=>r(gr,{label:o,value:o},o))})})]});case"audio":return f(d,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column"},children:[r(F,{variant:"h6",sx:{mb:2},children:a.name}),r("audio",{src:w,controls:!0,style:{width:"100%",maxWidth:"500px"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uC624\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})]});default:return f(d,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[r(F,{variant:"h6",color:"text.secondary",children:"\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4"}),r(F,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]})}};return f(ur,{open:c,onClose:Ut,maxWidth:"lg",fullScreen:!0,children:[f(mr,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"grey.800",color:"white",height:"60px",boxSizing:"border-box",userSelect:"none",px:h?1:3},onContextMenu:e=>e.preventDefault(),children:[f(d,{sx:{display:"flex",alignItems:"center",gap:ee?.35:1,flexShrink:0,"& .MuiSvgIcon-root":{fontSize:h?"1.7rem":void 0}},children:[h&&y==="pdf"&&I?r(D,{title:"\uD398\uC774\uC9C0 \uBAA9\uB85D",children:r(E,{onClick:()=>We(e=>!e),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:r(Mr,{})})}):null,y==="pdf"&&I?f(d,{sx:{display:"flex",alignItems:"center",gap:h?0:.5},children:[r(D,{title:"\uC774\uC804 \uD398\uC774\uC9C0",children:r("span",{style:{display:"inline-flex"},children:r(E,{onClick:ye,disabled:k<=1,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:r(kr,{})})})}),r(F,{variant:"body2",sx:{minWidth:h?"auto":"80px",textAlign:"center",color:"white",px:h?.5:1,fontSize:h?"1.05rem":void 0,fontWeight:h?600:void 0,whiteSpace:"nowrap"},children:ee?k:`${k} / ${I}`}),r(D,{title:"\uB2E4\uC74C \uD398\uC774\uC9C0",children:r("span",{style:{display:"inline-flex"},children:r(E,{onClick:be,disabled:k>=I,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:r(Lr,{})})})})]}):null]}),r(d,{sx:{display:"flex",alignItems:"center",flexGrow:1,mr:ee?0:2,overflow:"hidden"},children:!ee&&f(d,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:1.5,fontSize:"1rem"},children:[Ar(y),a.name]})}),f(d,{className:"toolbar",sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:ee?.35:1,"& .MuiSvgIcon-root":{fontSize:h?"1.7rem":void 0}},children:[(y==="image"||y==="pdf"||y==="text"||y==="html"||y==="code"||y==="spreadsheet")&&f(ae,{children:[!(h&&(y==="image"||y==="pdf"))&&f(ae,{children:[r(D,{title:"\uD655\uB300",children:r(E,{onClick:Do,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(Cr,{})})}),r(D,{title:"\uCD95\uC18C",children:r(E,{onClick:So,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(Ir,{})})})]}),!h&&r(D,{title:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30",children:r(E,{onClick:jt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(ao,{})})}),!h&&(y==="image"||y==="pdf")&&f(ae,{children:[r(D,{title:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804",children:r(E,{onClick:Xt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(no,{})})}),r(D,{title:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804",children:r(E,{onClick:_t,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(io,{})})})]})]}),!h&&r(D,{title:"\uB2E4\uC6B4\uB85C\uB4DC",children:r(E,{onClick:kt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(ro,{})})}),h&&f(ae,{children:[r(D,{title:"\uB354\uBCF4\uAE30",children:r(E,{onClick:e=>$(e.currentTarget),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:r(Tr,{})})}),f(xr,{anchorEl:xt,open:!!xt,onClose:()=>$(null),children:[y==="image"||y==="pdf"?f(ke,{onClick:()=>{jt(),$(null)},children:[r(Le,{children:r(ao,{fontSize:"small"})}),r(Fe,{children:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30"})]}):null,y==="image"||y==="pdf"?f(ke,{onClick:()=>{Xt(),$(null)},children:[r(Le,{children:r(no,{fontSize:"small"})}),r(Fe,{children:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,y==="image"||y==="pdf"?f(ke,{onClick:()=>{_t(),$(null)},children:[r(Le,{children:r(io,{fontSize:"small"})}),r(Fe,{children:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,f(ke,{onClick:()=>{kt(),$(null)},children:[r(Le,{children:r(ro,{fontSize:"small"})}),r(Fe,{children:"\uB2E4\uC6B4\uB85C\uB4DC"})]})]})]}),r(D,{title:"\uB2EB\uAE30",children:r(E,{onClick:Ut,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(wr,{})})})]})]}),r(pr,{sx:{p:"0 !important",overflow:"hidden",userSelect:"none"},onContextMenu:e=>e.preventDefault(),children:tr()}),r(yr,{open:!!ht,autoHideDuration:2e3,onClose:()=>fe(""),anchorOrigin:{vertical:"bottom",horizontal:"center"},message:ht,sx:{"& .MuiSnackbarContent-message":{fontSize:"0.95rem"}}})]})},Wr=xo;import{jsx as yo}from"react/jsx-runtime";function Re(c){return yo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:c.width||"22px",fill:c.fill||"#E91E63",...c,children:yo("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}import Xr from"@mui/icons-material/TextSnippet";import _r from"@mui/icons-material/VideoFile";import jr from"@mui/icons-material/AudioFile";import Yr from"@mui/icons-material/Description";import Or from"@mui/icons-material/InsertDriveFile";import Ur from"@mui/icons-material/Code";import Nr from"@mui/icons-material/TableView";import{jsx as z}from"react/jsx-runtime";function it(c,l=22){let a=`${l}px`,m={fontSize:l};switch(c){case"image":return z(Q,{width:a,height:a});case"pdf":return z(J,{width:a,height:a});case"html":return z(Re,{width:a,height:a});case"text":return z(Xr,{sx:{...m,color:"#66BB6A"}});case"spreadsheet":return z(Nr,{sx:{...m,color:"#4CAF50"}});case"code":return z(Ur,{sx:{...m,color:"#2196F3"}});case"video":return z(_r,{sx:{...m,color:"#AB47BC"}});case"audio":return z(jr,{sx:{...m,color:"#FF7043"}});case"office":return z(Yr,{sx:{...m,color:"#FFA726"}});default:return z(Or,{sx:{...m,color:"#78909C"}})}}function bo({fileName:c,mime:l,size:a=22}){return it(M(c,l??""),a)}export{bo as FileTypeIcon,xo as FileViewer,Wr as FileViewerDefault,Re as HtmlIcon,Q as ImageIcon,J as PdfIcon,ar as ensureFileExtension,Je as getEditorLanguage,Qe as getFileType,Qt as getFileTypeFromMime,it as getFileTypeIcon,nr as isFileViewerPreviewable,M as resolveFileType,et as saveBlobAsFile};
58
+ `,a.appendChild(l)}}})})]}):r(c,{sx:{backgroundColor:"white",p:2,borderRadius:1,border:"1px solid",borderColor:"grey.300",minHeight:"400px",display:"flex",alignItems:"center",justifyContent:"center"},children:r(E,{color:"text.secondary",children:"HTML \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"video":return r(c,{className:"draggable-scroll",onMouseDown:o=>{let n=o.currentTarget;qt(o,n)},sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"auto"},children:r("video",{src:M,controls:!0,style:{maxWidth:"100%",maxHeight:"70vh",transform:`scale(${k}) rotate(${Y}deg)`,transition:"transform 0.3s ease",pointerEvents:k>1?"none":"auto"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uBE44\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})});case"spreadsheet":return h(c,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[Ye.length>0||wt?h(c,{sx:{flex:1,position:"relative",overflow:"scroll",backgroundColor:"white",minHeight:"400px",minWidth:"100%","&::-webkit-scrollbar":{width:"18px",height:"18px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f1f1f1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"10px",border:"2px solid #f1f1f1","&:hover":{backgroundColor:"#555"}},"&::-webkit-scrollbar-corner":{backgroundColor:"#f1f1f1"}},children:[Ye.length>0&&r(c,{sx:{minWidth:"max-content",minHeight:"max-content"},children:r(Yr,{data:Ye,darkMode:!1})}),wt&&r(c,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",zIndex:1e3},children:r(Mo,{visible:So,exitDelay:200,fadeoutDuration:300,onComplete:tr})})]}):r(c,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:r(E,{color:"text.secondary",children:"\uC2A4\uD504\uB808\uB4DC\uC2DC\uD2B8 \uB370\uC774\uD130\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})}),yt.length>1&&r(c,{sx:{borderTop:1,borderColor:"divider",backgroundColor:"#e0e0e0",padding:"0 8px 8px 8px"},children:r(Ir,{value:Po,onChange:(o,n)=>or(n),variant:"scrollable",scrollButtons:"auto",sx:{minHeight:"36px","& .MuiTabs-flexContainer":{gap:"6px"},"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{minHeight:"32px",fontSize:"0.875rem",textTransform:"none",padding:"6px 16px",margin:"0",backgroundColor:"white",border:"1px solid #d0d0d0",borderRadius:"0 0 4px 4px",color:"#666",minWidth:"80px",transition:"all 0.2s ease","&:hover":{backgroundColor:"#f8f8f8",color:"#333"},"&.Mui-selected":{backgroundColor:"primary.main",color:"white",border:"1px solid",borderColor:"primary.dark",fontWeight:600,"&:hover":{backgroundColor:"primary.dark"}}}},children:yt.map(o=>r(kr,{label:o,value:o},o))})})]});case"audio":return h(c,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column"},children:[r(E,{variant:"h6",sx:{mb:2},children:u.name}),r("audio",{src:M,controls:!0,style:{width:"100%",maxWidth:"500px"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uC624\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})]});default:return h(c,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[r(E,{variant:"h6",color:"text.secondary",children:"\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4"}),r(E,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]})}};return h(wr,{open:i,onClose:Qt,maxWidth:"lg",fullScreen:!0,children:[h(Mr,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"grey.800",color:"white",height:"60px",boxSizing:"border-box",userSelect:"none",px:x?1:3},onContextMenu:e=>e.preventDefault(),children:[h(c,{sx:{display:"flex",alignItems:"center",gap:ne?.35:1,flexShrink:0,"& .MuiSvgIcon-root":{fontSize:x?"1.7rem":void 0}},children:[S.length>1?h(c,{sx:{display:"flex",alignItems:"center",gap:x?0:.5},children:[r(P,{title:"\uC774\uC804 \uD30C\uC77C",children:r("span",{style:{display:"inline-flex"},children:r(R,{onClick:()=>ie(e=>Math.max(e-1,0)),disabled:pe<=0,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"}},children:r(go,{})})})}),h(E,{variant:"body2",sx:{color:"grey.300",minWidth:40,textAlign:"center",userSelect:"none"},children:[pe+1," / ",S.length]}),r(P,{title:"\uB2E4\uC74C \uD30C\uC77C",children:r("span",{style:{display:"inline-flex"},children:r(R,{onClick:()=>ie(e=>Math.min(e+1,S.length-1)),disabled:pe>=S.length-1,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"}},children:r(xo,{})})})})]}):null,x&&b==="pdf"&&L?r(P,{title:"\uD398\uC774\uC9C0 \uBAA9\uB85D",children:r(R,{onClick:()=>$e(e=>!e),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:r(Sr,{})})}):null,b==="pdf"&&L?h(c,{sx:{display:"flex",alignItems:"center",gap:x?0:.5},children:[r(P,{title:"\uC774\uC804 \uD398\uC774\uC9C0",children:r("span",{style:{display:"inline-flex"},children:r(R,{onClick:Te,disabled:F<=1,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:r(go,{})})})}),r(E,{variant:"body2",sx:{minWidth:x?"auto":"80px",textAlign:"center",color:"white",px:x?.5:1,fontSize:x?"1.05rem":void 0,fontWeight:x?600:void 0,whiteSpace:"nowrap"},children:ne?F:`${F} / ${L}`}),r(P,{title:"\uB2E4\uC74C \uD398\uC774\uC9C0",children:r("span",{style:{display:"inline-flex"},children:r(R,{onClick:Ie,disabled:F>=L,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:r(xo,{})})})})]}):null]}),r(c,{sx:{display:"flex",alignItems:"center",flexGrow:1,mr:ne?0:2,overflow:"hidden"},children:!ne&&h(c,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:1.5,fontSize:"1rem"},children:[Nr(b),u.name]})}),h(c,{className:"toolbar",sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:ne?.35:1,"& .MuiSvgIcon-root":{fontSize:x?"1.7rem":void 0}},children:[(b==="image"||b==="pdf"||b==="text"||b==="html"||b==="code"||b==="spreadsheet")&&h(ue,{children:[!(x&&(b==="image"||b==="pdf"))&&h(ue,{children:[r(P,{title:"\uD655\uB300",children:r(R,{onClick:Yo,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(Br,{})})}),r(P,{title:"\uCD95\uC18C",children:r(R,{onClick:Oo,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(Hr,{})})})]}),!x&&r(P,{title:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30",children:r(R,{onClick:Kt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(fo,{})})}),!x&&(b==="image"||b==="pdf")&&h(ue,{children:[r(P,{title:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804",children:r(R,{onClick:$t,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(po,{})})}),r(P,{title:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804",children:r(R,{onClick:Gt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(ho,{})})})]})]}),!x&&r(P,{title:"\uB2E4\uC6B4\uB85C\uB4DC",children:r(R,{onClick:Dt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(mo,{})})}),x&&h(ue,{children:[r(P,{title:"\uB354\uBCF4\uAE30",children:r(R,{onClick:e=>Z(e.currentTarget),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:r(Dr,{})})}),h(Lr,{anchorEl:Tt,open:!!Tt,onClose:()=>Z(null),children:[b==="image"||b==="pdf"?h(Se,{onClick:()=>{Kt(),Z(null)},children:[r(De,{children:r(fo,{fontSize:"small"})}),r(Be,{children:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30"})]}):null,b==="image"||b==="pdf"?h(Se,{onClick:()=>{$t(),Z(null)},children:[r(De,{children:r(po,{fontSize:"small"})}),r(Be,{children:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,b==="image"||b==="pdf"?h(Se,{onClick:()=>{Gt(),Z(null)},children:[r(De,{children:r(ho,{fontSize:"small"})}),r(Be,{children:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,h(Se,{onClick:()=>{Dt(),Z(null)},children:[r(De,{children:r(mo,{fontSize:"small"})}),r(Be,{children:"\uB2E4\uC6B4\uB85C\uB4DC"})]})]})]}),r(P,{title:"\uB2EB\uAE30",children:r(R,{onClick:Qt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:r(Pr,{})})})]})]}),r(Cr,{sx:{p:"0 !important",overflow:"hidden",userSelect:"none"},onContextMenu:e=>e.preventDefault(),children:mr()}),r(Fr,{open:!!Mt,autoHideDuration:2e3,onClose:()=>ve(""),anchorOrigin:{vertical:"bottom",horizontal:"center"},message:Mt,sx:{"& .MuiSnackbarContent-message":{fontSize:"0.95rem"}}})]})},$r=Lo;import{jsx as Fo}from"react/jsx-runtime";function He(i){return Fo("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:i.width||"22px",fill:i.fill||"#E91E63",...i,children:Fo("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}import{jsx as _,jsxs as Gr}from"react/jsx-runtime";function ze(i){return Gr("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:i.width||"22px",fill:i.fill||"#B45309",...i,children:[_("path",{d:"M475.095,131.992c-0.032-2.526-0.833-5.021-2.568-6.993L366.324,3.694c-0.021-0.034-0.053-0.045-0.084-0.076 c-0.633-0.707-1.36-1.29-2.141-1.804c-0.232-0.15-0.465-0.285-0.707-0.422c-0.686-0.366-1.393-0.67-2.131-0.892 c-0.2-0.058-0.379-0.14-0.58-0.192C359.87,0.114,359.047,0,358.203,0H97.2C85.292,0,75.6,9.693,75.6,21.601v507.6 c0,11.913,9.692,21.601,21.6,21.601H453.6c11.918,0,21.601-9.688,21.601-21.601V133.202 C475.2,132.796,475.137,132.398,475.095,131.992z M243.599,523.494H141.75v-15.936l62.398-89.797v-0.785h-56.565v-24.484h95.051 v17.106l-61.038,88.636v0.771h62.002V523.494z M292.021,523.494h-29.744V392.492h29.744V523.494z M399.705,463.44 c-10.104,9.524-25.069,13.796-42.566,13.796c-3.893,0-7.383-0.19-10.104-0.58v46.849h-29.352V394.242 c9.134-1.561,21.958-2.721,40.036-2.721c18.277,0,31.292,3.491,40.046,10.494c8.354,6.607,13.996,17.486,13.996,30.322 C411.761,445.163,407.479,456.053,399.705,463.44z M97.2,366.752V21.601h129.167v-3.396h32.756v3.396h88.28v110.515 c0,5.961,4.831,10.8,10.8,10.8H453.6l0.011,223.836H97.2z"}),_("path",{d:"M359.279,413.87c-6.033,0-10.114,0.586-12.245,1.171v38.676c2.521,0.585,5.632,0.785,9.914,0.785 c15.736,0,25.46-7.979,25.46-21.378C382.408,421.063,374.045,413.87,359.279,413.87z"}),_("rect",{x:"259.124",y:"39.918",width:"32.756",height:"13.516"}),_("rect",{x:"226.368",y:"21.601",width:"32.756",height:"10.125"}),_("rect",{x:"226.368",y:"60.146",width:"32.756",height:"13.516"}),_("rect",{x:"259.124",y:"82.274",width:"32.756",height:"13.518"}),_("rect",{x:"259.124",y:"124.983",width:"32.756",height:"13.516"}),_("rect",{x:"226.368",y:"103.275",width:"32.756",height:"13.516"}),_("path",{d:"M259.124,149.537c-23.193,0-34.225,18.792-34.225,41.99l-7.765,70.348c0,23.198,18.792,42.003,41.984,42.003 c23.19,0,41.974-18.805,41.974-42.003l-7.741-70.348C293.361,168.334,282.318,149.537,259.124,149.537z M273.04,285.431h-27.799 v-58.728h27.799V285.431z"})]})}import Kr from"@mui/icons-material/TextSnippet";import qr from"@mui/icons-material/VideoFile";import Zr from"@mui/icons-material/AudioFile";import Qr from"@mui/icons-material/Description";import Jr from"@mui/icons-material/InsertDriveFile";import en from"@mui/icons-material/Code";import tn from"@mui/icons-material/TableView";import{jsx as V}from"react/jsx-runtime";function Ve(i,s=22){let d=`${s}px`,m={fontSize:s};switch(i){case"image":return V(oe,{width:d,height:d});case"pdf":return V(re,{width:d,height:d});case"html":return V(He,{width:d,height:d});case"archive":return V(ze,{width:d,height:d});case"text":return V(Kr,{sx:{...m,color:"#66BB6A"}});case"spreadsheet":return V(tn,{sx:{...m,color:"#4CAF50"}});case"code":return V(en,{sx:{...m,color:"#2196F3"}});case"video":return V(qr,{sx:{...m,color:"#AB47BC"}});case"audio":return V(Zr,{sx:{...m,color:"#FF7043"}});case"office":return V(Qr,{sx:{...m,color:"#FFA726"}});default:return V(Jr,{sx:{...m,color:"#78909C"}})}}var on=new Set(["zip","rar","7z","gz","tgz","tar","bz2","xz","alz","egg"]);function Ro({fileName:i,mime:s,size:d=22}){let m=i.includes(".")?i.slice(i.lastIndexOf(".")+1).toLowerCase():"";return on.has(m)?Ve("archive",d):Ve(T(i,s??""),d)}export{Ro as FileTypeIcon,Lo as FileViewer,$r as FileViewerDefault,He as HtmlIcon,oe as ImageIcon,re as PdfIcon,ze as ZipIcon,xr as ensureFileExtension,lt as getEditorLanguage,at as getFileType,io as getFileTypeFromMime,Ve as getFileTypeIcon,fr as isFileViewerPreviewable,T as resolveFileType,st as saveBlobAsFile};
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var gr=Object.create;var we=Object.defineProperty;var xr=Object.getOwnPropertyDescriptor;var yr=Object.getOwnPropertyNames;var br=Object.getPrototypeOf,vr=Object.prototype.hasOwnProperty;var wr=(s,u)=>{for(var c in u)we(s,c,{get:u[c],enumerable:!0})},to=(s,u,c,m)=>{if(u&&typeof u=="object"||typeof u=="function")for(let M of yr(u))!vr.call(s,M)&&M!==c&&we(s,M,{get:()=>u[M],enumerable:!(m=xr(u,M))||m.enumerable});return s};var p=(s,u,c)=>(c=s!=null?gr(br(s)):{},to(u||!s||!s.__esModule?we(c,"default",{value:s,enumerable:!0}):c,s)),Mr=s=>to(we({},"__esModule",{value:!0}),s);var Rr={};wr(Rr,{FileTypeIcon:()=>ct,FileViewer:()=>at,FileViewerDefault:()=>Io,HtmlIcon:()=>oe,ImageIcon:()=>Y,PdfIcon:()=>O,ensureFileExtension:()=>ro,getEditorLanguage:()=>Te,getFileType:()=>Me,getFileTypeFromMime:()=>qe,getFileTypeIcon:()=>ke,isFileViewerPreviewable:()=>oo,resolveFileType:()=>w,saveBlobAsFile:()=>Ce});module.exports=Mr(Rr);var i=require("react"),n=require("@mui/material"),uo=p(require("@mui/icons-material/Close"),1),mo=p(require("@mui/icons-material/Menu"),1),po=p(require("@mui/icons-material/MoreHoriz"),1),Je=p(require("@mui/icons-material/Download"),1),fo=p(require("@mui/icons-material/Add"),1),ho=p(require("@mui/icons-material/Remove"),1),et=p(require("@mui/icons-material/RotateLeft"),1),tt=p(require("@mui/icons-material/RotateRight"),1),ot=p(require("@mui/icons-material/FitScreen"),1),go=p(require("@mui/icons-material/KeyboardArrowLeft"),1),xo=p(require("@mui/icons-material/KeyboardArrowRight"),1),yo=p(require("@mui/icons-material/TextSnippet"),1),bo=p(require("@mui/icons-material/VideoFile"),1),vo=p(require("@mui/icons-material/AudioFile"),1),wo=p(require("@mui/icons-material/Description"),1),Mo=p(require("@mui/icons-material/InsertDriveFile"),1),rt=p(require("@mui/icons-material/Code"),1),To=p(require("@mui/icons-material/TableView"),1),A=require("react-pdf"),nt=p(require("@monaco-editor/react"),1),Co=p(require("react-spreadsheet"),1),te=p(require("xlsx"),1),it=require("@ehfuse/mui-fadeout-loading-progress");var Me=s=>{let u=s.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(u)?"image":u==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(u)?"text":["csv","xls","xlsx"].includes(u)?"spreadsheet":["html","htm"].includes(u)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(u)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(u)?"video":["mp3","wav","ogg","m4a","aac"].includes(u)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(u)?"office":"unsupported"},qe=s=>{let u=(s||"").toLowerCase().split(";")[0].trim();return u?u.startsWith("image/")?"image":u==="application/pdf"?"pdf":u.startsWith("video/")?"video":u.startsWith("audio/")?"audio":u==="text/html"?"html":u==="text/csv"||u==="application/vnd.ms-excel"||u==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":u.startsWith("text/")||u==="application/json"||u==="application/xml"?"text":"unsupported":"unsupported"},w=(s,u)=>{let c=Me(s);return c!=="unsupported"?c:qe(u)},Tr=new Set(["image","pdf","text","code","html","spreadsheet","video","audio"]),oo=s=>Tr.has(Me(s)),Cr={"image/jpeg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/svg+xml":"svg","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-excel":"xls","text/csv":"csv","text/plain":"txt","application/json":"json","text/xml":"xml","application/xml":"xml","text/html":"html","video/mp4":"mp4","video/webm":"webm","audio/mpeg":"mp3","audio/wav":"wav"},ro=(s,u)=>{let c=(s??"").trim()||"\uCCA8\uBD80\uD30C\uC77C";if(/\.[a-z0-9]+$/i.test(c))return c;let m=(u??"").trim().toLowerCase().split(";")[0],M=Cr[m]??"";return M?`${c}.${M}`:c},Te=s=>{let u=s.split(".").pop()?.toLowerCase()||"";return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",scss:"scss",sass:"scss",less:"less",json:"json",xml:"xml",php:"php",py:"python",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",swift:"swift",kt:"kotlin",scala:"scala",sql:"sql",sh:"shell",bash:"shell",bat:"bat",ps1:"powershell",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",conf:"ini",md:"markdown",markdown:"markdown",txt:"plaintext",log:"plaintext",csv:"plaintext"}[u]||"plaintext"};var Ir=s=>(s||"").replace(/[\\/:*?"<>|\r\n]/g,"_").trim()||"download",Ce=(s,u)=>{let c=URL.createObjectURL(s),m=document.createElement("a");m.href=c,m.download=Ir(u),m.rel="noopener",document.body.appendChild(m),m.click(),m.remove(),window.setTimeout(()=>URL.revokeObjectURL(c),6e4)};var no=async s=>{let u=URL.createObjectURL(s);try{let c=await new Promise((P,h)=>{let B=new Image;B.onload=()=>P(B),B.onerror=()=>h(new Error("\uC774\uBBF8\uC9C0\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")),B.src=u}),m=document.createElement("canvas");m.width=c.naturalWidth||c.width||1024,m.height=c.naturalHeight||c.height||1024;let M=m.getContext("2d");if(!M)throw new Error("\uCE94\uBC84\uC2A4\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return M.drawImage(c,0,0,m.width,m.height),await new Promise((P,h)=>{m.toBlob(B=>B?P(B):h(new Error("PNG \uBCC0\uD658 \uC2E4\uD328")),"image/png")})}finally{URL.revokeObjectURL(u)}};var Ie=require("@mui/material");function io(){let s=(0,Ie.useTheme)();return!(0,Ie.useMediaQuery)(s.breakpoints.up("lg"))}var S=require("react/jsx-runtime");function Y(s){return(0,S.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:s.width||"22px",...s,children:[(0,S.jsx)("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),(0,S.jsx)("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),(0,S.jsx)("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),(0,S.jsx)("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),(0,S.jsxs)("g",{children:[(0,S.jsx)("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),(0,S.jsx)("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}var b=require("react/jsx-runtime");function O(s){return(0,b.jsx)("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:s.width||"28px",...s,children:(0,b.jsxs)("g",{children:[(0,b.jsx)("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),(0,b.jsx)("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),(0,b.jsxs)("g",{children:[(0,b.jsxs)("g",{children:[(0,b.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),(0,b.jsx)("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),(0,b.jsx)("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),(0,b.jsx)("g",{children:(0,b.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),(0,b.jsx)("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),(0,b.jsx)("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),(0,b.jsx)("g",{children:(0,b.jsx)("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}var o=require("react/jsx-runtime");var kr="/pdfjs",ao=32,so=240,Lr=8192,Ke=.25,Ze=8,Qe=80,co=80,Fr=s=>{switch(s){case"image":return(0,o.jsx)(Y,{});case"pdf":return(0,o.jsx)(O,{});case"text":return(0,o.jsx)(yo.default,{sx:{mr:1,color:"#66BB6A"}});case"spreadsheet":return(0,o.jsx)(To.default,{sx:{mr:1,color:"#4CAF50"}});case"html":return(0,o.jsx)(rt.default,{sx:{mr:1,color:"#E91E63"}});case"code":return(0,o.jsx)(rt.default,{sx:{mr:1,color:"#2196F3"}});case"video":return(0,o.jsx)(bo.default,{sx:{mr:1,color:"#AB47BC"}});case"audio":return(0,o.jsx)(vo.default,{sx:{mr:1,color:"#FF7043"}});case"office":return(0,o.jsx)(wo.default,{sx:{mr:1,color:"#FFA726"}});default:return(0,o.jsx)(Mo.default,{sx:{mr:1,color:"#78909C"}})}},lo=s=>typeof s?.rotate=="number"?s.rotate:typeof s?._pageInfo?.rotate=="number"?s._pageInfo.rotate:0,at=({open:s,onClose:u,file:c,loadFile:m,onDownload:M,pdfAssetBase:P=kr})=>{let h=io(),B=(0,n.useTheme)(),q=(0,n.useMediaQuery)(B.breakpoints.down("sm")),[re,Le]=(0,i.useState)(!0),[Fe,lt]=(0,i.useState)(!1),[v,Re]=(0,i.useState)(""),[T,E]=(0,i.useState)(1),[V,K]=(0,i.useState)(0),[dt,ne]=(0,i.useState)(""),[C,ut]=(0,i.useState)(""),[mt,ie]=(0,i.useState)(""),[Z,ae]=(0,i.useState)(14),[Pe,se]=(0,i.useState)(""),[Ee,pt]=(0,i.useState)("preview"),[De,Q]=(0,i.useState)([]),[ft,ht]=(0,i.useState)([]),[So,Se]=(0,i.useState)(""),[Be,gt]=(0,i.useState)(null),[xt,ce]=(0,i.useState)(!1),[Bo,He]=(0,i.useState)(!0),[yt,le]=(0,i.useState)(""),[I,bt]=(0,i.useState)(),[k,W]=(0,i.useState)(1),[Ho,Ve]=(0,i.useState)(!1),[vt,U]=(0,i.useState)(null),[de,wt]=(0,i.useState)("portrait"),[Vo,Mt]=(0,i.useState)(0),[ze,Tt]=(0,i.useState)(0),[J,Ct]=(0,i.useState)({width:0,height:0}),It=(0,i.useRef)([]),Ae=(0,i.useRef)(null),X=(0,i.useRef)(null),We=(0,i.useRef)(null),Xe=(0,i.useRef)(null),zo=(0,i.useCallback)(e=>{if(We.current?.disconnect(),Xe.current?.(),Xe.current=null,X.current=e,!e){We.current=null;return}let t=l=>{l.touches.length>=2&&l.preventDefault()};e.addEventListener("touchmove",t,{passive:!1}),Xe.current=()=>e.removeEventListener("touchmove",t);let r=new ResizeObserver(l=>{let d=l[0]?.contentRect;d&&Ct({width:d.width,height:d.height})});r.observe(e),We.current=r;let a=e.getBoundingClientRect();Ct({width:a.width,height:a.height})},[]),[ue,kt]=(0,i.useState)(!1),[_e,Ao]=(0,i.useState)({x:0,y:0}),[je,Wo]=(0,i.useState)({x:0,y:0}),Xo=(0,i.useCallback)(async(e,t)=>{let r=URL.createObjectURL(e);Re(r),ut(e.type||"");let a=w(t,e.type||"");if(a==="text"||a==="code"){let d=await e.text();ie(d);return}if(a==="html"){let d=await e.text();se(d);return}if(a!=="spreadsheet")return;let l=t.split(".").pop()?.toLowerCase()||"";if(l==="csv"){let f=(await e.text()).split(`
2
- `).map(y=>y.split(",").map(F=>({value:F.trim()})));Q(f);return}if(l==="xls"||l==="xlsx"){ce(!0),He(!0);let d=await e.arrayBuffer(),f=te.read(d,{type:"array"});ht(f.SheetNames),gt(f);let y=f.SheetNames[0];Se(y),Ne(f,y)}},[]),me=(0,i.useRef)(null),Lt=(0,i.useCallback)(async e=>{if(e.blob)return e.blob;if(m)return await m(e);if(e.url){let t=await fetch(e.url);if(!t.ok)throw new Error("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return await t.blob()}throw new Error("\uD30C\uC77C \uB370\uC774\uD130 \uC18C\uC2A4(blob/url/loadFile)\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")},[m]);(0,i.useEffect)(()=>(c&&s?Oo():(v&&URL.revokeObjectURL(v),me.current=null,Re(""),ie(""),se(""),Q([]),ae(14),E(1),K(0)),()=>{v&&URL.revokeObjectURL(v)}),[c,s]);let _o=({numPages:e})=>{bt(e),W(1),be.current=!0},jo=e=>{let{width:t,height:r}=Yo(e);Mt(lo(e)),t>0&&r>0&&Tt(t/r);let a=t>r?"landscape":"portrait";wt(a)},Yo=e=>{let t=e?.width||0,r=e?.height||0,a=lo(e);try{if(typeof e?.getViewport=="function"){let l=e.getViewport({scale:1,rotation:a});t=l.width,r=l.height}}catch(l){console.warn("[FileViewer] getViewport \uC2E4\uD328 - \uAE30\uBCF8 width/height\uB85C \uB300\uCCB4",l)}return{width:t,height:r}},pe=(0,i.useCallback)(()=>{W(e=>Math.max(e-1,1))},[]),fe=(0,i.useCallback)(()=>{W(e=>Math.min(e+1,I||1))},[I]),Ft=(0,i.useMemo)(()=>({cMapUrl:`${P}/cmaps/`,cMapPacked:!0,standardFontDataUrl:`${P}/standard_fonts/`,wasmUrl:`${P}/wasm/`}),[P]);(0,i.useEffect)(()=>{typeof window>"u"||(A.pdfjs.GlobalWorkerOptions.workerSrc=`${P}/pdf.worker.min.mjs`)},[P]),(0,i.useEffect)(()=>{if(!s||w(c?.name||"",C)!=="pdf")return;let e=r=>{switch(r.key){case"ArrowLeft":case"ArrowUp":r.preventDefault(),pe();break;case"ArrowRight":case"ArrowDown":r.preventDefault(),fe();break;case"Home":r.preventDefault(),W(1);break;case"End":r.preventDefault(),I&&W(I);break}},t=r=>{r.ctrlKey||Math.abs(r.deltaY)>50&&(r.preventDefault(),r.deltaY>0?fe():pe())};return document.addEventListener("keydown",e),document.addEventListener("wheel",t,{passive:!1}),()=>{document.removeEventListener("keydown",e),document.removeEventListener("wheel",t)}},[s,c,C,pe,fe,I]),(0,i.useEffect)(()=>{if(!I||!s||w(c?.name||"",C)!=="pdf")return;if(k===1&&Ae.current){Ae.current.scrollTo({top:0,behavior:"smooth"});return}let e=It.current[k-1];e&&e.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[s,c,C,I,k]),(0,i.useEffect)(()=>{re&&lt(!0)},[re,Fe]);let Oo=async()=>{if(c){Le(!0),ne(""),ut(""),ie(""),se(""),Q([]);try{let e=await Lt(c);me.current=e,await Xo(e,c.name)}catch(e){console.error("\uD30C\uC77C \uB85C\uB4DC \uC624\uB958:",e),ne("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}finally{Le(!1)}}},Rt=async()=>{if(c)try{if(M){await M(c);return}let e=me.current??await Lt(c);Ce(e,c.name)}catch(e){console.error("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC624\uB958:",e)}},Uo=()=>{let e=c?w(c.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?ae(t=>Math.min(t+2,24)):E(e==="pdf"?t=>Math.min(t+.25,Ze):t=>Math.min(t+.25,3))},No=()=>{let e=c?w(c.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?ae(t=>Math.max(t-2,10)):E(e==="pdf"?t=>Math.max(t-.25,Ke):t=>Math.max(t-.25,.25))},g=(0,i.useRef)(new Map),$o=e=>Math.min(Math.max(e,.25),3),Go=e=>Math.min(Math.max(e,Ke),Ze),Ye=(0,i.useRef)(null),he=(0,i.useRef)(null),H=(0,i.useRef)({scale:1,tx:0,ty:0,rotation:0}),z=(0,i.useRef)(0),N=(0,i.useRef)(null),ge=(0,i.useRef)(null),xe=(0,i.useCallback)((e,t,r,a)=>{let l=Ye.current,d=he.current;if(!l||!d)return{tx:t,ty:r};let f=d.offsetWidth,y=d.offsetHeight,F=(Math.round(a/90)%4+4)%4;if(F===1||F===3){let hr=f;f=y,y=hr}let D=f*e,Qt=y*e,Jt=D>l.clientWidth?(D+l.clientWidth)/2-co:0,eo=Qt>l.clientHeight?(Qt+l.clientHeight)/2-co:0;return{tx:Math.min(Jt,Math.max(-Jt,t)),ty:Math.min(eo,Math.max(-eo,r))}},[]),Pt=(0,i.useCallback)((e,t)=>{let r=Ye.current,a=he.current;if(!r||!a)return e>1;let l=(Math.round(t/90)%4+4)%4,d=l===1||l===3,f=d?a.offsetHeight:a.offsetWidth,y=d?a.offsetWidth:a.offsetHeight;return f*e>r.clientWidth+1||y*e>r.clientHeight+1},[]),_=(0,i.useCallback)(e=>{let t=he.current;if(!t)return;let{scale:r,tx:a,ty:l,rotation:d}=H.current;t.style.transition=e?"transform 0.25s ease":"none",t.style.transform=`translate(${a}px, ${l}px) scale(${r}) rotate(${d}deg)`},[]),Et=(0,i.useCallback)(()=>{let e=H.current,t=xe(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,!z.current&&(z.current=requestAnimationFrame(()=>{z.current=0,_(!1)}))},[_,xe]),Dt=(0,i.useCallback)(()=>{z.current&&(cancelAnimationFrame(z.current),z.current=0),g.current.clear(),N.current=null,ge.current=null},[]),qo=(0,i.useCallback)(e=>{he.current=e,e&&(H.current={scale:1,tx:0,ty:0,rotation:0},_(!1))},[_]);(0,i.useEffect)(()=>{if(w(c?.name||"",C)!=="image")return;let e=H.current;e.scale=T,e.rotation=V;let t=xe(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,_(!0)},[T,V,c,C,v,_,xe]),(0,i.useEffect)(()=>()=>{z.current&&cancelAnimationFrame(z.current)},[]);let Ko=e=>{e.currentTarget.setPointerCapture?.(e.pointerId),g.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...g.current.values()],r=H.current;if(t.length===2){N.current=null;let a=e.currentTarget.getBoundingClientRect();ge.current={startDist:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)||1,baseScale:r.scale,baseTx:r.tx,baseTy:r.ty,startMidX:(t[0].x+t[1].x)/2,startMidY:(t[0].y+t[1].y)/2,centerX:a.left+a.width/2,centerY:a.top+a.height/2}}else t.length===1&&Pt(r.scale,r.rotation)&&(N.current={startX:e.clientX,startY:e.clientY,baseTx:r.tx,baseTy:r.ty})},Zo=e=>{if(!g.current.has(e.pointerId))return;g.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=H.current,r=ge.current,a=[...g.current.values()];if(r&&a.length>=2){let d=Math.hypot(a[0].x-a[1].x,a[0].y-a[1].y),f=(a[0].x+a[1].x)/2,y=(a[0].y+a[1].y)/2,F=$o(r.baseScale*d/r.startDist),D=F/r.baseScale;t.scale=F,t.tx=f-r.centerX-D*(r.startMidX-r.centerX-r.baseTx),t.ty=y-r.centerY-D*(r.startMidY-r.centerY-r.baseTy),Et();return}let l=N.current;l&&a.length===1&&(t.tx=l.baseTx+(e.clientX-l.startX),t.ty=l.baseTy+(e.clientY-l.startY),Et())},St=e=>{if(!g.current.has(e.pointerId))return;g.current.delete(e.pointerId),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId);let t=H.current;if(g.current.size<2&&(ge.current=null,Math.abs(t.scale-T)>.001&&E(t.scale)),g.current.size===0)N.current=null;else if(g.current.size===1&&Pt(t.scale,t.rotation)){let r=[...g.current.values()][0];N.current={startX:r.x,startY:r.y,baseTx:t.tx,baseTy:t.ty}}},Bt=(0,i.useCallback)(async()=>{if(v)try{let t=await(await fetch(v)).blob(),r=t.type==="image/png"?t:await no(t);await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),le("\uC774\uBBF8\uC9C0\uB97C \uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")}catch(e){console.error("\uC774\uBBF8\uC9C0 \uBCF5\uC0AC \uC624\uB958:",e),le("\uC774\uBBF8\uC9C0\uB97C \uBCF5\uC0AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}},[v]);(0,i.useEffect)(()=>{if(!s||w(c?.name||"",C)!=="image")return;let e=t=>{if(!(t.ctrlKey||t.metaKey)||t.key.toLowerCase()!=="c")return;let r=t.target,a=r?.tagName;a==="INPUT"||a==="TEXTAREA"||r?.isContentEditable||(t.preventDefault(),Bt())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s,c,C,Bt]);let $=(0,i.useRef)(null),L=(0,i.useRef)(0),ee=(0,i.useRef)(null),G=(0,i.useRef)(null),j=()=>X.current?.querySelector(".react-pdf__Page")??null,ye=(0,i.useRef)(null),Ht=(0,i.useRef)(null),Qo=()=>{let e=Ht.current,t=j()?.querySelector("canvas");if(!e||!t||!t.width||!t.height)return!1;let r=document.createElement("canvas");r.width=t.width,r.height=t.height;let a=r.getContext("2d");if(!a)return!1;a.drawImage(t,0,0);let l=t.getBoundingClientRect(),d=e.getBoundingClientRect();return Object.assign(r.style,{position:"absolute",left:`${l.left-d.left}px`,top:`${l.top-d.top}px`,width:`${l.width}px`,height:`${l.height}px`,pointerEvents:"none",zIndex:"1"}),e.appendChild(r),ye.current=r,!0},Vt=()=>{ye.current?.remove(),ye.current=null;let e=j();e&&(e.style.visibility="")},Jo=()=>{L.current||(L.current=requestAnimationFrame(()=>{L.current=0;let e=$.current,t=j();!e||!t||(t.style.transition="none",t.style.transformOrigin="top left",t.style.transform=`translate(${e.tx}px, ${e.ty}px) scale(${e.k})`,ee.current={k:e.k,tx:e.tx,ty:e.ty,midX:e.lastMidX,midY:e.lastMidY})}))},zt=()=>{L.current&&(cancelAnimationFrame(L.current),L.current=0),$.current=null,G.current=null,ee.current=null,Vt();let e=j();e&&(e.style.transform="",e.style.willChange="auto")},At=e=>{let t=j(),r=X.current;if(!t||!r)return;t.style.transform&&(t.style.transform="");let a=t.getBoundingClientRect(),l=r.getBoundingClientRect(),d=(e[0].x+e[1].x)/2,f=(e[0].y+e[1].y)/2;$.current={startDist:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)||1,rectLeft:a.left,rectTop:a.top,pageW:a.width,pageH:a.height,viewerL:l.left,viewerT:l.top,viewerR:l.right,viewerB:l.bottom,startMidX:d,startMidY:f,lastMidX:d,lastMidY:f,k:1,tx:0,ty:0},ee.current={k:1,tx:0,ty:0,midX:d,midY:f},t.style.willChange="transform"},er=e=>{if(e.pointerType!=="touch")return;g.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...g.current.values()];if(t.length===2){if(G.current||ye.current)return;At(t)}},tr=e=>{if(!g.current.has(e.pointerId))return;g.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=$.current,r=[...g.current.values()];if(t&&r.length>=2){e.preventDefault();let a=Math.hypot(r[0].x-r[1].x,r[0].y-r[1].y),l=Math.min(Math.max(a/t.startDist,Ke/(T||1)),Ze/(T||1)),d=(r[0].x+r[1].x)/2,f=(r[0].y+r[1].y)/2,y=d-t.rectLeft-l*(t.startMidX-t.rectLeft),F=f-t.rectTop-l*(t.startMidY-t.rectTop),D=Qe;y=Math.min(t.viewerR-D-t.rectLeft,Math.max(t.viewerL+D-t.rectLeft-l*t.pageW,y)),F=Math.min(t.viewerB-D-t.rectTop,Math.max(t.viewerT+D-t.rectTop-l*t.pageH,F)),t.k=l,t.tx=y,t.ty=F,t.lastMidX=d,t.lastMidY=f,Jo()}},Wt=e=>{if(g.current.delete(e.pointerId),g.current.size>=2)return;let t=$.current;if($.current=null,!t)return;L.current&&(cancelAnimationFrame(L.current),L.current=0);let r=ee.current??{k:1,tx:0,ty:0,midX:t.startMidX,midY:t.startMidY};ee.current=null;let a=Go(T*r.k);if(Math.abs(a-T)<.001){let d=X.current;zt(),d&&(d.scrollLeft-=r.tx,d.scrollTop-=r.ty);return}let l=X.current;if(l){let d=l.getBoundingClientRect();G.current={u:(r.midX-t.rectLeft-r.tx)/r.k,v:(r.midY-t.rectTop-r.ty)/r.k,offX:r.midX-d.left,offY:r.midY-d.top,factor:a/(T||1)}}if(Qo()){let d=j();d&&(d.style.transform="",d.style.visibility="hidden")}E(a),Math.round(Math.min($e*a,qt))===Ge&&requestAnimationFrame(()=>_t())},be=(0,i.useRef)(!0),Oe=(0,i.useRef)(null),Xt=()=>{let e=X.current;e&&(e.scrollLeft=(e.scrollWidth-e.clientWidth)/2,e.scrollTop=(e.scrollHeight-e.clientHeight)/2)},_t=()=>{let e=G.current;if(!e)return;G.current=null;let t=X.current,r=j();if(!t||!r)return;Vt(),r.style.transform="",r.style.willChange="auto";let a=r.getBoundingClientRect(),l=t.getBoundingClientRect();t.scrollLeft+=a.left-l.left+e.u*e.factor-e.offX,t.scrollTop+=a.top-l.top+e.v*e.factor-e.offY;let d=[...g.current.values()];d.length>=2&&At(d)},jt=()=>{let e=`${k}:${V}`;if(G.current){Oe.current=e,_t();return}(be.current||Oe.current!==e)&&(be.current=!1,Oe.current=e,Xt())};(0,i.useEffect)(()=>()=>{L.current&&cancelAnimationFrame(L.current)},[]);let Yt=()=>{K(e=>e-90)},Ot=()=>{K(e=>e+90)},Ut=()=>{let e=w(c?.name||"",C);zt(),e==="text"||e==="html"||e==="code"||e==="spreadsheet"?ae(14):e==="pdf"?(E(1),T===1&&V===0?Xt():be.current=!0):(Dt(),H.current={scale:1,tx:0,ty:0,rotation:0},_(!0),E(1)),K(0)},Nt=(e,t)=>{kt(!0),Ao({x:e.clientX,y:e.clientY}),Wo({x:t.scrollLeft,y:t.scrollTop}),e.preventDefault()},$t=(0,i.useCallback)((e,t)=>{if(!ue)return;let r=e.clientX-_e.x,a=e.clientY-_e.y;t.scrollLeft=je.x-r,t.scrollTop=je.y-a,e.preventDefault()},[ue,_e,je]),Ue=(0,i.useCallback)(()=>{kt(!1),document.body.style.cursor="default"},[]);(0,i.useEffect)(()=>{if(ue){let e=t=>{document.querySelectorAll(".draggable-scroll").forEach(a=>{$t(t,a)})};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",Ue),document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",Ue),document.body.style.userSelect="",document.body.style.webkitUserSelect=""}}},[ue,$t,Ue]);let or=(0,i.useCallback)(()=>{Le(!1),lt(!1)},[]),Ne=(0,i.useCallback)(async(e,t)=>{ce(!0),He(!0);try{await new Promise(f=>setTimeout(f,500));let r=e.Sheets[t],a=te.utils.decode_range(r["!ref"]||"A1");console.debug("Excel range:",a);let d=te.utils.sheet_to_json(r,{header:1,range:a,defval:""}).map(f=>f.map(y=>({value:y!=null?String(y):""})));Q(d),await new Promise(f=>setTimeout(f,200))}catch(r){console.error("\uC6CC\uD06C\uC2DC\uD2B8 \uB85C\uB4DC \uC624\uB958:",r)}finally{He(!1)}},[]),rr=(0,i.useCallback)(()=>{ce(!1)},[]),nr=(0,i.useCallback)(e=>{Be&&(Se(e),Ne(Be,e))},[Be,Ne]),Gt=()=>{Dt(),H.current={scale:1,tx:0,ty:0,rotation:0},le(""),v&&URL.revokeObjectURL(v),me.current=null,Re(""),ie(""),se(""),Q([]),ht([]),Se(""),gt(null),ce(!1),E(1),K(0),ne(""),bt(void 0),W(1),wt("portrait"),Mt(0),Tt(0),u()};if(!c)return null;let x=w(c.name,C),ir=((Vo+V)%360+360)%360,ve=V%180===0?ze:ze>0?1/ze:0,ar=Math.max(J.width-ao,so),sr=Math.max(J.height-ao,so),$e=J.width>0&&ve>0?Math.min(ar,sr*ve):de==="portrait"?600:800,cr=typeof window<"u"&&window.devicePixelRatio||1,qt=Lr/cr*(ve>0?Math.min(1,ve):1),Ge=Math.round(Math.min($e*T,qt)),Kt=Math.round($e*T),lr=Kt>Ge,dr=Math.max(16,Math.round(J.width)-Qe),ur=Math.max(16,Math.round(J.height)-Qe),mr=de==="landscape"?"200px":"150px",pr=de==="landscape"?.18:.17,Zt=()=>I?(0,o.jsx)(n.Box,{ref:Ae,sx:{width:mr,height:"100%",backgroundColor:"grey.200",borderRight:"1px solid",borderColor:"grey.300",overflow:"auto",p:2},children:Array.from({length:I},(e,t)=>(0,o.jsxs)(n.Box,{ref:r=>{It.current[t]=r},children:[(0,o.jsx)(n.Box,{sx:{mb:0,p:1,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:k===t+1?"2px solid":"1px solid",borderColor:k===t+1?"primary.main":"grey.400",borderRadius:1,overflow:"hidden",backgroundColor:"white","&:hover":{borderColor:"primary.main"},aspectRatio:de==="landscape"?"4 / 3":"3 / 4"},onClick:()=>{W(t+1),h&&Ve(!1)},children:(0,o.jsx)(A.Document,{file:v,options:Ft,loading:(0,o.jsx)("div",{style:{display:"none"}}),children:(0,o.jsx)(A.Page,{pageNumber:t+1,scale:pr,loading:(0,o.jsx)("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1})})}),(0,o.jsx)(n.Typography,{variant:"caption",sx:{display:"block",textAlign:"center",p:.5,mb:1,color:k===t+1?"primary.main":"",fontWeight:k===t+1?"bold":"normal"},children:t+1})]},t+1))}):null,fr=()=>{let e=w(c?.name||"",C);if(Fe&&!(e==="spreadsheet"))return(0,o.jsx)(n.Box,{sx:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(it.LoadingProgress,{visible:re,exitDelay:100,onComplete:or})});if(dt)return(0,o.jsxs)(n.Box,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[(0,o.jsx)(n.Typography,{color:"error",variant:"h6",children:dt}),(0,o.jsx)(n.Typography,{color:"text.secondary",variant:"body2",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]});if(!v)return null;switch(e){case"image":return(0,o.jsx)(n.Box,{ref:Ye,"data-allow-pinch":"true",onPointerDown:Ko,onPointerMove:Zo,onPointerUp:St,onPointerCancel:St,sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"hidden",height:"100%",backgroundColor:"grey.100",p:2,touchAction:"none",overscrollBehavior:"contain",userSelect:"none","&:active":{cursor:"grabbing"}},children:(0,o.jsx)("img",{ref:qo,src:v,alt:c.name,draggable:!1,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",transform:"translate(0px, 0px) scale(1) rotate(0deg)",transformOrigin:"center center",pointerEvents:"none"}})});case"pdf":return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.Box,{ref:Ht,sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",backgroundColor:"grey.100",position:"relative",overflow:"hidden"},children:[!h&&Zt(),(0,o.jsx)(n.Box,{ref:zo,className:"draggable-scroll",onMouseDown:r=>{let a=r.currentTarget;Nt(r,a)},"data-allow-pinch":"true",onPointerDown:er,onPointerMove:tr,onPointerUp:Wt,onPointerCancel:Wt,sx:{flex:1,display:"flex",flexDirection:"column",overflow:"auto",height:"100%",py:h?0:2,overflowAnchor:"none",touchAction:"pan-x pan-y","& > .react-pdf__Document":{m:"auto",...h&&{px:`${dr}px`,py:`${ur}px`},...lr&&{"& .react-pdf__Page__canvas":{width:`${Kt}px !important`,height:"auto !important"}}}},children:(0,o.jsx)(A.Document,{file:v,onLoadSuccess:_o,onLoadError:r=>{console.error("PDF \uB85C\uB4DC \uC624\uB958:",r),ne("PDF \uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")},loading:(0,o.jsx)("div",{style:{display:"none"}}),error:(0,o.jsxs)(n.Box,{sx:{textAlign:"center",p:4},children:[(0,o.jsx)(n.Typography,{color:"error",variant:"h6",sx:{mb:2},children:"PDF\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}),(0,o.jsx)(n.Typography,{color:"text.secondary",variant:"body2",children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]}),options:Ft,children:(0,o.jsx)(A.Page,{pageNumber:k,width:Ge,rotate:V===0?void 0:ir,loading:(0,o.jsx)("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1,onLoadSuccess:jo,onRenderSuccess:jt,onRenderError:jt})})})]}),h&&(0,o.jsx)(n.Drawer,{anchor:"left",open:Ho,onClose:()=>Ve(!1),sx:{zIndex:r=>r.zIndex.modal+2},children:Zt()})]});case"text":case"code":return(0,o.jsx)(n.Box,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column"},children:mt?(0,o.jsx)(n.Box,{sx:{flex:1,height:"100%",overflow:"hidden"},children:(0,o.jsx)(nt.default,{height:"100%",language:Te(c.name),value:mt,theme:"vs-dark",loading:!1,options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,formatOnPaste:!0,formatOnType:!0,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:Z,lineHeight:Math.round(Z*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(r,a)=>{r.onDidAttemptReadOnlyEdit(()=>{});let l=r.getDomNode();if(l){let d=document.createElement("style");d.textContent=`
1
+ "use strict";var Tr=Object.create;var Re=Object.defineProperty;var Ir=Object.getOwnPropertyDescriptor;var kr=Object.getOwnPropertyNames;var Lr=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty;var Rr=(a,d)=>{for(var u in d)Re(a,u,{get:d[u],enumerable:!0})},uo=(a,d,u,m)=>{if(d&&typeof d=="object"||typeof d=="function")for(let T of kr(d))!Fr.call(a,T)&&T!==u&&Re(a,T,{get:()=>d[T],enumerable:!(m=Ir(d,T))||m.enumerable});return a};var h=(a,d,u)=>(u=a!=null?Tr(Lr(a)):{},uo(d||!a||!a.__esModule?Re(u,"default",{value:a,enumerable:!0}):u,a)),Er=a=>uo(Re({},"__esModule",{value:!0}),a);var Ar={};Rr(Ar,{FileTypeIcon:()=>xt,FileViewer:()=>ft,FileViewerDefault:()=>So,HtmlIcon:()=>le,ImageIcon:()=>N,PdfIcon:()=>$,ZipIcon:()=>se,ensureFileExtension:()=>po,getEditorLanguage:()=>Pe,getFileType:()=>Ee,getFileTypeFromMime:()=>ot,getFileTypeIcon:()=>ce,isFileViewerPreviewable:()=>mo,resolveFileType:()=>M,saveBlobAsFile:()=>Se});module.exports=Er(Ar);var i=require("react"),n=require("@mui/material"),vo=h(require("@mui/icons-material/Close"),1),wo=h(require("@mui/icons-material/Menu"),1),Mo=h(require("@mui/icons-material/MoreHoriz"),1),at=h(require("@mui/icons-material/Download"),1),Co=h(require("@mui/icons-material/Add"),1),To=h(require("@mui/icons-material/Remove"),1),lt=h(require("@mui/icons-material/RotateLeft"),1),st=h(require("@mui/icons-material/RotateRight"),1),ct=h(require("@mui/icons-material/FitScreen"),1),dt=h(require("@mui/icons-material/KeyboardArrowLeft"),1),ut=h(require("@mui/icons-material/KeyboardArrowRight"),1),Io=h(require("@mui/icons-material/TextSnippet"),1),ko=h(require("@mui/icons-material/VideoFile"),1),Lo=h(require("@mui/icons-material/AudioFile"),1),Fo=h(require("@mui/icons-material/Description"),1),Ro=h(require("@mui/icons-material/InsertDriveFile"),1),mt=h(require("@mui/icons-material/Code"),1),Eo=h(require("@mui/icons-material/TableView"),1),X=require("react-pdf"),pt=h(require("@monaco-editor/react"),1),Po=h(require("react-spreadsheet"),1),ae=h(require("xlsx"),1),ht=require("@ehfuse/mui-fadeout-loading-progress");var Ee=a=>{let d=a.split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","bmp","webp","svg"].includes(d)?"image":d==="pdf"?"pdf":["txt","json","xml","log","md","markdown"].includes(d)?"text":["csv","xls","xlsx"].includes(d)?"spreadsheet":["html","htm"].includes(d)?"html":["js","jsx","ts","tsx","css","scss","sass","less","php","py","java","c","cpp","h","hpp","cs","go","rs","rb","swift","kt","scala","sql","sh","bash","bat","ps1","yml","yaml","toml","ini","conf"].includes(d)?"code":["mp4","avi","mov","wmv","flv","webm"].includes(d)?"video":["mp3","wav","ogg","m4a","aac"].includes(d)?"audio":["doc","docx","ppt","pptx","hwp","hwpx"].includes(d)?"office":"unsupported"},ot=a=>{let d=(a||"").toLowerCase().split(";")[0].trim();return d?d.startsWith("image/")?"image":d==="application/pdf"?"pdf":d.startsWith("video/")?"video":d.startsWith("audio/")?"audio":d==="text/html"?"html":d==="text/csv"||d==="application/vnd.ms-excel"||d==="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?"spreadsheet":d.startsWith("text/")||d==="application/json"||d==="application/xml"?"text":"unsupported":"unsupported"},M=(a,d)=>{let u=Ee(a);return u!=="unsupported"?u:ot(d)},Pr=new Set(["image","pdf","text","code","html","spreadsheet","video","audio"]),mo=a=>Pr.has(Ee(a)),Sr={"image/jpeg":"jpg","image/png":"png","image/gif":"gif","image/webp":"webp","image/bmp":"bmp","image/svg+xml":"svg","application/pdf":"pdf","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-excel":"xls","text/csv":"csv","text/plain":"txt","application/json":"json","text/xml":"xml","application/xml":"xml","text/html":"html","video/mp4":"mp4","video/webm":"webm","audio/mpeg":"mp3","audio/wav":"wav"},po=(a,d)=>{let u=(a??"").trim()||"\uCCA8\uBD80\uD30C\uC77C";if(/\.[a-z0-9]+$/i.test(u))return u;let m=(d??"").trim().toLowerCase().split(";")[0],T=Sr[m]??"";return T?`${u}.${T}`:u},Pe=a=>{let d=a.split(".").pop()?.toLowerCase()||"";return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",html:"html",htm:"html",css:"css",scss:"scss",sass:"scss",less:"less",json:"json",xml:"xml",php:"php",py:"python",java:"java",c:"c",cpp:"cpp",h:"c",hpp:"cpp",cs:"csharp",go:"go",rs:"rust",rb:"ruby",swift:"swift",kt:"kotlin",scala:"scala",sql:"sql",sh:"shell",bash:"shell",bat:"bat",ps1:"powershell",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",conf:"ini",md:"markdown",markdown:"markdown",txt:"plaintext",log:"plaintext",csv:"plaintext"}[d]||"plaintext"};var Dr=a=>(a||"").replace(/[\\/:*?"<>|\r\n]/g,"_").trim()||"download",Se=(a,d)=>{let u=URL.createObjectURL(a),m=document.createElement("a");m.href=u,m.download=Dr(d),m.rel="noopener",document.body.appendChild(m),m.click(),m.remove(),window.setTimeout(()=>URL.revokeObjectURL(u),6e4)};var ho=async a=>{let d=URL.createObjectURL(a);try{let u=await new Promise((_,G)=>{let I=new Image;I.onload=()=>_(I),I.onerror=()=>G(new Error("\uC774\uBBF8\uC9C0\uB97C \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")),I.src=d}),m=document.createElement("canvas");m.width=u.naturalWidth||u.width||1024,m.height=u.naturalHeight||u.height||1024;let T=m.getContext("2d");if(!T)throw new Error("\uCE94\uBC84\uC2A4\uB97C \uB9CC\uB4E4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return T.drawImage(u,0,0,m.width,m.height),await new Promise((_,G)=>{m.toBlob(I=>I?_(I):G(new Error("PNG \uBCC0\uD658 \uC2E4\uD328")),"image/png")})}finally{URL.revokeObjectURL(d)}};var De=require("@mui/material");function fo(){let a=(0,De.useTheme)();return!(0,De.useMediaQuery)(a.breakpoints.up("lg"))}var z=require("react/jsx-runtime");function N(a){return(0,z.jsxs)("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 501.551 501.551",xmlSpace:"preserve",width:a.width||"22px",...a,children:[(0,z.jsx)("path",{style:{fill:"#F2F2F2"},d:"M480.653,0H20.898C9.404,0,0,9.404,0,20.898v459.755c0,11.494,9.404,20.898,20.898,20.898h459.755 c11.494,0,20.898-9.404,20.898-20.898V20.898C501.551,9.404,492.147,0,480.653,0z"}),(0,z.jsx)("rect",{x:36.571,y:36.571,style:{fill:"#84DBFF"},width:428.408,height:345.861}),(0,z.jsx)("path",{style:{fill:"#334A5E"},d:"M261.224,382.433H36.571v-87.771c17.763-5.224,37.616-7.314,57.469-7.314 c25.078,0,50.155,4.18,71.053,12.539c6.269,2.09,11.494,4.18,16.718,7.314C218.384,323.918,246.596,350.041,261.224,382.433z"}),(0,z.jsx)("path",{style:{fill:"#40596B"},d:"M464.98,271.673v110.759H127.478c9.404-29.257,29.257-55.38,55.38-76.278 c42.841-34.482,103.445-55.38,172.408-55.38C393.927,250.776,432.588,258.09,464.98,271.673z"}),(0,z.jsxs)("g",{children:[(0,z.jsx)("circle",{style:{fill:"#FFFFFF"},cx:122.253,cy:122.253,r:42.841}),(0,z.jsx)("path",{style:{fill:"#FFFFFF"},d:"M433.633,101.355c1.045-3.135,1.045-6.269,1.045-9.404c0-16.718-13.584-31.347-31.347-31.347 c-11.494,0-21.943,6.269-27.167,15.673c-3.135-2.09-7.314-2.09-11.494-2.09c-14.629,0-26.122,10.449-28.212,24.033 c-8.359,2.09-14.629,9.404-14.629,17.763c0,10.449,8.359,18.808,18.808,18.808h82.547c10.449,0,18.808-8.359,18.808-18.808 C441.992,109.714,438.857,104.49,433.633,101.355z"})]})]})}var v=require("react/jsx-runtime");function $(a){return(0,v.jsx)("svg",{id:"_x35_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",width:a.width||"28px",...a,children:(0,v.jsxs)("g",{children:[(0,v.jsx)("polygon",{style:{fill:"#B12A27"},points:"475.435,117.825 475.435,512 47.791,512 47.791,0.002 357.613,0.002 412.491,54.881 "}),(0,v.jsx)("rect",{x:36.565,y:34.295,style:{fill:"#F2F2F2"},width:205.097,height:91.768}),(0,v.jsxs)("g",{children:[(0,v.jsxs)("g",{children:[(0,v.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"}),(0,v.jsx)("path",{style:{fill:"#B12A27"},d:"M164.558,75.761c-0.075-2.035-0.151-3.844-0.377-5.503c-0.226-1.659-0.603-3.166-1.131-4.598 c-0.528-1.357-1.206-2.714-2.111-3.92c-2.035-2.94-4.523-5.126-7.312-6.483c-2.865-1.357-6.257-2.035-10.252-2.035h-20.956 v58.195h20.956c3.995,0,7.387-0.678,10.252-2.035c2.789-1.357,5.277-3.543,7.312-6.483c0.905-1.206,1.583-2.563,2.111-3.92 c0.528-1.432,0.905-2.94,1.131-4.598c0.226-1.658,0.301-3.468,0.377-5.503c0.075-1.96,0.075-4.146,0.075-6.558 C164.633,79.908,164.633,77.721,164.558,75.761z M153.175,88.2c0,1.734-0.151,3.091-0.302,4.297 c-0.151,1.131-0.377,2.186-0.678,2.94c-0.301,0.829-0.754,1.583-1.281,2.261c-1.885,2.412-4.749,3.543-8.518,3.543h-8.669V63.323 h8.669c3.769,0,6.634,1.206,8.518,3.618c0.528,0.678,0.98,1.357,1.281,2.186s0.528,1.809,0.678,3.015 c0.151,1.131,0.302,2.563,0.302,4.221c0.075,1.659,0.075,3.694,0.075,5.955C153.251,84.581,153.251,86.541,153.175,88.2z"}),(0,v.jsx)("path",{style:{fill:"#B12A27"},d:"M213.18,63.323V53.222h-38.37v58.195h11.383V87.823h22.992V77.646h-22.992V63.323H213.18z"})]}),(0,v.jsx)("g",{children:(0,v.jsx)("path",{style:{fill:"#B12A27"},d:"M110.132,64.379c-0.905-2.186-2.111-4.146-3.769-5.804c-1.658-1.658-3.694-3.015-6.031-3.92 c-2.412-0.98-5.126-1.432-8.141-1.432H69.651v58.195h11.383V89.481h11.157c3.015,0,5.729-0.452,8.141-1.432 c2.337-0.905,4.372-2.261,6.031-3.92c1.659-1.658,2.865-3.543,3.769-5.804c0.829-2.186,1.282-4.523,1.282-6.935 C111.413,68.902,110.961,66.565,110.132,64.379z M97.844,77.118c-1.508,1.432-3.618,2.186-6.181,2.186H81.034V63.323h10.629 c2.563,0,4.674,0.754,6.181,2.261c1.432,1.432,2.186,3.392,2.186,5.804C100.031,73.726,99.277,75.686,97.844,77.118z"})})]}),(0,v.jsx)("polygon",{style:{opacity:.08,fill:"#040000"},points:"475.435,117.825 475.435,512 47.791,512 47.791,419.581 247.705,219.667 259.54,207.832 266.098,201.273 277.029,190.343 289.995,177.377 412.491,54.881 "}),(0,v.jsx)("polygon",{style:{fill:"#771B1B"},points:"475.435,117.836 357.599,117.836 357.599,0 "}),(0,v.jsx)("g",{children:(0,v.jsx)("path",{style:{fill:"#F2F2F2"},d:"M414.376,370.658c-2.488-4.372-5.88-8.518-10.101-12.287c-3.467-3.166-7.538-6.106-12.137-8.82 c-18.544-10.93-45.003-16.207-80.961-16.207h-3.618c-1.96-1.809-3.995-3.618-6.106-5.503 c-13.644-12.287-24.499-25.63-32.942-40.48c16.584-36.561,24.499-69.126,23.519-96.867c-0.151-4.674-0.829-9.046-2.035-13.117 c-1.809-6.558-4.824-12.363-9.046-17.112c-0.075-0.075-0.075-0.075-0.151-0.151c-6.709-7.538-16.056-11.835-25.555-11.835 c-9.574,0-18.393,4.146-24.801,11.76c-6.332,7.538-9.724,17.866-9.875,30.002c-0.226,18.544,1.281,36.108,4.448,52.315 c0.301,1.282,0.528,2.563,0.829,3.844c3.166,14.7,7.84,28.645,13.87,41.611c-7.086,14.398-14.247,26.836-19.223,35.279 c-3.769,6.408-7.915,13.117-12.212,19.826c-19.373,3.468-35.807,7.689-50.129,12.966c-19.373,7.011-34.902,16.056-46.059,26.836 c-7.237,6.935-12.137,14.323-14.549,22.012c-2.563,7.915-2.412,15.83,0.452,22.916c2.638,6.558,7.387,12.061,13.72,15.83 c1.508,0.905,3.091,1.658,4.749,2.337c4.825,1.96,10.101,3.015,15.604,3.015c12.74,0,25.856-5.503,36.937-15.378 c20.655-18.469,41.988-48.169,54.577-66.94c10.327-1.583,21.559-2.94,34.224-4.297c14.926-1.508,28.118-2.412,40.104-2.865 c3.694,3.317,7.237,6.483,10.629,9.498c18.846,16.81,33.168,28.947,46.134,37.465c0,0.075,0.075,0.075,0.151,0.075 c5.126,3.392,10.026,6.181,14.926,8.443c5.503,2.563,11.081,3.92,16.81,3.92c7.237,0,14.021-2.186,19.675-6.181 c5.729-4.146,9.875-10.101,11.76-16.81C420.18,387.694,418.899,378.724,414.376,370.658z M247.705,219.667 c-1.055-9.348-1.508-19.072-1.357-29.324c0.151-9.724,3.694-16.283,8.895-16.283c3.92,0,8.066,3.543,9.95,10.327 c0.528,2.035,0.905,4.372,0.98,7.01c0.151,3.166,0.075,6.483-0.075,9.875c-0.452,9.574-2.111,19.75-4.975,30.681 c-1.734,7.011-3.995,14.323-6.784,21.936C251.173,243.186,248.911,231.803,247.705,219.667z M121.967,418.073 c-1.282-3.166,0.151-9.272,7.991-16.81c11.986-11.458,30.756-20.504,56.914-27.364c-4.975,6.784-9.875,12.966-14.624,18.619 c-7.237,8.744-14.172,16.132-20.429,21.71c-5.352,4.824-11.232,7.84-16.81,8.594c-0.98,0.151-1.96,0.226-2.94,0.226 C127.168,423.049,123.173,421.089,121.967,418.073z M242.428,337.942l0.528-0.829l-0.829,0.151 c0.151-0.377,0.377-0.754,0.603-1.055c3.166-5.352,7.161-12.212,11.458-20.127l0.377,0.829l0.98-2.035 c3.166,4.523,6.634,8.971,10.252,13.267c1.734,2.035,3.543,3.995,5.352,5.955l-1.206,0.075l1.055,0.98 c-3.091,0.226-6.332,0.528-9.574,0.829c-2.035,0.226-4.146,0.377-6.257,0.603C250.796,337.037,246.499,337.49,242.428,337.942z M369.297,384.98c-8.971-5.729-18.996-13.795-31.359-24.575c17.564,1.809,31.359,5.654,41.159,11.383 c4.297,2.488,7.538,5.051,9.724,7.538c3.618,3.844,4.9,7.312,4.221,9.649c-0.603,2.337-3.241,3.92-6.483,3.92 c-1.885,0-3.844-0.452-5.88-1.432c-3.468-1.658-7.086-3.694-10.93-6.181C369.598,385.282,369.448,385.131,369.297,384.98z"})})]})})}var o=require("react/jsx-runtime");var Br="/pdfjs",go=32,xo=240,Hr=8192,rt=.25,nt=8,it=80,yo=80,zr=a=>{switch(a){case"image":return(0,o.jsx)(N,{});case"pdf":return(0,o.jsx)($,{});case"text":return(0,o.jsx)(Io.default,{sx:{mr:1,color:"#66BB6A"}});case"spreadsheet":return(0,o.jsx)(Eo.default,{sx:{mr:1,color:"#4CAF50"}});case"html":return(0,o.jsx)(mt.default,{sx:{mr:1,color:"#E91E63"}});case"code":return(0,o.jsx)(mt.default,{sx:{mr:1,color:"#2196F3"}});case"video":return(0,o.jsx)(ko.default,{sx:{mr:1,color:"#AB47BC"}});case"audio":return(0,o.jsx)(Lo.default,{sx:{mr:1,color:"#FF7043"}});case"office":return(0,o.jsx)(Fo.default,{sx:{mr:1,color:"#FFA726"}});default:return(0,o.jsx)(Ro.default,{sx:{mr:1,color:"#78909C"}})}},bo=a=>typeof a?.rotate=="number"?a.rotate:typeof a?._pageInfo?.rotate=="number"?a._pageInfo.rotate:0,ft=({open:a,onClose:d,file:u,files:m=null,initialIndex:T=0,loadFile:_,onDownload:G,pdfAssetBase:I=Br})=>{let g=fo(),Xo=(0,n.useTheme)(),J=(0,n.useMediaQuery)(Xo.breakpoints.down("sm")),R=(0,i.useMemo)(()=>m&&m.length>0?m:[],[m]),[de,ee]=(0,i.useState)(0);(0,i.useEffect)(()=>{a&&ee(R.length>0?Math.min(Math.max(T,0),R.length-1):0)},[a,T,R]);let p=R.length>0?R[de]??u:u,[ue,Be]=(0,i.useState)(!0),[He,yt]=(0,i.useState)(!1),[w,ze]=(0,i.useState)(""),[k,B]=(0,i.useState)(1),[A,te]=(0,i.useState)(0),[bt,me]=(0,i.useState)(""),[C,vt]=(0,i.useState)(""),[wt,pe]=(0,i.useState)(""),[oe,he]=(0,i.useState)(14),[Ve,fe]=(0,i.useState)(""),[Ae,Mt]=(0,i.useState)("preview"),[We,re]=(0,i.useState)([]),[Ct,Tt]=(0,i.useState)([]),[_o,Xe]=(0,i.useState)(""),[_e,It]=(0,i.useState)(null),[kt,ge]=(0,i.useState)(!1),[jo,je]=(0,i.useState)(!0),[Lt,xe]=(0,i.useState)(""),[L,Ft]=(0,i.useState)(),[F,j]=(0,i.useState)(1),[Yo,Ye]=(0,i.useState)(!1),[Rt,K]=(0,i.useState)(null),[ye,Et]=(0,i.useState)("portrait"),[Oo,Pt]=(0,i.useState)(0),[Oe,St]=(0,i.useState)(0),[ne,Dt]=(0,i.useState)({width:0,height:0}),Bt=(0,i.useRef)([]),Ue=(0,i.useRef)(null),Y=(0,i.useRef)(null),Ne=(0,i.useRef)(null),$e=(0,i.useRef)(null),Uo=(0,i.useCallback)(e=>{if(Ne.current?.disconnect(),$e.current?.(),$e.current=null,Y.current=e,!e){Ne.current=null;return}let t=s=>{s.touches.length>=2&&s.preventDefault()};e.addEventListener("touchmove",t,{passive:!1}),$e.current=()=>e.removeEventListener("touchmove",t);let r=new ResizeObserver(s=>{let c=s[0]?.contentRect;c&&Dt({width:c.width,height:c.height})});r.observe(e),Ne.current=r;let l=e.getBoundingClientRect();Dt({width:l.width,height:l.height})},[]),[be,Ht]=(0,i.useState)(!1),[Ge,No]=(0,i.useState)({x:0,y:0}),[Ke,$o]=(0,i.useState)({x:0,y:0}),Go=(0,i.useCallback)(async(e,t)=>{let r=URL.createObjectURL(e);ze(r),vt(e.type||"");let l=M(t,e.type||"");if(l==="text"||l==="code"){let c=await e.text();pe(c);return}if(l==="html"){let c=await e.text();fe(c);return}if(l!=="spreadsheet")return;let s=t.split(".").pop()?.toLowerCase()||"";if(s==="csv"){let f=(await e.text()).split(`
2
+ `).map(b=>b.split(",").map(D=>({value:D.trim()})));re(f);return}if(s==="xls"||s==="xlsx"){ge(!0),je(!0);let c=await e.arrayBuffer(),f=ae.read(c,{type:"array"});Tt(f.SheetNames),It(f);let b=f.SheetNames[0];Xe(b),Je(f,b)}},[]),ve=(0,i.useRef)(null),zt=(0,i.useCallback)(async e=>{if(e.blob)return e.blob;if(_)return await _(e);if(e.url){let t=await fetch(e.url);if(!t.ok)throw new Error("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");return await t.blob()}throw new Error("\uD30C\uC77C \uB370\uC774\uD130 \uC18C\uC2A4(blob/url/loadFile)\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.")},[_]);(0,i.useEffect)(()=>(p&&a?Qo():(w&&URL.revokeObjectURL(w),ve.current=null,ze(""),pe(""),fe(""),re([]),he(14),B(1),te(0)),()=>{w&&URL.revokeObjectURL(w)}),[p,a]);let Ko=({numPages:e})=>{Ft(e),j(1),Le.current=!0},qo=e=>{let{width:t,height:r}=Zo(e);Pt(bo(e)),t>0&&r>0&&St(t/r);let l=t>r?"landscape":"portrait";Et(l)},Zo=e=>{let t=e?.width||0,r=e?.height||0,l=bo(e);try{if(typeof e?.getViewport=="function"){let s=e.getViewport({scale:1,rotation:l});t=s.width,r=s.height}}catch(s){console.warn("[FileViewer] getViewport \uC2E4\uD328 - \uAE30\uBCF8 width/height\uB85C \uB300\uCCB4",s)}return{width:t,height:r}},we=(0,i.useCallback)(()=>{j(e=>Math.max(e-1,1))},[]),Me=(0,i.useCallback)(()=>{j(e=>Math.min(e+1,L||1))},[L]),Vt=(0,i.useMemo)(()=>({cMapUrl:`${I}/cmaps/`,cMapPacked:!0,standardFontDataUrl:`${I}/standard_fonts/`,wasmUrl:`${I}/wasm/`}),[I]);(0,i.useEffect)(()=>{typeof window>"u"||(X.pdfjs.GlobalWorkerOptions.workerSrc=`${I}/pdf.worker.min.mjs`)},[I]),(0,i.useEffect)(()=>{if(!a||R.length<=1||M(p?.name||"",C)==="pdf")return;let e=t=>{t.key==="ArrowLeft"?(t.preventDefault(),ee(r=>Math.max(r-1,0))):t.key==="ArrowRight"&&(t.preventDefault(),ee(r=>Math.min(r+1,R.length-1)))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a,R.length,p?.name,C]),(0,i.useEffect)(()=>{if(!a||M(p?.name||"",C)!=="pdf")return;let e=r=>{switch(r.key){case"ArrowLeft":case"ArrowUp":r.preventDefault(),we();break;case"ArrowRight":case"ArrowDown":r.preventDefault(),Me();break;case"Home":r.preventDefault(),j(1);break;case"End":r.preventDefault(),L&&j(L);break}},t=r=>{r.ctrlKey||Math.abs(r.deltaY)>50&&(r.preventDefault(),r.deltaY>0?Me():we())};return document.addEventListener("keydown",e),document.addEventListener("wheel",t,{passive:!1}),()=>{document.removeEventListener("keydown",e),document.removeEventListener("wheel",t)}},[a,p,C,we,Me,L]),(0,i.useEffect)(()=>{if(!L||!a||M(p?.name||"",C)!=="pdf")return;if(F===1&&Ue.current){Ue.current.scrollTo({top:0,behavior:"smooth"});return}let e=Bt.current[F-1];e&&e.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},[a,p,C,L,F]),(0,i.useEffect)(()=>{ue&&yt(!0)},[ue,He]);let Qo=async()=>{if(p){Be(!0),me(""),vt(""),pe(""),fe(""),re([]);try{let e=await zt(p);ve.current=e,await Go(e,p.name)}catch(e){console.error("\uD30C\uC77C \uB85C\uB4DC \uC624\uB958:",e),me("\uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}finally{Be(!1)}}},At=async()=>{if(p)try{if(G){await G(p);return}let e=ve.current??await zt(p);Se(e,p.name)}catch(e){console.error("\uD30C\uC77C \uB2E4\uC6B4\uB85C\uB4DC \uC624\uB958:",e)}},Jo=()=>{let e=p?M(p.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?he(t=>Math.min(t+2,24)):B(e==="pdf"?t=>Math.min(t+.25,nt):t=>Math.min(t+.25,3))},er=()=>{let e=p?M(p.name,C):"";e==="text"||e==="html"||e==="code"||e==="spreadsheet"?he(t=>Math.max(t-2,10)):B(e==="pdf"?t=>Math.max(t-.25,rt):t=>Math.max(t-.25,.25))},x=(0,i.useRef)(new Map),tr=e=>Math.min(Math.max(e,.25),3),or=e=>Math.min(Math.max(e,rt),nt),qe=(0,i.useRef)(null),Ce=(0,i.useRef)(null),V=(0,i.useRef)({scale:1,tx:0,ty:0,rotation:0}),W=(0,i.useRef)(0),q=(0,i.useRef)(null),Te=(0,i.useRef)(null),Ie=(0,i.useCallback)((e,t,r,l)=>{let s=qe.current,c=Ce.current;if(!s||!c)return{tx:t,ty:r};let f=c.offsetWidth,b=c.offsetHeight,D=(Math.round(l/90)%4+4)%4;if(D===1||D===3){let Cr=f;f=b,b=Cr}let H=f*e,lo=b*e,so=H>s.clientWidth?(H+s.clientWidth)/2-yo:0,co=lo>s.clientHeight?(lo+s.clientHeight)/2-yo:0;return{tx:Math.min(so,Math.max(-so,t)),ty:Math.min(co,Math.max(-co,r))}},[]),Wt=(0,i.useCallback)((e,t)=>{let r=qe.current,l=Ce.current;if(!r||!l)return e>1;let s=(Math.round(t/90)%4+4)%4,c=s===1||s===3,f=c?l.offsetHeight:l.offsetWidth,b=c?l.offsetWidth:l.offsetHeight;return f*e>r.clientWidth+1||b*e>r.clientHeight+1},[]),O=(0,i.useCallback)(e=>{let t=Ce.current;if(!t)return;let{scale:r,tx:l,ty:s,rotation:c}=V.current;t.style.transition=e?"transform 0.25s ease":"none",t.style.transform=`translate(${l}px, ${s}px) scale(${r}) rotate(${c}deg)`},[]),Xt=(0,i.useCallback)(()=>{let e=V.current,t=Ie(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,!W.current&&(W.current=requestAnimationFrame(()=>{W.current=0,O(!1)}))},[O,Ie]),_t=(0,i.useCallback)(()=>{W.current&&(cancelAnimationFrame(W.current),W.current=0),x.current.clear(),q.current=null,Te.current=null},[]),rr=(0,i.useCallback)(e=>{Ce.current=e,e&&(V.current={scale:1,tx:0,ty:0,rotation:0},O(!1))},[O]);(0,i.useEffect)(()=>{if(M(p?.name||"",C)!=="image")return;let e=V.current;e.scale=k,e.rotation=A;let t=Ie(e.scale,e.tx,e.ty,e.rotation);e.tx=t.tx,e.ty=t.ty,O(!0)},[k,A,p,C,w,O,Ie]),(0,i.useEffect)(()=>()=>{W.current&&cancelAnimationFrame(W.current)},[]);let nr=e=>{e.currentTarget.setPointerCapture?.(e.pointerId),x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...x.current.values()],r=V.current;if(t.length===2){q.current=null;let l=e.currentTarget.getBoundingClientRect();Te.current={startDist:Math.hypot(t[0].x-t[1].x,t[0].y-t[1].y)||1,baseScale:r.scale,baseTx:r.tx,baseTy:r.ty,startMidX:(t[0].x+t[1].x)/2,startMidY:(t[0].y+t[1].y)/2,centerX:l.left+l.width/2,centerY:l.top+l.height/2}}else t.length===1&&Wt(r.scale,r.rotation)&&(q.current={startX:e.clientX,startY:e.clientY,baseTx:r.tx,baseTy:r.ty})},ir=e=>{if(!x.current.has(e.pointerId))return;x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=V.current,r=Te.current,l=[...x.current.values()];if(r&&l.length>=2){let c=Math.hypot(l[0].x-l[1].x,l[0].y-l[1].y),f=(l[0].x+l[1].x)/2,b=(l[0].y+l[1].y)/2,D=tr(r.baseScale*c/r.startDist),H=D/r.baseScale;t.scale=D,t.tx=f-r.centerX-H*(r.startMidX-r.centerX-r.baseTx),t.ty=b-r.centerY-H*(r.startMidY-r.centerY-r.baseTy),Xt();return}let s=q.current;s&&l.length===1&&(t.tx=s.baseTx+(e.clientX-s.startX),t.ty=s.baseTy+(e.clientY-s.startY),Xt())},jt=e=>{if(!x.current.has(e.pointerId))return;x.current.delete(e.pointerId),e.currentTarget.hasPointerCapture?.(e.pointerId)&&e.currentTarget.releasePointerCapture?.(e.pointerId);let t=V.current;if(x.current.size<2&&(Te.current=null,Math.abs(t.scale-k)>.001&&B(t.scale)),x.current.size===0)q.current=null;else if(x.current.size===1&&Wt(t.scale,t.rotation)){let r=[...x.current.values()][0];q.current={startX:r.x,startY:r.y,baseTx:t.tx,baseTy:t.ty}}},Yt=(0,i.useCallback)(async()=>{if(w)try{let t=await(await fetch(w)).blob(),r=t.type==="image/png"?t:await ho(t);await navigator.clipboard.write([new ClipboardItem({"image/png":r})]),xe("\uC774\uBBF8\uC9C0\uB97C \uD074\uB9BD\uBCF4\uB4DC\uC5D0 \uBCF5\uC0AC\uD588\uC2B5\uB2C8\uB2E4.")}catch(e){console.error("\uC774\uBBF8\uC9C0 \uBCF5\uC0AC \uC624\uB958:",e),xe("\uC774\uBBF8\uC9C0\uB97C \uBCF5\uC0AC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")}},[w]);(0,i.useEffect)(()=>{if(!a||M(p?.name||"",C)!=="image")return;let e=t=>{if(!(t.ctrlKey||t.metaKey)||t.key.toLowerCase()!=="c")return;let r=t.target,l=r?.tagName;l==="INPUT"||l==="TEXTAREA"||r?.isContentEditable||(t.preventDefault(),Yt())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a,p,C,Yt]);let Z=(0,i.useRef)(null),S=(0,i.useRef)(0),ie=(0,i.useRef)(null),Q=(0,i.useRef)(null),U=()=>Y.current?.querySelector(".react-pdf__Page")??null,ke=(0,i.useRef)(null),Ot=(0,i.useRef)(null),ar=()=>{let e=Ot.current,t=U()?.querySelector("canvas");if(!e||!t||!t.width||!t.height)return!1;let r=document.createElement("canvas");r.width=t.width,r.height=t.height;let l=r.getContext("2d");if(!l)return!1;l.drawImage(t,0,0);let s=t.getBoundingClientRect(),c=e.getBoundingClientRect();return Object.assign(r.style,{position:"absolute",left:`${s.left-c.left}px`,top:`${s.top-c.top}px`,width:`${s.width}px`,height:`${s.height}px`,pointerEvents:"none",zIndex:"1"}),e.appendChild(r),ke.current=r,!0},Ut=()=>{ke.current?.remove(),ke.current=null;let e=U();e&&(e.style.visibility="")},lr=()=>{S.current||(S.current=requestAnimationFrame(()=>{S.current=0;let e=Z.current,t=U();!e||!t||(t.style.transition="none",t.style.transformOrigin="top left",t.style.transform=`translate(${e.tx}px, ${e.ty}px) scale(${e.k})`,ie.current={k:e.k,tx:e.tx,ty:e.ty,midX:e.lastMidX,midY:e.lastMidY})}))},Nt=()=>{S.current&&(cancelAnimationFrame(S.current),S.current=0),Z.current=null,Q.current=null,ie.current=null,Ut();let e=U();e&&(e.style.transform="",e.style.willChange="auto")},$t=e=>{let t=U(),r=Y.current;if(!t||!r)return;t.style.transform&&(t.style.transform="");let l=t.getBoundingClientRect(),s=r.getBoundingClientRect(),c=(e[0].x+e[1].x)/2,f=(e[0].y+e[1].y)/2;Z.current={startDist:Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y)||1,rectLeft:l.left,rectTop:l.top,pageW:l.width,pageH:l.height,viewerL:s.left,viewerT:s.top,viewerR:s.right,viewerB:s.bottom,startMidX:c,startMidY:f,lastMidX:c,lastMidY:f,k:1,tx:0,ty:0},ie.current={k:1,tx:0,ty:0,midX:c,midY:f},t.style.willChange="transform"},sr=e=>{if(e.pointerType!=="touch")return;x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=[...x.current.values()];if(t.length===2){if(Q.current||ke.current)return;$t(t)}},cr=e=>{if(!x.current.has(e.pointerId))return;x.current.set(e.pointerId,{x:e.clientX,y:e.clientY});let t=Z.current,r=[...x.current.values()];if(t&&r.length>=2){e.preventDefault();let l=Math.hypot(r[0].x-r[1].x,r[0].y-r[1].y),s=Math.min(Math.max(l/t.startDist,rt/(k||1)),nt/(k||1)),c=(r[0].x+r[1].x)/2,f=(r[0].y+r[1].y)/2,b=c-t.rectLeft-s*(t.startMidX-t.rectLeft),D=f-t.rectTop-s*(t.startMidY-t.rectTop),H=it;b=Math.min(t.viewerR-H-t.rectLeft,Math.max(t.viewerL+H-t.rectLeft-s*t.pageW,b)),D=Math.min(t.viewerB-H-t.rectTop,Math.max(t.viewerT+H-t.rectTop-s*t.pageH,D)),t.k=s,t.tx=b,t.ty=D,t.lastMidX=c,t.lastMidY=f,lr()}},Gt=e=>{if(x.current.delete(e.pointerId),x.current.size>=2)return;let t=Z.current;if(Z.current=null,!t)return;S.current&&(cancelAnimationFrame(S.current),S.current=0);let r=ie.current??{k:1,tx:0,ty:0,midX:t.startMidX,midY:t.startMidY};ie.current=null;let l=or(k*r.k);if(Math.abs(l-k)<.001){let c=Y.current;Nt(),c&&(c.scrollLeft-=r.tx,c.scrollTop-=r.ty);return}let s=Y.current;if(s){let c=s.getBoundingClientRect();Q.current={u:(r.midX-t.rectLeft-r.tx)/r.k,v:(r.midY-t.rectTop-r.ty)/r.k,offX:r.midX-c.left,offY:r.midY-c.top,factor:l/(k||1)}}if(ar()){let c=U();c&&(c.style.transform="",c.style.visibility="hidden")}B(l),Math.round(Math.min(et*l,no))===tt&&requestAnimationFrame(()=>qt())},Le=(0,i.useRef)(!0),Ze=(0,i.useRef)(null),Kt=()=>{let e=Y.current;e&&(e.scrollLeft=(e.scrollWidth-e.clientWidth)/2,e.scrollTop=(e.scrollHeight-e.clientHeight)/2)},qt=()=>{let e=Q.current;if(!e)return;Q.current=null;let t=Y.current,r=U();if(!t||!r)return;Ut(),r.style.transform="",r.style.willChange="auto";let l=r.getBoundingClientRect(),s=t.getBoundingClientRect();t.scrollLeft+=l.left-s.left+e.u*e.factor-e.offX,t.scrollTop+=l.top-s.top+e.v*e.factor-e.offY;let c=[...x.current.values()];c.length>=2&&$t(c)},Zt=()=>{let e=`${F}:${A}`;if(Q.current){Ze.current=e,qt();return}(Le.current||Ze.current!==e)&&(Le.current=!1,Ze.current=e,Kt())};(0,i.useEffect)(()=>()=>{S.current&&cancelAnimationFrame(S.current)},[]);let Qt=()=>{te(e=>e-90)},Jt=()=>{te(e=>e+90)},eo=()=>{let e=M(p?.name||"",C);Nt(),e==="text"||e==="html"||e==="code"||e==="spreadsheet"?he(14):e==="pdf"?(B(1),k===1&&A===0?Kt():Le.current=!0):(_t(),V.current={scale:1,tx:0,ty:0,rotation:0},O(!0),B(1)),te(0)},to=(e,t)=>{Ht(!0),No({x:e.clientX,y:e.clientY}),$o({x:t.scrollLeft,y:t.scrollTop}),e.preventDefault()},oo=(0,i.useCallback)((e,t)=>{if(!be)return;let r=e.clientX-Ge.x,l=e.clientY-Ge.y;t.scrollLeft=Ke.x-r,t.scrollTop=Ke.y-l,e.preventDefault()},[be,Ge,Ke]),Qe=(0,i.useCallback)(()=>{Ht(!1),document.body.style.cursor="default"},[]);(0,i.useEffect)(()=>{if(be){let e=t=>{document.querySelectorAll(".draggable-scroll").forEach(l=>{oo(t,l)})};return document.addEventListener("mousemove",e),document.addEventListener("mouseup",Qe),document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",Qe),document.body.style.userSelect="",document.body.style.webkitUserSelect=""}}},[be,oo,Qe]);let dr=(0,i.useCallback)(()=>{Be(!1),yt(!1)},[]),Je=(0,i.useCallback)(async(e,t)=>{ge(!0),je(!0);try{await new Promise(f=>setTimeout(f,500));let r=e.Sheets[t],l=ae.utils.decode_range(r["!ref"]||"A1");console.debug("Excel range:",l);let c=ae.utils.sheet_to_json(r,{header:1,range:l,defval:""}).map(f=>f.map(b=>({value:b!=null?String(b):""})));re(c),await new Promise(f=>setTimeout(f,200))}catch(r){console.error("\uC6CC\uD06C\uC2DC\uD2B8 \uB85C\uB4DC \uC624\uB958:",r)}finally{je(!1)}},[]),ur=(0,i.useCallback)(()=>{ge(!1)},[]),mr=(0,i.useCallback)(e=>{_e&&(Xe(e),Je(_e,e))},[_e,Je]),ro=()=>{_t(),V.current={scale:1,tx:0,ty:0,rotation:0},xe(""),w&&URL.revokeObjectURL(w),ve.current=null,ze(""),pe(""),fe(""),re([]),Tt([]),Xe(""),It(null),ge(!1),B(1),te(0),me(""),Ft(void 0),j(1),Et("portrait"),Pt(0),St(0),d()};if(!p)return null;let y=M(p.name,C),pr=((Oo+A)%360+360)%360,Fe=A%180===0?Oe:Oe>0?1/Oe:0,hr=Math.max(ne.width-go,xo),fr=Math.max(ne.height-go,xo),et=ne.width>0&&Fe>0?Math.min(hr,fr*Fe):ye==="portrait"?600:800,gr=typeof window<"u"&&window.devicePixelRatio||1,no=Hr/gr*(Fe>0?Math.min(1,Fe):1),tt=Math.round(Math.min(et*k,no)),io=Math.round(et*k),xr=io>tt,yr=Math.max(16,Math.round(ne.width)-it),br=Math.max(16,Math.round(ne.height)-it),vr=ye==="landscape"?"200px":"150px",wr=ye==="landscape"?.18:.17,ao=()=>L?(0,o.jsx)(n.Box,{ref:Ue,sx:{width:vr,height:"100%",backgroundColor:"grey.200",borderRight:"1px solid",borderColor:"grey.300",overflow:"auto",p:2},children:Array.from({length:L},(e,t)=>(0,o.jsxs)(n.Box,{ref:r=>{Bt.current[t]=r},children:[(0,o.jsx)(n.Box,{sx:{mb:0,p:1,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",border:F===t+1?"2px solid":"1px solid",borderColor:F===t+1?"primary.main":"grey.400",borderRadius:1,overflow:"hidden",backgroundColor:"white","&:hover":{borderColor:"primary.main"},aspectRatio:ye==="landscape"?"4 / 3":"3 / 4"},onClick:()=>{j(t+1),g&&Ye(!1)},children:(0,o.jsx)(X.Document,{file:w,options:Vt,loading:(0,o.jsx)("div",{style:{display:"none"}}),children:(0,o.jsx)(X.Page,{pageNumber:t+1,scale:wr,loading:(0,o.jsx)("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1})})}),(0,o.jsx)(n.Typography,{variant:"caption",sx:{display:"block",textAlign:"center",p:.5,mb:1,color:F===t+1?"primary.main":"",fontWeight:F===t+1?"bold":"normal"},children:t+1})]},t+1))}):null,Mr=()=>{let e=M(p?.name||"",C);if(He&&!(e==="spreadsheet"))return(0,o.jsx)(n.Box,{sx:{display:"flex",height:"100%",width:"100%",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(ht.LoadingProgress,{visible:ue,exitDelay:100,onComplete:dr})});if(bt)return(0,o.jsxs)(n.Box,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[(0,o.jsx)(n.Typography,{color:"error",variant:"h6",children:bt}),(0,o.jsx)(n.Typography,{color:"text.secondary",variant:"body2",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]});if(!w)return null;switch(e){case"image":return(0,o.jsx)(n.Box,{ref:qe,"data-allow-pinch":"true",onPointerDown:nr,onPointerMove:ir,onPointerUp:jt,onPointerCancel:jt,sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"hidden",height:"100%",backgroundColor:"grey.100",p:2,touchAction:"none",overscrollBehavior:"contain",userSelect:"none","&:active":{cursor:"grabbing"}},children:(0,o.jsx)("img",{ref:rr,src:w,alt:p.name,draggable:!1,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block",transform:"translate(0px, 0px) scale(1) rotate(0deg)",transformOrigin:"center center",pointerEvents:"none"}})});case"pdf":return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(n.Box,{ref:Ot,sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",backgroundColor:"grey.100",position:"relative",overflow:"hidden"},children:[!g&&ao(),(0,o.jsx)(n.Box,{ref:Uo,className:"draggable-scroll",onMouseDown:r=>{let l=r.currentTarget;to(r,l)},"data-allow-pinch":"true",onPointerDown:sr,onPointerMove:cr,onPointerUp:Gt,onPointerCancel:Gt,sx:{flex:1,display:"flex",flexDirection:"column",overflow:"auto",height:"100%",py:g?0:2,overflowAnchor:"none",touchAction:"pan-x pan-y","& > .react-pdf__Document":{m:"auto",...g&&{px:`${yr}px`,py:`${br}px`},...xr&&{"& .react-pdf__Page__canvas":{width:`${io}px !important`,height:"auto !important"}}}},children:(0,o.jsx)(X.Document,{file:w,onLoadSuccess:Ko,onLoadError:r=>{console.error("PDF \uB85C\uB4DC \uC624\uB958:",r),me("PDF \uD30C\uC77C\uC744 \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.")},loading:(0,o.jsx)("div",{style:{display:"none"}}),error:(0,o.jsxs)(n.Box,{sx:{textAlign:"center",p:4},children:[(0,o.jsx)(n.Typography,{color:"error",variant:"h6",sx:{mb:2},children:"PDF\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."}),(0,o.jsx)(n.Typography,{color:"text.secondary",variant:"body2",children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]}),options:Vt,children:(0,o.jsx)(X.Page,{pageNumber:F,width:tt,rotate:A===0?void 0:pr,loading:(0,o.jsx)("div",{style:{display:"none"}}),renderAnnotationLayer:!1,renderTextLayer:!1,onLoadSuccess:qo,onRenderSuccess:Zt,onRenderError:Zt})})})]}),g&&(0,o.jsx)(n.Drawer,{anchor:"left",open:Yo,onClose:()=>Ye(!1),sx:{zIndex:r=>r.zIndex.modal+2},children:ao()})]});case"text":case"code":return(0,o.jsx)(n.Box,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column"},children:wt?(0,o.jsx)(n.Box,{sx:{flex:1,height:"100%",overflow:"hidden"},children:(0,o.jsx)(pt.default,{height:"100%",language:Pe(p.name),value:wt,theme:"vs-dark",loading:!1,options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,formatOnPaste:!0,formatOnType:!0,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:oe,lineHeight:Math.round(oe*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(r,l)=>{r.onDidAttemptReadOnlyEdit(()=>{});let s=r.getDomNode();if(s){let c=document.createElement("style");c.textContent=`
3
3
  .monaco-editor .margin-view-overlays {
4
4
  border-right: 1px solid #3c3c3c;
5
5
  }
@@ -27,7 +27,7 @@
27
27
  .monaco-editor .overlay.cursor-layer {
28
28
  padding-left: 15px !important;
29
29
  }
30
- `,l.appendChild(d)}}})}):(0,o.jsx)(n.Box,{sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(n.Typography,{color:"text.secondary",children:"\uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"html":return(0,o.jsx)(n.Box,{sx:{width:"100%",height:"calc(100vh - 60px)",overflow:"hidden",borderRadius:1},children:Pe?(0,o.jsxs)(n.Box,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[(0,o.jsxs)(n.Box,{sx:{display:"flex",gap:1,p:1,borderBottom:"1px solid",borderColor:"grey.300",backgroundColor:"grey.50"},children:[(0,o.jsx)(n.Button,{variant:Ee==="preview"?"contained":"outlined",size:"small",onClick:()=>pt("preview"),children:"\uBBF8\uB9AC\uBCF4\uAE30"}),(0,o.jsx)(n.Button,{variant:Ee==="source"?"contained":"outlined",size:"small",onClick:()=>pt("source"),children:"\uC18C\uC2A4\uCF54\uB4DC"})]}),Ee==="preview"?(0,o.jsx)(n.Box,{sx:{flex:1,overflow:"auto",backgroundColor:"white",border:"1px solid",borderColor:"grey.300",fontSize:`${Z}px`,p:2},dangerouslySetInnerHTML:{__html:Pe}}):(0,o.jsx)(n.Box,{sx:{flex:1,height:"100%",overflow:"hidden"},children:(0,o.jsx)(nt.default,{height:"100%",language:"html",value:Pe,theme:"vs-dark",options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:Z,lineHeight:Math.round(Z*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(r,a)=>{r.onDidAttemptReadOnlyEdit(()=>{});let l=r.getDomNode();if(l){let d=document.createElement("style");d.textContent=`
30
+ `,s.appendChild(c)}}})}):(0,o.jsx)(n.Box,{sx:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(n.Typography,{color:"text.secondary",children:"\uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"html":return(0,o.jsx)(n.Box,{sx:{width:"100%",height:"calc(100vh - 60px)",overflow:"hidden",borderRadius:1},children:Ve?(0,o.jsxs)(n.Box,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[(0,o.jsxs)(n.Box,{sx:{display:"flex",gap:1,p:1,borderBottom:"1px solid",borderColor:"grey.300",backgroundColor:"grey.50"},children:[(0,o.jsx)(n.Button,{variant:Ae==="preview"?"contained":"outlined",size:"small",onClick:()=>Mt("preview"),children:"\uBBF8\uB9AC\uBCF4\uAE30"}),(0,o.jsx)(n.Button,{variant:Ae==="source"?"contained":"outlined",size:"small",onClick:()=>Mt("source"),children:"\uC18C\uC2A4\uCF54\uB4DC"})]}),Ae==="preview"?(0,o.jsx)(n.Box,{sx:{flex:1,overflow:"auto",backgroundColor:"white",border:"1px solid",borderColor:"grey.300",fontSize:`${oe}px`,p:2},dangerouslySetInnerHTML:{__html:Ve}}):(0,o.jsx)(n.Box,{sx:{flex:1,height:"100%",overflow:"hidden"},children:(0,o.jsx)(pt.default,{height:"100%",language:"html",value:Ve,theme:"vs-dark",options:{readOnly:!0,domReadOnly:!0,minimap:{enabled:!0},scrollBeyondLastLine:!1,automaticLayout:!0,folding:!0,foldingHighlight:!1,wordWrap:"on",lineNumbers:"on",lineNumbersMinChars:4,glyphMargin:!1,renderLineHighlight:"none",renderWhitespace:"selection",fontFamily:"'Roboto', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace",fontSize:oe,lineHeight:Math.round(oe*1.5),scrollbar:{vertical:"auto",horizontal:"auto"},lineDecorationsWidth:10},onMount:(r,l)=>{r.onDidAttemptReadOnlyEdit(()=>{});let s=r.getDomNode();if(s){let c=document.createElement("style");c.textContent=`
31
31
  .monaco-editor .margin-view-overlays {
32
32
  border-right: 1px solid #3c3c3c;
33
33
  }
@@ -55,4 +55,4 @@
55
55
  .monaco-editor .overlay.cursor-layer {
56
56
  padding-left: 15px !important;
57
57
  }
58
- `,l.appendChild(d)}}})})]}):(0,o.jsx)(n.Box,{sx:{backgroundColor:"white",p:2,borderRadius:1,border:"1px solid",borderColor:"grey.300",minHeight:"400px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(n.Typography,{color:"text.secondary",children:"HTML \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"video":return(0,o.jsx)(n.Box,{className:"draggable-scroll",onMouseDown:r=>{let a=r.currentTarget;Nt(r,a)},sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"auto"},children:(0,o.jsx)("video",{src:v,controls:!0,style:{maxWidth:"100%",maxHeight:"70vh",transform:`scale(${T}) rotate(${V}deg)`,transition:"transform 0.3s ease",pointerEvents:T>1?"none":"auto"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uBE44\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})});case"spreadsheet":return(0,o.jsxs)(n.Box,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[De.length>0||xt?(0,o.jsxs)(n.Box,{sx:{flex:1,position:"relative",overflow:"scroll",backgroundColor:"white",minHeight:"400px",minWidth:"100%","&::-webkit-scrollbar":{width:"18px",height:"18px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f1f1f1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"10px",border:"2px solid #f1f1f1","&:hover":{backgroundColor:"#555"}},"&::-webkit-scrollbar-corner":{backgroundColor:"#f1f1f1"}},children:[De.length>0&&(0,o.jsx)(n.Box,{sx:{minWidth:"max-content",minHeight:"max-content"},children:(0,o.jsx)(Co.default,{data:De,darkMode:!1})}),xt&&(0,o.jsx)(n.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",zIndex:1e3},children:(0,o.jsx)(it.LoadingProgress,{visible:Bo,exitDelay:200,fadeoutDuration:300,onComplete:rr})})]}):(0,o.jsx)(n.Box,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(n.Typography,{color:"text.secondary",children:"\uC2A4\uD504\uB808\uB4DC\uC2DC\uD2B8 \uB370\uC774\uD130\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})}),ft.length>1&&(0,o.jsx)(n.Box,{sx:{borderTop:1,borderColor:"divider",backgroundColor:"#e0e0e0",padding:"0 8px 8px 8px"},children:(0,o.jsx)(n.Tabs,{value:So,onChange:(r,a)=>nr(a),variant:"scrollable",scrollButtons:"auto",sx:{minHeight:"36px","& .MuiTabs-flexContainer":{gap:"6px"},"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{minHeight:"32px",fontSize:"0.875rem",textTransform:"none",padding:"6px 16px",margin:"0",backgroundColor:"white",border:"1px solid #d0d0d0",borderRadius:"0 0 4px 4px",color:"#666",minWidth:"80px",transition:"all 0.2s ease","&:hover":{backgroundColor:"#f8f8f8",color:"#333"},"&.Mui-selected":{backgroundColor:"primary.main",color:"white",border:"1px solid",borderColor:"primary.dark",fontWeight:600,"&:hover":{backgroundColor:"primary.dark"}}}},children:ft.map(r=>(0,o.jsx)(n.Tab,{label:r,value:r},r))})})]});case"audio":return(0,o.jsxs)(n.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column"},children:[(0,o.jsx)(n.Typography,{variant:"h6",sx:{mb:2},children:c.name}),(0,o.jsx)("audio",{src:v,controls:!0,style:{width:"100%",maxWidth:"500px"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uC624\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})]});default:return(0,o.jsxs)(n.Box,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[(0,o.jsx)(n.Typography,{variant:"h6",color:"text.secondary",children:"\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4"}),(0,o.jsx)(n.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]})}};return(0,o.jsxs)(n.Dialog,{open:s,onClose:Gt,maxWidth:"lg",fullScreen:!0,children:[(0,o.jsxs)(n.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"grey.800",color:"white",height:"60px",boxSizing:"border-box",userSelect:"none",px:h?1:3},onContextMenu:e=>e.preventDefault(),children:[(0,o.jsxs)(n.Box,{sx:{display:"flex",alignItems:"center",gap:q?.35:1,flexShrink:0,"& .MuiSvgIcon-root":{fontSize:h?"1.7rem":void 0}},children:[h&&x==="pdf"&&I?(0,o.jsx)(n.Tooltip,{title:"\uD398\uC774\uC9C0 \uBAA9\uB85D",children:(0,o.jsx)(n.IconButton,{onClick:()=>Ve(e=>!e),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:(0,o.jsx)(mo.default,{})})}):null,x==="pdf"&&I?(0,o.jsxs)(n.Box,{sx:{display:"flex",alignItems:"center",gap:h?0:.5},children:[(0,o.jsx)(n.Tooltip,{title:"\uC774\uC804 \uD398\uC774\uC9C0",children:(0,o.jsx)("span",{style:{display:"inline-flex"},children:(0,o.jsx)(n.IconButton,{onClick:pe,disabled:k<=1,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(go.default,{})})})}),(0,o.jsx)(n.Typography,{variant:"body2",sx:{minWidth:h?"auto":"80px",textAlign:"center",color:"white",px:h?.5:1,fontSize:h?"1.05rem":void 0,fontWeight:h?600:void 0,whiteSpace:"nowrap"},children:q?k:`${k} / ${I}`}),(0,o.jsx)(n.Tooltip,{title:"\uB2E4\uC74C \uD398\uC774\uC9C0",children:(0,o.jsx)("span",{style:{display:"inline-flex"},children:(0,o.jsx)(n.IconButton,{onClick:fe,disabled:k>=I,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(xo.default,{})})})})]}):null]}),(0,o.jsx)(n.Box,{sx:{display:"flex",alignItems:"center",flexGrow:1,mr:q?0:2,overflow:"hidden"},children:!q&&(0,o.jsxs)(n.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:1.5,fontSize:"1rem"},children:[Fr(x),c.name]})}),(0,o.jsxs)(n.Box,{className:"toolbar",sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:q?.35:1,"& .MuiSvgIcon-root":{fontSize:h?"1.7rem":void 0}},children:[(x==="image"||x==="pdf"||x==="text"||x==="html"||x==="code"||x==="spreadsheet")&&(0,o.jsxs)(o.Fragment,{children:[!(h&&(x==="image"||x==="pdf"))&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Tooltip,{title:"\uD655\uB300",children:(0,o.jsx)(n.IconButton,{onClick:Uo,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(fo.default,{})})}),(0,o.jsx)(n.Tooltip,{title:"\uCD95\uC18C",children:(0,o.jsx)(n.IconButton,{onClick:No,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(ho.default,{})})})]}),!h&&(0,o.jsx)(n.Tooltip,{title:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30",children:(0,o.jsx)(n.IconButton,{onClick:Ut,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(ot.default,{})})}),!h&&(x==="image"||x==="pdf")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Tooltip,{title:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804",children:(0,o.jsx)(n.IconButton,{onClick:Yt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(et.default,{})})}),(0,o.jsx)(n.Tooltip,{title:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804",children:(0,o.jsx)(n.IconButton,{onClick:Ot,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(tt.default,{})})})]})]}),!h&&(0,o.jsx)(n.Tooltip,{title:"\uB2E4\uC6B4\uB85C\uB4DC",children:(0,o.jsx)(n.IconButton,{onClick:Rt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(Je.default,{})})}),h&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Tooltip,{title:"\uB354\uBCF4\uAE30",children:(0,o.jsx)(n.IconButton,{onClick:e=>U(e.currentTarget),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:(0,o.jsx)(po.default,{})})}),(0,o.jsxs)(n.Menu,{anchorEl:vt,open:!!vt,onClose:()=>U(null),children:[x==="image"||x==="pdf"?(0,o.jsxs)(n.MenuItem,{onClick:()=>{Ut(),U(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(ot.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30"})]}):null,x==="image"||x==="pdf"?(0,o.jsxs)(n.MenuItem,{onClick:()=>{Yt(),U(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(et.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,x==="image"||x==="pdf"?(0,o.jsxs)(n.MenuItem,{onClick:()=>{Ot(),U(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(tt.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,(0,o.jsxs)(n.MenuItem,{onClick:()=>{Rt(),U(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(Je.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uB2E4\uC6B4\uB85C\uB4DC"})]})]})]}),(0,o.jsx)(n.Tooltip,{title:"\uB2EB\uAE30",children:(0,o.jsx)(n.IconButton,{onClick:Gt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(uo.default,{})})})]})]}),(0,o.jsx)(n.DialogContent,{sx:{p:"0 !important",overflow:"hidden",userSelect:"none"},onContextMenu:e=>e.preventDefault(),children:fr()}),(0,o.jsx)(n.Snackbar,{open:!!yt,autoHideDuration:2e3,onClose:()=>le(""),anchorOrigin:{vertical:"bottom",horizontal:"center"},message:yt,sx:{"& .MuiSnackbarContent-message":{fontSize:"0.95rem"}}})]})},Io=at;var st=require("react/jsx-runtime");function oe(s){return(0,st.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:s.width||"22px",fill:s.fill||"#E91E63",...s,children:(0,st.jsx)("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}var ko=p(require("@mui/icons-material/TextSnippet"),1),Lo=p(require("@mui/icons-material/VideoFile"),1),Fo=p(require("@mui/icons-material/AudioFile"),1),Ro=p(require("@mui/icons-material/Description"),1),Po=p(require("@mui/icons-material/InsertDriveFile"),1),Eo=p(require("@mui/icons-material/Code"),1),Do=p(require("@mui/icons-material/TableView"),1);var R=require("react/jsx-runtime");function ke(s,u=22){let c=`${u}px`,m={fontSize:u};switch(s){case"image":return(0,R.jsx)(Y,{width:c,height:c});case"pdf":return(0,R.jsx)(O,{width:c,height:c});case"html":return(0,R.jsx)(oe,{width:c,height:c});case"text":return(0,R.jsx)(ko.default,{sx:{...m,color:"#66BB6A"}});case"spreadsheet":return(0,R.jsx)(Do.default,{sx:{...m,color:"#4CAF50"}});case"code":return(0,R.jsx)(Eo.default,{sx:{...m,color:"#2196F3"}});case"video":return(0,R.jsx)(Lo.default,{sx:{...m,color:"#AB47BC"}});case"audio":return(0,R.jsx)(Fo.default,{sx:{...m,color:"#FF7043"}});case"office":return(0,R.jsx)(Ro.default,{sx:{...m,color:"#FFA726"}});default:return(0,R.jsx)(Po.default,{sx:{...m,color:"#78909C"}})}}function ct({fileName:s,mime:u,size:c=22}){return ke(w(s,u??""),c)}
58
+ `,s.appendChild(c)}}})})]}):(0,o.jsx)(n.Box,{sx:{backgroundColor:"white",p:2,borderRadius:1,border:"1px solid",borderColor:"grey.300",minHeight:"400px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(n.Typography,{color:"text.secondary",children:"HTML \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})})});case"video":return(0,o.jsx)(n.Box,{className:"draggable-scroll",onMouseDown:r=>{let l=r.currentTarget;to(r,l)},sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,overflow:"auto"},children:(0,o.jsx)("video",{src:w,controls:!0,style:{maxWidth:"100%",maxHeight:"70vh",transform:`scale(${k}) rotate(${A}deg)`,transition:"transform 0.3s ease",pointerEvents:k>1?"none":"auto"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uBE44\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})});case"spreadsheet":return(0,o.jsxs)(n.Box,{sx:{width:"100%",height:"calc(100vh - 60px)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[We.length>0||kt?(0,o.jsxs)(n.Box,{sx:{flex:1,position:"relative",overflow:"scroll",backgroundColor:"white",minHeight:"400px",minWidth:"100%","&::-webkit-scrollbar":{width:"18px",height:"18px"},"&::-webkit-scrollbar-track":{backgroundColor:"#f1f1f1",borderRadius:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"10px",border:"2px solid #f1f1f1","&:hover":{backgroundColor:"#555"}},"&::-webkit-scrollbar-corner":{backgroundColor:"#f1f1f1"}},children:[We.length>0&&(0,o.jsx)(n.Box,{sx:{minWidth:"max-content",minHeight:"max-content"},children:(0,o.jsx)(Po.default,{data:We,darkMode:!1})}),kt&&(0,o.jsx)(n.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(255, 255, 255, 0.8)",zIndex:1e3},children:(0,o.jsx)(ht.LoadingProgress,{visible:jo,exitDelay:200,fadeoutDuration:300,onComplete:ur})})]}):(0,o.jsx)(n.Box,{sx:{flex:1,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,o.jsx)(n.Typography,{color:"text.secondary",children:"\uC2A4\uD504\uB808\uB4DC\uC2DC\uD2B8 \uB370\uC774\uD130\uB97C \uBD88\uB7EC\uC62C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4."})}),Ct.length>1&&(0,o.jsx)(n.Box,{sx:{borderTop:1,borderColor:"divider",backgroundColor:"#e0e0e0",padding:"0 8px 8px 8px"},children:(0,o.jsx)(n.Tabs,{value:_o,onChange:(r,l)=>mr(l),variant:"scrollable",scrollButtons:"auto",sx:{minHeight:"36px","& .MuiTabs-flexContainer":{gap:"6px"},"& .MuiTabs-indicator":{display:"none"},"& .MuiTab-root":{minHeight:"32px",fontSize:"0.875rem",textTransform:"none",padding:"6px 16px",margin:"0",backgroundColor:"white",border:"1px solid #d0d0d0",borderRadius:"0 0 4px 4px",color:"#666",minWidth:"80px",transition:"all 0.2s ease","&:hover":{backgroundColor:"#f8f8f8",color:"#333"},"&.Mui-selected":{backgroundColor:"primary.main",color:"white",border:"1px solid",borderColor:"primary.dark",fontWeight:600,"&:hover":{backgroundColor:"primary.dark"}}}},children:Ct.map(r=>(0,o.jsx)(n.Tab,{label:r,value:r},r))})})]});case"audio":return(0,o.jsxs)(n.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column"},children:[(0,o.jsx)(n.Typography,{variant:"h6",sx:{mb:2},children:p.name}),(0,o.jsx)("audio",{src:w,controls:!0,style:{width:"100%",maxWidth:"500px"},children:"\uBE0C\uB77C\uC6B0\uC800\uAC00 \uC624\uB514\uC624\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4."})]});default:return(0,o.jsxs)(n.Box,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:400,flexDirection:"column",children:[(0,o.jsx)(n.Typography,{variant:"h6",color:"text.secondary",children:"\uBBF8\uB9AC\uBCF4\uAE30\uB97C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uD30C\uC77C \uD615\uC2DD\uC785\uB2C8\uB2E4"}),(0,o.jsx)(n.Typography,{variant:"body2",color:"text.secondary",sx:{mt:1},children:"\uD30C\uC77C\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uC5EC \uD655\uC778\uD574\uC8FC\uC138\uC694."})]})}};return(0,o.jsxs)(n.Dialog,{open:a,onClose:ro,maxWidth:"lg",fullScreen:!0,children:[(0,o.jsxs)(n.DialogTitle,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"grey.800",color:"white",height:"60px",boxSizing:"border-box",userSelect:"none",px:g?1:3},onContextMenu:e=>e.preventDefault(),children:[(0,o.jsxs)(n.Box,{sx:{display:"flex",alignItems:"center",gap:J?.35:1,flexShrink:0,"& .MuiSvgIcon-root":{fontSize:g?"1.7rem":void 0}},children:[R.length>1?(0,o.jsxs)(n.Box,{sx:{display:"flex",alignItems:"center",gap:g?0:.5},children:[(0,o.jsx)(n.Tooltip,{title:"\uC774\uC804 \uD30C\uC77C",children:(0,o.jsx)("span",{style:{display:"inline-flex"},children:(0,o.jsx)(n.IconButton,{onClick:()=>ee(e=>Math.max(e-1,0)),disabled:de<=0,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"}},children:(0,o.jsx)(dt.default,{})})})}),(0,o.jsxs)(n.Typography,{variant:"body2",sx:{color:"grey.300",minWidth:40,textAlign:"center",userSelect:"none"},children:[de+1," / ",R.length]}),(0,o.jsx)(n.Tooltip,{title:"\uB2E4\uC74C \uD30C\uC77C",children:(0,o.jsx)("span",{style:{display:"inline-flex"},children:(0,o.jsx)(n.IconButton,{onClick:()=>ee(e=>Math.min(e+1,R.length-1)),disabled:de>=R.length-1,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"}},children:(0,o.jsx)(ut.default,{})})})})]}):null,g&&y==="pdf"&&L?(0,o.jsx)(n.Tooltip,{title:"\uD398\uC774\uC9C0 \uBAA9\uB85D",children:(0,o.jsx)(n.IconButton,{onClick:()=>Ye(e=>!e),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:(0,o.jsx)(wo.default,{})})}):null,y==="pdf"&&L?(0,o.jsxs)(n.Box,{sx:{display:"flex",alignItems:"center",gap:g?0:.5},children:[(0,o.jsx)(n.Tooltip,{title:"\uC774\uC804 \uD398\uC774\uC9C0",children:(0,o.jsx)("span",{style:{display:"inline-flex"},children:(0,o.jsx)(n.IconButton,{onClick:we,disabled:F<=1,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(dt.default,{})})})}),(0,o.jsx)(n.Typography,{variant:"body2",sx:{minWidth:g?"auto":"80px",textAlign:"center",color:"white",px:g?.5:1,fontSize:g?"1.05rem":void 0,fontWeight:g?600:void 0,whiteSpace:"nowrap"},children:J?F:`${F} / ${L}`}),(0,o.jsx)(n.Tooltip,{title:"\uB2E4\uC74C \uD398\uC774\uC9C0",children:(0,o.jsx)("span",{style:{display:"inline-flex"},children:(0,o.jsx)(n.IconButton,{onClick:Me,disabled:F>=L,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},"&.Mui-disabled":{color:"rgba(255, 255, 255, 0.3)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(ut.default,{})})})})]}):null]}),(0,o.jsx)(n.Box,{sx:{display:"flex",alignItems:"center",flexGrow:1,mr:J?0:2,overflow:"hidden"},children:!J&&(0,o.jsxs)(n.Box,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",gap:1.5,fontSize:"1rem"},children:[zr(y),p.name]})}),(0,o.jsxs)(n.Box,{className:"toolbar",sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:J?.35:1,"& .MuiSvgIcon-root":{fontSize:g?"1.7rem":void 0}},children:[(y==="image"||y==="pdf"||y==="text"||y==="html"||y==="code"||y==="spreadsheet")&&(0,o.jsxs)(o.Fragment,{children:[!(g&&(y==="image"||y==="pdf"))&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Tooltip,{title:"\uD655\uB300",children:(0,o.jsx)(n.IconButton,{onClick:Jo,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(Co.default,{})})}),(0,o.jsx)(n.Tooltip,{title:"\uCD95\uC18C",children:(0,o.jsx)(n.IconButton,{onClick:er,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(To.default,{})})})]}),!g&&(0,o.jsx)(n.Tooltip,{title:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30",children:(0,o.jsx)(n.IconButton,{onClick:eo,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(ct.default,{})})}),!g&&(y==="image"||y==="pdf")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Tooltip,{title:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804",children:(0,o.jsx)(n.IconButton,{onClick:Qt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(lt.default,{})})}),(0,o.jsx)(n.Tooltip,{title:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804",children:(0,o.jsx)(n.IconButton,{onClick:Jt,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(st.default,{})})})]})]}),!g&&(0,o.jsx)(n.Tooltip,{title:"\uB2E4\uC6B4\uB85C\uB4DC",children:(0,o.jsx)(n.IconButton,{onClick:At,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(at.default,{})})}),g&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Tooltip,{title:"\uB354\uBCF4\uAE30",children:(0,o.jsx)(n.IconButton,{onClick:e=>K(e.currentTarget),size:"medium",sx:{color:"grey.300","&:hover":{color:"white"}},children:(0,o.jsx)(Mo.default,{})})}),(0,o.jsxs)(n.Menu,{anchorEl:Rt,open:!!Rt,onClose:()=>K(null),children:[y==="image"||y==="pdf"?(0,o.jsxs)(n.MenuItem,{onClick:()=>{eo(),K(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(ct.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uD654\uBA74\uC5D0 \uB9DE\uCD94\uAE30"})]}):null,y==="image"||y==="pdf"?(0,o.jsxs)(n.MenuItem,{onClick:()=>{Qt(),K(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(lt.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uC67C\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,y==="image"||y==="pdf"?(0,o.jsxs)(n.MenuItem,{onClick:()=>{Jt(),K(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(st.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uC624\uB978\uCABD\uC73C\uB85C \uD68C\uC804"})]}):null,(0,o.jsxs)(n.MenuItem,{onClick:()=>{At(),K(null)},children:[(0,o.jsx)(n.ListItemIcon,{children:(0,o.jsx)(at.default,{fontSize:"small"})}),(0,o.jsx)(n.ListItemText,{children:"\uB2E4\uC6B4\uB85C\uB4DC"})]})]})]}),(0,o.jsx)(n.Tooltip,{title:"\uB2EB\uAE30",children:(0,o.jsx)(n.IconButton,{onClick:ro,size:"medium",sx:{color:"grey.300","&:hover":{color:"white",backgroundColor:"rgba(255, 255, 255, 0.08)",transform:"scale(1.1)"},transition:"all 0.2s ease-in-out"},children:(0,o.jsx)(vo.default,{})})})]})]}),(0,o.jsx)(n.DialogContent,{sx:{p:"0 !important",overflow:"hidden",userSelect:"none"},onContextMenu:e=>e.preventDefault(),children:Mr()}),(0,o.jsx)(n.Snackbar,{open:!!Lt,autoHideDuration:2e3,onClose:()=>xe(""),anchorOrigin:{vertical:"bottom",horizontal:"center"},message:Lt,sx:{"& .MuiSnackbarContent-message":{fontSize:"0.95rem"}}})]})},So=ft;var gt=require("react/jsx-runtime");function le(a){return(0,gt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:a.width||"22px",fill:a.fill||"#E91E63",...a,children:(0,gt.jsx)("path",{d:"M488.426,197.019H475.2v-63.816c0-0.401-0.063-0.799-0.116-1.205c-0.021-2.534-0.827-5.023-2.562-6.992L366.325,3.691 c-0.032-0.031-0.063-0.042-0.085-0.073c-0.633-0.707-1.371-1.298-2.151-1.804c-0.231-0.158-0.464-0.287-0.706-0.422 c-0.676-0.366-1.393-0.675-2.131-0.896c-0.2-0.053-0.38-0.135-0.58-0.19C359.87,0.119,359.037,0,358.193,0H97.2 c-11.918,0-21.6,9.693-21.6,21.601v175.413H62.377c-17.049,0-30.873,13.818-30.873,30.87v160.542 c0,17.044,13.824,30.876,30.873,30.876h13.224V529.2c0,11.907,9.682,21.601,21.6,21.601h356.4c11.907,0,21.6-9.693,21.6-21.601 V419.302h13.226c17.044,0,30.871-13.827,30.871-30.87V227.89C519.297,210.838,505.47,197.019,488.426,197.019z M97.2,21.605 h250.193v110.51c0,5.967,4.841,10.8,10.8,10.8h95.407v54.108H97.2V21.605z M406.467,363.983h-26.104l-1.751-46.464 c-0.527-14.598-1.055-32.236-1.055-49.895h-0.517c-3.691,15.485-8.596,32.782-13.163,47.015l-14.354,47.366h-20.851l-12.625-47.002 c-3.85-14.228-7.889-31.524-10.694-47.374h-0.348c-0.707,16.397-1.234,35.129-2.1,50.253l-2.114,46.111h-24.711l7.535-121.395 h35.575l11.569,40.521c3.691,14.048,7.362,29.183,9.999,43.416h0.521c3.344-14.054,7.356-30.074,11.222-43.585l12.614-40.353 h34.879L406.467,363.983z M174.438,265.642v-23.058h90.77v23.058h-32.239v98.342h-26.821v-98.342H174.438z M89.403,313.195v50.788 H62.604V242.584h26.799v46.654h43.999v-46.654h26.645v121.399h-26.645v-50.794H89.403V313.195z M453.601,523.353H97.2V419.302 h356.4V523.353z M500.787,363.983h-73.786V242.584h26.811v98.339h46.976V363.983z"})})}var E=require("react/jsx-runtime");function se(a){return(0,E.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 550.801 550.801",width:a.width||"22px",fill:a.fill||"#B45309",...a,children:[(0,E.jsx)("path",{d:"M475.095,131.992c-0.032-2.526-0.833-5.021-2.568-6.993L366.324,3.694c-0.021-0.034-0.053-0.045-0.084-0.076 c-0.633-0.707-1.36-1.29-2.141-1.804c-0.232-0.15-0.465-0.285-0.707-0.422c-0.686-0.366-1.393-0.67-2.131-0.892 c-0.2-0.058-0.379-0.14-0.58-0.192C359.87,0.114,359.047,0,358.203,0H97.2C85.292,0,75.6,9.693,75.6,21.601v507.6 c0,11.913,9.692,21.601,21.6,21.601H453.6c11.918,0,21.601-9.688,21.601-21.601V133.202 C475.2,132.796,475.137,132.398,475.095,131.992z M243.599,523.494H141.75v-15.936l62.398-89.797v-0.785h-56.565v-24.484h95.051 v17.106l-61.038,88.636v0.771h62.002V523.494z M292.021,523.494h-29.744V392.492h29.744V523.494z M399.705,463.44 c-10.104,9.524-25.069,13.796-42.566,13.796c-3.893,0-7.383-0.19-10.104-0.58v46.849h-29.352V394.242 c9.134-1.561,21.958-2.721,40.036-2.721c18.277,0,31.292,3.491,40.046,10.494c8.354,6.607,13.996,17.486,13.996,30.322 C411.761,445.163,407.479,456.053,399.705,463.44z M97.2,366.752V21.601h129.167v-3.396h32.756v3.396h88.28v110.515 c0,5.961,4.831,10.8,10.8,10.8H453.6l0.011,223.836H97.2z"}),(0,E.jsx)("path",{d:"M359.279,413.87c-6.033,0-10.114,0.586-12.245,1.171v38.676c2.521,0.585,5.632,0.785,9.914,0.785 c15.736,0,25.46-7.979,25.46-21.378C382.408,421.063,374.045,413.87,359.279,413.87z"}),(0,E.jsx)("rect",{x:"259.124",y:"39.918",width:"32.756",height:"13.516"}),(0,E.jsx)("rect",{x:"226.368",y:"21.601",width:"32.756",height:"10.125"}),(0,E.jsx)("rect",{x:"226.368",y:"60.146",width:"32.756",height:"13.516"}),(0,E.jsx)("rect",{x:"259.124",y:"82.274",width:"32.756",height:"13.518"}),(0,E.jsx)("rect",{x:"259.124",y:"124.983",width:"32.756",height:"13.516"}),(0,E.jsx)("rect",{x:"226.368",y:"103.275",width:"32.756",height:"13.516"}),(0,E.jsx)("path",{d:"M259.124,149.537c-23.193,0-34.225,18.792-34.225,41.99l-7.765,70.348c0,23.198,18.792,42.003,41.984,42.003 c23.19,0,41.974-18.805,41.974-42.003l-7.741-70.348C293.361,168.334,282.318,149.537,259.124,149.537z M273.04,285.431h-27.799 v-58.728h27.799V285.431z"})]})}var Do=h(require("@mui/icons-material/TextSnippet"),1),Bo=h(require("@mui/icons-material/VideoFile"),1),Ho=h(require("@mui/icons-material/AudioFile"),1),zo=h(require("@mui/icons-material/Description"),1),Vo=h(require("@mui/icons-material/InsertDriveFile"),1),Ao=h(require("@mui/icons-material/Code"),1),Wo=h(require("@mui/icons-material/TableView"),1);var P=require("react/jsx-runtime");function ce(a,d=22){let u=`${d}px`,m={fontSize:d};switch(a){case"image":return(0,P.jsx)(N,{width:u,height:u});case"pdf":return(0,P.jsx)($,{width:u,height:u});case"html":return(0,P.jsx)(le,{width:u,height:u});case"archive":return(0,P.jsx)(se,{width:u,height:u});case"text":return(0,P.jsx)(Do.default,{sx:{...m,color:"#66BB6A"}});case"spreadsheet":return(0,P.jsx)(Wo.default,{sx:{...m,color:"#4CAF50"}});case"code":return(0,P.jsx)(Ao.default,{sx:{...m,color:"#2196F3"}});case"video":return(0,P.jsx)(Bo.default,{sx:{...m,color:"#AB47BC"}});case"audio":return(0,P.jsx)(Ho.default,{sx:{...m,color:"#FF7043"}});case"office":return(0,P.jsx)(zo.default,{sx:{...m,color:"#FFA726"}});default:return(0,P.jsx)(Vo.default,{sx:{...m,color:"#78909C"}})}}var Vr=new Set(["zip","rar","7z","gz","tgz","tar","bz2","xz","alz","egg"]);function xt({fileName:a,mime:d,size:u=22}){let m=a.includes(".")?a.slice(a.lastIndexOf(".")+1).toLowerCase():"";return Vr.has(m)?ce("archive",u):ce(M(a,d??""),u)}
@@ -10,6 +10,8 @@ export interface FileViewerProps {
10
10
  open: boolean;
11
11
  onClose: () => void;
12
12
  file: ViewerFile | null;
13
+ files?: ViewerFile[] | null;
14
+ initialIndex?: number;
13
15
  loadFile?: (file: ViewerFile) => Promise<Blob>;
14
16
  onDownload?: (file: ViewerFile) => void | Promise<void>;
15
17
  pdfAssetBase?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ehfuse/file-viewer",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "React 파일 미리보기 다이얼로그 (이미지/PDF/텍스트/코드/HTML/스프레드시트/비디오/오디오, MUI 기반)",
6
6
  "publishConfig": {