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