PageSourceSearch

https://flightsim.to/assets/NewUploadPage-BMoHpNaK.js

js flightsim.to collected 2026-10-01 10:19:59 UTC 50,655 bytes, 27 lines download raw bytes

1import{c as K,j as e,D as st,f as tt,t as le,g as ne,$ as T,v as ie,y as $e,B as m,w as oe,h as at,n as sa,a8 as ta,ac as aa,r as l,aO as ra,ad as te,i as y,Y as A,N as M,a4 as Ts,R as Ps,H as la,a2 as Ee,ah as na,b0 as $s,dg as Rs,z as ia,V as oa,b4 as Te,W as v,d as E,aR as k,as as Re,Z as Us,X as ae,x as Ks,cW as P,cX as $,cY as R,aQ as Bs,aj as ca,aq as da,bs as Hs,d5 as ma,ar as ua,b2 as ha,ax as xa,al as pa,b$ as ga,c0 as fa,Q as z}from"./index-BUR_l9d0.js";import{u as ja,b as re,U as ya,D as va,C as Ue}from"./useChunkedUpload-Bl760iAb.js";import{C as ba}from"./calendar-CCwiRygs.js";import{S as Na,a as _a,b as wa,c as ka,d as Pe}from"./select-B7hLupPU.js";import{C as de,a as me,b as ue,c as he,d as U,e as Ke}from"./command-Biq9FvDv.js";import Ca from"./BasicHtmlEditor-CJiq4Xjc.js";import{C as Sa}from"./CollectionModal-CConsxw4.js";import{u as Da,c as Fa,d as Aa,a as Ia}from"./useCategories-BeO0ZWdz.js";import{g as Ma}from"./useCollections-Bb_mAeQX.js";import{C as qs}from"./circle-alert-CUwKabO8.js";import{searchDependencies as Oa}from"./moreTabApi-CnhEVbZy.js";import{A as Vs}from"./ArticleModal-DfLB0EiX.js";import{C as Ys}from"./calendar-clock-CXGENipu.js";import{S as Xs}from"./shield-ChckRLwm.js";import{M as La}from"./mouse-pointer-click-CYY-PZFv.js";import{B as za}from"./ban-EgjSDx-N.js";import{P as Ea}from"./pause-DswLVMhD.js";import{P as Ta}from"./play-D6OT02J9.js";import{P as Zs}from"./plus-JPnTyDXo.js";import{C as Pa}from"./circle-help-CtDLl6Ix.js";import{F as Ws}from"./folder-plus-SbwataL-.js";import{L as Gs}from"./link-2-BEbq4Sq5.js";import{I as Js}from"./image-plus-A8zaXqkY.js";import{Y as $a}from"./youtube-BW00j5b2.js";import"./myUploadsApi-CMavfcRg.js";import"./addMonths-DydxCsTQ.js";import"./index-BAkSLD1T.js";import"./YoutubeNode-BinUHndW.js";import"./separator-DMzUUELV.js";import"./forumsApi-CUuRvBCA.js";import"./types-DXPrN7FL.js";import"./list-BeYbbxeC.js";import"./link-BhXY5Cr0.js";import"./minus-4CiSas3o.js";import"./code-xml-FNXQWRqw.js";import"./checkbox-DczHt24I.js";import"./useArticleDetail-gx6wKVeO.js";import"./supportApi-BT1qrbYP.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ra=K("BookX",[["path",{d:"m14.5 7-5 5",key:"dy991v"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"m9.5 7 5 5",key:"s45iea"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Ua=K("FileArchive",[["path",{d:"M10 12v-1",key:"v7bkov"}],["path",{d:"M10 18v-2",key:"1cjy8d"}],["path",{d:"M10 7V6",key:"dljcrl"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v16a2 2 0 0 0 .274 1.01",key:"gkbcor"}],["circle",{cx:"10",cy:"20",r:"2",key:"1xzdoj"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const Qs=K("FilePenLine",[["path",{d:"m18 5-2.414-2.414A2 2 0 0 0 14.172 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2",key:"142zxg"}],["path",{d:"M21.378 12.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"2t3380"}],["path",{d:"M8 18h1",key:"13wk12"}]]);/**
17 * @license lucide-react v0.462.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */const ce=K("FileUp",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
22 * @license lucide-react v0.462.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */const et=K("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);function b({icon:t,title:n,description:d,action:c}){return e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"text-lg font-semibold text-foreground flex items-center gap-2",children:[e.jsx(t,{className:"h-[18px] w-[18px] text-primary shrink-0"}),e.jsx("span",{className:"truncate",children:n})]}),d&&e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:d})]}),c&&e.jsx("div",{className:"shrink-0",children:c})]})}const Be="https://flightsim.to";async function Ka(t){const n=await fetch(`${Be}/backend/user/uploads/create`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),d=await n.json();if(!n.ok||!d.success){let c=d.message||d.error||`Upload failed (${n.status})`;
26if(d.errors){const u=Object.values(d.errors).flat().join(" ");u&&(c=`${c} ${u}`)}throw new Error(c)}return d}async function Ba(t){const n=await fetch(`${Be}/backend/user/uploads/ai-check`,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),d=await n.json().catch(()=>({}));if(!n.ok){const c=d.error||d.message||`AI check failed (${n.status})`;throw new Error(c)}return{pass:!!d.pass,reason:typeof d.reason=="string"?d.reason:void 0}}async function Ha(t,n){const d=new FormData;d.append("file_id",String(t)),d.append("image",n);const c=await fetch(`${Be}/backend/user/uploads/add-image`,{method:"POST",credentials:"include",body:d}),u=await c.json();if(!c.ok||!u.success)throw new Error(u.message||"Image upload failed");return u.data}function qa({open:t,state:n,reason:d,errorMessage:c,onEdit:u,onSubmitAnyway:h}){const g=n==="analyzing";return e.jsx(st,{open:t,onOpenChange:()=>{},children:e.jsxs(tt,{className:"sm:max-w-md [&>button]:hidden",onInteractOutside:i=>i.preventDefault(),onEscapeKeyDown:i=>i.preventDefault(),children:[g&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsxs(ne,{className:"flex items-center gap-2",children:[e.jsx(T,{className:"h-5 w-5 animate-spin text-primary"}),"Analyzing Upload…"]}),e.jsx(ie,{children:"Our AI is reviewing your submission for compliance with the platform guidelines. This usually takes a few seconds."})]}),e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(T,{className:"h-10 w-10 animate-spin text-primary"})})]}),n==="failed"&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsxs(ne,{className:"flex items-center gap-2 text-destructive",children:[e.jsx(qs,{className:"h-5 w-5"}),"Issue Detected"]}),e.jsx(ie,{children:"Our AI found a potential issue with your submission. You can edit your form and try again, or submit anyway for manual moderation. Manual moderation may take up to 48 hours."})]}),d&&e.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 text-sm text-foreground whitespace-pre-wrap",children:d}),e.jsxs($e,{className:"gap-2 sm:gap-2",children:[e.jsx(m,{variant:"secondary",onClick:u,children:"Edit Form"}),e.jsxs(m,{variant:"destructive",onClick:h,className:"gap-2",children:[e.jsx(oe,{className:"h-4 w-4"}),"Submit Anyway"]})]})]}),n==="error"&&e.jsxs(e.Fragment,{children:[e.jsxs(le,{children:[e.jsxs(ne,{className:"flex items-center gap-2",children:[e.jsx(qs,{className:"h-5 w-5 text-muted-foreground"}),"Pre-check Unavailable"]}),e.jsxs(ie,{children:[c||"We couldn't run the AI pre-check right now."," You can cancel and try again, or proceed with the upload — it will go through standard moderation."]})]}),e.jsxs($e,{className:"gap-2 sm:gap-2",children:[e.jsx(m,{variant:"secondary",onClick:u,children:"Cancel"}),e.jsx(m,{onClick:h,children:"Submit Anyway"})]})]})]})})}function Va({onFileDrop:t,onClick:n,children:d}){const{t:c}=at("newUpload"),[u,h]=l.useState(!1);return e.jsxs("div",{onDragOver:g=>{g.preventDefault(),h(!0)},onDragEnter:g=>{g.preventDefault(),h(!0)},onDragLeave:()=>h(!1),onDrop:g=>{h(!1),t(g)},onClick:n,className:`group relative flex flex-col items-center justify-center gap-3 rounded-xl border-2 border-dashed px-6 py-10 text-center transition-all cursor-pointer ${u?"border-primary bg-primary/10 scale-[1.01]":"border-border bg-muted/40 hover:border-primary/60 hover:bg-primary/5"}`,children:[e.jsx("div",{className:`flex h-12 w-12 items-center justify-center rounded-full transition-colors ${u?"bg-primary text-primary-foreground":"bg-primary/10 text-primary group-hover:bg-primary/15"}`,children:e.jsx(ce,{className:"h-6 w-6"})}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx("p",{className:`text-sm font-medium transition-colors ${u?"text-primary":"text-foreground"}`,children:c("drag_drop_or_click")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:c("zip_rar")})]}),d]})}const Ya=({categories:t,value:n,onChange:d,t:c})=>{const[u,h]=l.useState(!1),g=l.useMemo(()=>{var i;if(!t||!n)return"";for(const f of t){const p=(i=f.subcategories)==null?void 0:i.find(B=>B.slug===n);if(p)return p.simulator?`${p.simulator} 🔹 ${p.name}`:`🔹 ${p.name}`}return n},[t,n]);return e.jsxs("div",{children:[e.jsx(v,{children:c("category_label")}),e.jsxs(P,{open:u,onOpenChange:h,children:[e.jsx($,{asChild:!0,children:e.jsxs(m,{variant:"outline",role:"combobox","aria-expanded":u,className:"mt-1 w-full justify-between font-normal h-10",children:[e.jsx("span",{className:"truncate",children:g||c("select_category")}),e.jsx(Ue,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(R,{className:"w-[--radix-popover-trigger-width] p-0 z-50 bg-popover",align:"start",children:e.jsxs(de,{children:[e.jsx(Ke,{placeholder:c("search_categories")}),e.jsxs(me,{children:[e.jsx(ue,{children:c("no_category")}),t==null?void 0:t.slice().sort((i,f)=>i.slug==="liveries"?-1:f.slug==="liveries"?1:0).map(i=>{var f;return e.jsx(he,{heading:i.name,children:(f=i.subcategories)==null?void 0:f.map(p=>e.jsxs(U,{value:`${p.simulator} ${p.name} ${i.name}`,onSelect:()=>{d(p.slug),h(!1)},children:[e.jsx(A,{className:`mr-2 h-4 w-4 ${n===p.slug?"opacity-100":"opacity-0"}`}),p.simulator," 🔹 ",p.name]},p.id))},i.id)})]})]})})]})]})},Xa=({affiliations:t,value:n,onChange:d,t:c})=>{const[u,h]=l.useState(!1),g=l.useMemo(()=>
26{if(!t||!n)return"";const i=t.find(p=>p.name===n);if(!i)return n;const f=i.msfs2020&&i.msfs2024?"MSFS 2020/24":i.msfs2024?"MSFS 2024":i.msfs2020?"MSFS 2020":"";return f?`${f} 🔹 ${i.name}`:i.name},[t,n]);return e.jsxs("div",{children:[e.jsx(v,{children:c("affiliation_label")}),e.jsxs(P,{open:u,onOpenChange:h,children:[e.jsx($,{asChild:!0,children:e.jsxs(m,{variant:"outline",role:"combobox","aria-expanded":u,className:"mt-1 w-full justify-between font-normal h-10",children:[e.jsx("span",{className:"truncate",children:g||c("select_affiliation")}),e.jsx(Ue,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(R,{className:"w-[--radix-popover-trigger-width] p-0 z-50 bg-popover",align:"start",children:e.jsxs(de,{children:[e.jsx(Ke,{placeholder:c("search_affiliations")}),e.jsxs(me,{children:[e.jsx(ue,{children:c("no_affiliation")}),e.jsxs(he,{children:[e.jsxs(U,{value:"none clear no affiliation",onSelect:()=>{d(""),h(!1)},children:[e.jsx(A,{className:`mr-2 h-4 w-4 ${n?"opacity-0":"opacity-100"}`}),e.jsx("span",{className:"text-muted-foreground",children:c("affiliation_none")})]}),t==null?void 0:t.map(i=>{const f=i.msfs2020&&i.msfs2024?"MSFS 2020/24":i.msfs2024?"MSFS 2024":i.msfs2020?"MSFS 2020":"";return e.jsxs(U,{value:`${i.name} ${i.keywords} ${f}`,onSelect:()=>{d(i.name),h(!1)},children:[e.jsx(A,{className:`mr-2 h-4 w-4 ${n===i.name?"opacity-100":"opacity-0"}`}),f&&e.jsxs("span",{className:"text-muted-foreground mr-1",children:[f," 🔹"]}),i.name]},i.id)})]})]})]})})]})]})},Za=({countries:t,value:n,onChange:d,t:c})=>{const[u,h]=l.useState(!1),g=l.useMemo(()=>{var i;return!t||!n?"":((i=t.find(f=>f.code===n))==null?void 0:i.label)??n},[t,n]);return e.jsxs("div",{children:[e.jsx(v,{children:c("country_label")}),e.jsxs(P,{open:u,onOpenChange:h,children:[e.jsx($,{asChild:!0,children:e.jsxs(m,{variant:"outline",role:"combobox","aria-expanded":u,className:"mt-1 w-full justify-between font-normal h-10",children:[e.jsx("span",{className:"truncate",children:g||c("select_country")}),e.jsx(Ue,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(R,{className:"w-[--radix-popover-trigger-width] p-0 z-50 bg-popover",align:"start",children:e.jsxs(de,{children:[e.jsx(Ke,{placeholder:c("search_countries")}),e.jsxs(me,{children:[e.jsx(ue,{children:c("no_country")}),e.jsx(he,{children:t==null?void 0:t.map(i=>e.jsxs(U,{value:`${i.label} ${i.code}`,onSelect:()=>{d(i.code),h(!1)},children:[e.jsx(A,{className:`mr-2 h-4 w-4 ${n===i.code?"opacity-100":"opacity-0"}`}),i.label]},i.code))})]})]})})]})]})},Wa=({image:t,index:n,total:d,onRemove:c,onMoveUp:u,onMoveDown:h,mainLabel:g})=>e.jsxs("div",{className:"relative group rounded-lg overflow-hidden border border-border bg-muted/30",children:[e.jsx("img",{src:t.previewUrl,alt:t.file.name,className:"w-full aspect-video object-cover"}),n===0&&e.jsx(E,{className:"absolute top-2 left-2 text-xs",children:g}),e.jsxs("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-1",children:[e.jsx(m,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white",onClick:u,disabled:n===0,children:e.jsx(ga,{className:"h-4 w-4"})}),e.jsx(m,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white",onClick:h,disabled:n===d-1,children:e.jsx(fa,{className:"h-4 w-4"})}),e.jsx(m,{variant:"ghost",size:"icon",className:"h-7 w-7 text-white hover:text-destructive",onClick:c,children:e.jsx(Re,{className:"h-4 w-4"})})]})]}),Tr=()=>{var Es;const{t}=at("newUpload"),{user:n,isAuthenticated:d,isLoading:c}=sa(),u=ta(),{data:h,isLoading:g}=ja();aa({title:t("page_title"),description:t("page_desc")}),l.useEffect(()=>{!c&&!d&&u("/login",{replace:!0})},[c,d,u]),l.useEffect(()=>{n!=null&&n.username&&!p&&B(n.username)},[n]);const[i,f]=l.useState(""),[p,B]=l.useState(""),[Ga,Ja]=l.useState(""),[H,He]=l.useState(""),[N,rt]=l.useState(""),[qe,Ve]=l.useState(""),[Ye,lt]=l.useState(""),[Xe,nt]=l.useState(""),[q,Ze]=l.useState(""),[it,V]=l.useState(!1),[We,ot]=l.useState(""),[xe,ct]=l.useState(""),[Ge,dt]=l.useState("1.0"),[pe,Je]=l.useState([]),[Qe,es]=l.useState(""),[ss,mt]=l.useState(""),[ts,ut]=l.useState(!0),[ge,as]=l.useState(!1),[ht,fe]=l.useState(!1),[rs,xt]=l.useState(!0),[ls,pt]=l.useState(!1),[_,je]=l.useState([]),[ye,ns]=l.useState(!1),[is,Y]=l.useState(!1),[gt,ve]=l.useState("analyzing"),[ft,os]=l.useState(void 0),[jt,cs]=l.useState(void 0),X=l.useRef(null),[S,yt]=l.useState(null),[vt,ds]=l.useState(!1),[bt,Nt]=l.useState(0),[D,ms]=l.useState(void 0),[be,_t]=l.useState("12:00"),[wt,us]=l.useState(!1),[kt,Ct]=l.useState(!1),[St,hs]=l.useState(!1),[xs,ps]=l.useState(null),[gs,Dt]=l.useState(!1),[O,Ft]=l.useState([]),[At,fs]=l.useState(!1),[Z,Ne]=l.useState([]),[W,_e]=l.useState(""),we=ra(W,300),[js,ke]=l.useState([]),[It,ys]=l.useState(!1),[Mt,G]=l.useState(!1);l.useEffect(()=>{if(we.length<2){ke([]);return}let s=!1;return ys(!0),Oa(we).then(a=>{s||ke(a)}).catch(()=>{s||ke([])}).finally(()=>{s||ys(!1)}),()=>{s=!0}},[we]);const Ce=l.useRef(null);l.useRef(null);const{data:F}=Da(),{data:Se}=Fa(),{data:Ot}=Aa(),{data:De}=Ia(),vs=re(0),bs=re(0),Ns=re(0),_s=re(0),j=l.useMemo(()=>[vs,bs,Ns,_s],[vs,bs,Ns,_s]),[ws,Lt]=l.useState([t("main_download"),"","",""]),[I,ks]=l.useState(1),Cs=[l.useRef(null),l.useRef(null),l.useRef(null),l.useRef(null)],L=l.useRef(0),[zt,Fe]=l.useState(!1);l.useEffect(()=>{const s=x=>{var w;return Array.from(((w=x.dataTransfer)==null?void 0:w.types)??[]).includes("Files")},a=x=>{s(x)&&(L.current+=1,Fe(!0))},r=()=>{L.current=Math.max(0,L.current-1),L.current===0&&Fe(!1)},o=()=>{L.current=0,Fe(!1)};return window.addEventListener("dragenter",a),window.addEventListener("dragleave",r),window.addEventListener("drop",o),window.addEventListener("dragend",o),()=>{window.removeEventListener("dragenter",a),window.removeEventListener("dragleave",r),window.removeEventListener("drop",o),window.removeEventListener("dragend",o)}},[]);const Ae=l.useMemo(()=>{var s;if(!F||!N)return null;for(const a of F)if((s=a.subcategories)!=null&&s.some(r=>r.slug===N))return a.id;return null},[F,N]),Ie=Ae===2||Ae===10,Ss=Ae===1,Et=s=>{var a;if(rt(s),F&&Se)for(const r of F){const o=(a=r.subcategories)==null?void 0:a.find(x=>x.slug===s);if(o!=null&&o.affiliation_id){const x=Se.find(w=>w.id===o.affiliation_id);if(x){Ve(x.name);return}}}},Ds=()=>{const s=Qe.trim();s&&!pe.includes(s)&&(Je(a=>[...a,s]),es(""))},Tt=s=>Je(a=>a.filter(r=>r!==s)),[J,Me]=l.useState(!1),Fs=s=>{const a=s.filter(o=>o.type.startsWith("image/"));if(!a.length)return;const r=a.map(o=>({id:crypto.randomUUID(),file:o,previewUrl:URL.createObjectURL(o)}));je(o=>[...o,...r])},Pt=s=>{const a=Array.from(s.target.files||[]);Fs(a),s.target.value=""},As=s=>{s.preventDefault(),s.stopPropagation(),Me(!1);const a=Array.from(s.dataTransfer.files||[]);Fs(a)},Q=s=>{s.preventDefault(),s.stopPropagation(),J||Me(!0)},Is=s=>{s.preventDefault(),s.stopPropagation(),s.currentTarget===s.target&&Me(!1)},$t=s=>{je(a=>{const r=a.find(o=>o.id===s);return r&&URL.revokeObjectURL(r.previewUrl),a.filter(o=>o.id!==s)})},Ms=(s,a)=>{je(r=>{const o=[...r],x=s+a;return x<0||x>=o.length||([o[s],o[x]]=[o[x],o[s]]),o})},Rt=3.5*1024*1024*1024,Ut=[".zip",".rar"],Kt=/[^a-zA-Z0-9._\-() ]/,Oe=s=>{const a=s.name.substring(s.name.lastIndexOf(".")).toLowerCase(),r=s.name.substring(0,s.name.lastIndexOf("."));return Ut.includes(a)?Kt.test(r)?(z.error(t("invalid_filename")),!1):s.size>Rt?(z.error(t("file_exceeds_limit")),!1):!0:(z.error(t("only_zip_rar")),!1)},Bt=s=>a=>{var o;const r=(o=a.target.files)==null?void 0:o[0];r&&Oe(r)&&j[s].selectFile(r)},Ht=s=>a=>{a.preventDefault();const r=a.dataTransfer.files[0];r&&Oe(r)&&j[s].selectFile(r)},qt=s=>{if(s.defaultPrevented)return;s.preventDefault();const a=s.dataTransfer.files[0];if(!a)return;const r=j.findIndex(o=>o.status==="idle");r===-1||r>=I||Oe(a)&&j[r].selectFile(a)},Os=(s,a)=>{Lt(r=>{const o=[...r];return o[s]=a,o})},Ls=s=>{j[s].reset(),Os(s,""),s===I-1&&I>1&&ks(a=>a-1)},Vt=l.useMemo(()=>{for(let s=0;s<I;s++){const a=j[s];if(s===0){if(a.status!=="complete"||!a.filename)return!1}else if(a.status!=="idle"&&a.status!=="complete")return!1}return!0},[j,I]),Le=i.trim().length>0&&N.length>0&&_.length>0&&Vt&&!ye,Yt=l.useMemo(()=>{var s;if(!F||!N)return"";for(const a of F){const r=(s=a.subcategories)==null?void 0:s.find(o=>o.slug===N);if(r)return r.name}return N},[F,N]),ze=l.useMemo(()=>{var s;return[{label:t("summary_check_title","Title"),done:i.trim().length>0},{label:t("summary_check_category","Category"),done:N.length>0},{label:t("summary_check_description","Description"),done:H.trim().length>0},{label:t("summary_check_images","Screenshot"),done:_.length>0},{label:t("summary_check_file","Download file"),done:((s=j[0])==null?void 0:s.status)==="complete"}]},[t,i,N,H,_.length,j]),Xt=()=>{const s=[];for(let r=0;r<I;
26r++)j[r].status==="complete"&&j[r].filename&&s.push({filename:j[r].filename,title:ws[r]||(r===0?t("main_download"):t("file_n",{num:r+1})),size:ee(j[r].totalBytes)});let a=null;if(D){const[r,o]=be.split(":").map(Number),x=new Date(D);x.setUTCHours(r,o,0,0),a=x.toISOString()}return{title:i,author:p,description:H,category_slug:N,affiliation:qe,country:Ye,icao_code:Xe,airline:q,coordinates:We,simulator:xe,version:Ge,search_keywords:pe,youtube_link:ss,drag_and_drop:ts,auto_install:ge,donation_buttons:rs,comments_disabled:gs,fictional:ls,files:s,dependencies:Z.map(r=>({id:r.id,type:r.type})),scheduled_at:a}},zs=async s=>{var a,r,o,x,w;ns(!0);try{const C=await Ka(s);if((a=C.data)!=null&&a.file_id&&_.length>0)for(const se of _)try{await Ha(C.data.file_id,se.file)}catch{z.error(t("failed_upload_image",{name:se.file.name}))}if((r=C.data)!=null&&r.file_id&&O.length>0)for(const se of O)try{await Ma.toggleCollectionItem(se,C.data.file_id)}catch{}yt({status:((o=C.data)==null?void 0:o.status)||"pending",slug:((x=C.data)==null?void 0:x.slug)||"",fileId:((w=C.data)==null?void 0:w.file_id)||0,message:C.message||""})}catch(C){z.error(C.message||t("failed_submit"))}finally{ns(!1)}},Zt=async()=>{if(!Le)return;const s=Xt();X.current=s,os(void 0),cs(void 0),ve("analyzing"),Y(!0);try{const a=await Ba(s);a.pass?(Y(!1),await zs(s)):(os(a.reason||"Your submission may not meet our content guidelines."),ve("failed"))}catch(a){cs(a==null?void 0:a.message),ve("error")}},Wt=()=>{Y(!1),X.current=null},Gt=async()=>{const s=X.current;Y(!1),s&&await zs(s),X.current=null};if(c||g)return e.jsx(te,{children:e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsx(T,{className:"h-8 w-8 animate-spin text-primary"})})});if(!d)return null;if(h&&!h.uploads_allowed)return e.jsx(te,{children:e.jsx(ya,{})});if(S)return e.jsx(te,{children:e.jsx("div",{className:"flex items-center justify-center min-h-[60vh]",children:e.jsxs(y,{className:"max-w-lg w-full p-8 text-center space-y-6",children:[S.status==="approved"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-primary/15 flex items-center justify-center",children:e.jsx(A,{className:"h-8 w-8 text-primary"})}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:t("result_approved_title")}),e.jsx("p",{className:"text-muted-foreground",children:S.message||t("result_approved_desc")}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(m,{asChild:!0,className:"gap-2",children:e.jsxs(M,{to:`/addon/${S.fileId}/${S.slug}`,children:[e.jsx(Ts,{className:"h-4 w-4"})," ",t("view_your_addon")]})}),e.jsx(m,{variant:"outline",asChild:!0,children:e.jsx(M,{to:"/user/uploads",children:t("my_uploads")})})]})]}),S.status==="scheduled"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-accent/15 flex items-center justify-center",children:e.jsx(Ys,{className:"h-8 w-8 text-accent"})}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:t("result_scheduled_title")}),e.jsx("p",{className:"text-muted-foreground",children:S.message||t("result_scheduled_desc")}),e.jsx("div",{className:"flex flex-col gap-3",children:e.jsx(m,{variant:"outline",asChild:!0,children:e.jsx(M,{to:"/user/uploads",children:t("my_uploads")})})})]}),S.status==="pending"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mx-auto w-16 h-16 rounded-full bg-muted flex items-center justify-center",children:e.jsx(Xs,{className:"h-8 w-8 text-muted-foreground"})}),e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:t("result_pending_title")}),e.jsx("p",{className:"text-muted-foreground",children:S.message||t("result_pending_desc")}),e.jsx("div",{className:"flex flex-col gap-3",children:e.jsx(m,{variant:"outline",asChild:!0,children:e.jsx(M,{to:"/user/uploads",children:t("my_uploads")})})})]})]})})});const ee=s=>{if(s===0)return"0 B";const a=1024,r=["B","KB","MB","GB"],o=Math.floor(Math.log(s)/Math.log(a));return parseFloat((s/Math.pow(a,o)).toFixed(1))+" "+r[o]},Jt=[{icon:$s,titleKey:"rule_english_title",descKey:"rule_english_desc"},{icon:Rs,titleKey:"rule_images_title",descKey:"rule_images_desc"},{icon:Xs,titleKey:"rule_ip_title",descKey:"rule_ip_desc"},{icon:za,titleKey:"rule_donationware_title",descKey:"rule_donationware_desc"},{icon:Ra,titleKey:"rule_guides_title",descKey:"rule_guides_desc"},{icon:ia,titleKey:"rule_quality_title",descKey:"rule_quality_desc"},{icon:oa,titleKey:"rule_external_title",descKey:"rule_external_desc"},{icon:Qs,titleKey:"rule_filenames_title",descKey:"rule_filenames_desc"},{icon:et,titleKey:"rule_voicepacks_title",descKey:"rule_voicepacks_desc"}],Qt=[{key:"dragDrop",icon:La,label:t("opt_drag_drop"),desc:t("opt_drag_drop_desc"),checked:ts,toggle:()=>ut(s=>!s)},{key:"autoInstall",icon:Ps,label:t("opt_auto_install"),desc:t("opt_auto_install_desc"),checked:ge,toggle:()=>{ge?as(!1):fe(!0)}},{key:"donations",icon:la,label:t("opt_donations"),desc:t("opt_donations_desc"),checked:rs,toggle:()=>xt(s=>!s)},{key:"fictional",icon:Ee,label:t("opt_fictional"),desc:t("opt_fictional_desc"),checked:ls,toggle:()=>pt(s=>!s)}],ea=[{label:t("help_category_affiliation"),slug:"understanding-category-and-affiliation-selections"},{label:t("help_proper_category"),slug:"selecting-the-proper-category-for-your-upload"}
26,{label:t("help_managing_addons"),slug:"managing-your-addons-after-upload"}];return e.jsxs(e.Fragment,{children:[e.jsxs(te,{children:[e.jsxs("section",{className:"relative overflow-hidden py-12 lg:py-16",children:[e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-background via-background to-background"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_top,hsl(var(--primary)/0.15),transparent_50%)]"}),e.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(ellipse_at_bottom_right,hsl(var(--accent)/0.1),transparent_50%)]"}),e.jsx("div",{className:"absolute inset-0 opacity-[0.03]",style:{backgroundImage:`linear-gradient(hsl(var(--foreground)) 1px, transparent 1px),
27                              linear-gradient(90deg, hsl(var(--foreground)) 1px, transparent 1px)`,backgroundSize:"60px 60px"}}),e.jsxs("div",{className:"absolute inset-0 overflow-hidden",children:[e.jsx("div",{className:"absolute top-10 left-[15%] w-1.5 h-1.5 bg-primary/30 rounded-full animate-float"}),e.jsx("div",{className:"absolute top-20 right-[20%] w-1 h-1 bg-accent/40 rounded-full animate-float-delayed"}),e.jsx("div",{className:"absolute bottom-10 left-[60%] w-1 h-1 bg-primary/20 rounded-full animate-float"})]}),e.jsx("div",{className:"relative max-w-6xl mx-auto px-4 sm:px-6 z-10",children:e.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[e.jsx("div",{className:"flex justify-center",children:e.jsx(m,{variant:"ghost",size:"sm",className:"mb-6 -ml-2 text-muted-foreground hover:text-foreground group",asChild:!0,children:e.jsxs(M,{to:"/user/uploads",children:[e.jsx(na,{className:"h-4 w-4 mr-1 transition-transform group-hover:-translate-x-0.5"}),t("back_to_uploads")]})})}),e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-primary/10 border border-primary/20 mb-6",children:e.jsx(ce,{className:"h-8 w-8 text-primary"})}),e.jsxs("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-bold tracking-tight mb-4 text-foreground",children:[t("hero_title_new")," ",t("hero_title_upload")]}),e.jsx("p",{className:"text-lg text-muted-foreground max-w-xl mx-auto",children:t("hero_subtitle")})]})})]}),kt?e.jsx(e.Fragment,{children:e.jsx("section",{className:"py-8 bg-muted/30",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 space-y-6",children:[e.jsxs(y,{className:"p-6 space-y-4 relative overflow-hidden",onDragOver:s=>s.preventDefault(),onDrop:qt,children:[zt&&e.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 rounded-lg border-2 border-primary bg-background/80 backdrop-blur-sm pointer-events-none",children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full bg-primary text-primary-foreground",children:e.jsx(Te,{className:"h-6 w-6"})}),e.jsx("p",{className:"text-sm font-medium text-primary",children:t("drop_file_here")})]}),e.jsx(b,{icon:Te,title:t("upload_files"),description:t("upload_files_hint")}),e.jsx("div",{className:"space-y-4",children:Array.from({length:I}).map((s,a)=>{var o,x;const r=j[a];return e.jsxs("div",{className:"rounded-lg border border-border p-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx(v,{className:"text-xs text-muted-foreground",children:t("file_title",{num:a+1})}),a===0&&e.jsx(E,{variant:"secondary",className:"h-4 px-1.5 text-[10px] font-medium uppercase tracking-wide",children:t("main_download")})]}),e.jsx(k,{value:ws[a],onChange:w=>Os(a,w.target.value),placeholder:a===0?t("main_download"):t("file_n",{num:a+1}),className:"h-8 text-sm"})]}),a>0&&r.status==="idle"&&e.jsx(m,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive shrink-0 mt-5",onClick:()=>Ls(a),children:e.jsx(Re,{className:"h-4 w-4"})})]}),r.status==="idle"&&e.jsx(Va,{onFileDrop:Ht(a),onClick:()=>{var w;return(w=Cs[a].current)==null?void 0:w.click()},children:e.jsx("input",{ref:Cs[a],type:"file",accept:".zip,.rar",className:"hidden",onChange:Bt(a)})}),(r.status==="uploading"||r.status==="paused")&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ce,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium truncate",children:(o=r.file)==null?void 0:o.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[ee(r.uploadedBytes)," / ",ee(r.totalBytes)," · Chunk"," ",r.chunksCompleted,"/",r.chunksTotal]})]}),e.jsxs("span",{className:"text-sm font-medium tabular-nums",children:[r.progress,"%"]})]}),e.jsx(Us,{value:r.progress,className:"h-2"}),e.jsxs("div",{className:"flex gap-2",children:[r.status==="uploading"?e.jsxs(m,{type:"button",variant:"outline",size:"sm",onClick:r.pause,className:"gap-1.5",children:[e.jsx(Ea,{className:"h-3.5 w-3.5"})," ",t("pause")]}):e.jsxs(m,{type:"button",variant:"outline",size:"sm",onClick:r.resume,className:"gap-1.5",children:[e.jsx(Ta,{className:"h-3.5 w-3.5"})," ",t("resume")]}),e.jsxs(m,{type:"button",variant:"ghost",size:"sm",onClick:r.cancel,className:"gap-1.5 text-destructive",children:[e.jsx(ae,{className:"h-3.5 w-3.5"})," ",t("cancel")]})]})]}),r.status==="complete"&&e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg border border-primary/20 bg-primary/5",children:[e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10",children:e.jsx(Ua,{className:"h-4 w-4 text-primary"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-sm font-medium truncate",children:[e.jsx(A,{className:"h-3.5 w-3.5 shrink-0 text-primary"}),(x=r.file)==null?void 0:x.name]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[ee(r.totalBytes)," · ",t("uploaded")]})]}),e.jsx(m,{type:"button",variant:"outline",size:"sm",onClick:r.reset,className:"h-7 text-xs shrink-0",children:t("replace")}),a>0&&e.jsx(m,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7 text-muted-foreground hover:text-destructive shrink-0",onClick:()=>Ls(a),children:e.jsx(Re,{className:"h-3.5 w-3.5"})})]}),r.status==="error"&&e.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-lg bg-destructive/10 border border-destructive/20",children:[e.jsx(oe,{className:"h-4 w-4 text-destructive shrink-0 mt-0.5"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-medium text-destructive",children:t("upload_failed")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:r.error}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:[t("upload_failed_hint")," ",e.jsx("a",{href:"https://status.flightsim.to/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"status.flightsim.to"}),"."]})]}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",onClick:r.reset,className:"text-xs",children:t("retry")})]})]},a)})}),I<4&&e.jsxs("button",{type:"button",onClick:()=>ks(s=>Math.min(s+1,4)),className:"flex w-full items-center justify-center gap-2 rounded-xl border border-dashed border-border py-3 text-sm text-muted-foreground transition-colors hover:border-primary/60 hover:bg-primary/5 hover:text-primary",children:[e.jsx(Zs,{className:"h-4 w-4"}),t("add_file")]})]}),e.jsxs(y,{className:"p-6 space-y-6",children:[e.jsx(b,{icon:Ks,title:t("basic_info")}),e.jsxs("div",{className:"grid gap-4",children:[e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(v,{htmlFor:"title",children:t("title_label")}),e.jsx(k,{id:"title",value:i,onChange:s=>
27f(s.target.value),placeholder:t("title_placeholder")})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"author",children:t("author_label")}),e.jsx(k,{id:"author",value:p,onChange:s=>B(s.target.value),placeholder:t("author_placeholder")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx("div",{children:e.jsx(Ya,{categories:F,value:N,onChange:Et,t})}),e.jsx(Xa,{affiliations:Se,value:qe,onChange:Ve,t})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx(v,{children:t("compatibility_label")}),e.jsxs(Na,{value:xe,onValueChange:ct,children:[e.jsx(_a,{children:e.jsx(wa,{placeholder:t("select_compatibility")})}),e.jsxs(ka,{children:[e.jsx(Pe,{value:"MSFS2020",children:"Microsoft Flight Simulator 2020"}),e.jsx(Pe,{value:"MSFS2024",children:"Microsoft Flight Simulator 2024"}),e.jsx(Pe,{value:"MSFS2020/24",children:"Microsoft Flight Simulator 2020/24"})]})]})]}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"version",children:t("initial_version")}),e.jsx(k,{id:"version",value:Ge,onChange:s=>dt(s.target.value),placeholder:"1.0"})]})]})]})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:ea.map(s=>e.jsxs(m,{type:"button",variant:"outline",className:"justify-start gap-2 h-auto py-3 text-sm text-muted-foreground hover:text-foreground",onClick:()=>ps(s.slug),children:[e.jsx(Pa,{className:"h-4 w-4 shrink-0"}),s.label]},s.slug))}),e.jsx(Vs,{slug:xs??"",open:!!xs,onOpenChange:s=>{s||ps(null)}}),(Ie||Ss)&&e.jsxs(y,{className:"p-6 space-y-6",children:[e.jsx(b,{icon:$s,title:t("location_aircraft")}),e.jsxs("div",{className:"grid gap-4",children:[Ie&&e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[e.jsx(Za,{countries:Ot,value:Ye,onChange:lt,t}),e.jsxs("div",{children:[e.jsx(v,{htmlFor:"icao",children:t("icao_label")}),e.jsx(k,{id:"icao",value:Xe,onChange:s=>nt(s.target.value),placeholder:t("icao_placeholder")})]})]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[Ss&&e.jsxs("div",{children:[e.jsx(v,{htmlFor:"airline",children:t("airline_label")}),e.jsxs(P,{open:it,onOpenChange:V,children:[e.jsx($,{asChild:!0,children:e.jsx("div",{className:"relative mt-1",children:e.jsx(k,{id:"airline",value:q,onChange:s=>{Ze(s.target.value),s.target.value.length>0&&V(!0)},onFocus:()=>{q.length>0&&V(!0)},placeholder:t("type_to_search"),autoComplete:"off",className:"mt-0"})})}),De&&De.length>0&&e.jsx(R,{className:"w-[--radix-popover-trigger-width] p-0 z-50 bg-popover",align:"start",onOpenAutoFocus:s=>s.preventDefault(),children:e.jsx(de,{children:e.jsxs(me,{children:[e.jsx(ue,{children:t("no_airlines")}),e.jsx(he,{children:De.filter(s=>s.airline.toLowerCase().includes(q.toLowerCase())).slice(0,20).map(s=>e.jsxs(U,{value:s.airline,onSelect:()=>{Ze(s.airline),V(!1)},children:[s.airline,e.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:s.file_count})]},s.airline))})]})})})]})]}),Ie&&e.jsxs("div",{children:[e.jsx(v,{htmlFor:"coordinates",children:t("coordinates_label")}),e.jsx(k,{id:"coordinates",value:We,onChange:s=>ot(s.target.value),placeholder:t("coordinates_placeholder")})]})]})]})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{icon:Qs,title:t("description_title"),description:t("description_hint")}),e.jsxs(m,{type:"button",variant:"outline",size:"sm",onClick:()=>ds(!0),children:[e.jsx(Ks,{className:"h-4 w-4 mr-1.5"}),t("templates")]})]}),e.jsx(Ca,{value:H,onChange:He},bt)]}),e.jsx(va,{open:vt,onOpenChange:ds,onSelect:s=>{He(s),Nt(a=>a+1)}}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:Bs,title:t("search_keywords")}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(k,{value:Qe,onChange:s=>es(s.target.value),placeholder:t("add_keyword"),onKeyDown:s=>s.key==="Enter"&&(s.preventDefault(),Ds())}),e.jsx(m,{type:"button",variant:"secondary",onClick:Ds,children:e.jsx(Zs,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"flex flex-wrap gap-2 mt-3",children:pe.map(s=>e.jsxs(E,{variant:"secondary",className:"gap-1 pr-1",children:[s,e.jsx("button",{onClick:()=>Tt(s),className:"ml-1 hover:text-destructive",children:e.jsx(ae,{className:"h-3 w-3"})})]},s))})]})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:Ws,title:t("collections_label"),description:t("collections_hint")}),e.jsxs(m,{type:"button",variant:"outline",className:"gap-2 w-full",onClick:()=>fs(!0),children:[e.jsx(Ws,{className:"h-4 w-4"}),t("manage_collections"),O.length>0&&e.jsx(E,{variant:"secondary",className:"ml-auto",children:O.length})]}
27),e.jsx(Sa,{open:At,onOpenChange:fs,addonTitle:i||"New Upload",mode:"deferred",selectedIds:O,onSelectedIdsChange:Ft})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:Gs,title:t("dependencies_title"),description:t("dependencies_desc")}),e.jsxs("div",{className:"relative",children:[e.jsx(Bs,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(k,{value:W,onChange:s=>{_e(s.target.value),G(!0)},onFocus:()=>{W.length>=2&&G(!0)},placeholder:t("search_file"),className:"pl-9"}),Mt&&W.length>=2&&e.jsx("div",{className:"absolute z-50 w-full mt-1 rounded-lg border border-border bg-popover shadow-lg max-h-48 overflow-y-auto",children:It?e.jsxs("div",{className:"p-3 text-sm text-muted-foreground flex items-center gap-2",children:[e.jsx(T,{className:"h-4 w-4 animate-spin"})," ",t("searching")]}):js.length===0?e.jsx("div",{className:"p-3 text-sm text-muted-foreground",children:t("no_files_found")}):js.filter(s=>!Z.some(a=>a.id===s.id)).map(s=>e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 hover:bg-muted/50 text-sm",children:[e.jsx("span",{className:"truncate flex-1 mr-2",children:s.title}),e.jsxs("div",{className:"flex gap-1.5 shrink-0",children:[e.jsx(m,{type:"button",variant:"outline",size:"sm",className:"h-7 text-xs",onClick:()=>{Ne(a=>[...a,{...s,type:"required"}]),_e(""),G(!1)},children:t("dep_required")}),e.jsx(m,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:()=>{Ne(a=>[...a,{...s,type:"recommended"}]),_e(""),G(!1)},children:t("dep_recommended")})]})]},s.id))})]}),Z.length>0&&e.jsx("div",{className:"space-y-2",children:Z.map(s=>e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2.5 bg-muted/20",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Gs,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-sm font-medium truncate",children:s.title})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsx(E,{variant:s.type==="required"?"default":"secondary",className:"text-xs capitalize",children:s.type==="required"?t("dep_required"):t("dep_recommended")}),e.jsx("button",{type:"button",onClick:()=>Ne(a=>a.filter(r=>r.id!==s.id)),className:"text-muted-foreground hover:text-destructive",children:e.jsx(ae,{className:"h-3.5 w-3.5"})})]})]},s.id))})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(b,{icon:Rs,title:t("images_media")}),e.jsxs(m,{type:"button",variant:"outline",size:"sm",onClick:()=>{var s;return(s=Ce.current)==null?void 0:s.click()},className:"gap-1.5",children:[e.jsx(Js,{className:"h-4 w-4"}),t("add_images")]}),e.jsx("input",{ref:Ce,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:Pt})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("images_hint")}),_.length===0?e.jsxs("button",{type:"button",onClick:()=>{var s;return(s=Ce.current)==null?void 0:s.click()},onDrop:As,onDragOver:Q,onDragEnter:Q,onDragLeave:Is,className:`w-full border-2 border-dashed rounded-lg p-12 text-center transition-colors ${J?"border-primary bg-primary/10":"border-border hover:border-primary/50"}`,children:[e.jsx(Js,{className:"h-10 w-10 mx-auto text-muted-foreground mb-3"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:J?t("drop_images_here","Drop images here"):t("click_add_images")})]}):e.jsx("div",{onDrop:As,onDragOver:Q,onDragEnter:Q,onDragLeave:Is,className:`grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3 rounded-lg transition-colors ${J?"ring-2 ring-primary bg-primary/5 p-2":""}`,children:_.map((s,a)=>e.jsx(Wa,{image:s,index:a,total:_.length,onRemove:()=>$t(s.id),onMoveUp:()=>Ms(a,-1),onMoveDown:()=>Ms(a,1),mainLabel:t("main_badge")},s.id))}),_.length>0&&!_.length&&e.jsx("p",{className:"text-xs text-destructive",children:t("at_least_one_image")}),e.jsxs("div",{className:"mt-4 pt-4 border-t border-border",children:[e.jsxs(v,{htmlFor:"youtube",className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx($a,{className:"h-4 w-4 text-muted-foreground"}),t("youtube_label")]}),e.jsx(k,{id:"youtube",value:ss,onChange:s=>mt(s.target.value),placeholder:"https://www.youtube.com/watch?v=..."})]})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:Ee,title:t("options_title")}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:Qt.map(s=>e.jsxs("button",{type:"button",onClick:s.toggle,className:`relative flex flex-col items-center text-center gap-2 p-4 rounded-lg border-2 transition-all cursor-pointer ${s.checked?"border-primary bg-primary/5":"border-border hover:border-muted-foreground
27/30 bg-card/80"}`,children:[s.checked&&e.jsx("div",{className:"absolute top-2 right-2",children:e.jsx(A,{className:"h-3.5 w-3.5 text-primary"})}),e.jsx("div",{className:`p-2 rounded-lg ${s.checked?"bg-primary/10 text-primary":"bg-muted text-muted-foreground"}`,children:e.jsx(s.icon,{className:"h-5 w-5"})}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:s.desc})]},s.key))})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:Ys,title:t("schedule_release")}),e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-border bg-muted/40 px-4 py-3 text-sm text-muted-foreground",children:[e.jsx(ca,{className:"h-4 w-4 mt-0.5 shrink-0 text-primary"}),e.jsx("p",{children:t("schedule_info")})]}),e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:t("release_date")}),e.jsxs(P,{open:wt,onOpenChange:us,children:[e.jsx($,{asChild:!0,children:e.jsxs(m,{variant:"outline",className:"w-full justify-start font-normal h-10 text-left",children:[e.jsx(da,{className:"mr-2 h-4 w-4 text-muted-foreground"}),D?Hs(D,"PPP"):e.jsx("span",{className:"text-muted-foreground",children:t("pick_date")})]})}),e.jsx(R,{className:"w-auto p-0",align:"start",children:e.jsx(ba,{mode:"single",selected:D,onSelect:s=>{ms(s),us(!1)},disabled:s=>s<ma(new Date),initialFocus:!0,className:"p-3 pointer-events-auto"})})]}),D&&e.jsx("button",{type:"button",onClick:()=>ms(void 0),className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:t("clear_date")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{htmlFor:"release-time",children:t("release_time_utc")}),e.jsxs("div",{className:"relative",children:[e.jsx(ua,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none"}),e.jsx(k,{id:"release-time",type:"time",value:be,onChange:s=>_t(s.target.value),disabled:!D,className:"pr-9"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("all_times_utc")})]})]}),D&&e.jsx("p",{className:"text-sm text-foreground",dangerouslySetInnerHTML:{__html:t("scheduled_for",{date:Hs(D,"MMMM d, yyyy"),time:be})}})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:et,title:t("comments_section")}),e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx(v,{htmlFor:"disable-comments",className:"text-sm font-medium",children:t("disable_comments")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("disable_comments_desc")})]}),e.jsx(ha,{id:"disable-comments",checked:gs,onCheckedChange:Dt})]})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:oe,title:t("rules_n
27otices")}),e.jsxs("div",{className:"text-sm text-muted-foreground space-y-2",children:[e.jsx("p",{children:t("by_submitting")}),e.jsxs("ul",{className:"list-disc pl-5 space-y-1",children:[e.jsx("li",{children:t("rule_original_creator")}),e.jsx("li",{children:t("rule_no_malware")}),e.jsxs("li",{children:[t("rule_comply_tos").split("<terms>")[0],e.jsx(M,{to:"/terms",className:"text-primary underline",children:((Es=t("rule_comply_tos").match(/<terms>(.*?)<\/terms>/))==null?void 0:Es[1])||"Terms of Service"}),t("rule_comply_tos").split("</terms>")[1]||""]}),e.jsx("li",{children:t("rule_review_time")}),e.jsx("li",{children:t("rule_max_file_size")}),e.jsx("li",{children:t("rule_screenshot_required")}),e.jsx("li",{children:t("rule_no_misleading")})]})]})]}),e.jsxs(y,{className:"p-6 space-y-4",children:[e.jsx(b,{icon:ce,title:t("summary_title","Upload Summary"),description:t("summary_hint","Review your submission before publishing.")}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("title_label")}),e.jsx("p",{className:"text-sm font-medium text-foreground break-words",children:i.trim()||e.jsx("span",{className:"text-muted-foreground",children:"—"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("category_label")}),e.jsx("p",{className:"text-sm font-medium text-foreground break-words",children:Yt||e.jsx("span",{className:"text-muted-foreground",children:"—"})})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:t("compatibility_label")}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:xe})]})]}),_.length>0&&e.jsx("div",{className:"grid grid-cols-3 sm:grid-cols-6 gap-2",children:_.slice(0,6).map(s=>e.jsx("div",{className:"aspect-video rounded-md overflow-hidden border border-border bg-muted",children:e.jsx("img",{src:s.previewUrl,alt:t("images_media"),className:"w-full h-full object-cover",loading:"lazy"})},s.id))}),e.jsxs("div",{className:"border-t border-border pt-4 space-y-2",children:[e.jsx("div",{className:"flex flex-wrap gap-x-6 gap-y-2",children:ze.map(s=>e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.done?e.jsx(A,{className:"h-3.5 w-3.5 text-primary shrink-0"}):e.jsx(ae,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),e.jsx("span",{className:s.done?"text-foreground":"text-muted-foreground",children:s.label})]},s.label))}),e.jsx(Us,{value:ze.filter(s=>s.done).length/ze.length*100,className:"h-1.5"})]}),(n==null?void 0:n.creatorRewards)&&e.jsxs("div",{className:"border-t border-border pt-4 space-y-3",children:[e.jsx(b,{icon:Ee,title:t("your_tier","Your Tier"),description:t("your_tier_summary_desc","Your current creator tier and monthly progress.")}),e.jsx(xa,{tierName:n.creatorRewards.currentTier,monthlyXp:n.creatorRewards.monthlyXp,showUnranked:!0,showProgress:!0,showRewardsButton:!0})]})]}),e.jsx(m,{onClick:Zt,disabled:!Le||is,className:"w-full gap-2 h-12 text-base",size:"lg",children:ye?e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"h-5 w-5 animate-spin"}),t("submitting")]}):e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"h-5 w-5"}),t("submit_upload")]})}),!Le&&!ye&&e.jsxs("p",{className:"text-xs text-muted-foreground text-center",children:[!i.trim()&&t("validation_title"),!N&&t("validation_category"),_.length===0&&t("validation_image"),j[0].status!=="complete"&&t("validation_file")]})]})})}):e.jsx("section",{className:"py-10 bg-muted/30",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6",children:[e.jsxs("div",{className:"flex items-center justify-center gap-3 bg-destructive/10 border border-destructive/30 rounded-lg p-4 mt-6 mb-8",children:[e.jsx(oe,{className:"h-5 w-5 text-destructive shrink-0"}),e.jsx("p",{className:"text-sm text-destructive",children:t("rules_warning")})]}),e.jsx(y,{className:"divide-y divide-border/60 overflow-hidden",children:Jt.map((s,a)=>e.jsxs("div",{className:"flex items-start gap-3 px-4 py-3 hover:bg-muted/40 transition-colors",children:[e.jsx("div",{className:"mt-0.5 shrink-0 text-primary",children:e.jsx(s.icon,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-sm font-semibold text-foreground",children:t(s.titleKey)}),e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-relaxed",children:t(s.descKey)})]}),e.jsx(A,{className:"ml-auto mt-0.5 h-4 w-4 shrink-0 text-muted-foreground
27/40"})]},a))}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 mt-8",children:[e.jsxs(m,{size:"lg",onClick:()=>{Ct(!0),window.scrollTo({top:0,behavior:"smooth"})},className:"gap-2 px-8",children:[t("understood_continue"),e.jsx(Ts,{className:"h-4 w-4"})]}),e.jsx(m,{variant:"link",size:"sm",className:"text-muted-foreground",onClick:()=>hs(!0),children:t("view_all_rules")}),e.jsx(Vs,{slug:"general-rules-for-user-uploads",open:St,onOpenChange:hs})]})]})}),e.jsx(qa,{open:is,state:gt,reason:ft,errorMessage:jt,onEdit:Wt,onSubmitAnyway:Gt})]}),e.jsx(st,{open:ht,onOpenChange:fe,children:e.jsxs(tt,{className:"max-w-md",children:[e.jsxs(le,{children:[e.jsxs(ne,{className:"flex items-center gap-2",children:[e.jsx(Ps,{className:"h-5 w-5 text-primary"}),t("opt_auto_install")]}),e.jsx(ie,{className:"text-left pt-2 leading-relaxed",children:t("auto_install_info")})]}),e.jsxs($e,{className:"flex-col sm:flex-row gap-2 pt-2",children:[e.jsx(m,{variant:"outline",asChild:!0,className:"gap-2",children:e.jsxs("a",{href:"https://flightsim.to/support/article/flightsim-to-auto-installer",target:"_blank",rel:"noopener noreferrer",children:[e.jsx(pa,{className:"h-4 w-4"}),t("auto_install_learn_more")]})}),e.jsx(m,{onClick:()=>{as(!0),fe(!1)},children:t("auto_install_confirm")})]})]})})]})};export{Tr 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.