PageSourceSearch

https://snich.ai/assets/CreateBroadcastPage-45255047.js

js snich.ai collected 2026-10-05 15:07:31 UTC 36,844 bytes, 1 lines download raw bytes

1import{a as ts,b as ns,r as m,j as e}from"./vendor-react-72e4a099.js";import{u as ls,b as is,B as p,c as _,M as rs,S as J,d as ze,e as V,f as os}from"./Toast-43ee7788.js";import{A as De,b as cs,S as ds}from"./Display-48adcc24.js";import{u as ms}from"./Controls-5a18fd37.js";import{e as Z,u as hs}from"./api-d8a57490.js";import{C as us,e as ps}from"./format-5039f022.js";import{u as xs,r as w,B as gs,b as fs,e as X}from"./buildLifecycle-a44b0e05.js";import{u as js}from"./CabinetContext-31fc5321.js";import{u as vs,a as ys,e as R,b as Ue,F as Te,c as I,R as Ns,A as bs,P as Ee,d as ws,s as ks,f as Me,g as Ss}from"./shared-ca8c7fb4.js";import{u as Cs,P as zs,R as Ds}from"./restream-984cbc9c.js";import{d as Y,z as Us,a as Ts,b as Re,t as Q,c as Es,e as Ms}from"./zoned-50a8f13e.js";import{D as Rs}from"./DurationSelect-88daa32a.js";import{C as ee}from"./check-083433f7.js";import{G as Is}from"./globe-e09c7f1b.js";import{C as Ls}from"./calendar-days-6829c81b.js";import{S as Bs}from"./sparkles-e0558c3e.js";import{X as Os}from"./x-b9f3d093.js";import{S as Ps}from"./send-ef7332d3.js";import{L as Ie}from"./link-2-36909ef8.js";import{F as Fs}from"./file-text-e7c68864.js";import{L as As}from"./lock-73755c1f.js";import{S as Le}from"./sliders-horizontal-41aa44a5.js";import{C as Ws}from"./chevron-down-888c3b30.js";import{C as $s}from"./chevron-up-f536cc4c.js";import{P as Gs}from"./palette-a7aa7952.js";import{S as qs}from"./sun-a2f106f6.js";import{M as Hs}from"./moon-d002ab0c.js";import{U as Be}from"./upload-34ad8b6a.js";import{I as Ks}from"./image-aefc8036.js";import{R as Oe}from"./radio-dc3b7f8c.js";import{S as _s}from"./shield-check-111738a3.js";import{C as Js}from"./copy-34f4069e.js";import"./createLucideIcon-581cd729.js";import"./eye-5711d0dd.js";import"./circle-check-63b159d4.js";import"./circle-alert-67975319.js";import"./calendar-plus-0f511f3c.js";import"./chevron-left-39dc0897.js";import"./plus-39793e81.js";import"./mic-098d6d5b.js";import"./presentation-e2109ecf.js";import"./eventDuration-e09aabf0.js";const Pe=[{value:"webinar",title:"Вебинар",desc:"регистрация, вопросы, запись"},{value:"product",title:"Презентация продукта",desc:"страница эфира, бренд, запись"},{value:"closed",title:"Закрытый эфир",desc:"только приглашённые"}],Fe={webinar:{access:"registration",theme:"light",watermark:!1,polls:!0},product:{access:"registration",theme:"brand",watermark:!1,polls:!0},closed:{access:"invite",theme:"dark",watermark:!0,polls:!0}},Vs={link:"Страница эфира открыта всем, у кого есть ссылка, — без регистрации",registration:"Зритель оставит имя и email — пришлём ему ссылку и напоминание за час до начала",invite:"Смотреть смогут только те, кого вы пригласите: каждый получит письмо с личной ссылкой"},Zs={link:"Смотреть эфир",registration:"Зарегистрироваться",invite:"Войти по приглашению"},Xs=new Set(["gmail.com","mail.ru","yandex.ru","ya.ru","bk.ru","inbox.ru","list.ru","rambler.ru","outlook.com","hotmail.com","icloud.com","yahoo.com","proton.me","protonmail.com"]);let Ae=0;const We=()=>(Ae+=1,`m${Date.now().toString(36)}${Ae}`);function $e(i,h){var f;const c=ps(),d=Ms(c),U=i.get("date"),k=i.get("time"),z=((f=(h||"").split("@")[1])==null?void 0:f.toLowerCase())||"";return{title:"",description:"",startMode:"scheduled",date:U&&/^\d{4}-\d{2}-\d{2}$/.test(U)?U:d.date,time:k&&/^\d{1,2}:\d{2}$/.test(k)?k.padStart(5,"0"):d.time,duration:60,timezone:c,format:"webinar",team:[],access:"registration",viewerEmails:[],theme:"light",logoUrl:null,logoName:null,coverUrl:null,coverName:null,restream:{},passwordOn:!1,password:"",watermark:!1,corporateOnly:!1,corporateDomains:z&&!Xs.has(z)?z:"",slug:"",slugTouched:!1}}function Ge(i){i&&(i.style.height="auto",i.style.height=`${Math.max(50,Math.min(i.scrollHeight,220))}px`)}function L(i){return Array.from(new Set(i.split(/[\s,;]+/).map(h=>
1h.trim().toLowerCase().replace(/^@/,"")).filter(Boolean)))}function Ys(i){if(!i)return{};const h={};return["accentColor","splashColor","plateColor","plateStyle","font"].forEach(c=>{typeof i[c]=="string"&&i[c]&&(h[c]=i[c])}),i.studioBackground&&typeof i.studioBackground=="object"&&(h.studioBackground=i.studioBackground),h}function Wa(){var be,we,ke,Se;const i=ts(),h=ls(),{user:c}=xs(),{workspace:d,refreshNav:U}=js(),[k,z]=ns(),f=k.get("draft"),[a,B]=m.useState(()=>$e(k,c==null?void 0:c.email)),[G,q]=m.useState(f),[T,se]=m.useState(!!f),[ae,te]=m.useState(null),[ne,O]=m.useState(!1),[H,P]=m.useState(!1),[S,le]=m.useState(null),[u,j]=m.useState({}),[x,qe]=m.useState(null),[He,E]=m.useState(!1),[g,M]=m.useState({checking:!1,available:null}),[Ke,F]=m.useState(!1),[ie,re]=m.useState(null),K=vs(d==null?void 0:d.id),y=Cs(d==null?void 0:d.id),oe=m.useRef(null),ce=m.useRef(null),de=m.useRef(null),[_e]=ms(),A=is();ys(ne&&!S);const l=s=>{B(t=>({...t,...s})),O(!0)};m.useEffect(()=>{if(!(d!=null&&d.id))return;let s=!1;return R.workspaceBrand(d.id).then(t=>{s||(qe(t),t!=null&&t.logoUrl&&B(n=>n.logoUrl?n:{...n,logoUrl:t.logoUrl||null,logoName:"из бренда пространства"}))}),()=>{s=!0}},[d==null?void 0:d.id]),m.useEffect(()=>{if(!f)return;let s=!1;return se(!0),R.form(f).then(t=>{var Ce;if(s)return;if(t.status!=="draft"){i(w.event(t.id),{replace:!0});return}if(t.kind!=="broadcast"){i(w.createMeeting(t.id),{replace:!0});return}const n=t.form&&t.form.kind==="broadcast"?t.form.state:null,r=$e(new URLSearchParams,c==null?void 0:c.email),o=(n==null?void 0:n.timezone)||t.room.timezone||r.timezone,N=Y(t.room.scheduledAt,o),as=t.team.filter(b=>["producer","host","moderator","speaker","guest"].includes(b.role)).map(b=>({key:We(),email:b.email,name:b.name,role:b.role,title:b.title,avatarUrl:b.avatarUrl,userId:b.userId}));B({...r,...n||{},title:t.room.title||(n==null?void 0:n.title)||"",description:t.room.description||(n==null?void 0:n.description)||"",date:(N==null?void 0:N.date)||(n==null?void 0:n.date)||r.date,time:(N==null?void 0:N.time)||(n==null?void 0:n.time)||r.time,duration:t.room.durationMinutes||(n==null?void 0:n.duration)||60,timezone:o,team:as,startMode:"scheduled",password:"",passwordOn:!!((Ce=t.settings)!=null&&Ce.hasPassword)}),q(t.id),O(!1)}).catch(t=>{s||te(Z(t,"Черновик не найден"))}).finally(()=>{s||se(!1)}),()=>{s=!0}},[f]);
1const me=Ue(a.title,450),he=Ue(a.slug,400);m.useEffect(()=>{if(a.slugTouched||T)return;let s=!1;const t=me.trim();return R.slugCheck("",G,t||"efir").then(n=>{s||!n.suggestion||(B(r=>r.slugTouched?r:{...r,slug:n.suggestion}),M({checking:!1,available:!0}))}).catch(()=>{}),()=>{s=!0}},[me,a.slugTouched,T]),m.useEffect(()=>{if(!a.slugTouched)return;const s=he.trim();if(!s){M({checking:!1,available:!1,reason:"Введите адрес"});return}let t=!1;return M(n=>({...n,checking:!0})),R.slugCheck(s,G,a.title).then(n=>{t||M({checking:!1,available:n.available,reason:n.reason,suggestion:n.suggestion})}).catch(()=>{t||M({checking:!1,available:null})}),()=>{t=!0}},[he,a.slugTouched]);const v=a.startMode==="now"?new Date:Us(a.date,a.time,a.timezone),W=a.team.filter(s=>s.role==="speaker"),D=W.length?W:a.team.filter(s=>s.role==="host"),ue=((be=Pe.find(s=>s.value===a.format))==null?void 0:be.title)||"",pe=y.items.filter(s=>a.restream[s.id]),xe=pe.length?pe.map(s=>{var t;return((t=zs.find(n=>n.match(s)))==null?void 0:t.label.replace(" Видео",""))||s.displayName}).filter((s,t,n)=>n.indexOf(s)===t).join(" и "):"",C={recording:!0,aiSummary:!0,waitingRoom:!1,interactive:{chat:!0,questions:!0,polls:Fe[a.format].polls}},Je=["Запись","AI-итоги",...C.interactive.chat?["Чат"]:[],...C.interactive.questions?["Вопросы"]:[],...C.interactive.polls?["Опросы"]:[],...a.access==="registration"?["Регистрация"]:[],...xe?[xe]:[],...a.passwordOn?["Пароль"]:[],...a.watermark?["Водяной знак"]:[]],Ve=[...a.team.map(s=>s.email),...c!=null&&c.email?[String(c.email).toLowerCase()]:[]],Ze=v?`${Ts(v,a.timezone).replace(/^./,s=>s.toUpperCase())}, ${Re(v,a.duration,a.timezone)}`:"Дата не выбрана",ge=a.theme!=="light",fe=a.theme==="brand"?(x==null?void 0:x.splashColor)||"#0F1720":a.theme==="dark"?"#0D0E10":void 0,je=a.theme==="brand"&&(x!=null&&x.accentColor)?x.accentColor:void 0,ve=a.coverUrl||((we=D.find(s=>s.avatarUrl))==null?void 0:we.avatarUrl)||null,Xe=s=>{const t=s.email.toLowerCase();if(c!=null&&c.email&&t===String(c.email).toLowerCase()){h.show("Вы уже в команде — как продюсер эфира");return}if(a.team.some(n=>n.email===t)){h.show("Этот человек уже в команде");return}if(a.team.length>=60){h.error("В команде эфира может быть до 60 человек");return}l({team:[...a.team,{key:We(),email:t,name:s.name||t.split("@")[0],role:"speaker",title:s.title||null,avatarUrl:s.avatarUrl||null,userId:s.userId||null}]}),j(n=>({...n,team:""}))},ye=async(s,t)=>{if(t){if(!/^image\//.test(t.type)){h.error("Нужна картинка: PNG, JPG или SVG");return}if(t.size>5*1024*1024){h.error("Файл больше 5 МБ — сожмите его и попробуйте ещё раз");return}re(s);try{const n=await hs(t);l(s==="logo"?{logoUrl:n.url,logoName:t.name}:{coverUrl:n.url,coverName:t.name}),h.success(s==="logo"?"Логотип загружен":"Обложка загружена")}catch(n){h.error(Z(n,"Не удалось загрузить файл"))}finally{re(null)}}},Ye=s=>{const t={};return a.title.trim()||(t.title="Введите название эфира"),s&&(a.startMode==="scheduled"&&(v?v.getTime()<Date.now()-5*6e4&&(t.when="Это время уже прошло — выберите другое или нажмите «Сейчас»"):t.when="Укажите дату и время начала"),a.access==="invite"&&!a.viewerEmails.length&&!a.team.length&&(t.viewers="Добавьте хотя бы одного зрителя"),a.passwordOn&&a.password.trim().length<4&&(t.password="Пароль — минимум 4 символа"),a.corporateOnly&&!L(a.corporateDomains).length&&(t.domains="Укажите домен компании, например snich.ai"),a.corporateOnly&&L(a.corporateDomains).some(n=>!/^[a-z0-9.-]+\.[a-z]{2,}$/i.test(n))&&(t.domains="Домен указан неверно"),a.slugTouched&&g.available===!1&&(t.slug=g.reason||"Адрес занят")),t},Qe=s=>{const t=L(a.corporateDomains),{password:n,...r}=a;return{id:G||void 0,kind:"broadcast",publish:s,workspaceId:d==null?void 0:d.id,title:a.title.trim()||"Новая трансляция",description:a.description.trim()||void 0,startNow:a.startMode==="now"?!0:void 0,scheduledAt:a.startMode==="scheduled"&&v?v.toISOString():void 0,durationMinutes:a.duration,timezone:a.timezone,format:a.format,access:a.access,team:a.team.map(o=>({email:o.email,name:o.name,role:o.role,...o.title?{title:o.title}:{}})),viewerEmails:a.access==="invite"?a.viewerEmails:[],recording:C.recording,aiSummary:C.aiSummary,waitingRoom:C.waitingRoom,interactive:C.interactive,brand:{...Ys(x),theme:a.theme,logoUrl:a.logoUrl,coverUrl:a.coverUrl},restream:y.items.filter(o=>a.restream[o.id]).map(o=>({destinationId:o.id,enabled:!0})),password:a.passwordOn&&n.trim()?n.trim():null,watermark:a.watermark,corporateOnly:a.corporateOnly&&t.length>0,corporateDomains:t.filter(o=>/^[a-z0-9.-]+\.[a-z]{2,}$/i.test(o)),slug:a.slug.trim()||void 0,form:{kind:"broadcast",state:{...r,team:[],password:""}}}},$=async s=>{var n;const t=Ye(s);if(j(t),Object.keys(t).length){const r=Object.values(t)[0];return h.error(r),t.title&&((n=oe.current)==null||n.focus()),(t.password||t.domains)&&!H&&P(!0),!1}le(s?"create":"draft");try{const r=await R.upsert(Qe(s));if(O(!1),U(),!s){if(q(r.id),!f||f!==r.id){const o=new URLSearchParams(k);o.set("draft",r.id),o.delete("date"),o.delete("time"),z(o,{replace:!0})}return h.success("Черновик сохранён — он в разделе «Эфиры и встречи → Черновики»"),!0}return i(w.eventCreated(r.id),{replace:!0,state:{invitationsSent:r.invitationsSent,warnings:r.warnings}}),!0}catch(r){const o=Z(r,s?"Не удалось создать трансляцию":"Не удалось сохранить черновик");return/адрес/i.test(o)&&(j(N=>({...N,slug:o})),F(!0),l({slugTouched:!0})),h.error(o),!1}finally{le(null)}},Ne=()=>{ne?E(!0):i(w.dashboard())};if(ae)return e.jsx(Te,{title:"Новая трансляция",onBack:()=>i(w.dashboard()),children:e.jsxs("div",{style:{maxWidth:520,margin:"80px auto",textAlign:"center",padding:"0 16px",display:"flex",flexDirection:"column",gap:16,alignItems:"center"},children:[e.jsx("h2",{className:"sn-display",style:{fontSize:22},children:"Черновик не открылся"}),e.jsxs("p",{className:"sn-hint",style:{fontSize:15},children:[ae,". Возможно, его уже опубликовали или удалили."]}),e.jsxs("div",{style:{display:"flex",gap:10},children:[e.jsx(p,{variant:"quiet",to:w.eventsDrafts(),children:"Все черновики"}),e.jsx(p,{variant:"primary",onClick:()=>
1{te(null),z(new URLSearchParams,{replace:!0}),q(null)},children:"Начать заново"})]})]})});const es=e.jsxs("div",{className:"sn-c-summary",children:[e.jsx("span",{className:"sn-c-summary-ok",children:e.jsx(ee,{className:"sn-i"})}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10,minWidth:0},children:[e.jsx("span",{className:"sn-mono sn-hide-sm",style:{fontSize:12,fontWeight:600,color:"var(--sn-ink-3)",whiteSpace:"nowrap"},children:"01-04"}),e.jsx("b",{className:"sn-ellipsis",style:{fontSize:16},children:a.title||"Без названия"})]}),e.jsxs("div",{className:"sn-hint sn-ellipsis",style:{fontSize:13.5,marginTop:3},children:[Ze," · ",ue," · ",a.team.length?`команда из ${a.team.length} ${a.team.length%10===1&&a.team.length%100!==11?"человека":"человек"}`:"команда не добавлена"]})]}),a.team.length>0&&e.jsx("span",{className:"sn-hide-sm",children:e.jsx(De,{people:a.team.map(s=>({id:s.key,name:s.name,src:s.avatarUrl})),size:30,max:5})}),e.jsx(p,{variant:"text",size:"sm",onClick:()=>P(!1),children:"Изменить"})]}),ss=e.jsxs(e.Fragment,{children:[e.jsxs(I,{num:"01",title:"О чём эфир",children:[e.jsxs("div",{className:_("sn-c-titlebox",u.title&&"is-invalid"),children:[e.jsx("label",{className:"sn-sr",htmlFor:"cb-title",children:"Название"}),e.jsx("input",{id:"cb-title",ref:oe,type:"text",value:a.title,maxLength:200,placeholder:"Название эфира",onChange:s=>{l({title:s.target.value}),u.title&&j(t=>({...t,title:""}))}}),e.jsx("div",{className:"sn-c-titlesep"}),e.jsx("label",{className:"sn-sr",htmlFor:"cb-desc",children:"Описание"}),e.jsx("textarea",{id:"cb-desc",rows:1,value:a.description,maxLength:2e3,placeholder:"Коротко о том, что покажете (необязательно)",ref:s=>Ge(s),onChange:s=>{l({description:s.target.value}),Ge(s.currentTarget)}})]}),u.title&&e.jsx("div",{className:"sn-error",role:"alert",style:{marginTop:8},children:u.title})]}),e.jsxs(I,{num:"02",title:"Когда",hint:e.jsxs(e.Fragment,{children:[e.jsxs("button",{type:"button",className:"sn-c-tz",onClick:A.toggle,"aria-haspopup":"menu","aria-label":`Часовой пояс: ${Q(a.timezone)}`,children:[e.jsx(Is,{className:"sn-i sn-i-14"}),Q(a.timezone)]}),e.jsx(rs,{open:A.open,onClose:A.close,anchor:A.anchor,placement:"bottom-start",width:280,items:Array.from(new Set([a.timezone,...us])).map(s=>({label:Q(s),checked:s===a.timezone,onSelect:()=>l({timezone:s})}))})]}),children:[e.jsxs("div",{className:"sn-c-when",children:[e.jsx("span",{className:"sn-label sn-c-when-start",id:"cb-start",style:{gridRow:1},children:"Старт"}),e.jsx("label",{className:"sn-label sn-hide-sm",htmlFor:"cb-date",style:{gridRow:1},children:"Дата"}),e.jsx("label",{className:"sn-label sn-hide-sm",htmlFor:"cb-time",style:{gridRow:1},children:"Начало"}),e.jsx("label",{className:"sn-label sn-hide-sm",htmlFor:"cb-dur",style:{gridRow:1},children:"Длительность"}),e.jsx("div",{className:"sn-c-when-start",children:e.jsx(J,{ariaLabel:"Старт",value:a.startMode,onChange:s=>l({startMode:s}),options:[{value:"now",label:"Сейчас"},{value:"scheduled",label:"Запланировать"}]})}),e.jsxs("div",{className:"sn-c-dateinput sn-c-when-date",children:[e.jsx(Ls,{className:"sn-i sn-i-16"}),e.jsx("input",{id:"cb-date",className:"sn-input sn-mono",type:"date",value:a.startMode==="now"?((ke=Y(new Date,a.timezone))==null?void 0:ke.date)||"":a.date,disabled:a.startMode==="now","aria-invalid":u.when?!0:void 0,onChange:s=>{l({date:s.target.value}),j(t=>({...t,when:""}))}})]}),e.jsx("input",{id:"cb-time",className:"sn-input sn-mono",type:"time","aria-label":"Начало",value:a.startMode==="now"?((Se=Y(new Date,a.timezone))==null?void 0:Se.time)||"":a.time,disabled:a.startMode==="now","aria-invalid":u.when?!0:void 0,onChange:s=>{l({time:s.target.value}),j(t=>({...t,when:""}))}}),e.jsx(Rs,{value:a.duration,onChange:s=>l({duration:s})})]}),u.when&&e.jsx("div",{className:"sn-error",role:"alert",style:{marginTop:8},children:u.when}),a.startMode==="now"&&e.jsx("p",{className:"sn-hint",style:{marginTop:8},children:"Студия откроется сразу после создания — зрители увидят заставку, пока вы не выйдете в эфир."})]}
1),e.jsx(I,{num:"03",title:"Формат",id:"cb-h3",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10},children:[e.jsx("div",{role:"radiogroup","aria-labelledby":"cb-h3",className:"sn-c-formats",children:Pe.map(s=>{const t=a.format===s.value;return e.jsxs("button",{type:"button",role:"radio","aria-checked":t,className:"sn-c-format",onClick:()=>{const n=Fe[s.value];l({format:s.value,access:n.access,theme:n.theme,watermark:n.watermark})},children:[e.jsxs("span",{className:"sn-c-format-top",children:[e.jsx("span",{className:"sn-c-format-name",children:s.title}),e.jsx("span",{className:_("sn-c-radio",t&&"is-on"),children:t&&e.jsx(ee,{className:"sn-i",style:{width:12,height:12,strokeWidth:3}})})]}),e.jsx("span",{className:"sn-c-format-desc",children:s.desc})]},s.value)})}),e.jsxs("p",{className:"sn-hint",style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(Bs,{className:"sn-i sn-i-16",style:{color:"var(--sn-blue)"}}),"Формат сам включит нужное: запись, чат, вопросы, опросы, зал ожидания, AI-итоги"]})]})}),e.jsxs(I,{num:"04",title:"Команда эфира",hint:"Каждый получит письмо со своей ссылкой",children:[e.jsxs("ul",{className:"sn-c-team","aria-label":"Команда эфира",children:[a.team.map(s=>e.jsxs("li",{children:[e.jsx(cs,{name:s.name,src:s.avatarUrl,size:32}),e.jsxs("span",{className:"sn-c-person-name",children:[e.jsx("b",{className:"sn-ellipsis",children:s.name}),e.jsx("span",{children:s.email})]}),e.jsx(Ns,{value:s.role,personName:s.name,onChange:t=>l({team:a.team.map(n=>n.key===s.key?{...n,role:t}:n)})}),e.jsx(ze,{label:`Убрать: ${s.name}`,size:"sm",variant:"ghost",style:{color:"var(--sn-ink-3)"},onClick:()=>l({team:a.team.filter(t=>t.key!==s.key)}),children:e.jsx(Os,{className:"sn-i"})})]},s.key)),e.jsxs("li",{className:"sn-c-addrow",children:[e.jsx(bs,{}),e.jsx(Ee,{people:K,exclude:Ve,onPick:Xe,buttonLabel:"Добавить",inputClassName:"sn-input sn-c-addinput",placeholder:"Email или имя"})]})]}),!a.team.length&&e.jsx("p",{className:"sn-hint",style:{marginTop:8},children:"Добавьте спикеров, ведущую и модератора — или позже, на странице эфира."})]})]});return e.jsxs(Te,{title:"Новая трансляция",onBack:Ne,headerAction:e.jsxs(p,{variant:"text",size:"sm",style:{marginRight:-10},loading:S==="draft",disabled:!!S||T,onClick:()=>$(!1),"aria-label":"Сохранить черновик",children:[e.jsx("span",{className:"sn-hide-sm",children:"Сохранить черновик"}),e.jsx("span",{className:"sn-c-show-sm",children:"В черновик"})]}),footer:e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"sn-c-footnote",children:[e.jsx(Ps,{className:"sn-i",style:{color:"var(--sn-ink-3)"}}),a.team.length?"Приглашения уйдут сразу после создания":"Команду можно пригласить и после создания"]}),e.jsx("div",{style:{flexGrow:1}}),e.jsx(p,{variant:"text",onClick:Ne,disabled:!!S,children:"Отмена"}),e.jsx(p,{variant:"primary",size:"lg",loading:S==="create",disabled:!!S||T,onClick:()=>$(!0),children:"Создать трансляцию"})]}),children:[T?e.jsx("div",{style:{display:"flex",justifyContent:"center",padding:80,color:"var(--sn-ink-3)"},children:e.jsx(ds,{size:24})}):e.jsxs("div",{className:"sn-c-create",children:[e.jsxs("form",{className:"sn-c-form","aria-label":"Новая трансляция",onSubmit:s=>{s.preventDefault(),$(!0)},children:[H?es:ss,e.jsx(I,{num:"05",title:"Кто смотрит",id:"cb-h5",children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[e.jsx(J,{ariaLabel:"Кто смотрит",value:a.access,onChange:s=>l({access:s}),options:[{value:"link",label:e.jsx("span",{className:"sn-ellipsis",children:"Все по ссылке"}),icon:e.jsx(Ie,{className:"sn-i sn-i-16"})},{value:"registration",label:e.jsx("span",{className:"sn-ellipsis",children:"С регистрацией"}),icon:e.jsx(Fs,{className:"sn-i sn-i-16"})},{value:"invite",label:e.jsx("span",{className:"sn-ellipsis",children:"Только приглашённые"}),icon:e.jsx(As,{className:"sn-i sn-i-16"})}],className:"sn-c-segwrap"}),e.jsx("p",{className:"sn-hint",children:Vs[a.access]}),a.access==="invite"&&e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[e.jsxs("div",{className:"sn-c-chips","aria-label":"Зрители по приглашению",children:[a.viewerEmails.map(s=>{var t;return e.jsx(ws,{email:s,name:(t=K.find(n=>n.email===s))==null?void 0:t.name,onRemove:()=>l({viewerEmails:a.viewerEmails.filter(n=>n!==s)})},s)}),e.jsx(Ee,{people:K,exclude:[...a.viewerEmails,...a.team.map(s=>s.email)],onPick:s=>{l({viewerEmails:[...a.viewerEmails,s.email.toLowerCase()]}),j(t=>({...t,viewers:""}))},onBackspaceEmpty:()=>l({viewerEmails:a.viewerEmails.slice(0,-1)}),placeholder:"Email зрителей — через Enter",ariaLabel:"Добавить зрителя",inputClassName:"sn-input",compact:!0})]}),u.viewers&&e.jsx("div",{className:"sn-error",role:"alert",children:u.viewers})]})]})}),H?e.jsxs("div",{className:"sn-c-adv",children:[e.jsxs("button",{type:"button",className:"sn-c-more","aria-expanded":!0,onClick:()=>P(!1),children:[e.jsx("span",{className:"sn-c-moreicon is-open","aria-hidden":"true",children:e.jsx(Le,{className:"sn-i"})}),e.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,flexGrow:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600},children:"Дополнительно"}),e.jsx("span",{"data-long":!0,className:"sn-ellipsis",style:{fontSize:13,color:"var(--sn-ink-3)"},children:"Всё это можно поменять позже — в студии или в настройках эфира"})]}),e.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontSize:14,fontWeight:600,color:"var(--sn-ink-2)"},children:[e.jsx("span",{className:"sn-hide-sm",children:"Свернуть"}),e.jsx($s,{className:"sn-i sn-i-16"})]})]}),e.jsxs("div",{className:"sn-c-adv-grid",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"sn-c-adv-h",children:[e.jsx(Gs,{className:"sn-i"}),"Бренд"]}),e.jsx("div",{className:"sn-label",style:{marginBottom:8},children:"Тема страницы и эфира"}),e.jsx(J,{ariaLabel:"Тема страницы и эфира",className:"sn-c-segwrap",value:a.theme,onChange:s=>l({theme:s}),options:[{value:"light",label:"Светлая",icon:e.jsx(qs,{className:"sn-i sn-i-16"})},{value:"dark",label:"Тёмная",icon:e.jsx(Hs,{className:"sn-i sn-i-16"})},{value:"brand",label:"Фирменная",icon:e.jsx("span",{style:{width:12,height:12,borderRadius:3,background:(x==null?void 0:x.accentColor)||"var(--sn-blue)"}})}]}),e.jsx("div",{className:"sn-label",style:{margin:"16px 0 8px"},children:"Логотип"}),e.jsxs("div",{className:"sn-c-filebox",children:[e.jsx("span",{className:"sn-c-filethumb",children:a.logoUrl?e.jsx("img",{src:a.logoUrl,alt:""}):e.jsx("img",{src:gs,alt:""})}),e.jsxs("span",{style:{flex:1,minWidth:0},children:[e.jsx("span",{className:"sn-ellipsis",style:{display:"block",fontWeight:600,fontSize:14.5},children:a.logoUrl?a.logoName&&a.logoName!=="из бренда пространства"?a.logoName:"Логотип пространства":"snich.ai"}),e.jsx("span",{className:"sn-hint",style:{display:"block",fontSize:12.5},children:a.logoUrl?a.logoName==="из бренда пространства"?"из бренда пространства":"загружен для этого эфира":"по умолчанию"})]}),e.jsx(p,{size:"sm",variant:"quiet",icon:e.jsx(Be,{className:"sn-i sn-i-16"}),loading:ie==="logo",onClick:()=>{var s;return(s=ce.current)==null?void 0:s.click()},children:a.logoUrl?"Заменить":"Загрузить"}),e.jsx("input",{ref:ce,type:"file",accept:"image/png,image/jpeg,image/svg+xml,image/webp",hidden:!0,onChange:s=>{var t;ye("logo",(t=s.target.files)==null?void 0:t[0]),s.target.value=""}})]}),e.jsx("div",{className:"sn-label",style:{margin:"16px 0 8px"},children:"Обложка страницы"}),e.jsxs("div",{className:"sn-c-filebox",children:[e.jsx("span",{className:"sn-c-filethumb is-cover",children:a.coverUrl?e.jsx("img",{src:a.c
1overUrl,alt:""}):e.jsx(Ks,{className:"sn-i"})}),e.jsxs("span",{style:{flex:1,minWidth:0},children:[e.jsx("span",{className:"sn-ellipsis",style:{display:"block",fontWeight:600,fontSize:14.5},children:a.coverUrl?a.coverName||"Обложка":"Кадр со спикерами"}),e.jsx("span",{className:"sn-hint",style:{display:"block",fontSize:12.5},children:"16:9, JPG или PNG до 5 МБ"})]}),a.coverUrl&&e.jsx(p,{size:"sm",variant:"text",onClick:()=>l({coverUrl:null,coverName:null}),children:"Убрать"}),e.jsx(p,{size:"sm",variant:"quiet",icon:e.jsx(Be,{className:"sn-i sn-i-16"}),loading:ie==="cover",onClick:()=>{var s;return(s=de.current)==null?void 0:s.click()},children:a.coverUrl?"Заменить":"Загрузить"}),e.jsx("input",{ref:de,type:"file",accept:"image/png,image/jpeg,image/webp",hidden:!0,onChange:s=>{var t;ye("cover",(t=s.target.files)==null?void 0:t[0]),s.target.value=""}})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"sn-c-adv-h",children:[e.jsx(Oe,{className:"sn-i"}),"Ретрансляция"]}),y.error?e.jsxs("p",{className:"sn-error",children:[y.error," ",e.jsx("button",{type:"button",className:"sn-btn sn-btn-text sn-btn-xs",onClick:()=>y.reload(),children:"Повторить"})]}):e.jsx(Ds,{destinations:y.items,loading:y.loading,enabled:a.restream,workspaceId:d==null?void 0:d.id,onToggle:(s,t)=>l({restream:{...a.restream,[s.id]:t}}),eventTitle:a.title,onConnected:(s,t)=>{y.setItems(r=>[...r,s]);const n=Object.fromEntries(t.map(r=>[r,!1]));l({restream:{...a.restream,...n,[s.id]:!0}})}})]})]}),e.jsxs("div",{className:"sn-c-adv-sec",children:[e.jsxs("div",{className:"sn-c-adv-h",style:{marginBottom:4},children:[e.jsx(_s,{className:"sn-i"}),"Защита"]}),e.jsxs("div",{className:"sn-c-protect",children:[e.jsxs("div",{children:[e.jsxs("div",{style:{flex:1,minWidth:180},children:[e.jsx("b",{style:{display:"block",fontSize:14.5},children:"Пароль на вход"}),e.jsx("span",{className:"sn-hint",style:{fontSize:13},children:a.access==="registration"?"зритель введёт его после регистрации":"зритель введёт его перед входом"}),u.password&&e.jsx("div",{className:"sn-error",role:"alert",style:{marginTop:4},children:u.password})]}),e.jsx("input",{className:"sn-input sn-input-sm",style:{width:220,flex:"0 1 220px"},type:"text",autoComplete:"off",placeholder:"Придумайте пароль","aria-label":"Пароль на вход","aria-invalid":u.password?!0:void 0,maxLength:64,value:a.password,onChange:s=>{l({password:s.target.value,passwordOn:s.target.value.length>0?!0:a.passwordOn}),j(t=>({...t,password:""}))}}),e.jsx(V,{checked:a.passwordOn,onChange:s=>l({passwordOn:s}),label:"Пароль на вход"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("b",{style:{display:"block",fontSize:14.5},children:"Водяной знак"}),e.jsx("span",{className:"sn-hint",style:{fontSize:13},children:"имя и email зрителя поверх видео — чтобы запись не утекла"})]}),e.jsx(V,{checked:a.watermark,onChange:s=>l({watermark:s}),label:"Водяной знак"})]}),e.jsxs("div",{children:[e.jsxs("div",{style:{flex:1,minWidth:180},children:[e.jsx("b",{style:{display:"block",fontSize:14.5},children:"Только корпоративные домены"}),e.jsxs("span",{className:"sn-hint",style:{fontSize:13},children:["регистрироваться смогут только адреса ",L(a.corporateDomains).length?L(a.corporateDomains).map(s=>`@${s}`).join(", "):"вашей компании"]}),u.domains&&e.jsx("div",{className:"sn-error",role:"alert",style:{marginTop:4},children:u.domains})]}),a.corporateOnly&&e.jsx("input",{className:"sn-input sn-input-sm sn-mono",style:{width:220,flex:"0 1 220px"},placeholder:"snich.ai, partner.ru","aria-label":"Корпоративные домены",value:a.corporateDomains,onChange:s=>{l({corporateDomains:s.target.value}),j(t=>({...t,domains:""}))}}),e.jsx(V,{checked:a.corporateOnly,onChange:s=>l({corporateOnly:s}),label:"Только корпоративные домены"})]})]})]})]}):e.jsxs("button",{type:"button",className:"sn-c-more","aria-expanded":!1,onClick:()=>P(!0),children:[e.jsx("span",{className:"sn-c-moreicon","aria-hidden":"true",children:e.jsx(Le,{className:"sn-i"})}),e.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,flexGrow:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:15,fontWeight:600},children:"Дополнительно"}),e.jsx("span",{"data-long":!0,className:"sn-ellipsis",style:{fontSize:13,color:"var(--sn-ink-3)"},children:"Бренд, ретрансляция на YouTube/VK, пароль, водяной знак — всё можно поменять позже в студии"})]}),e.jsx(Ws,{className:"sn-i",style:{color:"var(--sn-ink-3)"}})]}),e.jsx("button",{type:"submit",hidden:!0,"aria-hidden":"true",tabIndex:-1})]}),e.jsxs("aside",{className:"sn-c-aside","aria-label":"Предпросмотр",children:[e.jsx("span",{className:"sn-eyebrow",style:{paddingTop:2},children:"Так увидят зрители"}),e.jsxs("div",{className:"sn-card sn-c-preview",role:"group","aria-label":"Предпросмотр страницы эфира",children:[e.jsxs("div",{className:_("sn-c-preview-hero",!ge&&"is-light"),style:fe?{background:fe}:void 0,children:[e.jsxs("div",{className:"sn-c-hero-text",children:[e.jsxs("span",{className:"sn-c-logo-mini",children:[e.jsx("img",{src:a.logoUrl||fs(ge),alt:""}),!a.logoUrl&&e.jsxs("span",{className:"sn-display",style:{fontSize:12,fontWeight:600},children:["snich",e.jsx("span",{style:{color:"var(--sn-s-red)"},children:"."}),"ai"]})]}),e.jsx("div",{style:{flexGrow:1}}),e.jsx("span",{className:"sn-tag sn-c-hero-tag",children:"Трансляция"}),e.jsx("span",{className:"sn-display sn-c-hero-title",children:a.title||"Название эфира"}),e.jsx("span",{className:"sn-c-hero-when",children:v?e.jsxs(e.Fragment,{children:[Es(v,a.timezone),", ",e.jsx("span",{className:"sn-mono",children:Re(v,a.duration,a.timezone)})]}):"Дата не выбрана"})]}),e.jsx("div",{className:"sn-c-hero-img",children:ve?e.jsx("img",{src:ve,alt:""}):e.jsx("span",{className:"sn-c-hero-initials",children:D[0]?D[0].name.split(/\s+/).map(s=>s[0]).slice(0,2).join("").toUpperCase():e.jsx(Oe,{className:"sn-i sn-i-24",style:{opacity:.6}})})})]}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:14,padding:"16px 18px 18px"},children:[e.jsx("div",{style:{display:"flex",alignItems:"center",gap:12,minHeight:32},children:D.length>0?e.jsxs(e.Fragment,{children:[e.jsx(De,{people:D.map(s=>({id:s.key,name:s.name,src:s.avatarUrl})),size:30,max:3}),e.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0},children:[e.jsx("span",{style:{fontSize:12,color:"var(--sn-ink-3)"},children:W.length?W.length===1?"Спикер":"Спикеры":"Ведущий"}),e.jsx("span",{className:"sn-ellipsis",style:{fontSize:13.5,fontWeight:600},children:ks(D.map(s=>s.name))})]})]}):e.jsx("span",{className:"sn-hint",style:{fontSize:13},children:"Спикеры появятся здесь, когда вы добавите их в команду"})}),e.jsx("span",{"aria-hidden":"true",className:"sn-c-cta",style:je?{background:je}:void 0,children:Zs[a.access]})]})]}),e.jsxs("div",{className:"sn-card",style:{display:"flex",flexDirection:"column"},children:[e.jsxs("div",{className:"sn-c-slugrow",children:[e.jsx(Ie,{className:"sn-i",style:{color:"var(--sn-ink-3)"}}),Ke?e.jsxs("div",{className:"sn-c-slugedit",children:[e.jsxs("span",{className:"sn-mono sn-hint",style:{fontSize:14,whiteSpace:"nowrap"},children:[Me(X("")).replace(/\/$/,""),"/"]}),e.jsx("input",{autoFocus:!0,"aria-label":"Адрес страницы эфира",value:a.slug,maxLength:80,onChange:s=>{l({slug:s.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-{2,}/g,"-"),slugTouched:!0}),j(t=>({...t,slug:""}))},onBlur:()=>F(!1),onKeyDown:s=>{(s.key==="Enter"||s.key==="Escape")&&(s.preventDefault(),F(!1))}})]}):e.jsx("button",{type:"button",className:"sn-c-slugbtn",title:"Изменить адрес",onClick:()=>F(!0),children:e.jsx("span",{className:"sn-ellipsis",children:Me(X(a.slug||"…"))})}),e.jsx(ze,{label:"Скопировать ссылку на страницу эфира",size:"sm",variant:"ghost",onClick:()=>_e(X(a.slug),"Ссылка скопирована — страница заработает после создания"),disabled:!a.slug,children:e.jsx(Js,{className:"sn-i"})})]}),a.slugTouched&&(g.checking||g.available!==null)||u.slug?e.jsx("div",{style:{padding:"0 16px 10px",fontSize:13},children:g.checking?e.jsx("span",{className:"sn-hint",children:"Проверяем адрес…"}):g.available?e.jsxs("span",{style:{color:"var(--sn-green)",display:"inline-flex",alignItems:"center",gap:5},children:[e.jsx(ee,{className:"sn-i sn-i-14"}),"Адрес свободен"]}):e.jsxs("span",{className:"sn-error",children:[u.slug||g.reason||"Адрес занят",g.suggestion&&g.suggestion!==a.slug&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"sn-btn sn-btn-text sn-btn-xs",style:{padding:"0 4px",height:22,color:"var(--sn-blue)"},onClick:()=>l({slug:g.suggestion||"",slugTouched:!0}),children:g.suggestion})]})]})}):null,e.jsx("div",{style:{height:1,background:"var(--sn-line)"}}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:10,padding:"14px 16px 16px"},children:[e.jsx("span",{className:"sn-label",children:"Будет включено"}),e.jsx("ul",{className:"sn-c-features",children:Je.map(s=>e.jsx(Ss,{children:s},s))}),e.jsxs("p",{className:"sn-hint",style:{lineHeight:1.4},children:["Из формата «",ue,"» и настроек пространства. Любую функцию можно выключить в настройках эфира — даже во время эфира."]})]})]})]})]}),e.jsx(os,{open:He,onClose:()=>E(!1),title:"Выйти без сохранения?",subtitle:"Трансляция ещё не создана. Сохраните черновик — к нему можно вернуться из раздела «Эфиры и встречи».",width:480,className:"sn-c-modal",footer:e.jsxs(e.Fragment,{children:[e.jsx(p,{variant:"text",onClick:()=>{O(!1),E(!1),i(w.dashboard())},children:"Не сохранять"}),e.jsx("div",{style:{flex:1}}),e.jsx(p,{variant:"quiet",onClick:()=>E(!1),children:"Остаться"}),e.jsx(p,{variant:"primary",loading:S==="draft",onClick:async()=>{const s=await $(!1);E(!1),s&&i(w.eventsDrafts())},children:"Сохранить черновик"})]})})]})}export{Wa 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.