import{j as e,T as s,r as u,V as m,z as x,ag as h,ah as j,G as g,ai as f,b as C,_ as T,I as y,J as b,M as F,aj as N}from"./main-D6SjkSWq.js";import{C as E,a as S,c as t,A,b as L,d as O,e as w,f as P}from"./content-type-field-CYfeEN1U.js";import{T as M}from"./track-BCLqLBLk.js";import{T as _,a as R,b as c}from"./tabs-BwrtVGjA.js";import{T as v,a as d}from"./tab-panels-DDLnWdlJ.js";import{C as D}from"./crupdate-resource-layout-IY4TseVy.js";import{B as I,a as p}from"./breadcrumb-Pvuej4Ko.js";import{F as Q}from"./switch-CvotT3pn.js";import"./admin-config-CcVyOMQ2.js";import"./globe-Bnh5BiEZ.js";import"./sticky-note-8BXAdCdJ.js";import"./tags-HILWsbVi.js";import"./select-BkmhiFLy.js";import"./combobox-end-adornment-Btuckat_.js";import"./chevron-down-BqXy_cI5.js";import"./info-dialog-trigger-DNg58Xm0.js";import"./genre-B_3ZyEC1.js";import"./album-C9ItuPVf.js";import"./artist-C2fP4kQS.js";import"./playlist-BqUIfvab.js";import"./channel-CQzLS58I.js";import"./ViewWeek-B-ZUFlwR.js";import"./user-D6GCMJ6c.js";import"./datatable-page-with-header-layout-BuTOEIJh.js";import"./dashboard-layout-context-C1ErlVWg.js";import"./useEffectEvent-Bb2YhEEQ.js";import"./ChevronRight-BN6UJOeQ.js";import"./MoreHoriz-Bms6kOtf.js";function z({children:n}){return e.jsxs(_,{isLazy:!0,children:[e.jsxs(R,{children:[e.jsx(c,{children:e.jsx(s,{message:"Details"})}),e.jsx(c,{children:e.jsx(s,{message:"SEO"})})]}),e.jsxs(v,{className:"pt-20",children:[e.jsx(d,{children:n}),e.jsx(d,{children:e.jsx(B,{})})]})]})}function B(){return e.jsxs(u.Fragment,{children:[e.jsx(m,{name:"config.seoTitle",label:e.jsx(s,{message:"SEO title"}),className:"mb-24"}),e.jsx(m,{name:"config.seoDescription",label:e.jsx(s,{message:"SEO description"}),inputElementType:"textarea",rows:6})]})}function K(n){const{trans:r}=x(),o=h(),i=j();return g({mutationFn:a=>C.post("channel",a).then(l=>l.data),onSuccess:async a=>{await i.invalidateQueries({queryKey:T.invalidateKey}),y(r(b("Channel created"))),o(`/admin/channels/${a.channel.id}/edit`,{replace:!0})},onError:a=>f(a,n)})}function V({defaultValues:n,children:r,submitButtonText:o}){const i=F({defaultValues:{content:N.pagination,config:{contentType:"listAll",contentOrder:"created_at:desc",nestedLayout:"carousel",...n}}}),a=K(i);return e.jsx(D,{submitButtonText:o,form:i,onSubmit:l=>{a.mutate(l)},title:e.jsxs(I,{size:"xl",children:[e.jsx(p,{to:"/admin/channels",children:e.jsx(s,{message:"Channels"})}),e.jsx(p,{children:e.jsx(s,{message:"New"})})]}),isLoading:a.isPending,children:r})}function ge(){return e.jsx(V,{defaultValues:{contentType:"listAll",contentModel:M,contentOrder:"created_at:desc",layout:"trackTable",nestedLayout:"carousel",paginationType:"infiniteScroll"},children:e.jsxs(z,{children:[e.jsx(E,{}),e.jsx(Q,{className:"mt-24",name:"config.hideTitle",description:e.jsx(s,{message:"Whether title should be shown when displaying this channel on the site."}),children:e.jsx(s,{message:"Hide title"})}),e.jsx(m,{name:"description",label:e.jsx(s,{message:"Description"}),inputElementType:"textarea",rows:2,className:"my-24"}),e.jsx(S,{config:t}),e.jsx(A,{config:t,className:"my-24"}),e.jsx(L,{config:t,className:"my-24"}),e.jsx(O,{config:t,className:"mb-24"}),e.jsx(w,{config:t,className:"mb-24"}),e.jsx(P,{config:t,className:"mb-24"})]})})}export{ge as Component};
