PageSourceSearch

https://www.hypeduck.ai/_next/static/chunks/65397.731544bab4eda3ff.js

js hypeduck.ai collected 2026-09-24 14:30:48 UTC 5,427 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[65397],{65397:(e,a,i)=>{i.r(a),i.d(a,{RawMakerArchiveDialog:()=>f});var s=i(18756),t=i(57802),r=i(26760),l=i(53897),n=i(95662),d=i(26565),c=i(7394),o=i(18889),m=i(47970),h=i(45094),x=i(95128);let u=new Intl.DateTimeFormat("ko-KR",{dateStyle:"medium",timeStyle:"short"});function f(e){let{onReuse:a,history:i=!1,disabled:f=!1}=e,[j,g]=(0,r.useState)(!1),[p,v]=(0,r.useState)([]),[w,y]=(0,r.useState)(null),[N,k]=(0,r.useState)(!1),[C,b]=(0,r.useState)(""),[S,E]=(0,r.useState)(null),z=(0,r.useCallback)(async e=>{k(!0),b("");try{let a=new URLSearchParams(i?"history=1":"");void 0!==e&&a.set("cursor",String(e));let s=await fetch("/api/threads/raw-maker/images?".concat(a)),t=await s.json().catch(()=>null);if(!s.ok||!Array.isArray(null==t?void 0:t.images))throw Error("load_failed");v(a=>e?[...a,...t.images]:t.images),y("number"==typeof t.nextCursor||"string"==typeof t.nextCursor?t.nextCursor:null)}catch(e){b("저장한 사진을 불러오지 못했어요.")}finally{k(!1)}},[i]);(0,r.useEffect)(()=>{j&&z()},[z,j]);let $=async e=>{var a;let i=null==(a=window.prompt("사진 이름",e.title||"날것 이미지"))?void 0:a.trim();if(i&&i!==e.title){E(e.id);try{let a=await fetch("/api/threads/raw-maker/images/".concat(e.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:i})}),s=await a.json().catch(()=>null);if(!a.ok||!(null==s?void 0:s.image))throw Error("rename_failed");v(a=>a.map(a=>a.id===e.id?s.image:a)),x.o.success("사진 이름을 바꿨어요")}catch(e){x.o.error("사진 이름을 바꾸지 못했어요.")}finally{E(null)}}},_=async e=>{if(window.confirm("이 사진을 보관함에서 삭제할까요? 되돌릴 수 없어요.")){E(e.id);try{if(!(await fetch("/api/threads/raw-maker/images/".concat(e.id),{method:"DELETE"})).ok)throw Error("delete_failed");v(a=>a.filter(a=>a.id!==e.id)),x.o.success("사진을 삭제했어요")}catch(e){x.o.error("사진을 삭제하지 못했어요.")}finally{E(null)}}},R=async e=>{E(e.id);try{await a(e.imageUrl),g(!1)}catch(e){x.o.error(e instanceof Error?e.message:"사진을 작업실로 불러오지 못했어요.")}finally{E(null)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(m.$,{variant:"outline",size:"sm",disabled:f,onClick:()=>g(!0),children:[(0,s.jsx)(l.T,{"aria-hidden":!0}),i?"이전에 만든 사진":"생성한 사진들 보기"]}),(0,s.jsx)(h.lG,{open:j,onOpenChange:g,children:(0,s.jsxs)(h.Cf,{className:"flex max-h-[88dvh] flex-col overflow-hidden rounded-[20px] sm:max-w-5xl",children:[(0,s.jsxs)(h.c7,{children:[(0,s.jsx)(h.L3,{children:i?"이전에 만든 사진":"생성한 사진들"}),(0,s.jsx)(h.rr,{children:i?"스튜디오와 날것 메이커에서 완성한 사진을 다시 첨부해요. 크레딧은 들지 않아요.":"날것 메이커로 만든 사진은 자동으로 여기에 저장돼요."})]}),(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto pr-1",children:[C?(0,s.jsxs)("div",{className:"flex min-h-48 flex-col items-center justify-center gap-3 text-center",role:"alert",children:[(0,s.jsx)("p",{className:"text-sm text-destructive",children:C}),(0,s.jsxs)(m.$,{variant:"outline",onClick:()=>void z(),children:[(0,s.jsx)(n.P,{"aria-hidden":!0}),"다시 시도"]})]}):0!==p.length||N?(0,s.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:p.map(e=>{let a=e.title||(i?"생성한 사진":"날것 이미지"),r="/api/reels/download?url=".concat(encodeURIComponent(e.imageUrl),"&filename=").concat(encodeURIComponent("".concat(a,".jpg")));return(0,s.jsxs)("article",{className:"overflow-hidden rounded-xl border border-border bg-card",children:[(0,s.jsx)("div",{className:"relative aspect-square bg-muted",children:(0,s.jsx)(t.default,{src:e.imageUrl,alt:a,fill:!0,unoptimized:!0,className:"object-cover"})}),(0,s.jsxs)("div",{className:"space-y-3 p-3",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("h3",{className:"truncate text-sm font-bold text-foreground",children:a}),(0,s.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[u.format(new Date(e.createdAt))," \xb7 ",e.aspectRatio]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,s.jsx)(m.$,{size:"sm",disabled:null!==S,onClick:()=>void R(e),children:"다시 사용하기"}),(0,s.jsx)(m.$,{asChild:!0,size:"sm",variant:"outline",children:(0,s.jsxs)("a",{href:r,children:[(0,s.jsx)(d.z,{"aria-hidden":!0}),"다운로드"]})}),!i&&(0,s.jsxs)(m.$,{size:"sm",variant:"ghost",disabled:null!==S,onClick:()=>void $(e),children:[(0,s.jsx)(c.g,{"aria-hidden":!0}),"이름 변경"]}),!i&&(0,s.jsxs)(m.$,{size:"sm",variant:"destructive",disabled:null!==S,onClick:()=>void _(e),children:[(0,s.jsx)(o.l,{"aria-hidden":!0}),"삭제"]})]})]})]},e.id)})}):(0,s.jsxs)("div",{className:"flex min-h-48 flex-col items-center justify-center gap-2 text-center text-muted-foreground",children:[(0,s.jsx)(l.T,{className:"size-8","aria-hidden":!0}),(0,s.jsx)("p",{className:"text-sm",children:"아직 저장된 사진이 없어요."})]}),null!==w&&!C&&(0,s.jsx)("div",{className:"flex justify-center pt-5",children:(0,s.jsx)(m.$,{variant:"outline",disabled:N,onClick:()=>void z(w),children:N?"불러오는 중":"더 보기"})}),N&&0===p.length&&(0,s.jsx)("p",{className:"py-16 text-center text-sm text-muted-foreground",children:"저장한 사진을 불러오는 중이에요."})]})]})})]})}}}]);

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.