1import{u as ye,i as fe,a as be,r as w,d as z,j as e,B as E,I as P,X as ee,K as ve,g as U,F as se,ah as we,m as y,b0 as Q,b1 as $}from"./index-WHULU0jW.js";import{u as Ne,F as Se,a as c,b as r,f as o,c as i,g as _,d as g,t as Ce}from"./form-E7bzEHyU.js";import{T as _e}from"./textarea-B68ByilJ.js";import{L as k}from"./label-Cp0G8FgB.js";import{S as te,a as ae,b as re,c as ie,d as V}from"./select-GrX3B2N2.js";import{S as I}from"./switch-By9zSkfh.js";import{R as Y,a as f}from"./radio-group-Cx3qEoVW.js";import{a as Pe,b as ke}from"./upload-images-CKfogz5j.js";import{A as Ve}from"./arrow-left-mtxmp75y.js";import{U as Te}from"./upload-BB-9yaP-.js";import{V as Ae}from"./video-DwjwTulo.js";import{C as oe}from"./chevron-up-CBx5ZPzc.js";import{C as le}from"./chevron-down-6yZoXBwj.js";import"./index-BdQq_4o_.js";import"./index-DXGq4QHA.js";import"./index-BFruoVYP.js";import"./index-B_Td0hGN.js";const Fe=we({title:y().min(1,"Show title is required"),scheduledAt:y().min(1,"Date and time is required"),category:y().min(1,"Category is required"),description:y().optional(),thumbnail:y().optional(),preview_videos:y().optional(),freePickup:$().default(!1),uspsPriorityMail:$().default(!0),uspsGroundAdvantage:$().default(!0),shippingProfile:y().optional(),shippingCoverage:Q(["seller_pays_all","buyer_pays_up_to","buyer_pays_all"]),maxBuyerPays:y().optional(),roomType:Q(["public","private"]),explicitContent:$().default(!1),repeatShow:Q(["none","daily","weekly","monthly"]),repeatCount:y().optional()});function Je(){const[,q]=ye(),{toast:b}=fe(),{user:p}=be(),[H,M]=w.useState(null),[J,D]=w.useState(null),[N,W]=w.useState(!1),[S,X]=w.useState(!1),[B,ne]=w.useState(!1),[R,de]=w.useState(!1),v=new URLSearchParams(window.location.search).get("edit"),C=!!v,{data:l,isLoading:G}=z({queryKey:["/api/rooms",v],queryFn:async()=>{if(!v)return null;const s=await U(`/api/rooms/${v}`);if(!s.ok)throw new Error("Failed to fetch show");return s.json()},enabled:C}),{data:h,isLoading:L}=z({queryKey:["/api/categories"],queryFn:async()=>{const s=await U("/api/categories?status=active&page=1&limit=100");if(!s.ok)throw new Error("Failed to fetch categories");return s.json()}}),Z=w.useMemo(()=>{if(!(h!=null&&h.categories))return[];const s=[];return h.categories.forEach(a=>{s.push(a),a.subCategories&&Array.isArray(a.subCategories)&&a.subCategories.length>0&&s.push(...a.subCategories)}),s},[h]),{data:T,isLoading:K}=z({queryKey:["external-shipping-profiles",p==null?void 0:p.id],queryFn:async()=>{if(!(p!=null&&p.id))throw new Error("User ID required");const s=await U(`/api/shipping/profiles/${p.id}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!s.ok)throw new Error(`Failed to fetch shipping profiles: ${s.status}`);return s.json()},enabled:!!(p!=null&&p.id)}),t=Ne({resolver:Ce(Fe),defaultValues:{title:"",scheduledAt:"",category:"",description:"",freePickup:!1,uspsPriorityMail:!0,uspsGroundAdvantage:!0,shippingProfile:"",shippingCoverage:"buyer_pays_all",maxBuyerPays:"",roomType:"public",explicitContent:!1,repeatShow:"none",repeatCount:""}});w.useEffect(()=>{var s,a,d;if(l&&C&&!L&&!K){console.log("ð¦ Categories loaded:",(s=h==null?void 0:h.categories)==null?void 0:s.length),console.log("ð¦ Shipping profiles loaded:",T==null?void 0:T.length);const n=new Date(l.date),u=O=>String(O).padStart(2,"0"),j=`${n.getFullYear()}-${u(n.getMonth()+1)}-${u(n.getDate())}T${u(n.getHours())}:${u(n.getMinutes())}`,m=l.shipping_settings||{};let x="buyer_pays_all";m.shippingCostMode?x=m.shippingCostMode:m.seller_pays?x="seller_pays_all":m.reducedShippingCapAmount>0&&(x="buyer_pays_up_to");const A=typeof l.category=="object"?((a=l.category)==null?void 0:a._id)||((d=l.category)==null?void 0:d.id)||"":l.category||"",F=Z.some(O=>O._id===A);console.log("ð Category exists in list?",F),setTimeout(()=>{t.setValue("title",l.title||""),t.setValue("scheduledAt",j),t.setValue("category",A),console.log('ð After setValue, form.getValues("category"):',t.getValues("category")),t.setValue("description",l.description||""),t.setValue("freePickup",!!m.freePickupEnabled),t.setValue("uspsPriorityMail",!!m.priorityMail
1Enabled),t.setValue("uspsGroundAdvantage",!!m.groundAdvantageEnabled),t.setValue("shippingProfile",m.shippingProfile||""),t.setValue("shippingCoverage",x),t.setValue("maxBuyerPays",m.reducedShippingCapAmount?String(m.reducedShippingCapAmount):""),t.setValue("roomType",l.roomType||"public"),t.setValue("explicitContent",l.explicit_content||!1),t.setValue("repeatShow",l.repeat||"none"),t.setValue("repeatCount",l.repeat_count?String(l.repeat_count):""),l.thumbnail&&(t.setValue("thumbnail",l.thumbnail),M(l.thumbnail)),l.preview_videos&&(t.setValue("preview_videos",l.preview_videos),D(l.preview_videos)),console.log("â
Form values set with category:",A)},100)}},[l,C,t,L,K,Z,T]);const ce=async s=>{var d;const a=(d=s.target.files)==null?void 0:d[0];if(a)try{W(!0);const n=new FileReader;n.onloadend=()=>{M(n.result)},n.readAsDataURL(a);const u=v||`show_${Date.now()}`,j=await Pe(a,u);t.setValue("thumbnail",j),console.log("ð¸ Image uploaded:",j),b({title:"Image Uploaded",description:"Thumbnail uploaded successfully!"})}catch{console.error("Error uploading image"),b({title:"Upload Failed",description:"Failed to upload image. Please try again.",variant:"destructive"}),M(null),t.setValue("thumbnail","")}finally{W(!1)}}
1,pe=()=>{M(null),t.setValue("thumbnail","")},ue=async s=>{var d;const a=(d=s.target.files)==null?void 0:d[0];if(a)try{X(!0);const n=new FileReader;n.onloadend=()=>{D(n.result)},n.readAsDataURL(a);const u=v||`show_${Date.now()}`,j=await ke(a,u);t.setValue("preview_videos",j),console.log("ð¥ Video uploaded:",j),b({title:"Video Uploaded",description:"Preview video uploaded successfully!"})}catch{console.error("Error uploading video"),b({title:"Upload Failed",description:"Failed to upload video. Please try again.",variant:"destructive"}),D(null),t.setValue("preview_videos","")}finally{X(!1)}},he=()=>{D(null),t.setValue("preview_videos","")},me=async s=>{try{if(!(p!=null&&p.id)){b({title:"Authentication Required",description:"Please log in to schedule a show.",variant:"destructive"});return}const d=new Date(s.scheduledAt).getTime(),n=s.maxBuyerPays?parseFloat(s.maxBuyerPays):0;let u=s.shippingCoverage;n>0&&(u="buyer_pays_up_to");const j={priorityMailEnabled:s.uspsPriorityMail,groundAdvantageEnabled:s.uspsGroundAdvantage,shippingCostMode:u,reducedShippingCapAmount:n,buyer_pays:u==="buyer_pays_all"||u==="buyer_pays_up_to",seller_pays:u==="seller_pays_all",freePickupEnabled:s.freePickup,shippingProfile:s.shippingProfile||null},m={title:s.title,roomType:s.roomType,userId:p.id,category:s.category,activeTime:Date.now(),status:!0,repeat:s.repeatShow,repeat_count:s.repeatCount?parseInt(s.repeatCount):0,date:d,shipping_settings:j,explicit_content:s.explicitContent,description:s.description||"",thumbnail:s.thumbnail||"",preview_videos:s.preview_videos||""};if(C&&v){const x=await U(`/api/rooms/${v}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(!x.ok){const F=await x.json();throw new Error(F.error||"Failed to update show")}const A=await x.json();await se.invalidateQueries({queryKey:["/api/rooms"]}),b({title:"Show Updated Successfully",description:`Your show "${s.title}" has been updated.`})}else{const x=await U("/api/rooms",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)});if(!x.ok){const F=await x.json();throw new Error(F.error||"Failed to create show")}const A=await x.json();await se.invalidateQueries({queryKey:["/api/rooms"]}),b({title:"Show Scheduled Successfully",description:`Your show "${s.title}" has been scheduled.`})}q("/live-shows")}catch(a){console.error("Error creating show"),b({title:"Failed to Schedule Show",description:a instanceof Error?a.message:"An error occurred",variant:"destructive"})}},xe=t.watch("shippingCoverage"),ge=t.watch("repeatShow"),je=T||[];return e.jsxs("div",{className:"h-full flex flex-col bg-background",children:[e.jsx("div",{className:"border-b border-border bg-background px-4 sm:px-6 py-3 sm:py-4",children:e.jsxs("div",{className:"flex items-center gap-2 sm:gap-4",children:[e.jsx(E,{variant:"ghost",size:"icon",onClick:()=>q("/live-shows"),"data-testid":"button-back",children:e.jsx(Ve,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl sm:text-2xl font-bold text-foreground","data-testid":"text-schedule-show-title",children:C?"Edit Show":"Schedule a Show"}),e.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground",children:C?"Update your show details and settings":"Set up your live selling show with shipping and content settings"})]})]})}),e.jsx("div",{className:"flex-1 overflow-auto px-4 sm:px-6 py-4 sm:py-6",children:e.jsx("div",{className:"w-full max-w-6xl mx-auto",children:e.jsx(Se,{...t,children:e.jsxs("form",{onSubmit:t.handleSubmit(me),className:"space-y-6",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(c,{control:t.control,name:"title",render:({field:s})=>e.jsxs(r,{children:[e.jsx(o,{children:"Show Title *"}),e.jsx(i,{children:e.jsx(P,{placeholder:"e.g., $100 in giveaways. $1 pre-loved Lululemon",...s,"data-testid":"input-show-title"})}),e.jsx(_,{children:"Make it descriptive to tell viewers what you're selling"}),e.jsx(g,{})]})}),e.jsx(c,{control:t.control,name:"scheduledAt",render:({field:s})=>e.jsxs(r,{children:[e.jsx(o,{children:"Date & Time *"}),e.jsx(i,{children:e.jsx(P,{type:"datetime-local",...s,"data-testid":"input-scheduled-at"})}),e.jsx(_,{children:"Schedule 1 week in advance for maximum bookmarks"}),e.jsx(g,{})]})}),e.jsx(c,{control:t.control,name:"category",render:({field:s})=>(console.log("ð¯ Category field.value:",s.value),e.jsxs(r,{children:[e.jsx(o,{children:"Category *"}),e.jsxs(te,{onValueChange:s.onChange,value:s.value,children:[e.jsx(i,{children:e.jsx(ae,{"data-testid":"select-category",children:e.jsx(re,{placeholder:L?"Loading c
1ategories...":"Select a category"})})}),e.jsx(ie,{children:L?e.jsx(V,{value:"loading",disabled:!0,children:"Loading..."}):h!=null&&h.categories&&h.categories.length>0?e.jsx(e.Fragment,{children:h.categories.map(a=>[e.jsx(V,{value:a._id||a.id,className:"font-semibold",children:a.name},a._id||a.id),...a.subCategories&&a.subCategories.length>0?a.subCategories.map(d=>e.jsxs(V,{value:d._id||d.id,className:"pl-6",children:["â³ ",d.name]},d._id||d.id)):[]])}):e.jsx(V,{value:"none",disabled:!0,children:"No categories available"})})]}),e.jsx(_,{children:"Helps buyers discover your show"}),e.jsx(g,{})]}))})]}),e.jsx("div",{className:"space-y-3",children:e.jsx(c,{control:t.control,name:"description",render:({field:s})=>e.jsxs(r,{children:[e.jsx(o,{children:"Description"}),e.jsx(i,{children:e.jsx(_e,{placeholder:"Add more details about what you'll be selling...",...s,className:"min-h-[120px]","data-testid":"textarea-description"})}),e.jsx(g,{})]})})}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{className:"text-sm font-medium",children:"Thumbnail/Cover Photo"}),e.jsx(c,{control:t.control,name:"thumbnail",render:({field:s})=>e.jsxs(r,{children:[e.jsx(i,{children:e.jsx("div",{className:"space-y-4",children:H?e.jsxs("div",{className:"relative w-full max-w-[160px]",children:[e.jsx("img",{src:H,alt:"Thumbnail preview",className:"w-full aspect-[9/16] object-cover rounded-lg border border-border"}),e.jsx(E,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-7 w-7",onClick:pe,"data-testid":"button-remove-thumbnail",children:e.jsx(ee,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:"border-2 border-dashed border-border rounded-lg p-6 text-center",children:[e.jsx(Te,{className:"h-10 w-10 text-muted-foreground mx-auto mb-2"}),e.jsx(k,{htmlFor:"thumbnail-upload",className:`cursor-pointer text-sm text-primary hover:underline ${N?"opacity-50 pointer-events-none":""}`,children:N?"Uploading...":"Upload"}),e.jsx(P,{id:"thumbnail-upload",type:"file",accept:"image/*,video/*",onChange:ce,className:"hidden","data-testid":"input-thumbnail",disabled:N}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"1080x1920px (9:16)"})]})})}),e.jsx(g,{})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{className:"text-sm font-medium",children:"Preview Video"}),e.jsx(c,{control:t.control,name:"preview_videos",render:({field:s})=>e.jsxs(r,{children:[e.jsx(i,{children:e.jsx("div",{className:"space-y-4",children:J?e.jsxs("div",{className:"relative w-full max-w-[160px]",children:[e.jsx("video",{src:J,className:"w-full aspect-[9/16] object-cover rounded-lg border border-border",controls:!0}),e.jsx(E,{type:"button",variant:"destructive",size:"icon",className:"absolute top-2 right-2 h-7 w-7",onClick:he,"data-testid":"button-remove-video",children:e.jsx(ee,{className:"h-4 w-4"})})]}):e.jsxs("div",{className:"border-2 border-dashed border-border rounded-lg p-6 text-center",children:[e.jsx(Ae,{className:"h-10 w-10 text-muted-foreground mx-auto mb-2"}),e.jsx(k,{htmlFor:"video-upload",className:`cursor-pointer text-sm text-primary hover:underline ${S?"opacity-50 pointer-events-none":""}`,children:S?"Uploading...":"Upload"}),e.jsx(P,{id:"video-upload",type:"file",accept:"video/*",onChange:ue,className:"hidden","data-testid":"input-video",disabled:S}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"MP4, MOV, or other video formats"})]})})}),e.jsx(g,{})]})})]})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(c,{control:t.control,name:"shippingProfile",render:({field:s})=>e.jsxs(r,{children:[e.jsx(o,{children:"Shipping Profile"}),e.jsxs(te,{onValueChange:s.onChange,value:s.value,disabled:K,"data-testid":"select-shipping-profile",children:[e.jsx(i,{children:e.jsx(ae,{children:e.jsx(re,{placeholder:"Select shipping profile"})})}),e.jsxs(ie,{position:"popper",children:[e.jsx(V,{value:"skip",children:"No Shipping Profile"}),je.map(a=>e.jsx(V,{value:a._id,children:a.name},a._id))]})]}),e.jsx(g,{})]})}),e.jsx(c,{control:t.control,name:"freePickup",render:({field:s})=>e.jsxs(r,{className:"flex flex-row items-center justify-between rounded-lg border border-border p-4",children:[e.jsx("div",{className:"space-y-0.5",children:e.jsx(o,{className:"text-base",children:"Free pickup"})}),e.jsx(i,{children:e.jsx(I,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"switch-free-pickup"})})]})}),e.jsxs("div",{className:"rounded-lg border border-border",children:[e.jsxs("button",{type:"button",onClick:()=>ne(!B),className:"w-full flex items-center justify-between p-4 hover:bg-muted/50 transition-colors","data-testid":"button-domestic-shipments",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-semibold text-sm",children:"Domestic Shipments"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"All orders falling outside of your shipping preferences will default to USPS Ground Advantage. Eligible sellers will default to Media Mail shipping."})]}),B?e.jsx(oe,{className:"h-5 w-5 text-muted-foreground flex-shrink-0 ml-2"}):e.jsx(le,{className:"h-5 w-5 text-muted-foreground flex-shrink-0 ml-2"})]}),B&&e.jsxs("div",{className:"p-4 pt-0 border-t border-border space-y-3",children:[e.jsx(c,{control:t.control,name:"uspsPriorityMail",render:({field:s})=>e.jsxs(r,{className:"flex flex-row items-center justify-between rounded-lg border border-border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(o,{className:"text-base font-semibold",children:"USPS Priority Mail"}),e.jsx(_,{className:"text-xs",children:"Arrives in 1-3 business days. Best for time-sensitive shipments."})]}),e.jsx(i,{children:e.jsx(I,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"switch-usps-priority"})})]})}),e.jsx(c,{control:t.control,name:"uspsGroundAdvantage",render:({field:s})=>e.jsxs(r,{className:"flex flex-row items-center justify-between rounded-lg border border-border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(o,{className:"text-base font-semibold",children:"USPS Ground Advantage"}),e.jsx(_,{className:"text-xs",children:"Best for shipping heavier items that aren't time-sensitive."})]}),e.jsx(i,{children:e.jsx(I,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"switch-usps-ground"})})]})})]})]}),e.jsxs("div",{className:"rounded-lg border border-border",children:[e.jsxs("button",{type:"button",onClick:()=>de(!R),className:"w-full flex items-center justify-between p-4 hover:bg-muted/50 transition-colors","data-testid":"button-shipping-costs",children:[e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"font-semibold text-sm",children:"Shipping Costs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Costs calculated based on buyer's location and shipment weight. Only applies to shipments within the contiguous U.S."})]}),R?e.jsx(oe,{className:"h-5 w-5 text-muted-foreground flex-shrink-0 ml-2"}):e.jsx(le,{className:"h-5 w-5 text-muted-foreground flex-shrink-0 ml-2"})]}),R&&e.jsx("div",{className:"p-4 pt-0 border-t border-border",children:e.jsx(c,{control:t.control,name:"shippingCoverage",render:({field:s})=>e.jsxs(r,{className:"space-y-3",children:[e.jsx(i,{children:e.jsxs(Y,{onValueChange:s.onChange,defaultValue:s.value,className:"flex flex-col space-y-3",children:[e.jsx(r,{className:"flex flex-col space-y-2 rounded-lg border border-border p-3",children:e.jsxs("div",{className:"flex items-start space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"seller_pays_all","data-testid":"radio-seller-pays-all",className:"mt-1"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(o,{className:"font-semibold cursor-pointer",children:"Seller pays all shipping costs"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"This only applies to domestic orders. Buyers have to pay for shipping on international orders."})]})]})}),e.jsxs(r,{className:"flex flex-col space-y-2 rounded-lg border border-border p-3",children:[e.jsxs("div",{className:"flex items-start space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"buyer_pays_up_to","data-testid":"radio-buyer-pays-up-to",className:"mt-1"})}),e.jsxs("div",{className:"flex-1",children:[e.jsx(o,{className:"font-semibold cursor-pointer",children:"Buyer pays up to a set shipping cost"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Set a maximum shipping cost buyers will pay for unlimited orders within your show."})]})]}),xe==="buyer_pays_up_to"&&e.jsx("div",{className:"ml-9 mt-2",children:e.jsx(c,{control:t.control,name:"maxBuyerPays",render:({field:a})=>e.jsxs(r,{children:[e.jsx(o,{className:"text-sm",children:"Amount"}),e.jsx(i,{children:e.jsx(P,{type:"number",step:"0.01",placeholder:"e.g., 9.21",...a,"data-testid":"input-max-buyer-pays",className:"max-w-[200px]"})}),e.jsx(g,{})]})})})]}),e.jsx(r,{className:"flex flex-col space-y-2 rounded-lg border border-border p-3",children:e.jsxs("div",{className:"flex items-start space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"buyer_pays_all","data-testid":"radio-buyer-pays-all",className:"mt-1"})}),e.jsx("div",{className:"flex-1",children:e.jsx(o,{className:"font-semibold cursor-pointer",children:"Buyer pays all shipping costs"})})]})})]})}),e.jsx(g,{})]})})})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{className:"text-sm font-medium",children:"Content Settings"}),e.jsx(c,{control:t.control,name:"roomType",render:({field:s})=>e.jsxs(r,{className:"space-y-2",children:[e.jsx(o,{className:"text-sm",children:"Room Type *"}),e.jsx(i,{children:e.jsxs(Y,{onValueChange:s.onChange,value:s.value,className:"flex flex-col space-y-2",children:[e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"public","data-testid":"radio-public"})}),e.jsx(o,{className:"font-normal cursor-pointer text-sm",children:"Public - Visible to everyone"})]}),e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"private","data-testid":"radio-private"})}),e.jsx(o,{className:"font-normal cursor-pointer text-sm",children:"Private - Share link only"})]})]})}),e.jsx(g,{})]})}),e.jsx(c,{control:t.control,name:"explicitContent",render:({field:s})=>e.jsxs(r,{className:"flex flex-row items-center justify-between rounded-lg border border-border p-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(o,{className:"text-sm",children:"Explicit Content"}),e.jsx(_,{className:"text-xs",children:"Enable this if your stream includes age-restricted (18+) or mature artwork, or if strong language will be used"})]}),e.jsx(i,{children:e.jsx(I,{checked:s.value,onCheckedChange:s.onChange,"data-testid":"switch-explicit-content"})})]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(k,{className:"text-sm font-medium",children:"Repeat Settings"}),e.jsx(c,{control:t.control,name:"repeatShow",render:({field:s})=>e.jsxs(r,{className:"space-y-2",children:[e.jsx(o,{className:"text-sm",children:"Repeat Frequency *"}),e.jsx(i,{children:e.jsxs(Y,{onValueChange:s.onChange,defaultValue:s.value,className:"flex flex-col space-y-1",children:[e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"none","data-testid":"radio-none"})}),e.jsx(o,{className:"font-normal cursor-pointer text-sm",children:"No repeat (one-time show)"})]}),e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"daily","data-testid":"radio-daily"})}),e.jsx(o,{className:"font-normal cursor-pointer text-sm",children:"Daily"})]}),e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"weekly","data-testid":"radio-weekly"})}),e.jsx(o,{className:"font-normal cursor-pointer text-sm",children:"Weekly"})]}),e.jsxs(r,{className:"flex items-center space-x-3 space-y-0",children:[e.jsx(i,{children:e.jsx(f,{value:"monthly","data-testid":"radio-monthly"})}),e.jsx(o,{className:"font-normal cursor-pointer text-sm",children:"Monthly"})]})]})}),e.jsx(g,{})]})}),ge!=="none"&&e.jsx(c,{control:t.control,name:"repeatCount",render:({field:s})=>e.jsxs(r,{children:[e.jsx(o,{className:"text-sm",children:"Number of Occurrences"}),e.jsx(i,{children:e.jsx(P,{type:"number",min:"1",placeholder:"e.g., 5",...s,"data-testid":"input-repeat-count",className:"max-w-[200px]"})}),e.jsx(_,{className:"text-xs",children:"Leave blank for unlimited"}),e.jsx(g,{})]})})]})]})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-3 sm:justify-end pt-4 border-t border-border",children:[e.jsx(E,{type:"button",variant:"outline",onClick:()=>q("/live-shows"),"data-testid":"button-cancel",disabled:N||S,children:"Cancel"}),e.jsxs(E,{type:"submit",disabled:G||N||S,"data-testid":"button-submit",children:[(N||S||G)&&e.jsx(ve,{className:"h-4 w-4 mr-2 animate-spin"}),N||S?"Uploading...":C?"Update Show":G?"Scheduling...":"Schedule Show"]})]})]})})})})]})}export{Je 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.