(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[501],{26977:function(e,i,n){Promise.resolve().then(n.bind(n,79477))},79477:function(e,i,n){"use strict";n.r(i),n.d(i,{default:function(){return p}});var t=n(57437),o=n(2265),l=n(32081),r=n(43402),s=n(66310),u=n(16869),d=n(33068),c=n(24033),a=n(86854);function p(){let{Paragraph:e}=l.Typography,{trigger:i}=(0,d.Z)("/v1/upload/streamers",u.wG),n=(0,c.useRouter)(),p=(0,o.useRef)(),[m,_]=(0,o.useState)("inset");return(0,o.useEffect)(()=>{let e=(0,s.ql)(s.f.lg,{match:()=>{_("left")},unmatch:()=>{_("top")}});return()=>e()},[]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{style:{display:"flex",flexDirection:"row-reverse",paddingRight:12},children:(0,t.jsx)(l.zx,{onClick:()=>{var e;null===(e=p.current)||void 0===e||e.submitForm()},type:"primary",icon:(0,t.jsx)(r.Z,{size:"large"}),theme:"solid",style:{marginTop:12,marginRight:4},children:"创建模板"})}),(0,t.jsx)("main",{style:{backgroundColor:"var(--semi-color-bg-0)",display:"flex",justifyContent:"space-around"},children:(0,t.jsx)(l.Form,{autoScrollToError:!0,onSubmit:async o=>{try{var r,s,u,d,c,a,p,m,_,v,h;let e={template_name:o.template_name,user_cookie:o.user_cookie,copyright:o.copyright,id:o.id,source:null!==(a=o.source)&&void 0!==a?a:"",tid:o.tid[1],cover_path:null!==(p=o.cover_path)&&void 0!==p?p:"",title:null!==(m=o.title)&&void 0!==m?m:"",description:null!==(_=o.description)&&void 0!==_?_:"",dynamic:null!==(v=o.dynamic)&&void 0!==v?v:"",tags:null!==(h=o.tags)&&void 0!==h?h:[],dolby:(null===(r=o.sound)||void 0===r?void 0:r.includes("dolby"))?1:0,hires:(null===(s=o.sound)||void 0===s?void 0:s.includes("hires"))?1:0,up_selection_reply:(null===(u=o.interaction)||void 0===u?void 0:u.includes("up_selection_reply"))?1:0,up_close_reply:(null===(d=o.interaction)||void 0===d?void 0:d.includes("up_close_reply"))?1:0,up_close_danmu:(null===(c=o.interaction)||void 0===c?void 0:c.includes("up_close_danmu"))?1:0,open_elec:o.open_elec?1:0,no_reprint:o.no_reprint?1:0,mission_id:o.mission_id,dtime:o.isDtime?null==o?void 0:o.dtime:null,credits:o.credits,uploader:o.uploader};await i(e),l.FN.success("创建成功"),n.push("/upload-manager")}catch(i){throw l.P_.error({title:"创建失败",content:(0,t.jsx)(e,{style:{maxWidth:450},children:i.message}),style:{width:"min-content"}}),i}},component:a.Z,getFormApi:e=>p.current=e,labelWidth:"180px",labelPosition:m})})]})}}},function(e){e.O(0,[835,713,151,971,472,744],function(){return e(e.s=26977)}),_N_E=e.O()}]);