PageSourceSearch

https://seedance25.kr/assets/history-jbnG27bK.js

js seedance25.kr collected 2026-10-04 11:47:15 UTC 18,891 bytes, 1 lines download raw bytes

1import{a as u,c as te,u as se,b as ae,r as N,d as le,j as t,I as z,e as m,h as ne,p as b,f as re,B as oe,i as ie,G as de,R as ce,Q as ue,A as me,k as xe,l as he,m as ge,L as I,n as E,o as fe,q as pe,t as be,v as O,x as F}from"./main-BmIQ3Ne6.js";import{I as ve}from"./image-placeholder-DTKpTF9U.js";import{c as P,I as U,a as S,E as je,S as A,b as _e}from"./prompt-gallery-state-BEvEQcNX.js";import{g as L}from"./view-transitions-BgnTfd7K.js";import{D as Ne,P as ye,a as we,b as ke}from"./dashboard-header-BdQNUYgK.js";import{D as Ce,a as Ie,b as Se,c as Pe,d as De,e as Te,f as Re}from"./drawer-CTsR-1DU.js";import{u as Oe}from"./use-creation-C8sfOEFF.js";import{I as Ae,d as Le}from"./download-D-vXNc7I.js";import{I as q,f as ze}from"./generation-credits-yIHEi4St.js";import{c as _}from"./common_all-ApiMy1HM.js";import{a as Ee,b as Fe,c as Ue,d as qe}from"./admin_tasks_status_processing-Dxqr5WYQ.js";import{a as Ve}from"./admin_tasks_columns_model-DwT3m-lx.js";import{a as Me,b as He,c as Ge,d as Ye}from"./admin_tasks_columns_resolution-BMGiNPVq.js";import{a as Be}from"./admin_tasks_columns_status--Fg9_OaP.js";import{c as Qe}from"./common_download_image-Bzp5z9wv.js";import{c as V}from"./common_use_this_prompt-mJ6pYdew.js";import"./IconArrowLeft-DSoudaeK.js";import"./index-C28nssON.js";import"./useInfiniteQuery-CMp6FCsQ.js";const $e=()=>"표시",Ke=((e={},s={})=>(s.locale??u(),$e())),We=()=>"생성물이 여기에 표시됩니다.",Xe=((e={},s={})=>(s.locale??u(),We())),Je=()=>"아직 기록이 없습니다",Ze=((e={},s={})=>(s.locale??u(),Je())),et=()=>"그리드",tt=((e={},s={})=>(s.locale??u(),et())),st=()=>"그리드 보기",at=((e={},s={})=>(s.locale??u(),st())),lt=()=>"목록",nt=((e={},s={})=>(s.locale??u(),lt())),rt=()=>"목록 보기",ot=((e={},s={})=>(s.locale??u(),rt())),it=()=>"생성물을 불러오는 중 문제가 발생했습니다.",dt=((e={},s={})=>(s.locale??u(),it())),ct=()=>"기록을 불러오지 못했습니다",ut=((e={},s={})=>(s.locale??u(),ct())),mt=()=>"최근 생성물을 가져오는 중입니다.",xt=((e={},s={})=>(s.locale??u(),mt())),ht=()=>"기록 불러오는 중",gt=((e={},s={})=>(s.locale??u(),ht()));const ft=[["path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -2",key:"svg-0"}],["path",{d:"M4 16a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v2a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -2",key:"svg-1"}]],M=te("outline","layout-list","LayoutList",ft),D=[{value:"all",label:_()},{value:"completed",label:Ee()},{value:"pending",label:Fe()},{value:"processing",label:Ue()},{value:"failed",label:qe()}],H=[{value:"all",label:_()},...de.map(e=>({value:e.key,label:e.displayName}))],G=[{value:"all",label:_()},...Object.entries(ce).map(([e,{label:s}])=>({value:e,label:s}))],Y=[{value:"all",label:_()},...Object.entries(ue).map(([e,{label:s}])=>({value:e,label:s}))],B=[{value:"all",label:_()},...Object.entries(me).map(([e,{label:s}])=>({value:e,label:s}))],Q=[{value:"all",label:_()},{value:"image",label:"이미지"},{value:"video",label:"비디오"}],$=[{value:"all",label:_()},{value:"fal",label:"Fal"},{value:"apimart",label:"APIMart"},{value:"kie",label:"KIE"}],K={pending:"bg-amber-100 text-amber-900 dark:bg-amber-500/15 dark:text-amber-200",processing:"bg-sky-100 text-sky-900 dark:bg-sky-500/15 dark:text-sky-200",completed:"bg-emerald-100 text-emerald-900 dark:bg-emerald-500/15 dark:text-emerald-200",failed:"bg-rose-100 text-rose-900 dark:bg-rose-500/15 dark:text-rose-200"};function W(e){return D.find(s=>s.value===e)?.label??e}function T(e){const s=e.mediaType==="video",r=e.assets?.find(n=>n.role==="thumbnail");return s&&e.outputUrl?{url:e.outputUrl,posterUrl:r?.url,isVideo:!0}:r?.url?{url:r.url,isVideo:!1}:{url:e.outputUrl,isVideo:!1}}const pt={view:re(["grid","list"]).withDefault("grid"),model:b.withDefault("all"),resolution:b.withDefault("all"),quality:b.withDefault("all"),ratio:b.withDefault("all"),status:b.withDefault("all"),provider:b.withDefault("all"),media:b.withDefault("all")};function bt(e){return{mediaType:e.media!=="all"?e.media:void 0,model:e.model!=="all"?e.model:void 0,resolution:e.resolution!=="all"?e.resolution:void 0,quality:e.quality!=="all"?e.quality:void 0,aspectRatio:e.ratio!=="all"?e.ratio:void 0,status:e.status!=="all"?e.status:void 0,provider:e.provider!=="all"?e.provider:void 0}}function X({item:e,className:s,alt:r}){const n=T(e),[d,c]=N.useState(!1);return!n.url||d?t.jsx("div",{className:m("relative flex items-center justify-center text-muted-foreground",s),children:t.jsx(ve,{variant:e.status==="failed"?"failed":"loading",className:"absolute inset-0"})}):n.isVideo?t.jsx("video",{src:n.url,poster:n.posterUrl,muted:!0,playsInl
1ine:!0,preload:"metadata",onError:()=>c(!0),style:{viewTransitionName:L(e.id)},className:s}):t.jsx("img",{src:n.url,alt:r??e.prompt.slice(0,60),loading:"lazy",decoding:"async",onError:()=>c(!0),style:{viewTransitionName:L(e.id)},className:s})}function vt(){const[e,s]=se(pt,{history:"replace"}),r=ae({select:a=>a.status==="pending"&&a.location.pathname!==(a.resolvedLocation?.pathname??"/history")}),n=N.useRef(e);r||(n.current=e);const d=r?n.current:e,{view:c,model:o,resolution:x,quality:i,ratio:l,status:g,provider:f,media:p}=d,Z=bt({media:p,model:o,resolution:x,quality:i,ratio:l,status:g,provider:f}),ee=Oe(Z),y=le.VITE_SHOW_IMAGE_PROVIDER,w=+(o!=="all")+ +(x!=="all")+ +(i!=="all")+ +(l!=="all")+ +(g!=="all")+ +(p!=="all")+Number(y&&f!=="all"),h=N.useCallback((a,R)=>{s({[a]:R==="all"?null:R})},[s]),k=N.useCallback(()=>{s({model:null,resolution:null,quality:null,ratio:null,status:null,provider:null,media:null})},[s]),C=N.useCallback(a=>{s({view:a==="grid"?null:a})},[s]);return t.jsxs("div",{className:"flex min-h-svh flex-col",children:[t.jsx(Ne,{showBack:!0,center:t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t.jsx("h1",{className:"shrink-0 font-sans font-semibold text-base",children:ne()}),w>0&&t.jsxs("div",{className:"hidden items-center gap-1.5 lg:flex",children:[p!=="all"&&t.jsx(v,{label:Q.find(a=>a.value===p)?.label??p,onRemove:()=>h("media","all")}),o!=="all"&&t.jsx(v,{label:H.find(a=>a.value===o)?.label??o,onRemove:()=>h("model","all")}),x!=="all"&&t.jsx(v,{label:G.find(a=>a.value===x)?.label??x,onRemove:()=>h("resolution","all")}),i!=="all"&&t.jsx(v,{label:Y.find(a=>a.value===i)?.label??i,onRemove:()=>h("quality","all")}),l!=="all"&&t.jsx(v,{label:B.find(a=>a.value===l)?.label??l,onRemove:()=>h("ratio","all")}),g!=="all"&&t.jsx(v,{label:D.find(a=>a.value===g)?.label??g,onRemove:()=>h("status","all")}),y&&f!=="all"&&t.jsx(v,{label:$.find(a=>a.value===f)?.label??f,onRemove:()=>h("provider","all")}),t.jsx("button",{type:"button",onClick:k,className:"ml-0.5 inline-flex h-6 items-center gap-1 rounded-full px-2 text-muted-foreground text-xs transition-colors hover:bg-accent hover:text-foreground",children:P()})]})]}),actions:t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"hidden lg:block",children:t.jsx(kt,{model:o,media:p,resolution:x,quality:i,ratio:l,status:g,provider:f,showProvider:y,onChange:h,onReset:k,activeCount:w})}),t.jsx("div",{className:"lg:hidden",children:t.jsx(Ct,{model:o,media:p,resolution:x,quality:i,ratio:l,status:g,provider:f,showProvider:y,onChange:h,onReset:k,activeCount:w,view:c,onViewChange:C})}),t.jsxs("div",{className:"hidden rounded-full bg-muted p-0.5 lg:flex",children:[t.jsx("button",{type:"button",onClick:()=>C("grid"),"aria-label":at(),className:m("inline-flex size-7 items-center justify-center rounded-full transition-colors",c==="grid"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.jsx(z,{className:"size-4"})}),t.jsx("button",{type:"button",onClick:()=>C("list"),"aria-label":ot(),className:m("inline-flex size-7 items-center justify-center rounded-full transition-colors",c==="list"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.jsx(M,{className:"size-4"})})]})]})}),t.jsx("div",{className:"flex-1 px-4 py-6 lg:px-6 lg:py-8",children:t.jsx(jt,{history:ee,viewMode:c})})]})}function jt({history:e,viewMode:s}){return e.isError?t.jsx(je,{title:ut(),description:e.error instanceof Error?e.error.message:dt()}):e.isLoading?t.jsx(A,{icon:t.jsx(xe,{className:"size-5 animate-spin"}),title:gt(),description:xt()}):e.items.length===0?t.jsx(A,{icon:t.jsx(he,{className:"size-5"}),title:Ze(),description:Xe()}):t.jsxs("div",{className:"space-y-4",children:[s==="grid"?t.jsx(_t,{items:e.items}):t.jsx(yt,{items:e.items}),t.jsx(_e,{hasNextPage:!!e.hasNextPage,isFetchingNextPage:e.isFetchingNextPage,onLoadMore:()=>{e.fetchNextPage()},totalLoaded:e.items.length,totalDocs:e.items.length})]})}function _t({items:e}){return t.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5",children:e.map(s=>t.jsx(Nt,{item:s},s.id))})}function Nt({item:e}){const s=e.prompt.trim().length>=5,r=ge(),n=T(e);function d(o){o.preventDefault(),o.stopPropagation(),r({to:F.Root,hash:"generate",search:{creationId:e.id}})}function c(o){o.preventDefault(),o.stopPropagation(),e.outputUrl&&Le(e.outputUrl,`creation-${e.id}.${e.mediaType==="video"?"mp4":"png"}`)}return t.jsx(I,{to:"/creation/$id",params:{id:e.id},className:"group relative block w-full overflow-hidden rounded-2xl bg-card shadow-sm outline-none animate-in fade-in [transition:box-sha
1dow_300ms_ease-out] hover:shadow-2xl hover:shadow-black/15 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 dark:hover:shadow-black/50",children:t.jsxs("div",{className:"relative overflow-hidden bg-muted",children:[t.jsx(X,{item:e,className:"aspect-square w-full object-cover transition-transform duration-700 ease-out group-hover:scale-[1.05]"}),n.isVideo&&t.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t.jsx("span",{className:"flex size-10 items-center justify-center rounded-full bg-black/55 text-white shadow-sm ring-1 ring-white/25 backdrop-blur-sm transition group-hover:bg-black/70",children:t.jsx(q,{className:"ml-0.5 size-4"})})}),t.jsx("span",{className:m("absolute top-2 left-2 inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",K[e.status]),children:W(e.status)}),t.jsx("div",{className:"pointer-events-none absolute inset-0 flex translate-y-2 flex-col justify-end opacity-0 transition-[opacity,transform] duration-300 ease-out group-hover:translate-y-0 group-hover:opacity-100",children:t.jsx("div",{className:"bg-linear-to-t from-black/85 via-black/55 to-transparent px-3 pt-12 pb-3 text-white",children:t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s&&t.jsxs("button",{type:"button",onClick:d,className:"pointer-events-auto inline-flex h-8 items-center gap-1.5 rounded-full bg-white px-3 font-medium text-neutral-900 text-xs shadow-md ring-1 ring-black/5 transition-colors hover:bg-white/90",children:[t.jsx(E,{className:"size-3.5"}),V()]}),e.outputUrl&&t.jsx("button",{type:"button",onClick:c,"aria-label":e.mediaType==="video"?"Download video":Qe(),className:"pointer-events-auto rounded-full bg-black/55 p-1.5 text-white/80 ring-1 ring-white/10 transition-[background-color,color,transform] duration-200 ease-out hover:bg-emerald-500 hover:text-white hover:ring-emerald-400/60 active:scale-[0.92]",children:t.jsx(Ae,{className:"size-3.5"})})]})})})]})})}function yt({items:e}){return t.jsx("div",{className:"space-y-2",children:e.map(s=>t.jsx(wt,{item:s},s.id))})}function wt({item:e}){const s=e.prompt.trim().length>=5,r=T(e),n=e.startedAt&&e.completedAt?fe(e.completedAt-e.startedAt):void 0;return t.jsxs(I,{to:"/creation/$id",params:{id:e.id}
1,className:"group flex items-center gap-4 rounded-xl border bg-card p-3 transition-colors hover:bg-accent/50 sm:p-4",children:[t.jsxs("div",{className:"relative size-[72px] shrink-0 overflow-hidden rounded-lg bg-muted sm:size-20",children:[t.jsx(X,{item:e,className:"size-full object-cover",alt:""}),r.isVideo&&t.jsx("span",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t.jsx("span",{className:"flex size-8 items-center justify-center rounded-full bg-black/55 text-white shadow-sm ring-1 ring-white/25 backdrop-blur-sm",children:t.jsx(q,{className:"ml-0.5 size-3.5"})})})]}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:m("inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",K[e.status]),children:W(e.status)}),t.jsx("p",{className:"mt-1.5 line-clamp-3 text-sm leading-snug",children:e.prompt}),t.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-y-1 text-muted-foreground text-xs",children:[t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(pe,{className:"size-3 text-amber-500"}),ze(e.creditsUsed,e.creditStatus)]}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.modelLabel}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.mediaType==="video"?"Video":"Image"}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.provider==="apimart"?"APIMart":e.provider==="kie"?"KIE":"Fal"}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.aspectRatio}),t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:e.resolutionLabel}),n&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsxs("span",{className:"inline-flex items-center gap-1",children:[t.jsx(be,{className:"size-3"}),n]})]}),e.startedAt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:O(new Date(e.startedAt))})]}),e.completedAt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 hidden text-border sm:inline",children:"~"}),t.jsx("span",{className:"hidden sm:inline",children:O(new Date(e.completedAt))})]})]})]}),s&&t.jsxs(I,{to:F.Root,hash:"generate",search:{creationId:e.id},onClick:d=>d.stopPropagation(),className:"hidden shrink-0 sm:inline-flex h-8 items-center gap-1.5 rounded-full border bg-background px-3 font-medium text-xs shadow-sm hover:bg-accent",children:[t.jsx(E,{className:"size-3.5"}),V()]})]})}function v({label:e,onRemove:s}){return t.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-accent px-2.5 py-1 text-xs ring-1 ring-border",children:[e,t.jsx("button",{type:"button",onClick:s,className:"ml-0.5 inline-flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-foreground
1/10 hover:text-foreground",children:t.jsx(ie,{className:"size-3"})})]})}function J({media:e,model:s,resolution:r,quality:n,ratio:d,status:c,provider:o,showProvider:x,onChange:i}){return t.jsxs("div",{className:"space-y-4",children:[t.jsx(j,{title:"미디어",options:Q,value:e,onChange:l=>i("media",l)}),t.jsx(j,{title:Ve(),options:H,value:s,onChange:l=>i("model",l)}),t.jsx(j,{title:Me(),options:G,value:r,onChange:l=>i("resolution",l)}),t.jsx(j,{title:He(),options:Y,value:n,onChange:l=>i("quality",l)}),t.jsx(j,{title:Ge(),options:B,value:d,onChange:l=>i("ratio",l)}),x&&t.jsx(j,{title:Ye(),options:$,value:o,onChange:l=>i("provider",l)}),t.jsx(j,{title:Be(),options:D,value:c,onChange:l=>i("status",l)})]})}function j({title:e,options:s,value:r,onChange:n}){return t.jsxs("section",{className:"space-y-2",children:[t.jsx("p",{className:"font-medium text-xs text-muted-foreground",children:e}),t.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map(d=>{const c=r===d.value;return t.jsx("button",{type:"button",onClick:()=>n(d.value),className:m("inline-flex h-7 items-center rounded-full px-3 text-xs transition-colors",c?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:d.label},d.value)})})]})}function kt(e){return t.jsxs(ye,{children:[t.jsxs(we,{className:m("inline-flex h-8 items-center gap-2 rounded-full border px-3 text-xs transition-colors",e.activeCount>0?"border-border bg-accent text-foreground":"border-border/60 text-foreground hover:bg-accent/60"),children:[t.jsx(U,{className:"size-3.5"}),S(),e.activeCount>0&&t.jsx("span",{className:"inline-flex min-w-5 items-center justify-center rounded-full bg-foreground px-1.5 py-0.5 text-[10px] text-background",children:e.activeCount})]}),t.jsxs(ke,{align:"end",sideOffset:8,className:"w-80 p-4",children:[t.jsx(J,{media:e.media,model:e.model,resolution:e.resolution,quality:e.quality,ratio:e.ratio,status:e.status,provider:e.provider,showProvider:e.showProvider,onChange:e.onChange}),t.jsx("button",{type:"button",onClick:e.onReset,className:"mt-3 inline-flex h-8 w-full items-center justify-center rounded-lg border text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",children:P()})]})]})}function Ct(e){return t.jsxs(Ce,{children:[t.jsxs(Ie,{className:m("inline-flex h-8 items-center gap-2 rounded-full border px-3 text-xs transition-colors",e.activeCount>0?"border-border bg-accent text-foreground":"border-border/60 text-foreground hover:bg-accent/60"),children:[t.jsx(U,{className:"size-3.5"}),S(),e.activeCount>0&&t.jsx("span",{className:"inline-flex min-w-5 items-center justify-center rounded-full bg-foreground px-1.5 py-0.5 text-[10px] text-background",children:e.activeCount})]}),t.jsxs(Se,{className:"rounded-t-[20px] border-t px-4 pb-6",children:[t.jsx(Pe,{className:"px-0 pb-3 text-left",children:t.jsx(De,{children:S()})}),t.jsxs("div",{className:"overflow-y-auto pb-2",children:[t.jsx(J,{media:e.media,model:e.model,resolution:e.resolution,quality:e.quality,ratio:e.ratio,status:e.status,provider:e.provider,showProvider:e.showProvider,onChange:e.onChange}),t.jsxs("section",{className:"mt-4 space-y-2 border-t pt-4",children:[t.jsx("p",{className:"font-medium text-xs text-muted-foreground",children:Ke()}),t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.jsxs("button",{type:"button",onClick:()=>e.onViewChange("grid"),className:m("inline-flex h-7 items-center gap-1.5 rounded-full px-3 text-xs transition-colors",e.view==="grid"?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:[t.jsx(z,{className:"size-3.5"}),tt()]}),t.jsxs("button",{type:"button",onClick:()=>e.onViewChange("list"),className:m("inline-flex h-7 items-center gap-1.5 rounded-full px-3 text-xs transition-colors",e.view==="list"?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:[t.jsx(M,{className:"size-3.5"}),nt()]})]})]})]}),t.jsx(Te,{className:"px-0",children:t.jsx(Re,{asChild:!0,children:t.jsx(oe,{type:"button",variant:"outline",className:"w-full",onClick:e.onReset,children:P()})})})]})]})}const Bt=vt;export{Bt as component};

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.