PageSourceSearch

https://rodrift.ro/assets/TvPage-DoFtfpYp.js

js rodrift.ro collected 2026-10-04 04:19:52 UTC 12,011 bytes, 1 lines download raw bytes

1import{r as i,j as e,E as I,X as J,H as G,S as W,l as X,T as D,I as Z,D as Q,J as R,K as ee}from"./vendor-react-aro8yD9l.js";import{b as te,a as T}from"./index-CAwCAWZT.js";function Y({ticket:s,added:r,onAdd:u}){const n=[s.class,s.title].filter(Boolean).join(" ")||"Bilet Live";return e.jsxs("div",{className:"lvpop-ticket",children:[e.jsxs("div",{className:"lvpop-ticket-info",children:[e.jsx("span",{className:"lvpop-ticket-name",children:n}),e.jsxs("span",{className:"lvpop-ticket-price",children:[Number(s.price||0)," RON"]})]}),e.jsx("button",{className:`lvpop-ticket-btn${r?" is-added":""}`,onClick:u,disabled:r,children:r?"✓ Adăugat":"Adaugă în coș"})]})}function se({video:s,onClose:r}){const{addToCart:u}=te(),[n,m]=i.useState([]),[h,j]=i.useState([]),[x,N]=i.useState(!0),[b,w]=i.useState({}),g=s==null?void 0:s.etapa_id,y=s!=null&&s.an?Number(s.an):null;i.useEffect(()=>{N(!0);const a=c=>["activ","active","1","true"].includes(String((c==null?void 0:c.status)??"").trim().toLowerCase()),f=c=>String((c==null?void 0:c.product_type)||"").toLowerCase()==="liveticket",v=c=>{const d=String((c==null?void 0:c.stage)??"").trim();return d===""||d==="0"||d==="-1"||d.toUpperCase()==="ALL"},S=g?T.getJSON({mode:"products",action:"get",etapa_id:g,per_page:100,_ts:Date.now()}).catch(()=>[]):Promise.resolve([]),E=T.getJSON({mode:"products",action:"get",product_type:"liveticket",per_page:100,_ts:Date.now()}).catch(()=>[]);Promise.all([S,E]).then(([c,d])=>{const z=Array.isArray(c)?c:(c==null?void 0:c.data)||[],F=Array.isArray(d)?d:(d==null?void 0:d.data)||[],k=z.filter(o=>f(o)&&a(o));m(k.filter(o=>String(o.stage)===String(g)));const P=k.filter(v),V=F.filter(o=>f(o)&&a(o)&&v(o)),C=new Set,A=[...P,...V].filter(o=>{const _=String(o.product_id||o.id||"");return C.has(_)?!1:(C.add(_),!0)}),O=y?A.filter(o=>!o.year||Number(o.year)===0||Number(o.year)===y):A;j(O)}).finally(()=>N(!1))},[g,y]);function p(a){const f=String(a.product_id||a.id||"");u({id:f,product_id:a.product_id||a.id,title:[a.class,a.title].filter(Boolean).join(" ")||"Bilet Live",price:parseFloat(a.price||0),quantity:1,product_type:a.product_type||"liveticket",type:"live",stage:a.stage}),w(v=>({...v,[f]:!0}
1))}const L=Object.keys(b).length>0;return e.jsx("div",{className:"lvpop-overlay",onClick:a=>{a.target===a.currentTarget&&r()},children:e.jsxs("div",{className:"lvpop-modal",children:[e.jsxs("div",{className:"lvpop-header",children:[e.jsxs("div",{className:"lvpop-title-row",children:[e.jsx(I,{size:18,color:"#ed1131"}),e.jsx("span",{className:"lvpop-title",children:"Cumpără bilet Live"})]}),e.jsx("button",{className:"lvpop-close",onClick:r,"aria-label":"Închide",children:e.jsx(J,{size:18})})]}),(s==null?void 0:s.title)&&e.jsxs("div",{className:"lvpop-video-label",children:[e.jsx("span",{className:"lvpop-video-icon",children:"🎬"}),e.jsx("span",{className:"lvpop-video-name",children:s.title})]}),e.jsx("div",{className:"lvpop-body",children:x?e.jsx("div",{className:"lvpop-loading",children:"Se încarcă biletele..."}):n.length===0&&h.length===0?e.jsxs("div",{className:"lvpop-empty",children:[e.jsx("p",{children:"Nu există bilete disponibile momentan."}),e.jsx("a",{href:"/tickets",className:"lvpop-link-all",onClick:r,children:"Vezi toate biletele →"})]}):e.jsxs(e.Fragment,{children:[n.length>0&&e.jsxs("div",{className:"lvpop-section",children:[e.jsxs("div",{className:"lvpop-section-title",children:[e.jsx(I,{size:12}),"Bilet etapă"]}),n.map(a=>e.jsx(Y,{ticket:a,added:!!b[String(a.product_id||"")],onAdd:()=>p(a)},a.product_id))]}),h.length>0&&e.jsxs("div",{className:"lvpop-section",children:[e.jsxs("div",{className:"lvpop-section-title",children:[e.jsx(G,{size:12}),"Bilet tot sezonul"]}),h.map(a=>e.jsx(Y,{ticket:a,added:!!b[String(a.product_id||"")],onAdd:()=>p(a)},a.product_id))]})]})}),L&&e.jsxs("div",{className:"lvpop-footer",children:[e.jsx("span",{className:"lvpop-added-msg",children:"✓ Adăugat în coș"}),e.jsxs("a",{href:"/checkout",className:"lvpop-btn-checkout",onClick:r,children:[e.jsx(W,{size:14}),"Mergi la checkout"]})]})]})})}const ae=[{key:"toate",label:"Toate"},{key:"premium",label:"Premium"},{key:"pro",label:"PRO / SemiPRO"},{key:"street",label:"Street"}];function M(s){const u=String((s==null?void 0:s.link)||"").trim().replace("https://rodrift.rohttps://","https://").replace("http://rodrift.rohttps://","https://").replace("https://rodrift.rohttp://","http://"),n=(s==null?void 0:s.type)==="vimeo"||/vimeo\.com/i.test(u),m=!n&&((s==null?void 0:s.type)==="youtube"||/youtube\.com|youtu\.be/i.test(u)),h=String((s==null?void 0:s.video_id)||"").trim();let j="";if(m){const N=u.match(/(?:v=|youtu\.be\/|embed\/)([A-Za-z0-9_-]{11})/);j=N?N[1]:h}const x=s.video_image&&String(s.video_image).trim()||(m&&j?`https://img.youtube.com/vi/${j}/mqdefault.jpg`:"")||(n&&h?`https://vumbnail.com/${h}.jpg`:"");return{id:String(s.id||""),etapa_id:s.etapa_id?Number(s.etapa_id):0,campionat_id:s.campionat_id?Number(s.campionat_id):0,an:s.an?Number(s.an):0,title:s.title||"Video RoDrift",category:String(s.category||""),kind:n?"vimeo":m?"youtube":"mp4",videoId:m?j:h,src:u,thumb:x,premium:s.premium==="true"||s.premium===!0||s.premium=="1",acces:s.acces==="true"||s.acces===!0||s.acces=="1"}}function U(s){return Number(s==null?void 0:s.an)>0&&Number(s==null?void 0:s.campionat_id)>0}function q({video:s,onClick:r,onBuy:u}){const n=s.premium&&!s.acces;return e.jsxs("article",{className:`tvl-card${n?" tvl-card--locked":""}`,onClick:()=>!n&&r(s),tabIndex:n?-1:0,onKeyDown:m=>m.key==="Enter"&&!n&&r(s),role:"button","aria-label":s.title,children:[e.jsxs("div",{className:"tvl-thumb-wrap",children:[s.thumb?e.jsx("img",{src:s.thumb,alt:s.title,className:"tvl-thumb-img",loading:"lazy"}):e.jsx("div",{className:"tvl-thumb-placeholder",children:e.jsx(D,{size:30,color:"#ccc"})}),n?e.jsxs("div",{className:"tvl-overlay tvl-overlay--lock",children:[e.jsx(Q,{size:24,color:"#fff"}),e.jsx("span",{children:"PREMIUM"})]}):e.jsx("div",{className:"tvl-overlay tvl-overlay--play",children:e.jsx(R,{size:52,color:"#fff"})}),s.premium&&e.jsxs("span",{className:"tvl-badge-premium",children:[e.jsx(ee,{size:11,color:"#FFD700",style:{marginRight:3,flexShrink:0}}),"Premium"]})]}),e.jsxs("div",{className:"tvl-card-info",children:[e.jsx("h3",{className:"tvl-card-title",children:s.title}),s.category?e.jsx("span",{className:"tvl-card-cat",children:s.category}):null,n&&e.jsxs("button",{className:"tvl-btn-buy",onClick:m=>{m.stopPropagation(),u?u(s):window.location.href="/tickets"},children:[e.jsx(I,{size:12,style:{marginRight:5,verticalAlign:"middle"}}),"Cumpara bilet"]})]})]})}function le(){const s=X(),[r,u]=i.useState([]),[n,m]=i.useState(!0),[h,j]=i.useState("toate"),[x,N]=i.useState(null),[b,w]=i.useState(null),[g,y]=i.useState(""),[p,L]=i.useState(""),[a,f]=i.useState(""),[v,S]=i.useState(""),[E,c]=i.useState([]),[d,z]=i.useState([]),[F,k]=i.useState(!1),[P,V]=i.useState(!1);i.useEffect(()=>{try{const t=localStorage.getItem("user");t&&t!=="undefined"&&t!=="null"&&N(JSON.parse(t))}catch{}},[]),i.useEffect(()=>{T.getJSON({mode:"championships",action:"get_all"}).then(t=>c(Array.isArray(t)?t:[])).catch(()=>{})},[]),i.useEffect(()=>{f(""),z([]),p&&(k(!0),T.getJSON({mode:"videos",action:"admin_get_stages",campionat_id:p,no_cache:1,_ts:Date.now()}).then(t=>z(Array.isArray(t==null?void 0:t.stages)?t.stages:[])).catch(()=>{}).finally(()=>k(!1)))}
1,[p]),i.useEffect(()=>{m(!0);const t=(x==null?void 0:x.user_id)||0;T.getJSON({mode:"videos",action:"tv",user_id:t,no_cache:!0}).then(l=>{const $=Array.isArray(l)?l:[];u($.map(M).filter(U))}).catch(()=>u([])).finally(()=>m(!1))},[x]);const C=i.useMemo(()=>[...new Set(r.filter(t=>t.an>0).map(t=>t.an))].sort((t,l)=>l-t),[r]),A=i.useMemo(()=>[...new Set(r.filter(t=>t.campionat_id>0).map(t=>t.campionat_id))],[r]),O=i.useMemo(()=>{if(!p||d.length===0)return d;const t=new Set(r.filter(l=>Number(l.campionat_id)===Number(p)&&l.etapa_id>0).map(l=>l.etapa_id));return d.filter(l=>t.has(Number(l.etapa_id)))},[p,r,d]),o=t=>{const l=E.find($=>String($.campionat_id)===String(t));return(l==null?void 0:l.title)||(l==null?void 0:l.name)||`Campionat ${t}`},_=g||p||v,H=()=>{y(""),L(""),f(""),S("")},B=r.filter(t=>{if(h==="premium"){if(!t.premium)return!1}else if(h==="pro"){const l=t.category.toLowerCase();if(!(l==="pro"||l==="semi pro"||l==="semipro"||l==="semi-pro"))return!1}else if(h==="street"&&!t.category.toLowerCase().includes("street"))return!1;return!(g&&Number(t.an)!==Number(g)||p&&Number(t.campionat_id)!==Number(p)||a&&Number(t.etapa_id)!==Number(a)||v==="premium"&&!t.premium||v==="free"&&t.premium)}),K=t=>{s(`/tv/${t.id}`,{state:{video:t,allVideos:r}})};return e.jsxs("div",{className:"tvl-wrap",children:[e.jsx("div",{className:"tvl-hero",children:e.jsxs("div",{className:"tvl-hero-inner",children:[e.jsx(D,{size:36,color:"#ed1131"}),e.jsxs("h1",{className:"tvl-hero-title",children:["RoDrift ",e.jsx("span",{children:"TV"})]}),e.jsx("p",{className:"tvl-hero-sub",children:"Curse, calificari si momente exclusive din lumea driftului romanesc"})]})}),e.jsx("div",{className:"tvl-tabs-bar",children:e.jsxs("div",{className:"tvl-tabs-inner",children:[ae.map(t=>e.jsx("button",{className:`tvl-tab${h===t.key?" tvl-tab--active":""}`,onClick:()=>j(t.key),children:t.label},t.key)),e.jsxs("button",{className:`tvl-filter-toggle${P||_?" is-active":""}`,onClick:()=>V(t=>!t),title:"Filtre",children:[e.jsx(Z,{size:15}),"Filtre",_&&e.jsx("span",{className:"tvl-filter-badge"})]})]})}),P&&e.jsx("div",{className:"tvl-filter-bar",children:e.jsxs("div",{className:"tvl-filter-inner",children:[C.length>0&&e.jsxs("div",{className:"tvl-filter-group",children:[e.jsx("label",{className:"tvl-filter-label",children:"An"}),e.jsxs("select",{className:"tvl-filter-select",value:g,onChange:t=>y(t.target.value),children:[e.jsx("option",{value:"",children:"Toți anii"}),C.map(t=>e.jsx("option",{value:t,children:t},t))]})]}),A.length>0&&e.jsxs("div",{className:"tvl-filter-group",children:[e.jsx("label",{className:"tvl-filter-label",children:"Campionat"}),e.jsxs("select",{className:"tvl-filter-select",value:p,onChange:t=>{L(t.target.value),f("")},children:[e.jsx("option",{value:"",children:"Toate"}),A.map(t=>e.jsx("option",{value:t,children:o(t)},t))]})]}),p&&e.jsxs("div",{className:"tvl-filter-group",children:[e.jsx("label",{className:"tvl-filter-label",children:"Etapă"}),e.jsxs("select",{className:"tvl-filter-select",value:a,onChange:t=>f(t.target.value),disabled:F||O.length===0,children:[e.jsx("option",{value:"",children:F?"Se încarcă...":"Toate etapele"}),O.map(t=>e.jsx("option",{value:t.etapa_id,children:t.title},t.etapa_id))]})]}),e.jsxs("div",{className:"tvl-filter-group tvl-filter-group--access",children:[e.jsx("span",{className:"tvl-filter-label",children:"Acces"}),e.jsxs("div",{className:"tvl-filter-access",children:[e.jsx("button",{className:`tvl-faccess-btn${v===""?" is-active":""}`,onClick:()=>S(""),children:"Toate"}),e.jsx("button",{className:`tvl-faccess-btn${v==="premium"?" is-active":""}`,onClick:()=>S(v==="premium"?"":"premium"),children:"Premium"}),e.jsx("button",{className:`tvl-faccess-btn${v==="free"?" is-active":""}`,onClick:()=>S(v==="free"?"":"free"),children:"Gratuit"})]})]}),_&&e.jsxs("button",{className:"tvl-filter-reset",onClick:H,children:[e.jsx(J,{size:13})," Resetează"]})]})}),e.jsx("div",{className:"tvl-content",children:n?e.jsxs("div",{className:"tvl-loading",children:[e.jsx("div",{className:"tvl-spinner"}),e.jsx("span",{children:"Se incarca videoclipurile..."})]}):B.length===0?e.jsxs("div",{className:"tvl-empty",children:[e.jsx(D,{size:52,color:"#ccc"}),e.jsx("p",{children:"Nu exista videoclipuri in aceasta categorie."})]}):e.jsx("div",{className:"tvl-grid",children:B.map(t=>e.jsx(q,{video:t,onClick:K,onBuy:l=>w(l)},t.id||t.src))})}),b&&e.jsx(se,{video:b,onClose:()=>w(null)})]})}const ce=Object.freeze(Object.defineProperty({__proto__:null,VideoCard:q,default:le,isPublicTvVideo:U,normalizeVideo:M},Symbol.toStringTag,{value:"Module"}));
1export{se as L,ce as T,q as V,U as i,M as n};

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.