PageSourceSearch

https://onlinecasinobahrain.net/build/assets/init.0403e669.js

js onlinecasinobahrain.net collected 2026-10-09 05:13:03 UTC 16,282 bytes, 16 lines download raw bytes

1import{r as c,g as P,j as s,c as M}from"./getTranslationFn.2356ac80.js";import{s as v}from"./selectStylesByLayout.27113c92.js";import{a as T}from"./index.054212fd.js";import{g as z,u as B,t as F,c as U,h as H,d as V,a as X}from"./auth.4886ff80.js";import{u as G}from"./useDebouncedValue.23fc529c.js";import{R as W}from"./index.98d5dc73.js";import{U as Y}from"./index.57849716.js";import{p as J,a as Q}from"./k2.module.68c80a31.js";import{a as Z,b as ee}from"./k2.module.9d7457c1.js";import{g as se}from"./api-routes.b5363d5a.js";import"./_commonjsHelpers.725317a4.js";import"./getProjectVersion.cf97dcd9.js";import"./getInitials.15d02be9.js";const te="_wrap_1dwfq_1",ne={wrap:te},re="_wrap_17lt0_2",oe={wrap:re},$=c.createContext(),p=P("react-gambler-reviews-translates"),A=T.create(z);function ae(e){var d;const[t,n]=c.useState(null),[r,o]=c.useState("idle"),a=window["api-auth"]||"",l=window["project-name"]||"";c.useEffect(()=>{if(!e)return;const m=new AbortController;async function h(){try{const i=await A.get(`/casinos/${e}/reviews-stat`,{params:{projectName:l},signal:m.signal,headers:{Authorization:a}});n(i.data),o("success")}catch(i){i.name!=="CanceledError"&&(console.error("Failed to fetch reviews filters/stat:",i),o("error"))}}return h(),()=>m.abort()},[e,l]);const _=r==="success"&&((d=t==null?void 0:t.stats)==null?void 0:d.total_reviews)>0;return{stats:t,hasStats:_,error:r==="error"}}function ce({casinoId:e,sort:t,filters:n,page:r=1,enabled:o=!0}){const[a,l]=c.useState([]),[_,d]=c.useState({}),[m,h]=c.useState(!1),[i,b]=c.useState(!1),[g,u]=c.useState(!1),w=window["api-auth"]||"",f=window["project-name"]||"";return c.useEffect(()=>{if(!o||!e)return;const j=new AbortController;async function N(){r===1?h(!0):b(!0);try{const x={projectName:f};t&&(x.sort=t),(n==null?void 0:n.length)>0&&n.forEach((y,L)=>{x[`filter[rating][${L}]`]=y}),r!==1&&(x.page=r);const S=await A.get(`/casinos/${e}/reviews`,{params:x,signal:j.signal,headers:{Authorization:w}}),{data:C,meta:E}=S.data;l(y=>r===1?C:[...y,...C]),d(E)}catch(x){x.name!=="CanceledError"&&console.error("Failed to fetch reviews list:",x)}finally{h(!1),b(!1),g||u(!0)}}return N(),()=>j.abort()},[e,f,t,n,r,o]),{data:a,meta:_,loading:m,pagesLoading:i,initialized:g}}function ie(){return s.jsxs("div",{className:"reviews-list-skeleton","aria-hidden":"true",children:[s.jsxs("div",{className:"reviews-list-skeleton__head",children:[s.jsx("div",{className:"reviews-list-skeleton__title"}),s.jsx("div",{className:"reviews-list-skeleton__btn"})]}),s.jsx("div",{className:"reviews-list-skeleton__review"})]})}const le="_title_1ej01_1",_e="_row_1ej01_13",ue="_btn_1ej01_27",de={title:le,row:_e,btn:ue},me="_title_swp4h_1",pe="_row_swp4h_13",he="_btn_swp4h_27",we={title:me,row:pe,btn:he},xe="_icon_10hug_21",be="_text_10hug_39",ve="_rating_10hug_80",fe={"no-reviews":"_no-reviews_10hug_1",icon:xe,text:be,"with-reviews":"_with-reviews_10hug_52","svg-icon":"_svg-icon_10hug_63",rating:ve},ge="_icon_1j39v_21",je="_text_1j39v_39",$e="_rating_1j39v_69",Ne={"no-reviews":"_no-reviews_1j39v_1",icon:ge,text:je,"with-reviews":"_with-reviews_1j39v_50","svg-icon":"_svg-icon_1j39v_61",rating:$e},ye="/build/assets/no-reviews-stars.svg";function ke(){var o,a;const e=v(fe,Ne),{stats:t}=c.useContext($),n=((o=t==null?void 0:t.stats)==null?void 0:o.total_reviews)||0,r=Number(((a=t==null?void 0:t.stats)==null?void 0:a.average_rating)||0).toFixed(1);return n?s.jsxs("div",{className:e["with-reviews"],children:[s.jsx("div",{className:e["svg-icon"],children:s.jsx("svg",{"aria-hidden":"true",children:s.jsx("use",{xlinkHref:"#svg-star"})})}),s.jsxs("span",{className:e.rating,children:[s.jsx("b",{children:r}),"(",n," ",p("reviews"),")"]})]}):s.jsxs("div",{className:e["no-reviews"],children:[s.jsx("img",{className:e.icon,src:ye,alt:"stars icon",width:"88",height:"60",loading:"lazy"}),s.jsx("span",{className:e.text,children:p("no-reviews")})]})}function qe({className:e=""}){const{casinoId:t,casinoName:n,casinoLogo:r}=c.useContext($),o=window["react-layout"]==="k1";function a(){const l=new CustomEvent("react-reviews-popup-open",{detail:{id:t,name:n,logo:r}});document.dispatchEvent(l)}return s.jsxs("button",{className:`${e} ${o?"reviews-popup-btn gradient-btn":"main-btn"}`,type:"button",onClick:a,children:[o&&s.jsx("svg",{"aria-hidden":"true",children:s.jsx("use",{xlinkHref:"#svg-review"})}),p("write-review")]})}function Ce(){const e=v(de,we);return s.jsxs(s.Fragment,{children:[s.jsx("h2",{className:e.title,children:p("gambler-reviews")}),s.jsxs("div",{className:e.row,children:[s.jsx(ke,{}),s.jsx(qe,{className:e.btn})]})]})}const Se="_wrap_1mbzo_1",Ee={wrap:Se},Le="_wrap_1mbzo_1",Fe={wrap:Le},Ke="_wrap_130op_1",Re="_row_130op_19",Ie="_checkbox_130op_32",Ae="_percent_130op_77",De={wrap:Ke,row:Re,"custom-checkbox":"_custom-checkbox_130op_24",checkbox:Ie,"checkbox-box":"_checkbox-box_130op_32","checkbox-label":"_checkbox-label_130op_55","progress-bg":"_progress-bg_130op_61","progress-fill":"_progress-fill_130op_70",percent:Ae},Oe="_wrap_ab0u9_1",Pe="_row_ab0u9_19",Me="_checkbox_ab0u9_32",Te="_percent_ab0u9_77",ze={wrap:Oe,row:Pe,"custom-checkbox":"_custom-checkbox_ab0u9_24",checkbox:Me,"checkbox-box":"_checkbox-box_ab0u9_32","checkbox-label":"_checkbox-label_ab0u9_55","progress-bg":"_progress-bg_ab0u9_61","progress-fill":"_progress-fill_ab0u9_70",percent:Te};function Be(){var b,g;const e=v(De,ze),{stats:t,filters:n,setFilters:r,setPage:o}=c.useContext($),[a,l]=c.useState(n),_=G(a,600),d=((b=t==null?void 0:t.stats)==null?void 0:b.breakdown)||{},m=((g=t==null?void 0:t.stats)==null?void 0:g.total_reviews)||0;c.useEffect(()=>{r(_),o(1)},[_,r,o]);const h=Object.entries(d).reduce((u,[w,f])=>{const j=m>0?Math.round(f/m*100):0;return u[w]=j,u},{}),i=u=>{l(w=>w.includes(u)?w.filter(f=>f!==u):[...w,u])};return s.jsx("div",{className:e.wrap,children:Object.entries(h).sort(([u],[w])=>Number(w)-Number(u)).map(([u,w])=>s.jsxs("div",{className:e.row,children:[s.jsxs("label",{className:e["custom-checkbox"],children:[s.jsx("input",{type:"checkbox",className:`${e.checkbox} visually-hidden`,onChange:()=>i(Number(u)),checked:a.includes(Number(u))}),s.jsx("span",{className:e["checkbox-box"],"aria-hidden":"true"}),s.jsxs("span",{className:e["checkbox-label"],children:[u,"-",p("star")]})]}),s.jsx("div",{className:e["progress-bg"],children:s.jsx("div",{className:e["progress-fill"],style:{width:`${w}%`}})}),s.jsxs("span",{className:e.percent,children:[w,"%"]})]},u))})}
1const Ue="_wrap_c193f_1",He="_active_c193f_12",Ve="_btn_c193f_12",Xe="_label_c193f_24",Ge="_inner_c193f_30",We="_dropdown_c193f_60",Ye="_option_c193f_73",Je={wrap:Ue,active:He,btn:Ve,label:Xe,inner:Ge,dropdown:We,option:Ye},Qe="_wrap_11din_1",Ze="_active_11din_12",es="_btn_11din_12",ss="_label_11din_24",ts="_inner_11din_29",ns="_dropdown_11din_64",rs="_option_11din_77",os={wrap:Qe,active:Ze,btn:es,label:ss,inner:ts,dropdown:ns,option:rs};function as(){const e=v(Je,os),[t,n]=c.useState(!1),{sortOptions:r,sort:o,setSort:a,setPage:l}=c.useContext($),_=c.useRef(null),d=()=>n(i=>!i),m=i=>{a(i),n(!1),l(1)};c.useEffect(()=>{const i=b=>{_.current&&!_.current.contains(b.target)&&n(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]);const h=r.filter(i=>i.value!==o.value);return s.jsxs("div",{className:`${e.wrap} ${t?e.active:""}`,ref:_,children:[s.jsxs("span",{className:e.label,children:[p("sort-by"),":"]}),s.jsxs("div",{className:e.inner,children:[s.jsx("button",{type:"button",className:e.btn,onClick:d,children:s.jsx("span",{children:o.label})}),t&&h.length>0&&s.jsx("div",{className:e.dropdown,children:h.map(i=>s.jsx("div",{className:e.option,onClick:()=>m(i),children:i.label},i.value))})]})]})}function cs(){var r;const e=v(Ee,Fe),{stats:t}=c.useContext($);return((r=t==null?void 0:t.stats)==null?void 0:r.total_reviews)?s.jsxs("div",{className:e.wrap,children:[s.jsx(Be,{}),s.jsx(as,{})]}):null}const is="_wrap_lqeeq_2",ls="_card_lqeeq_16",_s="_user_lqeeq_62",us="_active_lqeeq_66",ds="_rate_lqeeq_72",ms="_text_lqeeq_73",ps="_btns_lqeeq_74",hs="_form_lqeeq_75",ws="_head_lqeeq_88",xs="_name_lqeeq_117",bs="_date_lqeeq_125",vs="_btn_lqeeq_29",fs="_textarea_lqeeq_246",gs="_alert_lqeeq_258",k={wrap:is,"wrap-replies":"_wrap-replies_lqeeq_16",card:ls,"btn-more":"_btn-more_lqeeq_29","card-child":"_card-child_lqeeq_32",user:_s,"card-with-btn":"_card-with-btn_lqeeq_66",active:us,rate:ds,text:ms,btns:ps,form:hs,head:ws,"user-info":"_user-info_lqeeq_107",name:xs,date:bs,btn:vs,textarea:fs,alert:gs,"form-btns":"_form-btns_lqeeq_262","sand-btn":"_sand-btn_lqeeq_272","cancel-btn":"_cancel-btn_lqeeq_285","no-reviews":"_no-reviews_lqeeq_307"},js="_wrap_1rh6m_2",$s="_card_1rh6m_16",Ns="_head_1rh6m_41",ys="_text_1rh6m_55",ks="_user_1rh6m_84",qs="_active_1rh6m_88",Cs="_btns_1rh6m_95",Ss="_form_1rh6m_96",Es="_name_1rh6m_148",Ls="_date_1rh6m_157",Fs="_rate_1rh6m_163",Ks="_btn_1rh6m_29",Rs="_textarea_1rh6m_274",Is="_alert_1rh6m_285",q={wrap:js,"wrap-replies":"_wrap-replies_1rh6m_16",card:$s,"btn-more":"_btn-more_1rh6m_29","card-child":"_card-child_1rh6m_32",head:Ns,text:ys,user:ks,"card-with-btn":"_card-with-btn_1rh6m_88",active:qs,btns:Cs,form:Ss,"user-info":"_user-info_1rh6m_137",name:Es,date:Ls,rate:Fs,btn:Ks,textarea:Rs,alert:Is,"form-btns":"_form-btns_1rh6m_289","sand-btn":"_sand-btn_1rh6m_299","cancel-btn":"_cancel-btn_1rh6m_312","no-reviews":"_no-reviews_1rh6m_336"};function As(e){if(!e)return"";const t=new Date(e);return isNaN(t.getTime())?"":new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(t)}function Ds({setIsFormShown:e=()=>{}}){const t=v(k,q),{user:n,initialized:r,loading:o}=B(),{casinoId:a,casinoName:l,casinoLogo:_}=c.useContext($);function d(){if(o)return null;if(!r||!n||!(n!=null&&n.is_email_verified)){const m=new CustomEvent("react-reviews-popup-open",{detail:{id:a,name:l,logo:_}});document.dispatchEvent(m)}else e(m=>!m)}return s.jsx("div",{className:t.btns,children:s.jsxs("button",{className:`${t.btn}`,type:"button",onClick:d,children:[s.jsx("svg",{"aria-hidden":"true",children:s.jsx("use",{xlinkHref:"#svg-reply"})}),p("reply")]})})}function Os({isActive:e=!1,setIsActive:t=()=>{},repliesCount:n=0}){const r=v(k,q);return s.jsxs("button",{className:`
2      ${r["btn-more"]}
3      ${e?r.active:""}
4    `,onClick:()=>t(o=>!o),children:[s.jsx("span",{className:`${e?r.active:""}`,"aria-hidden":"true"}),!e&&s.jsxs("span",{children:[n," ",p("more-replies")]})]})}const K=1500;function Ps({reviewId:e="",name:t="",isFormShown:n=!1,setIsFormShown:r=()=>{}}){const o=v(k,q),a=v(Q,J),l=v(ee,Z),[_,d]=c.useState(""),[m,h]=c.useState(!1),[i,b]=c.useState(null),[g,u]=c.useState(null),{casinoId:w}=c.useContext($),f=window["react-layout"]==="k1";c.useEffect(()=>{d(""),b(null),u(null)},[n]);const j=()=>{r(x=>!x)},N=async()=>{var x,S,C,E;if(b(null),u(null),_.trim()===""){b(p("reply-cant-be-empty"));return}h(!0);try{const y={[U]:w,[H]:e||"",[V]:_.slice(0,K)};await X.post(se,y),d(""),u(p("reply-success"))}catch(y){const L=((S=(x=y.response)==null?void 0:x.data)==null?void 0:S.error)||((E=(C=y.response)==null?void 0:C.data)==null?void 0:E.message)||F("something-went-wrong");b(L)}finally{h(!1)}};return n?s.jsxs("div",{className:o.form,children:[s.jsx("label",{children:s.jsx("textarea",{className:`${a.textarea} ${o.textarea}
4`,value:_,onChange:x=>d(x.target.value),placeholder:`${p("reply-to")} ${t}`,maxLength:K})}),(i||g)&&s.jsx("p",{className:`${o.alert} ${i?l.error:l.success}`,role:i?"alert":"status",children:i||g}),s.jsxs("div",{className:o["form-btns"],children:[s.jsx("button",{className:o["cancel-btn"],type:"button",onClick:j,disabled:m,children:p("cancel")}),s.jsx("button",{className:`
5            ${a.button}
6            ${o["sand-btn"]}
7            ${f?"gradient-btn":"main-btn"}
8          `,type:"button",onClick:N,disabled:m||_.trim()==="",children:m?F("loading"):p("post-a-comment")})]})]}):null}function R({data:e=[],isParent:t=!1,showBtn:n=!1,isActive:r=!1,setIsActive:o=()=>{}}){var j,N,x;const a=v(k,q),l=window["react-layout"]==="k1",_=(e==null?void 0:e.id)||"",d=((j=e==null?void 0:e.user)==null?void 0:j.name)||"",m=((N=e==null?void 0:e.user)==null?void 0:N.avatar)||"",h=(e==null?void 0:e.average_rating)||0,i=((x=e==null?void 0:e.user)==null?void 0:x.approved_reviews_count)||0,b=As(e==null?void 0:e.created_at)||"",g=(e==null?void 0:e.content)||"",u=((e==null?void 0:e.replies)||[]).length,[w,f]=c.useState(!1);return s.jsxs("div",{className:`
9        ${a.card}
10        ${t?"":a["card-child"]}
11        ${n?a["card-with-btn"]:""}
12        ${r?a.active:""}
13      `,children:[s.jsxs("div",{className:a.head,children:[s.jsxs("div",{className:a.user,children:[s.jsx(Y,{name:d,avatarUrl:m,isReview:!0}),s.jsxs("div",{className:a["user-info"],children:[s.jsxs("div",{className:a.name,children:[s.jsx("b",{children:d}),!!i&&s.jsxs(s.Fragment,{children:["(",i," ",p("reviews"),")"]})]}),s.jsx("div",{className:a.date,children:b})]})]}),t&&s.jsxs("div",{className:a.rate,children:[s.jsx(W,{rate:h,isK1:l}),s.jsx("span",{children:h})]})]}),s.jsx("p",{className:a.text,children:g}),t&&s.jsxs(s.Fragment,{children:[s.jsx(Ds,{setIsFormShown:f}),s.jsx(Ps,{reviewId:_,name:d,isFormShown:w,setIsFormShown:f}),n&&s.jsx(Os,{isActive:r,setIsActive:o,repliesCount:u})]})]})}function Ms({data:e=[]}){const t=v(k,q),n=e.replies&&e.replies.length>0,[r,o]=c.useState(!1);return s.jsxs("div",{className:`
14        ${t.wrap}
15        ${n?t["wrap-replies"]:""}
16      `,children:[s.jsx(R,{data:e,isParent:!0,showBtn:n,isActive:r,setIsActive:o}),n&&r&&e.replies.map(a=>s.jsx(R,{data:a},a.id))]})}function Ts(){return s.jsxs("div",{className:"reviews-list-skeleton reviews-list-skeleton--alt","aria-hidden":"true",children:[s.jsx("div",{className:"reviews-list-skeleton__review"}),s.jsx("div",{className:"reviews-list-skeleton__review"})]})}function zs(){const e=v(k,q);return s.jsx("p",{className:e["no-reviews"],children:p("no-reviews-found")})}function Bs(){var a;const{stats:e,data:t,loading:n}=c.useContext($),r=t||[],o=((a=e==null?void 0:e.stats)==null?void 0:a.total_reviews)||0;return n?s.jsx(Ts,{}):o&&(!r||r.length===0)?s.jsx(zs,{}):r.map(l=>s.jsx(Ms,{data:l},l.id))}const Us="_text_onke8_4",Hs="_line_onke8_10",D={"progress-wrap":"_progress-wrap_onke8_1",text:Us,line:Hs,"line-inner":"_line-inner_onke8_17","load-more":"_load-more_onke8_25"},Vs="_text_h0ew8_4",Xs="_line_h0ew8_10",O={"progress-wrap":"_progress-wrap_h0ew8_1",text:Vs,line:Xs,"line-inner":"_line-inner_h0ew8_18","load-more":"_load-more_h0ew8_27"};function Gs({shownCount:e=0,totalCount:t=0}){const n=v(D,O),r=t>0?Math.min(100,Math.round(e/t*100)):0;return s.jsxs("div",{className:n["progress-wrap"],children:[s.jsxs("p",{className:n.text,children:[e," ",p("of")," ",t," ",p("reviews-shown")]}),s.jsx("div",{className:n.line,"aria-hidden":"true",children:s.jsx("div",{className:n["line-inner"],style:{width:`${r}%`}})})]})}function Ws({nextPage:e=1,loading:t,setPage:n}){const r=v(D,O);return s.jsx("button",{className:r["load-more"],type:"button",onClick:()=>n(e),disabled:t,children:t?F("loading"):p("load-more")})}function Ys(){const{meta:e,loading:t,pagesLoading:n,setPage:r}=c.useContext($);if(t||Object.keys(e).length===0)return null;const o=e.to??0,a=e.total??0,l=e.current_page??1,_=e.last_page??1,d=l+1;return a?s.jsxs(s.Fragment,{children:[s.jsx(Gs,{shownCount:o,totalCount:a}),l<_&&s.jsx(Ws,{nextPage:d,loading:n,setPage:r})]}):null}const I=[{label:p("date"),value:"-created_at"},{label:p("rating"),value:"-average_rating"}];function Js({id:e,name:t,logo:n}){const r=v(ne,oe),[o,a]=c.useState(I[0]),[l,_]=c.useState([]),[d,m]=c.useState(1),{stats:h,hasStats:i,error:b}=ae(e),{data:g,meta:u,loading:w,pagesLoading:f,initialized:j}
16=ce({casinoId:e,sort:o==null?void 0:o.value,filters:l,page:d,enabled:i}),N=!h||i&&!j;return b?null:N?s.jsx(ie,{}):s.jsx($.Provider,{value:{casinoId:e,casinoName:t,casinoLogo:n,stats:h,data:g,meta:u,loading:w,pagesLoading:f,sortOptions:I,sort:o,setSort:a,filters:l,setFilters:_,setPage:m},children:s.jsxs("div",{className:r.wrap,children:[s.jsx(Ce,{}),s.jsx(cs,{}),s.jsx(Bs,{}),s.jsx(Ys,{})]})})}function ut(){const e=document.getElementById("react-reviews-list");if(e){const t={id:e.dataset.id,name:e.dataset.name,logo:e.dataset.logo};M.createRoot(e).render(s.jsx(Js,{...t}))}}export{ut 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.