PageSourceSearch

https://museimagejp.com/assets/history-3qeHPDyF.js

js museimagejp.com collected 2026-10-08 07:32:18 UTC 18,006 bytes, 1 lines download raw bytes

1import{g as o,c as U,u as ee,r as y,h as te,j as t,b,A as ae,Q as re,R as se,i as le,D as ne,k as ie,l as oe,m as ce,n as de,o as ue,p as xe,B as me,q as ge,I as he,s as be,e as k,v as pe}from"./main-Co2mCMbR.js";import{u as fe,p as f,a as ve}from"./index-DazL2ILQ.js";import{I as F}from"./image-placeholder-DsVUciZw.js";import{I as q,E as je,S as E,a as _e}from"./prompt-gallery-state-DIkjD-yC.js";import{f as ye,a as z}from"./formatter-DnU6xZxU.js";import{g as M}from"./view-transitions-BgnTfd7K.js";import{D as Ne}from"./dashboard-header-_ijaDOEd.js";import{P as we,a as Ie,b as Oe}from"./popover-BS81UkoI.js";import{u as Se}from"./use-creation-7hUQB9Bx.js";import{d as ke}from"./download-DEdK4HuD.js";import{I as H}from"./IconLayoutGrid-86pPDAnw.js";import{I as V}from"./IconSparkles-CkkUW908.js";import{I as Ce}from"./IconDownload-C2vzDrgF.js";import{I as Pe}from"./IconClock-NeMOmw1r.js";import{l as P,a as Te,b as C}from"./library_reset-BwWSFixm.js";import{l as T,a as D,b as A,c as L,d as De,e as Ae,f as Le,g as Re,h as Ee,i as ze}from"./library_status_processing-CE_1XlNU.js";import{l as Y}from"./library_use_this_prompt-CrLzpIb3.js";import"./IconPhoto-Dsi7IJlw.js";import"./useRender-DBIZH2M_.js";import"./sidebar-ZVOHbvxC.js";import"./IconArrowLeft-BDl5NgIB.js";import"./useInfiniteQuery-CgV2Ri3Y.js";const Ue=()=>"表示",Fe=((e={},a={})=>(a.locale??o(),Ue())),qe=()=>"ステータス",Me=((e={},a={})=>(a.locale??o(),qe())),He=()=>"グリッド表示",Ve=((e={},a={})=>(a.locale??o(),He())),Ye=()=>"あなたの作品はここに表示されます。",Qe=((e={},a={})=>(a.locale??o(),Ye())),Be=()=>"履歴はまだありません",Ge=((e={},a={})=>(a.locale??o(),Be())),$e=()=>"作品の読み込み中に問題が発生しました。",We=((e={},a={})=>(a.locale??o(),$e())),Xe=()=>"履歴の読み込みに失敗しました",Je=((e={},a={})=>(a.locale??o(),Xe())),Ke=()=>"最近の作品を取得しています。",Ze=((e={},a={})=>(a.locale??o(),Ke())),et=()=>"履歴を読み込み中",tt=((e={},a={})=>(a.locale??o(),et())),at=()=>"履歴",rt=((e={},a={})=>(a.locale??o(),at())),st=()=>"リスト表示",lt=((e={},a={})=>(a.locale??o(),st())),nt=()=>"グリッド",it=((e={},a={})=>(a.locale??o(),nt())),ot=()=>"リスト",ct=((e={},a={})=>(a.locale??o(),ot()));const dt=[["path",{d:"M12 8l0 4l2 2",key:"svg-0"}],["path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5",key:"svg-1"}]],ut=U("outline","history","History",dt);const xt=[["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"}]],Q=U("outline","layout-list","LayoutList",xt);function B(){const e=Te();return{STATUS_OPTIONS:[{value:"all",label:e},{value:"completed",label:T()},{value:"pending",label:D()},{value:"processing",label:A()},{value:"failed",label:L()}],MODEL_OPTIONS:[{value:"all",label:e},...le.map(a=>({value:a.id,label:a.displayName}))],RESOLUTION_OPTIONS:[{value:"all",label:e},...Object.entries(se).map(([a,{label:s}])=>({value:a,label:s}))],QUALITY_OPTIONS:[{value:"all",label:e},...Object.entries(re).map(([a,{label:s}])=>({value:a,label:s}))],ASPECT_RATIO_OPTIONS:[{value:"all",label:e},...Object.entries(ae).map(([a,{label:s}])=>({value:a,label:s}))],PROVIDER_OPTIONS:[{value:"all",label:e},{value:"fal",label:"Fal"},{value:"apimart",label:"APIMart"}]}}const G={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"},mt={view:ve(["grid","list"]).withDefault("grid"),model:f.withDefault("all"),resolution:f.withDefault("all"),quality:f.withDefault("all"),ratio:f.withDefault("all"),status:f.withDefault("all"),provider:f.withDefault("all")};function gt(e){return{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 ht(){const[e,a]=fe(mt,{history:"replace"}),s=ee({select:r=>r.status==="pending"&&r.location.pathname!==(r.resolvedLocation?.pathname??"/history")}),d=y.useRef(e);s||(d.current=e);const c=s?d.current:e,{view:u,model:l,resolution:n,quality:x,ratio:m,status:g,provider:h}=c,N=gt({model:l,resolution:n,quality:x,ratio:m,status:g,provider:h}),w=Se(N),{STATUS_OPTIONS:i,MODEL_OPTIONS:W,RESOLUTION_OPTIONS:X,QUALITY_OPTIONS:J,ASPECT_RATIO_OPTIONS:K,PROVIDER_OPTIONS:Z}=B(),_=te.VITE_SHOW_IMAGE_PROVIDER,I=+(l!=="all")+ +(n!=="all")+ +(x!=="all")+ +(m!=="all")+ +(g!=="all")+Number(_&&h!=="all"),p=y.useCallback((r,R)=>{a({[r]:R==="all"?null:R})},[a]),O=y.useCallback(()=>
1{a({model:null,resolution:null,quality:null,ratio:null,status:null,provider:null})},[a]),S=y.useCallback(r=>{a({view:r==="grid"?null:r})},[a]);return t.jsxs("div",{className:"flex min-h-svh flex-col",children:[t.jsx(Ne,{showBack:!0,withSidebarTrigger:!1,center:t.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[t.jsx("h1",{className:"shrink-0 font-semibold text-base",children:rt()}),I>0&&t.jsxs("div",{className:"hidden items-center gap-1.5 lg:flex",children:[l!=="all"&&t.jsx(v,{label:W.find(r=>r.value===l)?.label??l,onRemove:()=>p("model","all")}),n!=="all"&&t.jsx(v,{label:X.find(r=>r.value===n)?.label??n,onRemove:()=>p("resolution","all")}),x!=="all"&&t.jsx(v,{label:J.find(r=>r.value===x)?.label??x,onRemove:()=>p("quality","all")}),m!=="all"&&t.jsx(v,{label:K.find(r=>r.value===m)?.label??m,onRemove:()=>p("ratio","all")}),g!=="all"&&t.jsx(v,{label:i.find(r=>r.value===g)?.label??g,onRemove:()=>p("status","all")}),_&&h!=="all"&&t.jsx(v,{label:Z.find(r=>r.value===h)?.label??h,onRemove:()=>p("provider","all")}),t.jsx("button",{type:"button",onClick:O,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(_t,{model:l,resolution:n,quality:x,ratio:m,status:g,provider:h,showProvider:_,onChange:p,onReset:O,activeCount:I})}),t.jsx("div",{className:"lg:hidden",children:t.jsx(yt,{model:l,resolution:n,quality:x,ratio:m,status:g,provider:h,showProvider:_,onChange:p,onReset:O,activeCount:I,view:u,onViewChange:S})}),t.jsxs("div",{className:"hidden rounded-full bg-muted p-0.5 lg:flex",children:[t.jsx("button",{type:"button",onClick:()=>S("grid"),"aria-label":Ve(),className:b("inline-flex size-7 items-center justify-center rounded-full transition-colors",u==="grid"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.jsx(H,{className:"size-4"})}),t.jsx("button",{type:"button",onClick:()=>S("list"),"aria-label":lt(),className:b("inline-flex size-7 items-center justify-center rounded-full transition-colors",u==="list"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:t.jsx(Q,{className:"size-4"})})]})]})}),t.jsx("div",{className:"flex-1 px-4 py-6 lg:px-6 lg:py-8",children:t.jsx(bt,{history:w,viewMode:u})})]})}function bt({history:e,viewMode:a}){return e.isError?t.jsx(je,{title:Je(),description:e.error instanceof Error?e.error.message:We()}):e.isLoading?t.jsx(E,{icon:t.jsx(he,{className:"size-5 animate-spin"}),title:tt(),description:Ze()}):e.items.length===0?t.jsx(E,{icon:t.jsx(ut,{className:"size-5"}),title:Ge(),description:Qe()}):t.jsxs("div",{className:"space-y-4",children:[a==="grid"?t.jsx(pt,{items:e.items}):t.jsx(vt,{items:e.items}),t.jsx(_e,{hasNextPage:!!e.hasNextPage,isFetchingNextPage:e.isFetchingNextPage,onLoadMore:()=>{e.fetchNextPage()},totalLoaded:e.items.length,totalDocs:e.items.length})]})}function pt({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(a=>t.jsx(ft,{item:a},a.id))})}function ft({item:e}){const a=e.prompt.trim().length>=5,s=be(),d={pending:D(),processing:A(),completed:T(),failed:L()};function c(l){l.preventDefault(),l.stopPropagation(),s({to:"/generate",search:{creationId:e.id}})}function u(l){l.preventDefault(),l.stopPropagation(),e.outputUrl&&ke(e.outputUrl,`creation-${e.id}.png`)}return t.jsx(k,{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-shadow_300ms_ease-out] hover:shadow-2xl hover:shadow-black/15 focu
1s-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:[e.outputUrl?t.jsx("img",{src:e.outputUrl,alt:e.prompt.slice(0,60),loading:"lazy",decoding:"async",style:{viewTransitionName:M(e.id)},className:"aspect-square w-full object-cover transition-transform duration-700 ease-out group-hover:scale-[1.05]"}):t.jsx("div",{className:"relative flex aspect-square w-full items-center justify-center text-muted-foreground",children:t.jsx(F,{variant:e.status==="failed"?"failed":"loading",className:"absolute inset-0"})}),t.jsx("span",{className:b("absolute top-2 left-2 inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",G[e.status]),children:d[e.status]??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:[a&&t.jsxs("button",{type:"button",onClick:c,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(V,{className:"size-3.5"}),Y()]}),e.outputUrl&&t.jsx("button",{type:"button",onClick:u,"aria-label":ze(),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(Ce,{className:"size-3.5"})})]})})})]})})}function vt({items:e}){return t.jsx("div",{className:"space-y-2",children:e.map(a=>t.jsx(jt,{item:a},a.id))})}function jt({item:e}){const a=e.prompt.trim().length>=5,s={pending:D(),processing:A(),completed:T(),failed:L()},d=e.startedAt&&e.completedAt?ye(e.completedAt-e.startedAt):void 0;return t.jsxs(k,{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.jsx("div",{className:"size-[72px] shrink-0 overflow-hidden rounded-lg bg-muted sm:size-20",children:e.outputUrl?t.jsx("img",{src:e.outputUrl,alt:"",loading:"lazy",decoding:"async",style:{viewTransitionName:M(e.id)},className:"size-full object-cover"}):t.jsx("div",{className:"relative flex size-full items-center justify-center text-muted-foreground",children:t.jsx(F,{variant:e.status==="failed"?"failed":"loading",className:"absolute inset-0"})})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("span",{className:b("inline-flex items-center rounded-full px-2 py-0.5 font-medium text-[10px] capitalize",G[e.status]),children:s[e.status]??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"}),e.creditsUsed]}),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.provider==="apimart"?"APIMart":"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}),d&&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(Pe,{className:"size-3"}),d]})]}),e.startedAt&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mx-1.5 text-border",children:"/"}),t.jsx("span",{children:z(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:z(new Date(e.completedAt))})]})]})]}),a&&t.jsxs(k,{to:"/generate",search:{creationId:e.id},onClick:c=>c.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(V,{className:"size-3.5"}),Y()]})]})}function v({label:e,onRemove:a}){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:a,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(ge,{className:"size-3"})})]})}function $({model:e,resolution:a,quality:s,ratio:d,status:c,provider:u,showProvider:l,onChange:n}){const{STATUS_OPTIONS:x,MODEL_OPTIONS:m,RESOLUTION_OPTIONS:g,QUALITY_OPTIONS:h,ASPECT_RATIO_OPTIONS:N,PROVIDER_OPTIONS:w}=B();return t.jsxs("div",{className:"space-y-4",children:[t.jsx(j,{title:De(),options:m,value:e,onChange:i=>n("model",i)}),t.jsx(j,{title:Ae(),options:g,value:a,onChange:i=>n("resolution",i)}),t.jsx(j,{title:Le(),options:h,value:s,onChange:i=>n("quality",i)}),t.jsx(j,{title:Re(),options:N,value:d,onChange:i=>n("ratio",i)}),l&&t.jsx(j,{title:Ee(),options:w,value:u,onChange:i=>n("provider",i)}),t.jsx(j,{title:Me(),options:x,value:c,onChange:i=>n("status",i)})]})}function j({title:e,options:a,value:s,onChange:d}){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:a.map(c=>{const u=s===c.value;return t.jsx("button",{type:"button",onClick:()=>d(c.value),className:b("inline-flex h-7 items-center rounded-full px-3 text-xs transition-colors",u?"bg-foreground text-background shadow-sm":"bg-muted text-muted-foreground hover:bg-accent hover:text-foreground"),children:c.label},c.value)})})]})}function _t(e){return t.jsxs(we,{children:[t.jsxs(Ie,{className:b("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(q,{className:"size-3.5"}),C(),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(Oe,{align:"end",sideOffset:8,className:"w-80 p-4",children:[t.jsx($,{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 yt(e){return t.jsxs(ne,{children:[t.jsxs(ie,{className:b("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(q,{className:"size-3.5"}),C(),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(oe,{className:"rounded-t-[20px] border-t px-4 pb-6",children:[t.jsx(ce,{className:"px-0 pb-3 text-left",children:t.jsx(de,{children:C()})}),t.jsxs("div",{className:"overflow-y-auto pb-2",children:[t.jsx($,{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:Fe()}),t.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[t.jsxs("button",{type:"button",onClick:()=>e.onViewChange("grid"),className:b("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(H,{className:"size-3.5"}),it()]}),t.jsxs("button",{type:"button",onClick:()=>e.onViewChange("list"),className:b("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(Q,{className:"size-3.5"}),ct()]})]})]})]}),t.jsx(ue,{className:"px-0",children:t.jsx(xe,{asChild:!0,children:t.jsx(me,{type:"button",variant:"outline",className:"w-full",onClick:e.onReset,children:P()})})})]})]})}const Qt=ht;export{Qt 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.