(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[720],{69277:function(l,i,e){Promise.resolve().then(e.bind(e,24814))},24814:function(l,i,e){"use strict";e.r(i);var n=e(57437),o=e(2265),t=e(76842),d=e(43402),u=e(16869),r=e(86854),s=e(66310),a=e(33068),v=e(24033),c=e(30713),p=e(65746);i.default=()=>{var l,i,e;let{Paragraph:m}=t.Typography,_=(0,v.useSearchParams)(),{trigger:g}=(0,a.Z)("/v1/upload/streamers",u.wG),{data:h,error:y,isLoading:f,mutate:x}=(0,c.ZP)(()=>_.get("id")?"/v1/upload/streamers/".concat(_.get("id")):null,u._i),j=(0,v.useRouter)(),{typeTree:w,isError:b}=(0,p.JB)(),k=(0,o.useRef)(),[E,P]=(0,o.useState)("inset");if((0,o.useEffect)(()=>{let l=(0,s.q)(s.f.lg,{match:()=>{P("left")},unmatch:()=>{P("top")}});return()=>l()},[]),y||b)return(0,n.jsx)("div",{children:null==y?void 0:y.message});if(f)return(0,n.jsx)("div",{children:"Loading..."});if(!h||!w)return null;let F={...h,tag:(null===(l=h.tags)||void 0===l?void 0:l.length)===0?[]:null===(i=h.tags)||void 0===i?void 0:i.split(","),tid:[null===(e=w.find(l=>l.children.some(l=>l.id===(null==h?void 0:h.tid))))||void 0===e?void 0:e.value,h.tid]};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{style:{display:"flex",flexDirection:"row-reverse",paddingRight:12},children:(0,n.jsx)(t.zx,{onClick:async()=>{var l,i,e,o,d,u,r,s,a,v,c,p,_;let h=await (null===(l=k.current)||void 0===l?void 0:l.validate());try{let l={template_name:null==h?void 0:h.template_name,copyright:null==h?void 0:h.copyright,id:null==h?void 0:h.id,source:null!==(i=null==h?void 0:h.source)&&void 0!==i?i:"",tid:null==h?void 0:h.tid[1],cover:null!==(e=null==h?void 0:h.cover)&&void 0!==e?e:"",title:null!==(o=null==h?void 0:h.title)&&void 0!==o?o:"",description:null!==(d=null==h?void 0:h.description)&&void 0!==d?d:"",dynamic:null!==(u=null==h?void 0:h.dynamic)&&void 0!==u?u:"",tag:null!==(r=null==h?void 0:h.tag)&&void 0!==r?r:"",interactive:null!==(s=null==h?void 0:h.interactive)&&void 0!==s?s:0,dolby:null!==(a=null==h?void 0:h.dolby)&&void 0!==a?a:0,lossless_music:null!==(v=null==h?void 0:h.lossless_music)&&void 0!==v?v:0,up_selection_reply:null!==(c=null==h?void 0:h.up_selection_reply)&&void 0!==c&&c,up_close_reply:null!==(p=null==h?void 0:h.up_close_reply)&&void 0!==p&&p,up_close_danmu:null!==(_=null==h?void 0:h.up_close_danmu)&&void 0!==_&&_,open_elec:null==h?void 0:h.open_elec,no_reprint:null==h?void 0:h.no_reprint,mission_id:null==h?void 0:h.mission_id,dtime:null==h?void 0:h.dtime,user_cookie:null==h?void 0:h.user_cookie},n=await g(l);await x(n),t.FN.success("更新成功"),j.push("/upload-manager")}catch(l){t.P_.error({title:"创建失败",content:(0,n.jsx)(m,{style:{maxWidth:450},children:l.message}),style:{width:"min-content"}})}},type:"primary",icon:(0,n.jsx)(d.Z,{size:"large"}),theme:"solid",style:{marginTop:12,marginRight:4},children:"保存模板"})}),(0,n.jsx)(t.Form,{initValues:F,style:{paddingLeft:30,paddingBottom:40},getFormApi:l=>k.current=l,autoScrollToError:!0,component:r.Z,labelWidth:"180px",labelPosition:E})]})}}},function(l){l.O(0,[368,713,833,971,472,744],function(){return l(l.s=69277)}),_N_E=l.O()}]);