1import{x as A,T as Q,N as T,h as O,i as h,g as ne,y as le,d as ee,bd as ie,o as j,E as V,S as c,G as i,u as e,K as H,a as d,aj as te,M as z,t as C,W as oe,_ as re,z as ce,c as D,F as de,r as pe,b as K,br as ue}from"./index-4KLvpQhX.js";import{S as me}from"./SearchInput-Zru72plE.js";import{B as fe}from"./Button-s86KR94V.js";import{I as ve}from"./Icon-C2ZhqHhB.js";import{P as _e}from"./ProjectCard-Z2Sgsa4K.js";import{E as he}from"./Empty-Ci0R0byK.js";import{h as ge,g as xe,i as ye,q as je,p as Ce,j as ke,k as W}from"./segment-BNtsujeQ.js";import{p as Me}from"./useFastStoryboardMock-DUCEOMxL.js";import{F as be,_ as we}from"./index-CI9fdvcw.js";import{I as Ee,_ as Pe}from"./index-C9qvTwWr.js";import{_ as Se}from"./InfiniteScrollLoad.vue_vue_type_script_setup_true_lang-CxjV-Sq7.js";import{S as Ie}from"./index-94ugU9m-.js";import"./url-CV_E09l6.js";import"./imageUrlList-BNFAdSYP.js";import"./videoQuickStraightOut-CMrHuk-Z.js";import"./asset-C3itTVx4.js";import"./form-mkYLIy9B.js";import"./videoGenerateApi-DV1uUdNC.js";import"./modelParam-Cv8G6QHj.js";import"./videoDuration-CeesXxCC.js";import"./fastStoryboardMention-DQUzj1lV.js";import"./index-DtAU0q4f.js";import"./shootParamsApi-DI8cM9oJ.js";import"./normalizeAsset-B4EAfYPC.js";import"./firstNotUndefined-CQBN84kM.js";import"./hasIn-BW0MfbRl.js";import"./_baseAssignValue-DbF5gltX.js";import"./isSymbol-ClaQLOF6.js";import"./responsiveObserve-DrxcAbNv.js";import"./_arrayIncludes-B8uzE354.js";import"./debounce-DWqSdS_y.js";import"./index-DcfRwKy6.js";import"./collapseMotion-wqOJPGtk.js";import"./useInfiniteScrollLoad-64FNJxeN.js";const U=30,Y=500,X=10,F=h(!1),q=h(!1),y=h({title:"",description:""}),_=h([]),N=h(!1),B=h(!1),G=h(1),Z=h(""),J=h("");function ae(){const b=ne(),m=le(),{t:a}=A(),f=O(()=>!!y.value.id),w=O(()=>_.value),g=O(()=>!B.value);function k(){y.value={title:"",description:""}}function P(){k(),F.value=!0}function E(t){y.value={id:t.id,title:t.title,description:t.description??""},F.value=!0}function M(){F.value=!1,k()}function S(t){const n=_.value.find(o=>o.id===t);Q.confirm({title:a("project.fast.episodePanel.deleteConfirmTitle"),content:a("project.fast.episodePanel.deleteConfirmContent",{title:(n==null?void 0:n.title)??""}),okText:a("project.fast.episodePanel.confirmOk"),okType:"danger",onOk:async()=>{try{await ge({id:t}),_.value=_.value.filter(o=>o.id!==t),T.success(a("project.fast.episodePanel.deleted"))}catch{}}})}async function p(t=!1){if(N.value)return;const n=b.params.id;if(n&&(t&&(_.value=[],G.value=1,B.value=!1),!B.value)){N.value=!0;try{const o=G.value,r=(await je({projectId:n,pageNum:o,pageSize:X,segmentName:J.value.trim()||void 0})).data,$=Ce(r),R=$.map(L=>ke(L,{title:L.segmentName??L.segment_name??"",description:L.segmentDesc??L.segment_desc??""}));t?_.value=R:_.value=[..._.value,...R];const se=(r==null?void 0:r.total)??0;_.value.length>=se||$.length<X?B.value=!0:G.value=o+1}catch{t&&(_.value=[])}finally{N.value=!1}}}function l(){J.value=Z.value,p(!0)}function s(){p(!1)}async function I(t){var $;if(!await(t==null?void 0:t.validate().catch(()=>!1)))return;const o=y.value.title.trim(),v=(($=y.value.description)==null?void 0:$.trim())??"",r=b.params.id;if(!r){T.error(a("project.fast.episodePanel.invalidProjectId"));return}try{if(q.value=!0,y.value.id){await xe({id:y.value.id,projectId:r,segmentName:o,segmentDesc:v}),T.success(a("project.fast.episodePanel.updated")),M(),await p(!0);return}await ye({projectId:r,segmentName:o,segmentDesc:v}),T.success(a("project.fast.episodePanel.created")),M(),await p(!0)}catch{}finally{q.value=!1}}function u(t){const n=b.params.id;Me(n,{id:t.id,title:t.title,description:t.description}),m.push({name:"ProjectFast-Episode-Workbench",params:{id:n,episodeId:t.id}})}function x(t){const n=b.params.id;m.push({name:"InfiniteCanvas",params:{projectId:n},query:{segmentId:t.id}})}return{EPISODE_TITLE_MAX:U,EPISODE_DESC_MAX:Y,modalOpen:F,submitLoading:q,formData:y,isEdit:f,searchText:Z,displayList:w,loading:N,hasMore:g,fetchEpisodeList:p,onSearch:l,loadMore:s,openCreate:P,openEdit:E,closeModal:M,submitForm:I,removeItem:S,onCardClick:u,onGoCanvas:x}}const $e={class:"flex items-center justify-between w-full pr-2"},Le={class:"text-lg font-semibold"},De={class:"flex justify-end gap-3 pt-2"},Te=ee({__name:"CreateEpisodeModal",setup(b){const{t:m}=A(),a=h(null),{modalOpen:f,submitLoading:w,formData:g,isEdit:k,closeModal:P,submitForm:E}=ae(),M=O(()=>({title:[{required:!0,message:m("project.fast.episodeModal.rules.titleRequired")},{max:U,message:m("project.fast.episodeModal.rules.titleMax")}],description:[{max:Y,message:m("project.fast.episodeModal.rules.descMax")}]}));async function S(){await E(a.value)}function p(){var l;
1(l=a.value)==null||l.clearValidate(),P()}return(l,s)=>{const I=Ee,u=we,x=Pe,t=te,n=be,o=Q,v=ie("no-space");return j(),V(o,{open:e(f),"onUpdate:open":s[2]||(s[2]=r=>oe(f)?f.value=r:null),footer:null,closable:!1,width:520,class:"fast-create-episode-modal",onCancel:p},{title:c(()=>[d("div",$e,[d("span",Le,C(e(k)?l.$t("project.fast.episodeModal.editTitle"):l.$t("project.fast.episodeModal.createTitle")),1),d("button",{type:"button",class:"flex items-center justify-center w-8 h-8 rounded hover:bg-white/10 transition-colors text-gray-400 hover:text-white",onClick:p},[...s[3]||(s[3]=[d("i",{class:"ri-close-line text-xl"},null,-1)])])])]),default:c(()=>[i(n,{ref_key:"formRef",ref:a,model:e(g),rules:M.value,layout:"horizontal","label-col":{flex:"0 0 130px"},"wrapper-col":{flex:1},class:"fast-episode-form"},{default:c(()=>[i(u,{label:l.$t("project.fast.episodeModal.nameLabel"),name:"title",required:"",class:"mb-4"},{default:c(()=>[H(i(I,{value:e(g).title,"onUpdate:value":s[0]||(s[0]=r=>e(g).title=r),maxlength:e(U),"show-count":"",placeholder:l.$t("project.fast.episodeModal.namePlaceholder"),class:"rounded flex-1"},null,8,["value","maxlength","placeholder"]),[[v]])]),_:1},8,["label"]),i(u,{label:l.$t("project.fast.episodeModal.descLabel"),name:"description",class:"mb-6 form-item-label-top"},{default:c(()=>[H(i(x,{value:e(g).description,"onUpdate:value":s[1]||(s[1]=r=>e(g).description=r),rows:4,maxlength:e(Y),"show-count":"",placeholder:l.$t("project.fast.episodeModal.descPlaceholder"),class:"rounded"},null,8,["value","maxlength","placeholder"]),[[v]])]),_:1},8,["label"]),d("div",De,[i(t,{onClick:p},{default:c(()=>[z(C(l.$t("common.cancel")),1)]),_:1}),i(t,{type:"primary",loading:e(w),onClick:S},{default:c(()=>[z(C(l.$t("project.fast.episodeModal.confirm")),1)]),_:1},8,["loading"])])]),_:1},8,["model","rules"])]),_:1},8,["open"])}}}),Fe=re(Te,[["__scopeId","data-v-fd1459fa"]]),Ne={class:"relative flex-1 overflow-hidden h-full"},Be={class:"flex justify-between items-center gap-4 px-5 pt-5"},Oe={class:"flex flex-col items-center min-h-[calc(100%-70px)] p-5 gap-5"},qe={class:"grid gap-4 grid-cols-[repeat(auto-fill,363.2px)] w-full"},Ge={key:1,class:"flex-1 flex items-center justify-center py-20"},Ve={class:"flex flex-col items-center gap-2 py-4 w-full"},ze={key:0,class:"flex items-center gap-2 text-white/40"},Ue={class:"text-xs"},Ye={key:1,class:"text-white/20 text-xs"},bt=ee({__name:"EpisodePanel",setup(b){const{searchText:m,displayList:a,loading:f,hasMore:w,fetchEpisodeList:g,onSearch:k,loadMore:P,openCreate:E,openEdit:M,removeItem:S,onCardClick:p,onGoCanvas:l}=ae(),{t:s}=A();function I(u){if(!(u!=null&&u.trim()))return"";const x=ue(u);return x.isValid()?x.format("YYYY-MM-DD HH:mm:ss"):u}return ce(()=>{g(!0)}),(u,x)=>{const t=te,n=Ie;return j(),D("div",Ne,[i(Fe),i(Se,{class:"h-full overflow-y-auto","has-more":e(w),loading:e(f),onLoadMore:e(P)},{footer:c(()=>[d("div",Ve,[e(f)&&e(a).length>0?(j(),D("div",ze,[i(n,{size:"small"}),d("span",Ue,C(e(s)("project.fast.episodePanel.loading")),1)])):e(a).length>0&&!e(w)?(j(),D("div",Ye,C(e(s)("project.fast.episodePanel.allLoaded")),1)):K("",!0)])]),default:c(()=>[d("div",Be,[i(me,{value:e(m),"onUpdate:value":x[0]||(x[0]=o=>oe(m)?m.value=o:null),placeholder:e(s)("project.fast.episodePanel.searchPlaceholder"),class:"w-90!",onSearch:e(k),onClear:e(k)},null,8,["value","placeholder","onSearch","onClear"]),i(fe,{primary:"",onClick:e(E)},{icon:c(()=>[i(ve,{name:"ThreeStar"})]),default:c(()=>[d("span",null,C(e(s)("project.fast.episodePanel.create")),1)]),_:1},8,["onClick"])]),d("div",Oe,[d("div",qe,[(j(!0),D(de,null,pe(e(a),o=>(j(),V(_e,{key:o.id,title:o.title,description:e(W)(o)?void 0:o.description,image:e(W)(o)||null,tags:[],"show-metadata":"","show-go-canvas":"",creator:o.user_name,date:I(o.create_time),icon:"ri-file-text-line","action-type":"edit",onDelete:v=>e(S)(o.id),onEdit:v=>e(M)(o),onGoCanvas:v=>e(l)(o),onClick:v=>e(p)(o)},null,8,["title","description","image","creator","date","onDelete","onEdit","onGoCanvas","onClick"]))),128))]),!e(f)&&e(a).length===0?(j(),V(he,{key:0,class:"flex-1"},{description:c(()=>[d("span",null,C(e(s)("project.fast.episodePanel.emptyPrefix")),1),i(t,{type:"link",class:"p-0!",onClick:e(E)},{default:c(()=>[z(C(e(s)("project.fast.episodePanel.emptyCreate")),1)]),_:1},8,["onClick"])]),_:1})):e(f)&&e(a).length===0?(j(),D("div",Ge,[i(n)])):K("",!0)])]),_:1},8,["has-more","loading","onLoadMore"])])}}});
1export{bt as default};
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.