PageSourceSearch

https://utilzip.com/_next/static/chunks/4866.1f01ece24690cdac.js

js utilzip.com collected 2026-10-02 01:49:57 UTC 29,431 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4866],{4866:(e,t,r)=>{r.r(t),r.d(t,{default:()=>g});var s=r(95155),n=r(94801),a=r(12115),l=r(47520),i=r(11544),o=r(87390),d=r(46339),c=r(31166),h=r(92531);let x=[{bg:"#dbeafe",text:"#1d4ed8",border:"#93c5fd",badge:"#bfdbfe"},{bg:"#fce7f3",text:"#be185d",border:"#f9a8d4",badge:"#fbcfe8"},{bg:"#dcfce7",text:"#15803d",border:"#86efac",badge:"#bbf7d0"},{bg:"#fef9c3",text:"#a16207",border:"#fde047",badge:"#fef08a"},{bg:"#ede9fe",text:"#6d28d9",border:"#c4b5fd",badge:"#ddd6fe"},{bg:"#ffedd5",text:"#c2410c",border:"#fdba74",badge:"#fed7aa"}];function g(){return(0,s.jsx)(u,{})}function u(){let[e,t]=(0,a.useState)([]),[g,u]=(0,a.useState)([]),[p,f]=(0,a.useState)("select"),[m,b]=(0,a.useState)("card"),[w,y]=(0,a.useState)(""),[v,j]=(0,a.useState)(1),[k,N]=(0,a.useState)(!1),[_,C]=(0,a.useState)(null),[M,$]=(0,a.useState)(!1),[B,I]=(0,a.useState)(!1),[P,D]=(0,a.useState)(null),[S,R]=(0,a.useState)(null),[W,E]=(0,a.useState)(null),L=(0,a.useRef)(null),F=(0,a.useRef)(null),z=(0,a.useRef)(null),U=(0,a.useRef)(null),O=(0,a.useRef)(null),[V,H]=(0,a.useState)({w:0,h:0}),[A,Z]=(0,a.useState)({w:0,h:0}),T=new Map(e.map(e=>[e.id,x[e.colorIdx%x.length]])),G=async(r,s)=>{if(r.type&&"application/pdf"!==r.type&&!/\.pdf$/i.test(r.name))return void alert("PDF 파일을 선택해주세요.");I(!0);try{let a=(0,l.t)();a||(await (0,l.I)(),a=(0,l.t)());let i=await r.arrayBuffer(),d=new Uint8Array(i),c=await a.getDocument({data:d.slice(0)}).promise,h=`${Date.now()}-${Math.random().toString(36).slice(2)}`,x=e.length,p={id:h,name:r.name,bytes:d,pdfDoc:c,colorIdx:x};t(e=>[...e,p]);let f=(await (0,o.I)(c)).map((e,t)=>({uid:`${h}-${t}-${Math.random().toString(36).slice(2)}`,sourceIndex:t,fileId:h,fileName:r.name,thumbnail:e,selected:!1,rotation:0}));(0,n.sx)("pdf_split_file_loaded",{page_count:c.numPages,inserted:void 0!==s}),u(e=>{if(null==s)return null===s?[...e,...f]:[...f];let t=e.findIndex(e=>e.uid===s);if(t<0)return[...e,...f];let r=[...e];return r.splice(t+1,0,...f),r}),0===g.length&&D(0)}catch(e){console.error(e),alert("PDF를 여는 중 오류가 발생했습니다. 손상되었거나 암호가 걸린 파일일 수 있습니다.")}finally{I(!1)}},K=async(t,r,s)=>{if(t.isBlank){r.width=Math.round(.77*s),r.height=s;let e=r.getContext("2d");return e.fillStyle="#ffffff",e.fillRect(0,0,r.width,r.height),{w:r.width,h:r.height}}let n=e.find(e=>e.id===t.fileId);if(!n)return{w:0,h:0};let a=await n.pdfDoc.getPage(t.sourceIndex+1),l=(((a.rotate??0)+t.rotation)%360+360)%360,i=a.getViewport({scale:1,rotation:l}),o=i.width>i.height?s/i.width:s/i.height,d=a.getViewport({scale:o,rotation:l});return r.width=d.width,r.height=d.height,await a.render({canvasContext:r.getContext("2d"),viewport:d}).promise,{w:d.width,h:d.height}};(0,a.useEffect)(()=>{if(null===P||"viewer"!==m||!g[P])return;let e=U.current;if(!e)return;let t=!1;return K(g[P],e,900).then(e=>{t||H(e)}),()=>{t=!0}},[P,m,g,e]);let q=S?g.find(e=>e.uid===S)??null:null;(0,a.useEffect)(()=>{if(!q)return;let e=O.current;if(!e)return;let t=!1;return K(q,e,1800).then(e=>{t||Z(e)}),()=>{t=!0}},[S,g,e]);let J=g.map(e=>e.uid),Q=S?J.indexOf(S):-1;(0,a.useEffect)(()=>{if(!S)return;let e=e=>{"ArrowLeft"===e.key&&Q>0&&R(J[Q-1]),"ArrowRight"===e.key&&Q<J.length-1&&R(J[Q+1]),"Escape"===e.key&&R(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[S,Q]);let X=e=>u(t=>t.map(t=>t.uid===e?{...t,selected:!t.selected}:t)),Y=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"cw";(0,n.sx)("pdf_split_page_rotated",{direction:t}),u(r=>r.map(r=>r.uid===e?{...r,rotation:r.rotation+("cw"===t?90:-90)}:r))},ee=e=>{(0,n.sx)("pdf_split_page_duplicated"),u(t=>{let r=t.findIndex(t=>t.uid===e);if(r<0)return t;let s={...t[r],uid:`${t[r].uid}-copy-${Math.random().toString(36).slice(2)}`,selected:!1},n=[...t];return n.splice(r+1,0,s),n})},et=e=>{(0,n.sx)("pdf_split_page_removed"),u(t=>t.filter(t=>t.uid!==e)),S===e&&R(null)},er=(e,t)=>{let r=new Set;return e.split(",").forEach(e=>{let s=e.trim(),n=s.match(/^(\d+)\s*-\s*(\d+)$/);if(n)for(let e=Math.max(0,parseInt(n[1])-1);e<=Math.min(t-1,parseInt(n[2])-1);e++)r.add(e);else{let e=parseInt(s)-1;!isNaN(e)&&e>=0&&e<t&&r.add(e)}}),r},es=async()=>
1{if(0!==g.length){(0,n.sx)("pdf_split_execute_clicked",{mode:p,selected_count:eo}),N(!0),C(null);try{let e=[];if("every"===p)for(let t=0;t<g.length;t+=v){let r=`split_part${Math.floor(t/v)+1}.pdf`,s=await ea(g.slice(t,t+v));e.push({name:r,blob:s})}else{let t;if("range"===p){let e=er(w,g.length);t=g.filter((t,r)=>e.has(r))}else t=g.filter(e=>e.selected);if(0===t.length)return void alert("페이지를 선택해주세요.");let r=await ea(t);e.push({name:"split.pdf",blob:r})}C(e),(0,n.sx)("pdf_split_complete",{mode:p,result_count:e.length})}catch(e){console.error(e),alert("PDF 분할 중 오류가 발생했습니다.")}finally{N(!1)}}},en=async()=>{if(_&&!(_.length<2)&&!M){$(!0);try{let{default:e}=await Promise.all([r.e(5376),r.e(7496)]).then(r.t.bind(r,7496,23)),t=new e;_.forEach(e=>t.file(e.name,e.blob));let s=await t.generateAsync({type:"blob"}),a=URL.createObjectURL(s);Object.assign(document.createElement("a"),{href:a,download:"split_files.zip"}).click(),URL.revokeObjectURL(a),(0,n.sx)("pdf_split_zip_download",{total_files:_.length})}catch(e){console.error(e),alert("ZIP으로 묶는 중 오류가 발생했습니다.")}finally{$(!1)}}},ea=async t=>{let r=await i.PDFDocument.create(),s=new Map;for(let n of t){if(n.isBlank){r.addPage([595,842]);continue}let t=e.find(e=>e.id===n.fileId);if(!t)continue;s.has(n.fileId)||s.set(n.fileId,await i.PDFDocument.load(t.bytes));let[a]=await r.copyPages(s.get(n.fileId),[n.sourceIndex]),l=(n.rotation%360+360)%360;if(l){let e=(((a.getRotation().angle??0)+l)%360+360)%360;a.setRotation({type:"degrees",angle:e})}r.addPage(a)}return new Blob([(await r.save()).buffer],{type:"application/pdf"})},el=()=>{(0,n.sx)("pdf_split_reset"),t([]),u([]),D(null),R(null),C(null)},ei="range"===p&&w.trim()?er(w,g.length):null,eo="select"===p?g.filter(e=>e.selected).length:"range"===p?ei?.size??0:Math.ceil(g.length/v),ed=(e,t)=>"select"===p?e.selected:"range"!==p||!!ei&&ei.has(t),ec=e=>"range"===p&&!!ei&&!ei.has(e),eh=e.length>0,ex=(0,a.useRef)(null),[eg,eu]=(0,a.useState)(null),ep=e=>{ex.current=e},ef=e=>eu(e),em=()=>{let e=ex.current;e&&eg&&e!==eg&&(u(t=>{let r=t.findIndex(t=>t.uid===e),s=t.findIndex(e=>e.uid===eg);if(r<0||s<0)return t;let n=[...t],[a]=n.splice(r,1);return n.splice(s,0,a),n}),(0,n.sx)("pdf_split_page_reordered")),ex.current=null,eu(null)};if(!eh)return(0,s.jsx)(h.A,{onFiles:e=>{e[0]&&((0,n.sx)("pdf_split_dropped_area"),G(e[0]))},accept:"application/pdf",icon:(0,s.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 24 24",fill:"none",stroke:"#4F46E5",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,s.jsx)("polyline",{points:"14 2 14 8 20 8"})]}),label:"PDF 파일 선택",hint:"분할할 PDF 파일을 선택하세요"});let eb=e=>{let{afterUid:t}=e;return(0,s.jsx)("div",{className:"flex items-center justify-center",style:{width:32},children:(0,s.jsx)("div",{className:"group/ins relative flex items-center justify-center",children:(0,s.jsx)("button",{onClick:e=>{e.stopPropagation();let r=e.currentTarget.getBoundingClientRect();E({afterUid:t,x:r.left,y:r.bottom+8})},className:"w-8 h-8 rounded-full bg-white border-2 border-accent/40 text-accent hover:bg-accent hover:text-white hover:border-accent transition-all shadow-sm flex items-center justify-center text-lg font-light leading-none",title:"페이지 삽입",children:"+"})})})};return(0,s.jsxs)("div",{className:"space-y-4",onClick:()=>E(null),children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap bg-white border border-gray-200 rounded-xl px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex bg-gray-100 rounded-lg p-1 gap-1 shrink-0",children:[(0,s.jsx)("button",{onClick:()=>{b("card"),(0,n.sx)("pdf_split_view_changed",{view:"card"})},className:`px-3 py-1.5 text-sm rounded-md font-medium transition-colors ${"card"===m?"bg-white shadow text-gray-900":"text-gray-500 hover:text-gray-700"}`,children:"파일 보기"}),(0,s.jsxs)("button",{onClick:()=>{b("viewer"),(0,n.sx)("pdf_split_view_changed",{view:"viewer"})},className:`px-3 py-1.5 text-sm rounded-md font-medium transition-colors ${"viewer"===m?"bg-white shadow text-gray-900":"text-gray-500 hover:text-gray-700"}`,children:[(0,s.jsx)(d.Z_,{size:14,className:"inline mr-1"}),"페이지 보기"]})]}),(0,s.jsx)("div",{className:"flex gap-2 flex-wrap",children:[{key:"select",label:"페이지 선택"},{key:"range",label:"범위 입력"},{key:"every",label:"N페이지씩"}].map(e=>{let{key:t,label:r}=e;return(0,s.jsx)("button",{onClick:()=>{f(t),(0,n.sx)("pdf_split_mode_changed",{mode:t})},className:`px-3 py-1.5 text-xs rounded-lg border transition-colors ${p===t?"bg-accent text-white border-accent":"border-gray-300 text-gray-600 hover:border-gray-400"}`,children:r},t)})}),"range"===p&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-xs text-gray-500 whitespace-nowrap",children:"페이지 범위:"}),(0,s.jsx)("input",{type:"text",value:w,onChange:e=>y(e.target.value),onBlur:()=>{w.trim()&&(0,n.sx)("pdf_split_range_used",{range_segment_count:w.split(",").filter(e=>e.trim().length>0).length})},placeholder:"예: 1-3, 5, 7-9",className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm w-44 focus:outline-none focus:border-accent"}),ei&&(0,s.jsxs)("span",{className:"text-xs text-accent whitespace-nowrap",children:[ei.size,"p 선택"]})]}
1),"every"===p&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-xs text-gray-500 whitespace-nowrap",children:"페이지마다 분할:"}),(0,s.jsx)("input",{type:"number",min:1,max:g.length,value:v,onChange:e=>j(Math.max(1,parseInt(e.target.value)||1)),onBlur:()=>(0,n.sx)("pdf_split_every_n_set",{n:v}),className:"w-20 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:border-accent"}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:[v,"p씩 → ",Math.ceil(g.length/v),"개 파일"]})]}),"select"===p&&(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:()=>{u(e=>e.map(e=>({...e,selected:!0}))),(0,n.sx)("pdf_split_select_all")},className:"text-xs text-accent hover:underline",children:"전체 선택"}),(0,s.jsx)("button",{onClick:()=>{u(e=>e.map(e=>({...e,selected:!1}))),(0,n.sx)("pdf_split_deselect_all")},className:"text-xs text-gray-400 hover:underline",children:"전체 해제"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 ml-auto",children:[(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"every"===p?`${eo}개 파일`:`${eo}페이지 선택됨`}),(0,s.jsx)("button",{onClick:es,disabled:k,className:`min-h-[44px] px-6 rounded-lg border text-sm font-medium transition-colors whitespace-nowrap disabled:opacity-50 ${_?"border-warm-200 bg-white text-warm-700 hover:border-accent hover:text-accent-deep":"border-accent bg-accent text-white hover:bg-accent-hover"}`,children:k?"처리 중...":"PDF 분할"}),_&&_.length>1&&(0,s.jsxs)("button",{onClick:en,disabled:M,className:c.t0,children:[(0,s.jsx)(d.s3,{size:16,className:"shrink-0"}),M?"ZIP 생성 중...":`ZIP 전체 다운로드 (${_.length}개)`]}),_&&_.length<=5&&_.map(e=>(0,s.jsxs)("button",{onClick:()=>{(0,n.sx)("pdf_split_download_clicked",{total_files:_.length});let t=URL.createObjectURL(e.blob);Object.assign(document.createElement("a"),{href:t,download:e.name}).click(),URL.revokeObjectURL(t)},className:1===_.length?c.t0:c.tV,children:[(0,s.jsx)(d.s3,{size:1===_.length?16:13,className:"shrink-0"}),e.name]},e.name))]})]}),"card"===m&&(0,s.jsxs)("div",{className:"rounded-2xl border border-gray-200 bg-gray-50 p-8",children:[(0,s.jsx)("div",{className:"flex flex-wrap gap-6 items-start",children:g.map((e,t)=>{let r=ed(e,t),a=ec(t),l=e.isBlank?x[0]:T.get(e.fileId)??x[0],i=e.fileName.replace(/\.pdf$/i,""),o=eg===e.uid,d=90===Math.abs(e.rotation%180);return(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("div",{draggable:!0,onDragStart:()=>ep(e.uid),onDragEnter:()=>ef(e.uid),onDragEnd:em,onDragOver:e=>e.preventDefault(),className:`group relative rounded-2xl p-2 transition-all select-none cursor-grab active:cursor-grabbing ${r&&!a?"ring-2 ring-blue-400":""} ${a?"opacity-40":""} ${o?"scale-105 opacity-70 shadow-xl":""}`,style:{background:r&&!a?l.bg:"transparent"},onMouseEnter:e=>{r&&!a||(e.currentTarget.style.background="#f9fafb")},onMouseLeave:e=>{r&&!a||(e.currentTarget.style.background="transparent")},onClick:()=>{"select"===p&&X(e.uid)},children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5 px-0.5 h-7 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",children:[(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),X(e.uid)},className:`w-6 h-6 rounded border-2 flex items-center justify-center transition-colors ${r&&!a?"bg-accent border-accent":"bg-white border-gray-300 hover:border-accent"}`,children:r&&!a&&(0,s.jsx)("span",{className:"text-white text-[10px]",children:"✓"})}),(0,s.jsxs)("div",{className:"flex gap-1",children:[(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),(0,n.sx)("pdf_split_modal_opened"),R(e.uid)},className:"w-6 h-6 bg-white rounded-md shadow-sm border border-gray-200 flex items-center justify-center text-gray-500 hover:text-accent hover:bg-warm-50 transition-colors",title:"크게 보기",children:(0,s.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,s.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}),(0,s.jsx)("line",{x1:"11",y1:"8",x2:"11",y2:"14"}),(0,s.jsx)("line",{x1:"8",y1:"11",x2:"14",y2:"11"})]})}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),Y(e.uid,"ccw")},className:"w-6 h-6 bg-white rounded-md shadow-sm border border-gray-200 flex items-center justify-center text-gray-500 hover:text-yellow-600 hover:bg-yellow-50 transition-colors",title:"반시계 회전",children:(0,s.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M2.5 2v6h6"}),(0,s.jsx)("path",{d:"M2.66 15.57a10 10 0 1 0 .57-8.38"})]})}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),Y(e.uid,"cw")},className:"w-6 h-6 bg-white rounded-md shadow-sm border border-gray-200 flex items-center justify-center text-gray-500 hover:text-yellow-600 hover:bg-yellow-50 transition-colors",title:"시계 회전",children:(0,s.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M21.5 2v6h-6"}),(0,s.jsx)("path",{d:"M21.34 15.57a10 10 0 1 1-.57-8.38"})]})}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),ee(e.uid)},className:"w-6 h-6 bg-white rounded-md shadow-sm border border-gray-200 flex items-center justify-center text-gray-500 hover:text-green-600 hover:bg-green-50 transition-colors",title:"복제",children:(0,s.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,s.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),(0,s.jsx)("button",{onClick:t=>{t.stopPropagation(),et(e.uid)},className:"w-6 h-6 bg-white rounded-md shadow-sm border border-gray-200 flex items-center justify-center text-gray-400 hover:text-red-500 hover:bg-red-50 transition-colors",title:"페이지 제거",children:(0,s.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,s.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,s.jsx)("path",{d:"M10 11v6"}),(0,s.jsx)("path",{d:"M14 11v6"}),(0,s.jsx)("path",{d:"M9 6V4h6v2"})]})})]})]}),(0,s.jsxs)("div",{className:`rounded-xl overflow-hidden border-2 shadow-sm transition-all flex items-center justify-center bg-white ${r&&!a?"border-accent":"border-gray-200 group-hover:border-gray-300"}`,style:{width:195,height:d?Math.round(146.25):Math.round(260)},children:[e.isBlank?(0,s.jsx)("div",{className:"w-full h-full flex items-center justify-center text-gray-300",children:(0,s.jsx)("svg",{width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"})})}):(0,s.jsx)("img",{src:e.thumbnail,alt:`p${e.sourceIndex+1}`,className:"pointer-events-none",style:{width:d?Math.round(260):195,height:d?195:Math.round(260),objectFit:"cover",transform:`rotate(${e.rotation}deg)`,transition:"transform 0.2s",flexShrink:0},draggable:!1}),a&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-white/30",children:(0,s.jsx)("span",{className:"text-xs bg-gray-800/70 text-white px-2 py-0.5 rounded",children:"제외"})})]}),(0,s.jsxs)("div",{className:"mt-2 text-center",style:{width:195},children:[(0,s.jsx)("div",{className:"inline-block w-full px-2 py-0.5 rounded-full text-xs font-medium truncate",style:{background:l.badge,color:l.text},children:i}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:e.isBlank?"빈 페이지":e.sourceIndex+1})]})]}),(0,s.jsx)(eb,{afterUid:e.uid})]},e.uid)})}),(0,s.jsxs)("div",{className:"mt-6 pt-4 border-t border-gray-200 flex items-center justify-between",children:[(0,s.jsx)("button",{onClick:()=>{F.current=null,z.current?.click()},className:"text-xs text-accent hover:underline",children:"+ PDF 파일 추가"}),(0,s.jsx)("button",{onClick:el,className:"text-xs text-gray-400 hover:text-red-500 transition-colors",children:"초기화"})]}),(0,s.jsx)("input",{ref:z,type:"file",accept:"application/pdf",className:"hidden",onChange:e=>{let t=e.target.files?.[0];t&&G(t,null),e.target.value=""}})]}),"viewer"===m&&(0,s.jsxs)("div",{className:"flex bg-white border border-gray-200 rounded-xl overflow-hidden",style:{height:"85vh"},children:[(0,s.jsx)("aside",{className:"w-28 bg-white border-r border-gray-200 overflow-y-auto shrink-0 py-3",children:g.map((e,t)=>{let r=ed(e,t),n=ec(t),a=P===t,l=e.isBlank?x[0]:T.get(e.fileId)??x[0],i=eg===e.uid;return(0,s.jsxs)("div",{draggable:!0,onDragStart:()=>ep(e.uid),onDragEnter:()=>ef(e.uid),onDragEnd:em,onDragOver:e=>e.preventDefault(),onClick:()=>{D(t),"select"===p&&X(e.uid)},className:`group relative mx-2 mb-1.5 rounded-lg overflow-hidden border-2 cursor-grab active:cursor-grabbing transition-all select-none ${a?"border-accent shadow-md":r&&!n?"border-accent/40":"border-gray-200 hover:border-gray-400"} ${n?"opacity-35":""} ${i?"scale-105 opacity-70":""}`,children:[(0,s.jsx)("div",{className:"absolute top-0 left-0 right-0 h-1",style:{background:l.border}}),e.isBlank?(0,s.jsx)("div",{className:"w-full bg-white flex items-center justify-center text-gray-200",style:{aspectRatio:"3/4"},children:(0,s.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:(0,s.jsx)("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"})})}):(0,s.jsx)("img",{src:e.thumbnail,alt:"",className:"w-full block pointer-events-none",style:{transform:`rotate(${e.rotation}deg)`},draggable:!1}),(0,s.jsx)("div",{className:`absolute bottom-0 left-0 right-0 text-xs text-center py-0.5 ${a?"bg-accent text-white":"bg-black/50 text-white"}`,children:t+1}),r&&!n&&"select"===p&&(0,s.jsx)("div",{className:"absolute top-2 right-1 w-4 h-4 bg-accent rounded-full flex items-center justify-center",children:(0,s.jsx)("span",{className:"text-white text-[9px]",children:"✓"})}),n&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,s.jsx)("span",{className:"text-[10px] bg-gray-800/70 text-white px-1 rounded",children:"제외"})})]},e.uid)})}),(0,s.jsx)("main",{className:"flex-1 overflow-auto flex flex-col items-center py-6 bg-gray-100",children:null!==P&&g[P]?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sticky top-0 z-10 mb-4 flex items-center gap-3 bg-white border border-gray-200 rounded-lg shadow-sm px-4 py-2 text-xs text-gray-600",children:[(0,s.jsx)("span",{className:"font-medium truncate max-w-[200px]",children:g[P].fileName}),(0,s.jsx)("span",{className:"text-gray-400",children:"\xb7"}),(0,s.jsxs)("span",{children:[P+1," / ",g.length,"p"]}),(0,s.jsx)("button",{onClick:el,className:"ml-auto px-3 py-1 bg-gray-50 text-gray-500 border border-gray-200 rounded-lg text-xs hover:bg-red-50 hover:text-red-500 hover:border-red-200 transition-colors",children:"초기화"})]}),(0,s.jsx)("div",{className:"relative shadow-2xl bg-white",style:{width:V.w||"auto",height:V.h||"auto"},children:(0,s.jsx)("canvas",{ref:U,className:"block"})})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 gap-2",children:[(0,s.jsx)(d.Z_,{size:40,className:"text-gray-300"}),(0,s.jsx)("p",{className:"text-sm",children:"왼쪽에서 페이지를 클릭하면 미리보기가 표시됩니다"})]})})]}
1),W&&(0,s.jsx)("div",{className:"fixed z-40",style:{top:W.y,left:W.x},onClick:e=>e.stopPropagation(),children:(0,s.jsxs)("div",{className:"bg-white rounded-xl shadow-xl border border-gray-200 p-2 flex flex-col gap-1 min-w-[160px]",children:[(0,s.jsxs)("button",{onClick:()=>{var e=W.afterUid;(0,n.sx)("pdf_split_blank_page_inserted");let t={uid:`blank-${Date.now()}-${Math.random().toString(36).slice(2)}`,sourceIndex:-1,fileId:"blank",fileName:"빈 페이지",thumbnail:"",selected:!1,rotation:0,isBlank:!0};u(r=>{if(null===e)return[t,...r];let s=r.findIndex(t=>t.uid===e);if(s<0)return[...r,t];let n=[...r];return n.splice(s+1,0,t),n}),E(null)},className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:[(0,s.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,s.jsx)("rect",{x:"4",y:"2",width:"16",height:"20",rx:"2"})}),"빈 페이지 삽입"]}),(0,s.jsxs)("button",{onClick:()=>{(0,n.sx)("pdf_split_file_inserted"),F.current=W.afterUid,L.current?.click(),E(null)},className:"flex items-center gap-2 px-3 py-2 text-sm text-gray-700 hover:bg-gray-50 rounded-lg transition-colors",children:[(0,s.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),(0,s.jsx)("polyline",{points:"14 2 14 8 20 8"}),(0,s.jsx)("line",{x1:"12",y1:"18",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"9",y1:"15",x2:"15",y2:"15"})]}),"PDF 파일 삽입"]})]})}),(0,s.jsx)("input",{ref:L,type:"file",accept:"application/pdf",className:"hidden",onChange:e=>{let t=e.target.files?.[0];t&&G(t,F.current),e.target.value=""}}),S&&q&&(0,s.jsxs)("div",{className:"fixed inset-0 z-50 bg-black/70",onClick:()=>R(null),children:[(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",style:{paddingBottom:72},children:(0,s.jsx)("canvas",{ref:O,className:"block shadow-2xl bg-white rounded-sm",style:{maxWidth:"calc(100vw - 48px)",maxHeight:"calc(100vh - 120px)",width:"auto",height:"auto"},onClick:e=>e.stopPropagation()})}),(0,s.jsxs)("div",{className:"fixed bottom-6 left-1/2 -translate-x-1/2 flex items-center gap-1 bg-white/95 backdrop-blur-sm rounded-full shadow-2xl px-3 py-2 border border-gray-200",onClick:e=>e.stopPropagation(),children:[(0,s.jsx)("button",{onClick:()=>Q>0&&R(J[Q-1]),disabled:Q<=0,className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-gray-100 disabled:opacity-30 transition-colors text-gray-600",children:(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,s.jsx)("polyline",{points:"15 18 9 12 15 6"})})}),(0,s.jsxs)("span",{className:"text-sm text-gray-700 min-w-[64px] text-center font-medium",children:[Q+1," ",(0,s.jsxs)("span",{className:"text-gray-400 font-normal",children:["/ ",J.length]})]}),(0,s.jsx)("button",{onClick:()=>Q<J.length-1&&R(J[Q+1]),disabled:Q>=J.length-1,className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-gray-100 disabled:opacity-30 transition-colors text-gray-600",children:(0,s.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})}),(0,s.jsx)("div",{className:"w-px h-5 bg-gray-200 mx-1"}),(0,s.jsx)("button",{onClick:()=>Y(S,"ccw"),className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors text-gray-600",title:"반시계 회전",children:(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M2.5 2v6h6"}),(0,s.jsx)("path",{d:"M2.66 15.57a10 10 0 1 0 .57-8.38"})]})}),(0,s.jsx)("button",{onClick:()=>Y(S,"cw"),className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors text-gray-600",title:"시계 회전",children:(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("path",{d:"M21.5 2v6h-6"}),(0,s.jsx)("path",{d:"M21.34 15.57a10 10 0 1 1-.57-8.38"})]})}),(0,s.jsx)("button",{onClick:()=>ee(S),className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-gray-100 transition-colors text-gray-600",title:"복제",children:(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,s.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}),(0,s.jsx)("button",{onClick:()=>{et(S),R(null)},className:"w-9 h-9 flex items-center justify-center rounded-full hover:bg-red-50 hover:text-red-500 transition-colors text-gray-600",title:"페이지 제거",children:(0,s.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[(0,s.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,s.jsx)("path",{d:"M19 6l-1 14H6L5 6"}),(0,s.jsx)("path",{d:"M10 11v6"}),(0,s.jsx)("path",{d:"M14 11v6"}),(0,s.jsx)("path",{d:"M9 6V4h6v2"})]})})]})]})]})}},31166:(e,t,r)=>{r.d(t,{Ay:()=>x,S8:()=>c,oK:()=>h,t0:()=>o,tV:()=>d});var s=r(95155),n=r(12115);let a={primary:"bg-accent text-white shadow-cta hover:bg-accent-hover hover:shadow-cta-hover",secondary:"bg-white text-warm-600 border border-warm-200 shadow-card hover:border-accent hover:text-accent-deep hover:bg-accent-sub",ghost:"text-warm-600 hover:bg-warm-50",danger:"bg-red-500 text-white hover:bg-red-600"},l={sm:"h-8 px-3 text-sm",md:"h-10 px-4 text-sm",lg:"h-12 px-6 text-base"},i=(0,n.forwardRef)(function(e,t){let{variant:r="primary",size:n="md",loading:i=!1,disabled:o,className:d="",children:c,...h}=e;return(0,s.jsxs)("button",{ref:t,disabled:o||i,className:["rounded-md font-semibold transition-all duration-200 active:scale-95 disabled:opacity-50 disabled:pointer-events-none inline-flex items-center justify-center gap-2",a[r],l[n],d].join(" "),...h,children:[i&&(0,s.jsxs)("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",className:"animate-spin","aria-hidden":"true",children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeOpacity:"0.3"}),(0,s.jsx)("path",{d:"M12 2a10 10 0 0 1 10 10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round"})]}),c]})}),o="inline-flex items-center justify-center gap-2 min-h-[44px] px-5 rounded-xl bg-accent text-white text-sm font-bold whitespace-nowrap shadow-cta transition-all duration-200 hover:bg-accent-hover hover:shadow-cta-hover active:scale-95 disabled:opacity-50 disabled:shadow-none disabled:cursor-not-allowed disabled:hover:bg-accent",d="inline-flex items-center justify-center gap-1 min-h-[36px] px-2.5 rounded-lg bg-accent-sub text-accent-deep text-xs font-semibold whitespace-nowrap border border-accent/25 transition hover:bg-accent hover:text-white",c="inline-flex items-center justify-center gap-2 min-h-[44px] px-5 rounded-xl bg-accent-sub text-accent-deep text-sm font-semibold whitespace-nowrap border border-accent/25 transition hover:bg-accent-tint disabled:opacity-40 disabled:cursor-not-allowed",h="inline-flex shrink-0 items-center gap-1.5 rounded-full px-4 py-1.5 bg-accent text-white text-xs font-bold shadow-cta transition hover:bg-accent-hover hover:shadow-cta-hover disabled:opacity-50 disabled:shadow-none",x=i},47520:(e,t,r)=>{r.d(t,{I:()=>i,t:()=>l});let s="/pdfjs",n=null,a=null;function l(){return n}function i(){return a||(a=(async()=>{(n=await import(`${s}/pdf.min.mjs`)).GlobalWorkerOptions.workerSrc=`${s}/pdf.worker.min.mjs`})())}},87390:(e,t,r)=>{r.d(t,{I:()=>s});async function s(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.6,s=[];for(let n=0;n<e.numPages;n++){let a=await e.getPage(n+1),l=a.getViewport({scale:t}),i=document.createElement("canvas");i.width=l.width,i.height=l.height,await a.render({canvasContext:i.getContext("2d"),viewport:l}).promise,s.push(i.toDataURL("image/jpeg",r))}return s}}}]);

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