vendor: 10,471 bytes, line 1
1import{a1 as Sa,a2 as Ua,ah as za,r as f,ag as vt,e as q,a4 as Dl,af as Ra,z as gt,ad as ql,n as Ll,b as a,F as D,at as $a,R as et,au as Ia,d as s,a7 as Aa,av as Nl,aL as Fa,ax as Ea,T as Da,U as qa,u as La,s as Na,f as Pl,G as Pa,X as Ma,g as T,w as o,V as Ba,o as u,h as p,c as _,a as d,t as i,l as r,a0 as _e,j as J,S as Ml}from"./qXa0UkOI.js";import{_ as Oa}from"./DlAUqK2U.js";import{V as Qa}from"./DZYvAydJ.js";import{u as ja,b as y,e as Ka,V as G,a as m}from"./CRfRl_ok.js";import{d as Wa,a as ve,e as Ga,V as x,b as Dt}from"./U53C9mVz.js";import{V as qt}from"./DkOZWZRe.js";import{V as ee,a as Bl}from"./1cnyV7tM.js";import{f as Ha,V as le,b as ae,a as dl,c as sl}from"./fY5ZZOV7.js";import{V as Lt}from"./GEiD2O09.js";import{u as Ya,a as Za,g as Xa,f as Ja,e as Pt,h as en,V as Le}from"./Dt7RoE_E.js";import{V as Ol}from"./Cse1i5GT.js";import{V as tn}from"./DlYwUZ6L.js";import{V as cl}from"./CS9d6NBp.js";import{V as Nt}from"./DOuBO_oe.js";import{u as ln,h as an,m as nn}from"./BmKAgDdi.js";import{u as rn,t as ft,V as on,a as Ql}from"./C0gfi-T8.js";import{V as un,m as dn}from"./D1vOXED4.js";import{u as sn}from"./CaW-GR9b.js";import"./hK-fl9Cn.js";import"./CtL6ViMP.js";import"./BVnXLi1E.js";const cn=Ua({autoSelectFirst:{type:[Boolean,String]},clearOnSelect:{type:Boolean,default:!0},delimiters:Array,...nn({filterKeys:["title"]}),...en({hideNoData:!0,returnObject:!0}),...Aa(Ka({modelValue:null,role:"combobox"}),["validationValue","dirty","appendInnerIcon"]),...dn({transition:!1})},"VCombobox"),mn=Sa()({name:"VCombobox",props:cn(),emits:{"update:focused":g=>!0,"update:modelValue":g=>!0,"update:search":g=>!0,"update:menu":g=>!0},setup(g,n){var wt;let{emit:ne,slots:R}=n;const{t:F}=za(),j=f(),A=vt(!1),H=vt(!0),Ue=vt(!1),pt=f(),tt=f(),E=vt(-1);let Pe=!1;const N=q(()=>{var v;return(v=j.value)==null?void 0:v.color}),{items:O,transformIn:Mt,transformOut:yt}=rn(g),{textColorClasses:b,textColorStyles:lt}=Wa(N),U=Dl(g,"modelValue",[],v=>Mt(Ra(v)),v=>{const S=yt(v);return g.multiple?S:S[0]??null}),Y=ja(g),ge=q(()=>!!(g.chips||R.chip)),re=q(()=>ge.value||!!R.selection),oe=vt(!g.multiple&&!re.value?((wt=U.value[0])==null?void 0:wt.title)??"":""),Q=q({get:()=>oe.value,set:v=>{var S;if(oe.value=v??"",!g.multiple&&!re.value&&(U.value=[ft(g,v)]),v&&g.multiple&&((S=g.delimiters)!=null&&S.length)){const L=v.split(new RegExp(`(?:${g.delimiters.join("|")})+`));L.length>1&&(L.forEach(z=>{z=z.trim(),z&&M(ft(g,z))}),oe.value="")}v||(E.value=-1),H.value=!v}}),Bt=q(()=>typeof g.counterValue=="function"?g.counterValue(U.value):typeof g.counterValue=="number"?g.counterValue:g.multiple?U.value.length:Q.value.length),{filteredItems:ke,getMatches:bt}=ln(g,O,()=>H.value?"":Q.value),ie=q(()=>g.hideSelected?ke.value.filter(v=>!U.value.some(S=>S.value===v.value)):ke.value),ze=q(()=>g.hideNoData&&!ie.value.length||Y.isReadonly.value||Y.isDisabled.value),Z=Dl(g,"menu"),I=q({get:()=>Z.value,set:v=>{var S;Z.value&&!v&&((S=pt.value)!=null&&S.ΨopenChildren.size)||v&&ze.value||(Z.value=v)}}),Re=q(()=>I.value?g.closeText:g.openText);gt(oe,v=>{Pe?Ll(()=>Pe=!1):A.value&&!I.value&&(I.value=!0),ne("update:search",v)}),gt(U,v=>{var S;!g.multiple&&!re.value&&(oe.value=((S=v[0])==null?void 0:S.title)??"")});const $e=q(()=>U.value.map(v=>v.value)),Me=q(()=>{var S;return(g.autoSelectFirst===!0||g.autoSelectFirst==="exact"&&Q.value===((S=ie.value[0])==null?void 0:S.title))&&ie.value.length>0&&!H.value&&!Ue.value}),at=f(),kt=Ya(at,j);function Ot(v){Pe=!0,g.openOnClear&&(I.value=!0)}function ht(){ze.value||(I.value=!0)}function Qt(v){ze.value||(A.value&&(v.preventDefault(),v.stopPropagation()),I.value=!I.value)}function jt(v){var S;v.key!==" "&&Nl(v)&&((S=j.value)==null||S.focus())}function C(v){var z,P,K,X;if(Fa(v)||Y.isReadonly.value)return;const S=(z=j.value)==null?void 0:z.selectionStart,L=U.value.length;if(["Enter","ArrowDown","ArrowUp"].includes(v.key)&&v.preventDefault(),["Enter","ArrowDown"].includes(v.key)&&(I.value=!0),["Escape"].includes(v.key)&&(I.value=!1),["Enter","Escape","Tab"].includes(v.key)&&(Me.value&&["Enter","Tab"].includes(v.key)&&!U.value.some($=>{let{value:te}=$;return te===ie.value[0].value})&&M(ke.value[0]),H.value=!0),v.key==="ArrowDown"&&Me.value&&((P=at.value)==null||P.focus("next")),v.key==="Enter"&&Q.value&&(M(ft(g,Q.value)),re.value&&(oe.value="")),["Backspace","Delete"].includes(v.key)){if(!g.multiple&&re.value&&U.value.length>0&&!Q.value)return M(U.value[0],!1);if(~E.value){v.preventDefault();const $=E.value;M(U.value[E.value],!1),E.value=$>=L-1?L-2:$}else v.key==="Backspace"&&!Q.value&&(E.value=L-1);return}if(g.multiple)if(v.key==="ArrowLeft"){if(E.value<0&&S&&S>0)return;const $=E.value>-1?E.value-1:L-1;U.value[$]?E.value=$:(E.value=-1,(K=j.value)==null||K.setSelectionRange(Q.value.length,Q.value.length))}else if(v.key==="ArrowRight"){if(E.value<0)return;const $=E.value+1;U.value[$]?E.value=$:(E.value=-1,(X=j.value)==null||X.setSelectionRange(0,0))}else~E.value&&Nl(v)&&(E.value=-1)}function Vt(){var v;g.eager&&((v=tt.value)==null||v.calculateVisibleItems())}function nt(){var v;A.value&&(H.value=!0,(v=j.value)==null||v.focus())}function M(v){let S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!(!v||v.props.disabled))if(g.multiple){const L=U.value.findIndex(P=>(g.valueComparator||ql)(P.value,v.value)),z=S??!~L;if(~L){const P=z?[...U.value,v]:[...U.value];P.splice(L,1),U.value=P}else z&&(U.value=[...U.value,v]);g.clearOnSelect&&(Q.value="")}else{const L=S!==!1;U.value=L?[v]:[],oe.value=L&&!re.value?v.title:"",Ll(()=>{I.value=!1,H.value=!0})}}function fe(v){A.value=!0,setTimeout(()=>{Ue.value=!0})}function he(v){Ue.value=!1}function Ie(v){(v==null||v===""&&!g.multiple&&!re.value)&&(U.value=[])}return gt(A,(v,S)=>{if(!(v||v===S)&&(E.value=-1,I.value=!1,Q.value)){if(g.multiple){M(ft(g,Q.value));return}if(!re.value)return;U.value.some(L=>{let{title:z}=L;return z===Q.value})?oe.value="":M(ft(g,Q.value))}}),gt(I,()=>{if(!g.hideSelected&&I.value&&U.value.length){const v=ie.value.findIndex(S=>U.value.some(L=>(g.valueComparator||ql)(L.value,S.value)));Ea&&window.requestAnimationFrame(()=>{var S;v>=0&&((S=tt.value)==null||S.scrollToIndex(v))})}}),gt(()=>g.items,(v,S)=>{I.value||A.value&&!S.length&&v.length&&(I.value=!0)}),sn(()=>{const v=!!(!g.hideNoData||ie.value.length||R["prepend-item"]||R["append-item"]||R["no-data"]),S=U.value.length>0,L=y.filterProps(g);return a(y,et({ref:j},L,{modelValue:Q.value,"onUpdate:modelValue":[z=>Q.value=z,Ie],focused:A.value,"onUpdate:focused":z=>A.value=z,validationValue:U.externalValue,counterValue:Bt.value,dirty:S,class:["v-combobox",{"v-combobox--active-menu":I.value,"v-combobox--chips":!!g.chips,"v-combobox--selection-slot":!!re.value,"v-combobox--selecting-index":E.value>-1,[`v-combobox--${g.multiple?"multiple":"single"}`]:!0},g.class],style:g.style,readonly:Y.isReadonly.value,placeholder:S?void 0:g.placeholder,"onClick:clear":Ot,"onMousedown:control":ht,onKeydown:C}),{...R,default:()=>a(D,null,[a(Za,et({ref:pt,modelValue:I.value,"onUpdate:modelValue":z=>I.value=z,activator:"parent",contentClass:"v-combobox__content",disabled:ze.value,eager:g.eager,maxHeight:310,openOnClick:!1,closeOnContentClick:!1,transition:g.transition,onAfterEnter:Vt,onAfterLeave:nt},g.menuProps),{default:()=>[v&&a(on,et({ref:at,selected:$e.value,selectStrategy:g.multiple?"independent":"single-independent",onMousedown:z=>z.preventDefault(),onKeydown:jt,onFocusin:fe,onFocusout:he,tabindex:"-1","aria-live":"polite",color:g.itemColor??g.color},kt,g.listProps),{default:()=>{var z,P,K;return[(z=R["prepend-item"])==null?void 0:z.call(R),!ie.value.length&&!g.hideNoData&&(((P=R["no-data"])==null?void 0:P.call(R))??a(Ql,{key:"no-data",title:F(g.noDataText)},null)),a(Xa,{ref:tt,renderless:!0,items:ie.value,itemKey:"value"},{default:X=>{var Be;let{item:$,index:te,itemRef:B}=X;const ue=et($.props,{ref:B,key:$.value,active:Me.value&&te===0?!0:void 0,onClick:()=>M($,null)});return((Be=R.item)==null?void 0:Be.call(R,{item:$,index:te,props:ue}))??a(Ql,et(ue,{role:"option"}),{prepend:Oe=>{let{isSelected:Ve}=Oe;return a(D,null,[g.multiple&&!g.hideSelected?a(Ja,{key:$.value,modelValue:Ve,ripple:!1,tabindex:"-1"},null):void 0,$.props.prependAvatar&&a(un,{image:$.props.prependAvatar},null),$.props.prependIcon&&a(ve,{icon:$.props.prependIcon},null)])},title:()=>{var Oe;return H.value?$.title:an("v-combobox",$.title,(Oe=bt($))==null?void 0:Oe.title)}})}}),(K=R["append-item"])==null?void 0:K.call(R)]}})]}),U.value.map((z,P)=>{function K(B){B.stopPropagation(),B.preventDefault(),M(z,!1)}const X={"onClick:close":K,onKeydown(B){B.key!=="Enter"&&B.key!==" "||(B.preventDefault(),B.stopPropagation(),K(B))},onMousedown(B){B.preventDefault(),B.stopPropagation()},modelValue:!0,"onUpdate:modelValue":void 0},$=ge.value?!!R.chip:!!R.selection,te=$?Ia(ge.value?R.chip({item:z,index:P,props:X}):R.selection({item:z,index:P})):void 0;if(!($&&!te))return a("div",{key:z.value,class:["v-combobox__selection",P===E.value&&["v-combobox__selection--selected",b.value]],style:P===E.value?lt.value:{}},[ge.value?R.chip?a(Ga,{key:"chip-defaults",defaults:{VChip:{closable:g.closableChips,size:"small",text:z.title}}},{default:()=>[te]}):a(Pt,et({key:"chip",closable:g.closableChips,size:"small",text:z.title,disabled:z.props.disabled},X),null):te??a("span",{class:"v-combobox__selection-text"},[z.title,g.multiple&&P<U.value.length-1&&a("span",{class:"v-combobox__selection-comma"},[s(",")])])])})]),"append-inner":function(){var X,$;for(var z=arguments.length,P=new Array(z),K=0;K<z;K++)P[K]=arguments[K];return a(D,null,[(X=R["append-inner"])==null?void 0:X.call(R,...P),(!g.hideNoData||g.items.length)&&g.menuIcon?a(ve,{class:"v-combobox__menu-icon",color:($=j.value)==null?void 0:$.fieldIconColor,icon:g.menuIcon,onMousedown:Qt,onClick:$a,"aria-label":F(Re.value),title:F(Re.value),tabindex:"-1"},null):void 0])}})}),Ha({isFocused:A,isPristine:H,menu:I,search:Q,selectionIndex:E,filteredItems:ke,select:M},j)}}),ml="tournamentregtoken",_n=Da("tournamentregtoken",()=>{const g=f(null);function n(R){g.value=R,R?window.localStorage.setItem(ml,R):window.localStorage.removeItem(ml)}function ne(){g.value||(g.value=window.localStorage.getItem(ml))}return{token:g,updateToken:n,startup:ne}}),vn=window.setInterval,gn={class:"text-h5 font-weight-bold text-green-darken-3"},fn={key:1},pn={key:0,class:"text-center py-8 text-grey-darken-1"},yn={key:1},bn={class:"text-h6 font-weight-bold text-green-darken-3 mb-1"},kn={key:0,class:"text-body-2 text-grey-darken-2 mb-2"}
1,hn={key:0},Vn={key:0},wn={key:0},xn={key:0},Cn=["href"],Tn={key:2},Sn={class:"trnreg-lookup-wrap mb-3"},Un={key:0,class:"trnreg-searching-hint"},zn={key:1,class:"trnreg-dropdown"},Rn=["onMousedown"],$n={class:"trnreg-dropdown-meta"},In={key:2,class:"trnreg-searching-hint"},An={key:2},Fn={class:"font-weight-bold"},En={class:"mt-1"},Dn={key:1,class:"mb-3"},qn={class:"text-h6 font-weight-bold text-green-darken-3"},Ln={key:0},Nn={class:"text-body-2 text-grey-darken-1 font-weight-regular"},Pn={key:0,class:"text-center py-8 text-grey-darken-1"},Mn={key:1,class:"trnreg-table-scroll"},Bn={class:"bg-green-lighten-5"},On={key:3,class:"d-flex justify-center"},Qn={class:"text-h6 font-weight-bold text-green-darken-3 mb-3"},jn={class:"text-body-2 mb-3"},Kn={class:"text-caption text-medium-emphasis mt-2"},Wn={key:4},Gn={key:2},Hn={class:"text-h6 font-weight-bold text-green-darken-3"},Yn={key:1,class:"text-center py-8 text-grey-darken-1"},Zn={key:0,class:"text-center py-6 text-grey-darken-1"},Xn={class:"text-subtitle-1 font-weight-bold text-green-darken-3"},Jn={class:"text-body-2 text-grey-darken-2"},er={key:0},tr={key:0,class:"text-body-2 text-grey-darken-2"},lr={class:"d-flex flex-wrap ga-2 mt-3"},ar={key:1,class:"mt-6"},nr={class:"text-subtitle-1 font-weight-bold text-grey-darken-2"},rr={class:"text-body-2 text-grey-darken-2"},or={key:0},ir={class:"d-flex flex-wrap ga-2 mt-3"},ur={key:3},dr={class:"text-h6 font-weight-bold text-green-darken-3"},sr={class:"text-body-2 text-grey-darken-2"},cr={key:0},mr={key:0},_r={key:0},vr={class:"text-subtitle-2 font-weight-bold text-green-darken-3 mb-1"},gr={key:0,class:"text-body-2 text-grey-darken-1 mb-2"},fr={key:2,class:"text-body-2 text-grey-darken-1"},pr={class:"text-body-2"},yr={class:"text-grey-darken-1"},br={class:"text-subtitle-1 font-weight-bold text-green-darken-3 mb-2"},kr={class:"text-body-2 text-grey-darken-1 font-weight-regular"},hr={key:0,class:"text-center py-8 text-grey-darken-1"},Vr={key:1,class:"trnreg-table-scroll"},wr={class:"bg-green-lighten-5"},xr={class:"text-no-wrap"},Cr={class:"trnreg-lookup-wrap mb-3"},Tr={key:0,class:"trnreg-searching-hint"},Sr={key:1,class:"trnreg-dropdown"},Ur=["onMousedown"],zr={class:"trnreg-dropdown-meta"},Rr={class:"text-body-2 font-weight-bold mb-1"},$r={class:"text-subtitle-2 font-weight-bold text-green-darken-3 mt-2"},Ir={class:"trnreg-lookup-wrap"},Ar={key:0,class:"trnreg-searching-hint"},Fr={key:1,class:"trnreg-dropdown"},Er=["onMousedown"],Dr={class:"trnreg-dropdown-meta"},qr={key:2,class:"trnreg-searching-hint"},Lr={class:"text-body-2 mt-1"},Nr={class:"text-grey-darken-1"},Pr={key:1,class:"text-grey-darken-1"},Mr={class:"trnreg-lookup-wrap"},Br={key:0,class:"trnreg-searching-hint"},Or={key:1,class:"trnreg-dropdown"},Qr=["onMousedown"],jr={class:"trnreg-dropdown-meta"},Kr={key:2,class:"trnreg-searching-hint"},Wr={class:"text-body-2 mt-1"},Gr={class:"text-grey-darken-1"},Hr={key:1,class:"text-grey-darken-1"},Yr={class:"trnreg-lookup-wrap"},Zr={key:0,class:"trnreg-searching-hint"},Xr={key:1,class:"trnreg-dropdown"},Jr=["onMousedown"],eo={class:"trnreg-dropdown-meta"},to={key:2,class:"trnreg-searching-hint"},lo={class:"text-body-2 mt-1"},ao={class:"text-grey-darken-1"},no={key:1,class:"text-grey-darken-1"},ro={class:"text-subtitle-2 font-weight-bold text-green-darken-3 mt-2"},oo={class:"trnreg-lookup-wrap"},io={key:0,class:"trnreg-searching-hint"},uo={key:1,class:"trnreg-dropdown"},so=["onMousedown"],co={class:"trnreg-dropdown-meta"},mo={key:2,class:"trnreg-searching-hint"},_o={class:"text-body-2 mt-1"},vo={class:"text-grey-darken-1"},go={key:1,class:"text-grey-darken-1"},fo={class:"text-subtitle-2 font-weight-bold text-green-darken-3 mt-2"},po={class:"font-weight-bold text-body-1 my-2"},yo="/tools/tournament_registrations",Ne="23:59",bo={__name:"tournament_registrations",setup(g){const{t:n,locale:ne}=qa(),R=Ma(),{$backend:F}=La(),j=_n(),{token:A}=Na(j),H={last_name:"",first_name:"",sex:"",date_birth:"",place_birth:"",country_residence:"",nationality:"",phone:"",gsm:"",email:"",national_id:"",national_club:"",national_club_name:"",affiliated:null,fide_id:"",fide_rating_standard:"",fide_rating_rapid:"",fide_rating_blitz:"",fide_title:"",fide_federation:"",category_index:"",note:"",contact:"",rounds_absent:"",g_license:!1},Ue={name:"",address:"",city:"",system:"",rounds:"",categories:[],opening_registrations:"",closing_registrations:"",obligatory_presence:"",date_start:"",date_end:"",time_control:"",time_control_details:"",swar_cadence_number:"",event_c
1ode_fide_a:"",event_code_fide_b:"",event_code_fide_c:"",url:"",organizing_club:"",federation:"",chief_arbiter_person_id:"",chief_arbiter_name:"",chief_arbiter_email:"",chief_arbiter_phone:"",deputy_arbiter_1_person_id:"",deputy_arbiter_1_name:"",deputy_arbiter_1_email:"",deputy_arbiter_2_person_id:"",deputy_arbiter_2_name:"",deputy_arbiter_2_email:"",chief_organizer_person_id:"",chief_organizer_name:"",chief_organizer_email:"",chief_organizer_phone:"",email_copy_1:"",email_copy_2:"",email_copy_3:"",fide_homologated:!1,export_per_category:!1},pt=["FIDE","KBSB","VSF","FEFB","SVDB"],tt=["SWISS","SWISS_DBL","SWISS_ACCELERE","SWISS_321","SWISS_BAKU","SW_AMERICAIN","SW_AMERICAIN_DBL","ROBIN","ROBIN_DBL","ROBIN_AR"],E=["Std","Rapid","Blitz"],Pe={Std:[[1,"105 min/40 coups + 15 min. QPF"],[2,'120 min/40 coups + 15 min. avec incr. 30" à partir du 40ème coup'],[3,"120 min/40 coups + 30 min. QPF"],[4,'120 min/10 coups + 30 min. avec incr. 30" à partir du 40ème coup'],[5,"120 min QPF"],[6,"150 min QPF"],[7,"60 min QPF"],[8,'60 min avec incrément de 30"'],[9,"65 min QPF"],[10,'75 min avec incrément de 30"'],[11,'90 min/40 coups + 15 min avec incr. 30" à partir du 1er coup'],[12,'90 min/40 coups + 30 min avec incr. 30" à partir du 1er coup'],[13,'90 min avec incrément de 30"'],[14,"various - other"]],Rapid:[[1,'10 min. avec incr. 10"'],[2,'10 min. avec incr. 15"'],[3,'10 min. avec incr. 5"'],[4,"11 min. QPF"],[5,"12 min. QPF"],[6,'13 min. avec incr. 3"'],[7,'13 min. avec incr. 5"'],[8,"15 min. QPF"],[9,'15 min. avec incr. 10"'],[10,'15 min. avec incr. 15"'],[11,'15 min. avec incr. 5"'],[12,"20 min. QPF"],[13,'20 min. avec incr. 10"'],[14,'20 min. avec incr. 15"'],[15,'20 min. avec incr. 5"'],[16,"25 min. QPF"],[17,'25 min. avec incr. 10"'],[18,'25 min. avec incr. 15"'],[19,'25 min. avec incr. 5"'],[20,"30 min. QPF"],[21,"45 min. QPF"],[22,'8 min. avec incr. 4"'],[23,"various - other"]],Blitz:[[1,'3 min. avec incr. 2"'],[2,'3 min. avec incr. 3"'],[3,'4 min. avec incr. 2"'],[4,'4 min. avec incr. 3"'],[5,"5 min. QPF"],[6,'5 min. avec incr. 2"'],[7,'5 min. avec incr. 3"'],[8,'6 min. avec incr. 2"'],[9,'6 min. avec incr. 3"'],[10,'7 min. avec incr. 2"'],[11,"various - other"]]},N=f("list"),O=q(()=>R.query.trn||null),Mt=Ba();function yt(l){if(!O.value)return;const e={...R.query};l==="form"?e.view="register":delete e.view,Mt.replace({query:e})}const b=f(null),lt=f(!1),U=f(""),Y=f("");function ge(l){ne.value=l}function re(){fe.value&&K(),N.value="form",yt("form"),b.value||ie()}function oe(){N.value="list",yt("list"),Be()}function Q(){N.value="login"}async function Bt(){N.value="admin",Fe.value.length||await We(),ke()}function ke(){if(!O.value)return;const l=Fe.value.find(e=>String(e.id)===String(O.value));l&&(!V.value||V.value.id!==l.id)&&el(l)}function bt(){j.updateToken(null),Y.value="",typeof window<"u"&&window.localStorage.removeItem("tournamentregname"),V.value=null,Ke.value=[],Fe.value=[],N.value=O.value?"list":"login",O.value&&Be()}async function ie(){if(O.value){lt.value=!0,U.value="";try{const l=await F("tournament_registrations","getTournament",{id:O.value});b.value=l.data.tournament,ze()}catch(l){b.value=null,U.value=l.code===404?n("trnreg.tournament_not_found"):n("trnreg.load_tournament_failed")}finally{lt.value=!1}}}function ze(){const l=b.value&&Array.isArray(b.value.categories)?b.value.categories.length:0;C.value.category_index=l===1?0:""}const Z=f(""),I=f([]),Re=f(!1),$e=f(null);let Me=null;function at(){clearTimeout(Me),$e.value=null;const l=Z.value;if(!l||l.trim().length<2){I.value=[];return}Me=setTimeout(async()=>{Re.value=!0;try{const e=await F("tournament_registrations","lookup",{id:O.value,q:l});if(Z.value!==l)return;I.value=e.data&&e.data.players||[]}catch{Z.value===l&&(I.value=[])}finally{Z.value===l&&(Re.value=!1)}},300)}function kt(l){const e={...l};return delete e.id,delete e.tournament_id,delete e.created_at,delete e.updated_at,delete e.submitted_ip,["fide_rating_standard","fide_rating_rapid","fide_rating_blitz","category_index"].forEach(t=>{const k=e[t];e[t]=k===""||k===null||k===void 0?null:Number(k)}),e}function Ot(l,e,t){const k={...l};return k.closing_registrations=l.closing_registrations?Vl(l.closing_registrations,t||Ne):"",k.rounds=l.rounds===""||l.rounds===null||l.rounds===void 0?null:Number(l.rounds),e?l.date_start?k.obligatory_presence=Vl(l.date_start,e):delete k.obligatory_presence:k.obligatory_presence="",k}function ht(l,e){l.last_name=e.last_name||"",l.first_name=e.first_name||"",l.sex=e.sex||"",l.national_id=e.national_id||"",l.national_club=e.club||"",l.national_club_name=e.club_name||"",l.affiliated=e.affiliated===!0?!0:e.affiliated===!1?!1:null,l.g_license=e.g_license===!0,l.fide_id=e.f
1ide_id||"",l.fide_rating_standard=e.fide_rating_standard||"",l.fide_rating_rapid=e.fide_rating_rapid||"",l.fide_rating_blitz=e.fide_rating_blitz||"",l.fide_title=e.fide_title||"",l.fide_federation=e.fide_federation||"",l.nationality=e.fide_federation||""}function Qt(l){ht(C.value,l),$e.value=l.birth_year||null,Z.value=l.name||`${l.first_name} ${l.last_name}`,I.value=[]}function jt(){I.value=[]}const C=f({...H}),Vt=f(null),nt=f(!1),M=f(""),fe=f(null),he=l=>l!=null&&String(l).trim()!==""||n("trnreg.rule_required"),Ie=q(()=>String(C.value.fide_id||"").trim()!==""),wt=l=>Ie.value||he(l),v=q(()=>!!(b.value&&b.value.fide_homologated)&&!Ie.value);function S(l){return l===!0?n("trnreg.yes"):l===!1?n("trnreg.no"):"-"}const L=/^\s*\d+(\s*,\s*\d+)*\s*$/,z=l=>!l||L.test(l)||n("trnreg.rule_rounds_absent");async function P(){M.value="";const{valid:l}=await Vt.value.validate();if(!l){M.value=n("trnreg.rule_required");return}nt.value=!0,C.value.nationality=C.value.fide_federation||"";try{const e=await F("tournament_registrations","createRegistration",{id:O.value,lang:ne.value,...kt(C.value)});fe.value=e.data.registration,oe(),typeof window<"u"&&window.scrollTo({top:0,behavior:"smooth"})}catch(e){e.code===409?M.value=n("trnreg.duplicate_error"):e.errorCode==="registrations_not_open"?M.value=n("trnreg.registrations_not_open_yet"):e.errorCode==="registrations_closed"?M.value=n("trnreg.registrations_closed"):M.value=e.message||n("trnreg.submit_failed")}finally{nt.value=!1}}function K(){C.value={...H},ze(),Z.value="",I.value=[],$e.value=null,fe.value=null,M.value=""}const X=f([]),$=f(!1),te=f(""),B=f("rating"),ue=f("desc");async function Be(){if(O.value){$.value=!0,U.value="";try{const l=await F("tournament_registrations","getRegistrations",{id:O.value});X.value=l.data&&l.data.registrations||[]}catch(l){U.value=l.message||n("trnreg.load_registrations_failed")}finally{$.value=!1}}}const Oe={Std:"fide_rating_standard",Rapid:"fide_rating_rapid",Blitz:"fide_rating_blitz"};function Ve(l){return Oe[l&&l.time_control]||"fide_rating_standard"}function xt(l,e){const t=Number(l[Ve(e)]);if(t>0)return t;const k=Number(l.fide_rating_standard);return k>0?k:null}function _l(l,e,t,k,be){let ce=l[t],me=e[t];if(t==="rating"?(ce=xt(l,be)||0,me=xt(e,be)||0):t==="category_index"||t==="fide_rating_standard"||t==="id"?(ce=Number(ce)||0,me=Number(me)||0):(ce=ce?String(ce).toLowerCase():"",me=me?String(me).toLowerCase():""),ce<me)return-1*k;if(ce>me)return 1*k;if(t==="rating"||t==="fide_rating_standard"){const Xe=`${l.last_name||""} ${l.first_name||""}`.toLowerCase(),Je=`${e.last_name||""} ${e.first_name||""}`.toLowerCase();if(Xe<Je)return-1;if(Xe>Je)return 1}return 0}function jl(l,e){return e?`${l.id} ${l.last_name} ${l.first_name} ${l.national_club} ${l.national_club_name} ${l.national_id}`.toLowerCase().includes(e):!0}const Kl=q(()=>{const l=te.value.trim().toLowerCase();return X.value.filter(e=>jl(e,l))}),Kt=q(()=>{const l=ue.value==="asc"?1:-1;return[...Kl.value].sort((e,t)=>_l(e,t,B.value,l,b.value))});function Qe(l){B.value===l?ue.value=ue.value==="asc"?"desc":"asc":(B.value=l,ue.value="asc")}function vl(l,e){if(!l||!Array.isArray(l.categories)||e==null||e==="")return"";const t=Number(e);return Number.isInteger(t)&&l.categories[t]!==void 0?l.categories[t]:""}function Wl(l){if(!l||!l.time_control)return"";const e=n("trnreg.tc_"+l.time_control);let t=(l.time_control_details||"").trim();if(!t&&l.swar_cadence_number){const k=(Pe[l.time_control]||[]).find(([be])=>be===Number(l.swar_cadence_number));k&&!/^various/i.test(k[1])&&(t=k[1])}return t?`${e}: ${t}`:e}function de(l){if(!l)return"";const e=String(l).match(/^(\d{4})-(\d{2})-(\d{2})/);return e?`${e[3]}/${e[2]}/${e[1]}`:String(l)}function we(l){if(!l)return"";const e=String(l).match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:""}const rt=f(!1),h=f({...H}),gl=f(null),Wt=f(!1),Gt=f(!1),Ae=f(""),xe=f(""),Ce=f([]),Ht=f(!1);let fl=null;function Gl(l){gl.value=l.id,Wt.value=!0,xe.value="",Ce.value=[],Ae.value="",h.value={...H,...l,date_birth:we(l.date_birth)},rt.value=!0}function Hl(){rt.value=!1}function Yl(){clearTimeout(fl);const l=xe.value,e=Wt.value?V.value&&V.value.id:O.value;if(!l||l.trim().length<2){Ce.value=[];return}fl=setTimeout(async()=>{Ht.value=!0;try{const t=await F("tournament_registrations","lookup",{id:e,q:l});if(xe.value!==l)return;Ce.value=t.data&&t.data.players||[]}catch{xe.value===l&&(Ce.value=[])}finally{xe.value===l&&(Ht.value=!1)}},300)}function Zl(l){ht(h.value,l),xe.value=l.name||`${l.first_name} ${l.last_name}`,Ce.value=[]}const Xl=q(()=>{const l=Wt.value?V.value:b.value;return l&&l.categories||[]});async function Jl(){Gt.value=!0,Ae.value="";try{await F("tournament_registrations","admin_updateRegistration",{id:gl.value,token:A.value,...kt(h.value)}),rt.value=!1,await Rt()}catch(l){l.code===409?Ae.value=n("trnreg.duplicate_error"):l.code===404?Ae.value=n("trnreg.registration_not_found"):Ae.value=l.message||n("trnreg.update_failed")}finally{Gt.value=!1}}async function ea(l){if(!(typeof window<"u"&&!window.confirm(n("trnreg.delete_confirm")))){W.value="",pe.value="";try{await F("tournament_registrations","admin_deleteRegistration",{id:l.id,token:A.value}),pe.value=n("trnreg.delete_success"),await Rt()}catch(e){W.value=e.message||n("trnreg.delete_failed")}}}const Yt=f(""),Ct=f(""),Te=f(""),je=f(!1),Zt=f(""),Tt=f(""),St=f(!1);async function ta(l){j.updateToken(l.data.token),Y.value=l.data.name||"",typeof window<"u"&&window.localStorage.setItem("tournamentregname",Y.value),N.value="admin",await We(),ke()}async function la(){je.value=!0,Te.value="";try{const l=await F("tournament_registrations","admin_odooLogin",{email:Zt.value,password:Tt.value});Tt.value="",await ta(l)}catch(l){l.code===401?Te.value=n("trnreg.login_failed"):l.code===403?Te.value=n("trnreg.odoo_not_member"):Te.value=l.message||n("trnreg.login_failed")}finally{je.value=!1}}async function aa(){je.value=!0,Te.value="";try{const l=await F("tournament_registrations","admin_login",{username:Yt.value,password:Ct.value});j.updateToken(l.data.token),Y.value=l.data.name||"",typeof window<"u"&&window.localStorage.setItem("tournamentregname",Y.value),Ct.value="",N.value="admin",await We(),ke()}catch(l){Te.value=l.code===401?n("trnreg.login_failed"):l.message||n("trnreg.login_failed")}finally{je.value=!1}}const Fe=f([]),Xt=f(!1),W=f(""),pe=f(""),V=f(null),Ke=f([]),Jt=f(!1),Ee=f("id"),Se=f("asc"),na=q(()=>{const l=Se.value==="asc"?1:-1;return[...Ke.value].sort((e,t)=>
1_l(e,t,Ee.value,l,V.value))});function Ut(l){Ee.value===l?Se.value=Se.value==="asc"?"desc":"asc":(Ee.value=l,Se.value="asc")}async function We(){if(A.value){Xt.value=!0,W.value="";try{const l=await F("tournament_registrations","admin_getMyTournaments",{token:A.value});Fe.value=l.data&&l.data.tournaments||[],pl.value=l.data&&l.data.owner||null}catch(l){W.value=l.message||n("trnreg.admin_load_tournaments_failed"),l.code===401&&bt()}finally{Xt.value=!1}}}function el(l){V.value=l,_t.value=null,W.value="",pe.value="",Rt(),ra()}const pl=f(null),Ge=f([]),zt=f(""),He=f(!1),ye=f("");function ot(l){return!!l&&l.owner===pl.value}async function ra(){if(Ge.value=[],ye.value="",!!V.value)try{const l=await F("tournament_registrations","admin_getTournamentAdmins",{id:V.value.id,token:A.value});Ge.value=l.data.admins||[]}catch(l){ye.value=l.message}}async function oa(){const l=String(zt.value||"").trim();if(!/^-?\d+$/.test(l)){ye.value=n("trnreg.share_need_number");return}He.value=!0,ye.value="";try{const e=await F("tournament_registrations","admin_addTournamentAdmin",{id:V.value.id,token:A.value,national_id:Number(l)});Ge.value=e.data.admins||[],zt.value=""}catch(e){ye.value=e.code===404?n("trnreg.share_no_member").replace("{id}",l):e.message}finally{He.value=!1}}async function ia(l){const e=l.name?`${l.name} (${l.national_id})`:String(l.national_id);if(!(typeof window<"u"&&!window.confirm(n("trnreg.share_remove_confirm").replace("{who}",e)))){He.value=!0,ye.value="";try{const t=await F("tournament_registrations","admin_removeTournamentAdmin",{id:V.value.id,token:A.value,national_id:l.national_id});Ge.value=t.data.admins||[]}catch(t){ye.value=t.message}finally{He.value=!1}}}function yl(){V.value=null,Ke.value=[]}const it=f(!1),se=f(null),ut=f(""),tl=f(!1),dt=f("");function ua(l){se.value=l,ut.value="",dt.value="",it.value=!0}function da(){it.value=!1,se.value=null}async function sa(){if(!(!se.value||ut.value!==se.value.name)){tl.value=!0,dt.value="";try{await F("tournament_registrations","admin_deleteTournament",{id:se.value.id,token:A.value});const l=V.value&&V.value.id===se.value.id;it.value=!1,se.value=null,l&&yl(),pe.value=n("trnreg.admin_delete_tournament_success"),await We()}catch(l){dt.value=l.message||n("trnreg.admin_delete_tournament_failed")}finally{tl.value=!1}}}function bl(l){return`${yo}?trn=${encodeURIComponent(l.id)}`}async function Rt(){if(V.value){Jt.value=!0;try{const l=await F("tournament_registrations","admin_getRegistrations",{id:V.value.id,token:A.value});Ke.value=l.data&&l.data.registrations||[]}catch(l){W.value=l.message||n("trnreg.load_registrations_failed")}finally{Jt.value=!1}}}const Ye=f(!1),st=f("create"),c=f({...Ue}),ll=f(!1),De=f(""),ca=q(()=>{const l=Pe[c.value.time_control];return l?l.map(([e,t])=>({title:`${e} â ${t}`,value:e})):[]}),qe=f(""),ma=new Intl.DateTimeFormat("en-GB",{timeZone:"Europe/Brussels",hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"});function kl(l){const e={};for(const t of ma.formatToParts(new Date(l)))e[t.type]=t.value;return e}function hl(l){const e=kl(l);return Date.UTC(+e.year,+e.month-1,+e.day,+e.hour,+e.minute,+e.second)-Math.floor(l/1e3)*1e3}function Vl(l,e){const[t,k,be]=l.split("-").map(Number),[ce,me]=e.split(":").map(Number),Xe=Date.UTC(t,k-1,be,ce,me,0);let Je=Xe-hl(Xe);return Je=Xe-hl(Je),new Date(Je).toISOString()}function wl(l){if(!l)return{date:"",time:""};const e=new Date(l);if(isNaN(e.getTime()))return{date:"",time:""};const t=kl(e.getTime());return{date:`${t.year}-${t.month}-${t.day}`,time:`${t.hour}:${t.minute}`}}function xl(l){return wl(l).time}const Ze=f(Ne);function Cl(l){const e=new Date(l);return e.getUTCHours()===0&&e.getUTCMinutes()===0&&e.getUTCSeconds()===0&&e.getUTCMilliseconds()===0}function al(l){if(!l)return{date:"",time:Ne};const e=new Date(l);return isNaN(e.getTime())?{date:"",time:Ne}:Cl(l)?{date:we(l),time:Ne}:wl(l)}function _a(l){const{date:e,time:t}=al(l);return e?`${de(e)} ${t}`:""}function va(l,e=new Date){if(!l)return!1;const t=new Date(l);return isNaN(t.getTime())?!1:Cl(l)?new Intl.DateTimeFormat("en-CA",{timeZone:"Europe/Brussels"}).format(e)>we(l):e.getTime()>=t.getTime()}const nl=f(Date.now());let Tl=null;Pl(()=>{Tl=vn(()=>nl.value=Date.now(),3e4)}),Pa(()=>clearInterval(Tl));const Sl=q(()=>va(b.value&&b.value.closing_registrations,new Date(nl.value))),ga=["chief_arbiter","deputy_arbiter_1","deputy_arbiter_2","chief_organizer"];function Ul(){const l={};
1return ga.forEach(e=>{l[e]={query:"",results:[],searching:!1}}),l}const w=f(Ul()),zl={};function Rl(){w.value=Ul()}function $t(l){clearTimeout(zl[l]);const e=w.value[l].query;if(!e||e.trim().length<2){w.value[l].results=[];return}zl[l]=setTimeout(async()=>{w.value[l].searching=!0;try{const t=await F("tournament_registrations","lookupGlobal",{q:e});if(w.value[l].query!==e)return;w.value[l].results=t.data&&t.data.players||[]}catch{w.value[l].query===e&&(w.value[l].results=[])}finally{w.value[l].query===e&&(w.value[l].searching=!1)}},300)}function It(l,e){const t=e.name||`${e.first_name} ${e.last_name}`;c.value[`${l}_person_id`]=e.fide_id||"",c.value[`${l}_name`]=t,w.value[l].query=t,w.value[l].results=[]}function At(l){c.value[`${l}_person_id`]="",c.value[`${l}_name`]=""}function Ft(l){w.value[l].results=[]}function fa(){st.value="create",c.value={...Ue,categories:[]},qe.value="",Ze.value=Ne,Rl(),De.value="",Ye.value=!0}function rl(l){st.value="edit",c.value={...Ue,...l,categories:Array.isArray(l.categories)?[...l.categories]:[],date_start:we(l.date_start),date_end:we(l.date_end),opening_registrations:we(l.opening_registrations),closing_registrations:al(l.closing_registrations).date},qe.value=xl(l.obligatory_presence),Ze.value=al(l.closing_registrations).time,Rl(),De.value="",Ye.value=!0}function pa(){Ye.value=!1}function ol(l){rl(l),st.value="create",delete c.value.id,delete c.value.created_at,delete c.value.updated_at,c.value.name=`${l.name||""} ${n("trnreg.copy_suffix")}`.trim()}function ya(){const l=c.value;l.chief_organizer_person_id=l.chief_arbiter_person_id,l.chief_organizer_name=l.chief_arbiter_name,l.chief_organizer_email=l.chief_arbiter_email,l.chief_organizer_phone=l.chief_arbiter_phone,w.value.chief_organizer.query=l.chief_arbiter_name||""}function $l(l,e){const t=c.value;!t[l]&&t[e]&&(t[l]=t[e])}function ba(){const l=c.value;if(l.date_start&&l.date_end&&l.date_end<l.date_start)return n("trnreg.rule_end_after_start");if(l.opening_registrations&&l.closing_registrations&&l.closing_registrations<l.opening_registrations)return n("trnreg.rule_closing_after_opening");if(l.closing_registrations&&l.date_start){if(l.closing_registrations>l.date_start)return n("trnreg.rule_closing_before_start");if(l.closing_registrations===l.date_start&&qe.value&&(Ze.value||Ne)>qe.value)return n("trnreg.rule_closing_before_presence")}return l.fide_homologated&&![l.event_code_fide_a,l.event_code_fide_b,l.event_code_fide_c].some(e=>e&&String(e).trim())?n("trnreg.rule_event_code_required"):""}const Et=f(!1);function Il(l){const e=we(l.date_end)||we(l.date_start);return e?new Intl.DateTimeFormat("en-CA",{timeZone:"Europe/Brussels"}).format(new Date(nl.value))>e:!1}const Al=q(()=>Fe.value.filter(l=>!Il(l))),il=q(()=>Fe.value.filter(l=>Il(l)));function ka(){c.value.categories.push("")}function ha(l){c.value.categories.splice(l,1)}async function Va(){if(De.value=ba(),!De.value){ll.value=!0,pe.value="";try{const l=c.value.categories.filter(k=>k&&k.trim()),e={...Ot(c.value,qe.value,Ze.value),categories:l};delete e.id,delete e.created_at,delete e.updated_at;let t;st.value==="create"?t=await F("tournament_registrations","admin_createTournament",{token:A.value,...e}):t=await F("tournament_registrations","admin_updateTournament",{id:c.value.id,token:A.value,...e}),Ye.value=!1,pe.value=n("trnreg.admin_save_tournament_success"),await We(),t.data&&t.data.tournament&&V.value&&V.value.id===t.data.tournament.id&&(V.value=t.data.tournament)}catch(l){De.value=l.message||n("trnreg.admin_save_tournament_failed")}finally{ll.value=!1}}}const ct=f({}),mt=f({}),wa=q(()=>{const l=V.value,e=l&&Array.isArray(l.categories)?l.categories:[];return!l||!l.export_per_category||e.length<2?[{key:"all",label:""}]:e.map((t,k)=>({key:String(k),label:t}))}),ul=f(!1),_t=f(null);function Fl(l,e){const t=window.URL.createObjectURL(l),k=document.createElement("a");k.href=t,k.download=e,document.body.appendChild(k),k.click(),document.body.removeChild(k),window.URL.revokeObjectURL(t)}function El(l){return l==="all"?"":`_cat${Number(l)+1}`}async function xa(l){if(V.value){ct.value={...ct.value,[l]:!0},W.value="";try{const e=await F("tournament_registrations","admin_exportCsv",{id:V.value.id,token:A.value,category:l==="all"?null:l});Fl(e.data,`registrations_${V.value.id}${El(l)}.csv`)}catch{W.value=n("trnreg.admin_export_failed")}finally{ct.value={...ct.value,[l]:!1}}}}async function Ca(l){if(V.value){mt.value={...mt.value,[l]:!0},W.value="";try{const e=await F("tournament_registrations","admin_exportSwar",{id:V.value.id,category:l,token:A.value});Fl(e.data,`swar_${V.value.id}${El(l)}.csv`)}catch{W.value=n("trnreg.admin_export_failed")}finally{mt.value={...mt.value,[l]:!1}}}}async function Ta(){if(V.value){ul.value=!0,_t.value=null,W.value="";try{const l=await F("tournament_registrations","admin_refreshElo",{id:V.value.id,token:A.value});_t.value=l.data.updated,await Rt()}catch{W.value=n("trnreg.admin_refresh_elo_failed")}finally{ul.value=!1}}}return Pl(()=>{const l=R.query.locale||R.query.lang;ne.value=["en","nl","fr","de"].includes(l)?l:"nl",j.startup(),typeof window<"u"&&(Y.value=window.localStorage.getItem("tournamentregname")||""),O.value?(N.value=["register","form"].includes(R.query.view)?"form":"list",N.value==="list"&&Be()):A.value?(N.value="admin",We()):N.value="login",O.value&&ie(),typeof window<"u"&&window.parent!==window&&new ResizeObserver(t=>{for(const k of t)window.parent.postMessage({type:"kbsb-iframe-resize",height:k.target.scrollHeight},"*")}).observe(document.body)}),(l,e)=>(u(),T(Qa,{class:"my-4 trnreg-shell"},{default:o(()=>[a(G,{class:"mb-2 align-center",justify:"space-between"},{default:o(()=>[a(m,{cols:"auto"},{default:o(()=>[d("h1",gn,i(r(n)("trnreg.title")),1)]),_:1}
1),a(m,{cols:"auto",class:"d-flex ga-1"},{default:o(()=>[a(x,{size:"small",variant:"text",active:r(ne)==="fr",onClick:e[0]||(e[0]=t=>ge("fr"))},{default:o(()=>e[123]||(e[123]=[s("FR")])),_:1},8,["active"]),a(x,{size:"small",variant:"text",active:r(ne)==="nl",onClick:e[1]||(e[1]=t=>ge("nl"))},{default:o(()=>e[124]||(e[124]=[s("NL")])),_:1},8,["active"]),a(x,{size:"small",variant:"text",active:r(ne)==="en",onClick:e[2]||(e[2]=t=>ge("en"))},{default:o(()=>e[125]||(e[125]=[s("EN")])),_:1},8,["active"]),a(x,{size:"small",variant:"text",active:r(ne)==="de",onClick:e[3]||(e[3]=t=>ge("de"))},{default:o(()=>e[126]||(e[126]=[s("DE")])),_:1},8,["active"])]),_:1})]),_:1}),a(G,{class:"mb-3 align-center",dense:""},{default:o(()=>[O.value&&N.value!=="list"?(u(),T(m,{key:0,cols:"auto"},{default:o(()=>[a(x,{size:"small",variant:"tonal",color:"green-darken-2","prepend-icon":"mdi-format-list-bulleted",onClick:oe},{default:o(()=>[s(i(r(n)("trnreg.nav_list")),1)]),_:1})]),_:1})):p("",!0),a(qt),r(A)?(u(),_(D,{key:2},[N.value!=="admin"?(u(),T(m,{key:0,cols:"auto"},{default:o(()=>[a(x,{size:"small",variant:"text",color:"green-darken-2","prepend-icon":"mdi-view-dashboard",onClick:Bt},{default:o(()=>[s(i(r(n)("trnreg.nav_admin")),1)]),_:1})]),_:1})):p("",!0),Y.value?(u(),T(m,{key:1,cols:"auto",class:"text-body-2 text-grey-darken-1 d-flex align-center"},{default:o(()=>[s(i(r(n)("trnreg.logged_in_as"))+":Â ",1),d("strong",null,i(Y.value),1)]),_:1})):p("",!0),a(m,{cols:"auto"},{default:o(()=>[a(x,{size:"small",variant:"text",color:"grey-darken-1","prepend-icon":"mdi-logout",onClick:bt},{default:o(()=>[s(i(r(n)("trnreg.nav_logout")),1)]),_:1})]),_:1})],64)):(u(),T(m,{key:1,cols:"auto"},{default:o(()=>[a(x,{size:"small",variant:"text",color:"grey-darken-1","prepend-icon":"mdi-shield-account",onClick:Q},{default:o(()=>[s(i(r(n)("trnreg.nav_login")),1)]),_:1})]),_:1}))]),_:1}),U.value?(u(),T(ee,{key:0,type:"error",closable:"",class:"mb-4","onClick:close":e[4]||(e[4]=t=>U.value="")},{default:o(()=>[s(i(U.value),1)]),_:1})):p("",!0),N.value==="form"||N.value==="list"?(u(),_("div",fn,[O.value?(u(),_("div",yn,[lt.value?(u(),T(G,{key:0,justify:"center",class:"my-8"},{default:o(()=>[a(Dt,{indeterminate:"",color:"green"})]),_:1})):b.value?(u(),T(le,{key:1,class:"mb-4 elevation-2 border-green"},{default:o(()=>[a(ae,null,{default:o(()=>[d("h2",bn,i(b.value.name),1),b.value.address||b.value.city?(u(),_("div",kn,[d("strong",null,i(r(n)("trnreg.th_location"))+":",1),s(" "+i(b.value.address),1),b.value.address&&b.value.city?(u(),_("span",hn,", ")):p("",!0),s(i(b.value.city),1)])):p("",!0),a(G,{dense:"",class:"text-body-2"},{default:o(()=>[a(m,{cols:"12",sm:"6",md:"4"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_dates"))+":",1),s(" "+i(de(b.value.date_start)),1),b.value.date_end&&b.value.date_end!==b.value.date_start?(u(),_("span",Vn," - "+i(de(b.value.date_end)),1)):p("",!0)]),_:1}
1),b.value.time_control?(u(),T(m,{key:0,cols:"12",sm:"6",md:"4"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_time_control"))+":",1),s(" "+i(Wl(b.value)),1)]),_:1})):p("",!0),b.value.closing_registrations?(u(),T(m,{key:1,cols:"12",sm:"6",md:"4"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_closing"))+":",1),s(" "+i(_a(b.value.closing_registrations)),1)]),_:1})):p("",!0),b.value.obligatory_presence?(u(),T(m,{key:2,cols:"12",sm:"6",md:"4"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_obligatory_presence"))+":",1),s(" "+i(xl(b.value.obligatory_presence)),1)]),_:1})):p("",!0),b.value.categories&&b.value.categories.length?(u(),T(m,{key:3,cols:"12"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_categories"))+":",1),s(" "+i(b.value.categories.join(", ")),1)]),_:1})):p("",!0),b.value.chief_arbiter_name?(u(),T(m,{key:4,cols:"12",sm:"6"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_arbiter"))+":",1),s(" "+i(b.value.chief_arbiter_name)+" ",1),b.value.chief_arbiter_email?(u(),_("span",wn,"("+i(b.value.chief_arbiter_email)+")",1)):p("",!0)]),_:1})):p("",!0),b.value.chief_organizer_name?(u(),T(m,{key:5,cols:"12",sm:"6"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_organizer"))+":",1),s(" "+i(b.value.chief_organizer_name)+" ",1),b.value.chief_organizer_email?(u(),_("span",xn,"("+i(b.value.chief_organizer_email)+")",1)):p("",!0)]),_:1})):p("",!0),b.value.url?(u(),T(m,{key:6,cols:"12"},{default:o(()=>[d("strong",null,i(r(n)("trnreg.th_website"))+":",1),e[127]||(e[127]=s()),d("a",{href:b.value.url,target:"_blank",rel:"noopener"},i(b.value.url),9,Cn)]),_:1})):p("",!0)]),_:1})]),_:1})]),_:1})):p("",!0),b.value&&N.value==="form"?(u(),_("div",Tn,[Sl.value?(u(),T(ee,{key:0,type:"info",variant:"tonal",class:"elevation-2"},{default:o(()=>[s(i(r(n)("trnreg.registrations_closed")),1)]),_:1})):(u(),T(le,{key:1,class:"elevation-2"},{default:o(()=>[a(ae,null,{default:o(()=>[M.value?(u(),T(ee,{key:0,type:"error",class:"mb-4"},{default:o(()=>[s(i(M.value),1)]),_:1})):p("",!0),a(Lt,{ref_key:"regFormRef",ref:Vt,onSubmit:_e(P,["prevent"])},{default:o(()=>[d("div",Sn,[a(y,{modelValue:Z.value,"onUpdate:modelValue":e[5]||(e[5]=t=>Z.value=t),label:r(n)("trnreg.field_lookup"),variant:"outlined",color:"green-darken-2",density:"compact",autocomplete:"off",hint:r(n)("trnreg.lookup_hint"),"persistent-hint":"",onInput:at,onBlur:jt},null,8,["modelValue","label","hint"]),Re.value?(u(),_("span",Un,i(r(n)("trnreg.lookup_searching")),1)):p("",!0),I.value.length?(u(),_("ul",zn,[(u(!0),_(D,null,J(I.value,t=>(u(),_("li",{key:t.national_id||t.fide_id||t.name,onMousedown:_e(k=>Qt(t),["prevent"])},[s(i(t.name)+" ",1),d("span",$n,i(t.birth_year||"")+" "+i(t.club||""),1)],40,Rn))),128))])):p("",!0),!Re.value&&Z.value.trim().length>=2&&!I.value.length?(u(),_("div",In,i(r(n)("trnreg.lookup_no_results")),1)):p("",!0)]),a(G,{dense:""},{default:o(()=>[a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:C.value.last_name,"onUpdate:modelValue":e[6]||(e[6]=t=>C.value.last_name=t),label:r(n)("trnreg.field_last_name"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required",rules:[he]},null,8,["modelValue","label","rules"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:C.value.first_name,"onUpdate:modelValue":e[7]||(e[7]=t=>C.value.first_name=t),label:r(n)("trnreg.field_first_name"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required",rules:[he]},null,8,["modelValue","label","rules"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(Le,{modelValue:C.value.sex,"onUpdate:modelValue":e[8]||(e[8]=t=>C.value.sex=t),items:[{title:r(n)("trnreg.sex_m"),value:"M"},{title:r(n)("trnreg.sex_f"),value:"F"}],"item-title":"title","item-value":"value",label:r(n)("trnreg.field_sex"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","items","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:C.value.date_birth,"onUpdate:modelValue":e[9]||(e[9]=t=>C.value.date_birth=t),type:"date",label:r(n)("trnreg.field_date_birth"),variant:"outlined",color:"green-darken-2",density:"compact",required:!Ie.value,class:Ml(Ie.value?"":"trnreg-required"),rules:[wt],hint:Ie.value?r(n)("trnreg.birth_date_optional_hint"):$e.value?r(n)("trnreg.birth_year_hint")+": "+$e.value:"","persistent-hint":""},null,8,["modelValue","label","required","class","rules","hint"])]),_:1}
1),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:C.value.phone,"onUpdate:modelValue":e[10]||(e[10]=t=>C.value.phone=t),label:r(n)("trnreg.field_phone_gsm"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required",rules:[he]},null,8,["modelValue","label","rules"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:C.value.email,"onUpdate:modelValue":e[11]||(e[11]=t=>C.value.email=t),type:"email",label:r(n)("trnreg.field_email"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required",rules:[he]},null,8,["modelValue","label","rules"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:C.value.national_id,"onUpdate:modelValue":e[12]||(e[12]=t=>C.value.national_id=t),label:r(n)("trnreg.field_national_id"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:C.value.national_club,"onUpdate:modelValue":e[13]||(e[13]=t=>C.value.national_club=t),label:r(n)("trnreg.field_national_club"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4",class:"d-flex align-center ga-2 flex-wrap"},{default:o(()=>[a(Pt,{size:"small",variant:"tonal",color:C.value.affiliated===!0?"green-darken-2":"grey"},{default:o(()=>[s(i(r(n)("trnreg.field_affiliated"))+": "+i(S(C.value.affiliated)),1)]),_:1},8,["color"]),C.value.g_license?(u(),T(Pt,{key:0,size:"small",variant:"tonal",color:"blue-darken-2"},{default:o(()=>[s(i(r(n)("trnreg.field_g_license")),1)]),_:1})):p("",!0)]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:C.value.fide_id,"onUpdate:modelValue":e[14]||(e[14]=t=>C.value.fide_id=t),label:r(n)("trnreg.field_fide_id"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),v.value?(u(),T(m,{key:0,cols:"12"},{default:o(()=>[a(ee,{type:"warning",variant:"tonal",density:"compact"},{default:o(()=>[s(i(r(n)("trnreg.fide_id_warning")),1)]),_:1})]),_:1})):p("",!0),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:C.value.fide_title,"onUpdate:modelValue":e[15]||(e[15]=t=>C.value.fide_title=t),label:r(n)("trnreg.field_fide_title"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:C.value.fide_federation,"onUpdate:modelValue":e[16]||(e[16]=t=>C.value.fide_federation=t),label:r(n)("trnreg.field_fide_federation"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:C.value[Ve(b.value)],"onUpdate:modelValue":e[17]||(e[17]=t=>C.value[Ve(b.value)]=t),type:"number",label:r(n)("trnreg."+Ve(b.value).replace("fide_rating_","field_fide_rating_")),hint:Ve(b.value)!=="fide_rating_standard"&&!(Number(C.value[Ve(b.value)])>0)&&Number(C.value.fide_rating_standard)>0?r(n)("trnreg.rating_fallback_hint")+": "+C.value.fide_rating_standard:"","persistent-hint":"",variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label","hint"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(Le,{modelValue:C.value.category_index,"onUpdate:modelValue":e[18]||(e[18]=t=>C.value.category_index=t),items:(b.value.categories||[]).map((t,k)=>({title:t,value:k})),label:r(n)("trnreg.field_category"),placeholder:r(n)("trnreg.category_placeholder"),variant:"outlined",color:"green-darken-2",density:"compact",disabled:(b.value.categories||[]).length<=1,required:(b.value.categories||[]).length>1,class:Ml((b.value.categories||[]).length>1?"trnreg-required":""),rules:(b.value.categories||[]).length>1?[he]:[]},null,8,["modelValue","items","label","placeholder","disabled","required","class","rules"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:C.value.rounds_absent,"onUpdate:modelValue":e[19]||(e[19]=t=>C.value.rounds_absent=t),label:r(n)("trnreg.field_rounds_absent"),variant:"outlined",color:"green-darken-2",density:"compact",rules:[z]},null,8,["modelValue","label","rules"])]),_:1}
1),a(m,{cols:"12"},{default:o(()=>[a(Ol,{modelValue:C.value.note,"onUpdate:modelValue":e[20]||(e[20]=t=>C.value.note=t),label:r(n)("trnreg.field_note"),variant:"outlined",color:"green-darken-2",density:"compact",rows:"2"},null,8,["modelValue","label"])]),_:1})]),_:1}),a(x,{type:"submit",color:"green-darken-2",loading:nt.value,class:"mt-2"},{default:o(()=>[s(i(r(n)("trnreg.submit_btn")),1)]),_:1},8,["loading"])]),_:1},512)]),_:1})]),_:1}))])):p("",!0)])):(u(),_("div",pn,i(r(n)("trnreg.no_tournament")),1))])):p("",!0),N.value==="list"&&O.value?(u(),_("div",An,[fe.value?(u(),T(ee,{key:0,type:"success",variant:"tonal",closable:"",class:"mb-4","onClick:close":e[21]||(e[21]=t=>fe.value=null)},{default:o(()=>[d("div",Fn,i(r(n)("trnreg.submitted_title")),1),d("div",null,i(r(n)("trnreg.submitted_msg")),1),d("div",En,[s(i(r(n)("trnreg.registration_id_label"))+": ",1),d("strong",null,i(fe.value.id),1)])]),_:1})):p("",!0),b.value&&!Sl.value?(u(),_("div",Dn,[a(x,{color:"green-darken-2","prepend-icon":"mdi-account-plus",onClick:re},{default:o(()=>[s(i(fe.value?r(n)("trnreg.register_another"):r(n)("trnreg.nav_form")),1)]),_:1})])):p("",!0),a(G,{class:"mb-2 align-center",dense:""},{default:o(()=>[a(m,{cols:"12",sm:"6"},{default:o(()=>[d("h2",qn,[s(i(r(n)("trnreg.list_title")),1),b.value?(u(),_("span",Ln," - "+i(b.value.name),1)):p("",!0),d("span",Nn," ("+i(Kt.value.length)+" "+i(r(n)("trnreg.list_count"))+")",1)])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:te.value,"onUpdate:modelValue":e[22]||(e[22]=t=>te.value=t),label:r(n)("trnreg.list_filter"),variant:"outlined",density:"compact",color:"green-darken-2","prepend-inner-icon":"mdi-magnify","hide-details":"",clearable:""},null,8,["modelValue","label"])]),_:1})]),_:1}),$.value?(u(),T(G,{key:2,justify:"center",class:"my-8"},{default:o(()=>[a(Dt,{indeterminate:"",color:"green"})]),_:1})):(u(),T(le,{key:3,class:"elevation-2"},{default:o(()=>[a(ae,{class:"pa-0"},{default:o(()=>[Kt.value.length?(u(),_("div",Mn,[a(Bl,{hover:""},{default:o(()=>[d("thead",Bn,[d("tr",null,[d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[23]||(e[23]=t=>Qe("last_name"))},[s(i(r(n)("trnreg.col_name"))+" ",1),a(ve,{size:"small"},{default:o(()=>[s(i(B.value==="last_name"?ue.value==="asc"?"mdi-arrow-up":"mdi-arrow-down":"mdi-swap-vertical"),1)]),_:1})]),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[24]||(e[24]=t=>Qe("sex"))},i(r(n)("trnreg.col_sex")),1),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[25]||(e[25]=t=>Qe("birth_year"))},[s(i(r(n)("trnreg.col_birth"))+" ",1),a(ve,{size:"small"},{default:o(()=>[s(i(B.value==="birth_year"?ue.value==="asc"?"mdi-arrow-up":"mdi-arrow-down":"mdi-swap-vertical"),1)]),_:1})]),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[26]||(e[26]=t=>Qe("national_club"))},i(r(n)("trnreg.col_club")),1),d("th",null,i(r(n)("trnreg.col_category")),1),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[27]||(e[27]=t=>Qe("fide_id"))},i(r(n)("trnreg.col_fide_id")),1),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[28]||(e[28]=t=>Qe("rating"))},[s(i(r(n)("trnreg.col_rating"))+" ",1),a(ve,{size:"small"},{default:o(()=>[s(i(B.value==="rating"?ue.value==="asc"?"mdi-arrow-up":"mdi-arrow-down":"mdi-swap-vertical"),1)]),_:1})])])]),d("tbody",null,[(u(!0),_(D,null,J(Kt.value,t=>(u(),_("tr",{key:t.id},[d("td",null,i(t.last_name)+" "+i(t.first_name),1),d("td",null,i(t.sex),1),d("td",null,i(t.birth_year||""),1),d("td",null,i(t.national_club_name||t.national_club),1),d("td",null,i(vl(b.value,t.category_index)),1),d("td",null,i(t.fide_id),1),d("td",null,i(xt(t,b.value)||""),1)]))),128))])]),_:1})])):(u(),_("div",Pn,i(r(n)("trnreg.list_empty")),1))]),_:1})]),_:1}))])):p("",!0),N.value==="login"?(u(),_("div",On,[a(le,{class:"elevation-2",style:{"max-width":"420px",width:"100%"}},{default:o(()=>[a(ae,null,{default:o(()=>[d("h2",Qn,i(r(n)("trnreg.login_title")),1),Te.value?(u(),T(ee,{key:0,type:"error",class:"mb-3"},{default:o(()=>[s(i(Te.value),1)]),_:1}
1)):p("",!0),d("p",jn,i(r(n)("trnreg.odoo_login_intro")),1),a(Lt,{id:"odoo-login-form",name:"odoo-login",onSubmit:_e(la,["prevent"])},{default:o(()=>[a(y,{modelValue:Zt.value,"onUpdate:modelValue":e[29]||(e[29]=t=>Zt.value=t),id:"odoo-login-email",name:"username",type:"email",label:r(n)("trnreg.field_odoo_email"),variant:"outlined",color:"green-darken-2",density:"comfortable",autocomplete:"username",required:""},null,8,["modelValue","label"]),a(y,{modelValue:Tt.value,"onUpdate:modelValue":e[30]||(e[30]=t=>Tt.value=t),id:"odoo-login-password",name:"password",type:"password",label:r(n)("trnreg.field_password"),variant:"outlined",color:"green-darken-2",density:"comfortable",autocomplete:"current-password",required:""},null,8,["modelValue","label"]),a(x,{type:"submit",color:"green-darken-2",block:"",loading:je.value},{default:o(()=>[s(i(r(n)("trnreg.odoo_login_btn")),1)]),_:1},8,["loading"])]),_:1}),d("div",Kn,i(r(n)("trnreg.odoo_login_2fa_note")),1),a(tn,{class:"my-4"}),a(x,{variant:"text",size:"small",color:"grey-darken-1","prepend-icon":St.value?"mdi-chevron-down":"mdi-chevron-right",onClick:e[31]||(e[31]=t=>St.value=!St.value)},{default:o(()=>[s(i(r(n)("trnreg.password_login_toggle")),1)]),_:1},8,["prepend-icon"]),St.value?(u(),T(Lt,{key:1,id:"arbiter-login-form",name:"arbiter-login",class:"mt-3",onSubmit:_e(aa,["prevent"])},{default:o(()=>[a(y,{modelValue:Yt.value,"onUpdate:modelValue":e[32]||(e[32]=t=>Yt.value=t),id:"arbiter-login-username",name:"arbiter-username",label:r(n)("trnreg.field_username"),variant:"outlined",color:"green-darken-2",density:"comfortable",autocomplete:"username",required:""},null,8,["modelValue","label"]),a(y,{modelValue:Ct.value,"onUpdate:modelValue":e[33]||(e[33]=t=>Ct.value=t),id:"arbiter-login-password",name:"arbiter-password",type:"password",label:r(n)("trnreg.field_password"),variant:"outlined",color:"green-darken-2",density:"comfortable",autocomplete:"current-password",required:""},null,8,["modelValue","label"]),a(x,{type:"submit",color:"green-darken-2",variant:"tonal",block:"",loading:je.value},{default:o(()=>[s(i(r(n)("trnreg.login_btn")),1)]),_:1},8,["loading"])]),_:1})):p("",!0)]),_:1})]),_:1})])):p("",!0),N.value==="admin"&&r(A)?(u(),_("div",Wn,[W.value?(u(),T(ee,{key:0,type:"error",closable:"",class:"mb-4","onClick:close":e[34]||(e[34]=t=>W.value="")},{default:o(()=>[s(i(W.value),1)]),_:1})):p("",!0),pe.value?(u(),T(ee,{key:1,type:"success",closable:"",class:"mb-4","onClick:close":e[35]||(e[35]=t=>pe.value="")},{default:o(()=>[s(i(pe.value),1)]),_:1})):p("",!0),V.value?(u(),_("div",ur,[a(x,{size:"small",variant:"text",color:"green-darken-2","prepend-icon":"mdi-arrow-left",class:"mb-3",onClick:yl},{default:o(()=>[s(i(r(n)("trnreg.admin_back_to_tournaments")),1)]),_:1}),a(le,{class:"mb-4 elevation-2"},{default:o(()=>[a(ae,null,{default:o(()=>[a(G,{align:"center",justify:"space-between"},{default:o(()=>[a(m,{cols:"12",md:"auto"},{default:o(()=>[d("h2",dr,i(V.value.name),1),d("div",sr,[s(i(de(V.value.date_start)),1),V.value.date_end&&V.value.date_end!==V.value.date_start?(u(),_("span",cr," - "+i(de(V.value.date_end)),1)):p("",!0)])]),_:1}),a(m,{cols:"12",md:"auto",class:"d-flex flex-wrap ga-2"},{default:o(()=>[a(x,{size:"small",variant:"text",color:"grey-darken-1","prepend-icon":"mdi-pencil",onClick:e[37]||(e[37]=t=>rl(V.value))},{default:o(()=>[s(i(r(n)("trnreg.admin_edit_tournament")),1)]),_:1}),a(x,{size:"small",variant:"text",color:"grey-darken-1","prepend-icon":"mdi-content-copy",onClick:e[38]||(e[38]=t=>ol(V.value))},{default:o(()=>[s(i(r(n)("trnreg.admin_copy_tournament")),1)]),_:1}),a(x,{size:"small",variant:"text",color:"green-darken-2","prepend-icon":"mdi-open-in-new",href:bl(V.value),target:"_blank",rel:"noopener"},{default:o(()=>[s(i(r(n)("trnreg.admin_view_public_page")),1)]),_:1},8,["href"]),ot(V.value)?(u(),T(x,{key:0,size:"small",variant:"text",color:"red-darken-2","prepend-icon":"mdi-delete",onClick:e[39]||(e[39]=t=>ua(V.value))},{default:o(()=>[s(i(r(n)("trnreg.admin_delete_tournament")),1)]),_:1})):p("",!0),(u(!0),_(D,null,J(wa.value,t=>(u(),_(D,{key:"exp-"+t.key},[a(x,{size:"small",variant:"tonal",color:"green-darken-2","prepend-icon":"mdi-download",loading:!!ct.value[t.key],onClick:k=>
1xa(t.key)},{default:o(()=>[s(i(r(n)("trnreg.admin_export_csv")),1),t.label?(u(),_("span",mr,"Â ("+i(t.label)+")",1)):p("",!0)]),_:2},1032,["loading","onClick"]),a(x,{size:"small",variant:"tonal",color:"green-darken-2","prepend-icon":"mdi-download",loading:!!mt.value[t.key],onClick:k=>Ca(t.key)},{default:o(()=>[s(i(r(n)("trnreg.admin_export_swar")),1),t.label?(u(),_("span",_r,"Â ("+i(t.label)+")",1)):p("",!0)]),_:2},1032,["loading","onClick"])],64))),128)),a(x,{size:"small",variant:"tonal",color:"blue-darken-2","prepend-icon":"mdi-refresh",loading:ul.value,onClick:Ta},{default:o(()=>[s(i(r(n)("trnreg.admin_refresh_elo")),1)]),_:1},8,["loading"])]),_:1})]),_:1}),_t.value!==null?(u(),T(ee,{key:0,type:"success",density:"compact",class:"mt-3"},{default:o(()=>[s(i(r(n)("trnreg.admin_refresh_elo_result").replace("{count}",_t.value)),1)]),_:1})):p("",!0)]),_:1})]),_:1}),a(le,{class:"mb-4 elevation-1"},{default:o(()=>[a(ae,null,{default:o(()=>[d("div",vr,i(r(n)("trnreg.share_title")),1),ot(V.value)?p("",!0):(u(),_("div",gr,i(r(n)("trnreg.share_shared_with_you")),1)),ye.value?(u(),T(ee,{key:1,type:"error",density:"compact",class:"mb-2"},{default:o(()=>[s(i(ye.value),1)]),_:1})):p("",!0),Ge.value.length?p("",!0):(u(),_("div",fr,i(r(n)("trnreg.share_none")),1)),(u(!0),_(D,null,J(Ge.value,t=>(u(),_("div",{key:t.national_id,class:"d-flex align-center ga-2"},[d("span",pr,[s(i(t.name||"?")+" ",1),d("span",yr,"#"+i(t.national_id),1)]),ot(V.value)?(u(),T(x,{key:0,size:"x-small",variant:"text",color:"red-darken-2",disabled:He.value,onClick:k=>ia(t)},{default:o(()=>[s(i(r(n)("trnreg.share_remove")),1)]),_:2},1032,["disabled","onClick"])):p("",!0)]))),128)),ot(V.value)?(u(),T(Lt,{key:3,class:"d-flex align-start ga-2 mt-2",onSubmit:_e(oa,["prevent"])},{default:o(()=>[a(y,{modelValue:zt.value,"onUpdate:modelValue":e[40]||(e[40]=t=>zt.value=t),label:r(n)("trnreg.share_member_number"),variant:"outlined",color:"green-darken-2",density:"compact","hide-details":"",style:{"max-width":"220px"}},null,8,["modelValue","label"]),a(x,{type:"submit",color:"green-darken-2",variant:"tonal",loading:He.value},{default:o(()=>[s(i(r(n)("trnreg.share_add")),1)]),_:1},8,["loading"])]),_:1})):p("",!0)]),_:1})]),_:1}),d("h3",br,[s(i(r(n)("trnreg.list_title"))+" ",1),d("span",kr," ("+i(Ke.value.length)+" "+i(r(n)("trnreg.list_count"))+")",1)]),Jt.value?(u(),T(G,{key:0,justify:"center",class:"my-8"},{default:o(()=>[a(Dt,{indeterminate:"",color:"green"})]),_:1})):(u(),T(le,{key:1,class:"elevation-2"},{default:o(()=>[a(ae,{class:"pa-0"},{default:o(()=>[Ke.value.length?(u(),_("div",Vr,[a(Bl,{hover:""},{default:o(()=>[d("thead",wr,[d("tr",null,[d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[41]||(e[41]=t=>Ut("id"))},[s(i(r(n)("trnreg.col_id"))+" ",1),a(ve,{size:"small"},{default:o(()=>[s(i(Ee.value==="id"?Se.value==="asc"?"mdi-arrow-up":"mdi-arrow-down":"mdi-swap-vertical"),1)]),_:1})]),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[42]||(e[42]=t=>Ut("last_name"))},[s(i(r(n)("trnreg.col_name"))+" ",1),a(ve,{size:"small"},{default:o(()=>[s(i(Ee.value==="last_name"?Se.value==="asc"?"mdi-arrow-up":"mdi-arrow-down":"mdi-swap-vertical"),1)]),_:1})]),d("th",null,i(r(n)("trnreg.col_sex")),1),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[43]||(e[43]=t=>Ut("date_birth"))},[s(i(r(n)("trnreg.col_birth"))+" ",1),a(ve,{size:"small"},{default:o(()=>[s(i(Ee.value==="date_birth"?Se.value==="asc"?"mdi-arrow-up":"mdi-arrow-down":"mdi-swap-vertical"),1)]),_:1})]),d("th",null,i(r(n)("trnreg.col_club")),1),d("th",null,i(r(n)("trnreg.col_category")),1),d("th",null,i(r(n)("trnreg.col_fide_id")),1),d("th",{style:{cursor:"pointer","user-select":"none"},onClick:e[44]||(e[44]=t=>Ut("rating"))},[s(i(r(n)("trnreg.col_rating"))+" ",1),a(ve,{size:"small"},{default:o(()=>[s(i(Ee.value==="rating"?Se.value==="asc"?"mdi-arrow-up":"mdi-arrow-down":"mdi-swap-vertical"),1)]),_:1})]),d("th",null,i(r(n)("trnreg.col_email")),1),d("th",null,i(r(n)("trnreg.col_phone")),1),d("th",null,i(r(n)("trnreg.col_actions")),1)])]),d("tbody",null,[(u(!0),_(D,null,J(na.value,t=>(u(),_("tr",{key:t.id},[d("td",null,i(t.id),1),d("td",null,i(t.last_name)+" "+i(t.first_name),1),d("td",null,i(t.sex),1),d("td",null,i(de(t.date_birth)),1),d("td",null,i(t.national_club_name||t.national_club),1),d("td",null,i(vl(V.value,t.category_index)),1),d("td",null,i(t.fide_id),1),d("td",null,i(xt(t,V.value)||""),1),d("td",null,i(t.email),1),d("td",null,i(t.phone||t.gsm),1),d("td",xr,[a(x,{size:"small",variant:"text",color:"green-darken-2",onClick:k=>Gl(t)},{default:o(()=>[s(i(r(n)("trnreg.edit_btn")),1)]),_:2},1032,["onClick"]),a(x,{size:"small",variant:"text",color:"red-darken-2",onClick:k=>ea(t)},{default:o(()=>[s(i(r(n)("trnreg.delete_btn")),1)]),_:2},1032,["onClick"])])]))),128))])]),_:1})])):(u(),_("div",hr,i(r(n)("trnreg.list_empty")),1))]),_:1})]),_:1}))])):(u(),_("div",Gn,[a(G,{class:"mb-2 align-center",justify:"space-between"},{default:o(()=>[a(m,{cols:"auto"},{default:o(()=>[d("h2",Hn,i(r(n)("trnreg.admin_title")),1)]),_:1}
1),a(m,{cols:"auto"},{default:o(()=>[a(x,{color:"green-darken-2","prepend-icon":"mdi-plus",onClick:fa},{default:o(()=>[s(i(r(n)("trnreg.admin_new_tournament")),1)]),_:1})]),_:1})]),_:1}),Xt.value?(u(),T(G,{key:0,justify:"center",class:"my-8"},{default:o(()=>[a(Dt,{indeterminate:"",color:"green"})]),_:1})):Fe.value.length?(u(),_(D,{key:2},[Al.value.length?p("",!0):(u(),_("div",Zn,i(r(n)("trnreg.admin_no_active_tournaments")),1)),a(G,{dense:""},{default:o(()=>[(u(!0),_(D,null,J(Al.value,t=>(u(),T(m,{cols:"12",md:"6",lg:"4",key:t.id},{default:o(()=>[a(le,{class:"elevation-2 h-100"},{default:o(()=>[a(ae,null,{default:o(()=>[d("h3",Xn,i(t.name),1),d("div",Jn,[s(i(de(t.date_start)),1),t.date_end&&t.date_end!==t.date_start?(u(),_("span",er," - "+i(de(t.date_end)),1)):p("",!0)]),t.city?(u(),_("div",tr,i(t.city),1)):p("",!0),ot(t)?p("",!0):(u(),T(Pt,{key:1,size:"x-small",variant:"tonal",color:"blue-darken-2",class:"mt-1"},{default:o(()=>[s(i(r(n)("trnreg.share_shared_chip")),1)]),_:1})),d("div",lr,[a(x,{size:"small",color:"green-darken-2",variant:"tonal",onClick:k=>el(t)},{default:o(()=>[s(i(r(n)("trnreg.admin_manage_registrations")),1)]),_:2},1032,["onClick"]),a(x,{size:"small",variant:"text",color:"grey-darken-1",onClick:k=>rl(t)},{default:o(()=>[s(i(r(n)("trnreg.admin_edit_tournament")),1)]),_:2},1032,["onClick"]),a(x,{size:"small",variant:"text",color:"grey-darken-1","prepend-icon":"mdi-content-copy",onClick:k=>ol(t)},{default:o(()=>[s(i(r(n)("trnreg.admin_copy_tournament")),1)]),_:2},1032,["onClick"]),a(x,{size:"small",variant:"text",color:"green-darken-2","prepend-icon":"mdi-open-in-new",href:bl(t),target:"_blank",rel:"noopener"},{default:o(()=>[s(i(r(n)("trnreg.admin_view_public_page")),1)]),_:2},1032,["href"])])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1}),il.value.length?(u(),_("div",ar,[a(x,{variant:"text",color:"grey-darken-1","prepend-icon":Et.value?"mdi-chevron-down":"mdi-chevron-right",onClick:e[36]||(e[36]=t=>Et.value=!Et.value)},{default:o(()=>[s(i(r(n)("trnreg.admin_archived"))+" ("+i(il.value.length)+") ",1)]),_:1},8,["prepend-icon"]),Et.value?(u(),T(G,{key:0,dense:"",class:"mt-1"},{default:o(()=>[(u(!0),_(D,null,J(il.value,t=>(u(),T(m,{cols:"12",md:"6",lg:"4",key:"arch-"+t.id},{default:o(()=>[a(le,{class:"elevation-1 h-100",color:"grey-lighten-4"},{default:o(()=>[a(ae,null,{default:o(()=>[d("h3",nr,i(t.name),1),d("div",rr,[s(i(de(t.date_start)),1),t.date_end&&t.date_end!==t.date_start?(u(),_("span",or," - "+i(de(t.date_end)),1)):p("",!0)]),d("div",ir,[a(x,{size:"small",variant:"tonal",color:"grey-darken-2",onClick:k=>el(t)},{default:o(()=>[s(i(r(n)("trnreg.admin_manage_registrations")),1)]),_:2},1032,["onClick"]),a(x,{size:"small",variant:"text",color:"grey-darken-1","prepend-icon":"mdi-content-copy",onClick:k=>ol(t)},{default:o(()=>[s(i(r(n)("trnreg.admin_copy_tournament")),1)]),_:2},1032,["onClick"])])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128))]),_:1})):p("",!0)])):p("",!0)],64)):(u(),_("div",Yn,i(r(n)("trnreg.admin_no_tournaments")),1))]))])):p("",!0),a(cl,{modelValue:rt.value,"onUpdate:modelValue":e[70]||(e[70]=t=>rt.value=t),"max-width":"900",scrollable:""},{default:o(()=>[a(le,null,{default:o(()=>[a(dl,null,{default:o(()=>[s(i(r(n)("trnreg.edit_registration_title")),1)]),_:1}),a(ae,null,{default:o(()=>[Ae.value?(u(),T(ee,{key:0,type:"error",class:"mb-3"},{default:o(()=>[s(i(Ae.value),1)]),_:1})):p("",!0),d("div",Cr,[a(y,{modelValue:xe.value,"onUpdate:modelValue":e[45]||(e[45]=t=>xe.value=t),label:r(n)("trnreg.field_lookup"),variant:"outlined",color:"green-darken-2",density:"compact",autocomplete:"off",hint:r(n)("trnreg.lookup_hint"),"persistent-hint":"",onInput:Yl,onBlur:e[46]||(e[46]=t=>Ce.value=[])},null,8,["modelValue","label","hint"]),Ht.value?(u(),_("span",Tr,i(r(n)("trnreg.lookup_searching")),1)):p("",!0),Ce.value.length?(u(),_("ul",Sr,[(u(!0),_(D,null,J(Ce.value,t=>(u(),_("li",{key:t.national_id||t.fide_id||t.name,onMousedown:_e(k=>Zl(t),["prevent"])},[s(i(t.name)+" ",1),d("span",zr,i(t.birth_year||"")+" "+i(t.club||""),1)],40,Ur))),128))])):p("",!0)]),a(G,{dense:""},{default:o(()=>[a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:h.value.last_name,"onUpdate:modelValue":e[47]||(e[47]=t=>h.value.last_name=t),label:r(n)("trnreg.field_last_name"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required"},null,8,["modelValue","label"])]),_:1}
1),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:h.value.first_name,"onUpdate:modelValue":e[48]||(e[48]=t=>h.value.first_name=t),label:r(n)("trnreg.field_first_name"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(Le,{modelValue:h.value.sex,"onUpdate:modelValue":e[49]||(e[49]=t=>h.value.sex=t),items:[{title:r(n)("trnreg.sex_m"),value:"M"},{title:r(n)("trnreg.sex_f"),value:"F"}],"item-title":"title","item-value":"value",label:r(n)("trnreg.field_sex"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","items","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.date_birth,"onUpdate:modelValue":e[50]||(e[50]=t=>h.value.date_birth=t),type:"date",label:r(n)("trnreg.field_date_birth"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.place_birth,"onUpdate:modelValue":e[51]||(e[51]=t=>h.value.place_birth=t),label:r(n)("trnreg.field_place_birth"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:h.value.country_residence,"onUpdate:modelValue":e[52]||(e[52]=t=>h.value.country_residence=t),label:r(n)("trnreg.field_country_residence"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:h.value.nationality,"onUpdate:modelValue":e[53]||(e[53]=t=>h.value.nationality=t),label:r(n)("trnreg.field_nationality"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.phone,"onUpdate:modelValue":e[54]||(e[54]=t=>h.value.phone=t),label:r(n)("trnreg.field_phone"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.gsm,"onUpdate:modelValue":e[55]||(e[55]=t=>h.value.gsm=t),label:r(n)("trnreg.field_gsm"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.email,"onUpdate:modelValue":e[56]||(e[56]=t=>h.value.email=t),type:"email",label:r(n)("trnreg.field_email"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.national_id,"onUpdate:modelValue":e[57]||(e[57]=t=>h.value.national_id=t),label:r(n)("trnreg.field_national_id"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.national_club,"onUpdate:modelValue":e[58]||(e[58]=t=>h.value.national_club=t),label:r(n)("trnreg.field_national_club"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4",class:"d-flex align-center"},{default:o(()=>[a(Nt,{modelValue:h.value.affiliated,"onUpdate:modelValue":e[59]||(e[59]=t=>h.value.affiliated=t),label:r(n)("trnreg.field_affiliated"),color:"green-darken-2",density:"compact","hide-details":""},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.fide_id,"onUpdate:modelValue":e[60]||(e[60]=t=>h.value.fide_id=t),label:r(n)("trnreg.field_fide_id"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.fide_title,"onUpdate:modelValue":e[61]||(e[61]=t=>h.value.fide_title=t),label:r(n)("trnreg.field_fide_title"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.fide_federation,"onUpdate:modelValue":e[62]||(e[62]=t=>h.value.fide_federation=t),label:r(n)("trnreg.field_fide_federation"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}
1),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.fide_rating_standard,"onUpdate:modelValue":e[63]||(e[63]=t=>h.value.fide_rating_standard=t),type:"number",label:r(n)("trnreg.field_fide_rating_standard"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.fide_rating_rapid,"onUpdate:modelValue":e[64]||(e[64]=t=>h.value.fide_rating_rapid=t),type:"number",label:r(n)("trnreg.field_fide_rating_rapid"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:h.value.fide_rating_blitz,"onUpdate:modelValue":e[65]||(e[65]=t=>h.value.fide_rating_blitz=t),type:"number",label:r(n)("trnreg.field_fide_rating_blitz"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(Le,{modelValue:h.value.category_index,"onUpdate:modelValue":e[66]||(e[66]=t=>h.value.category_index=t),items:Xl.value.map((t,k)=>({title:t,value:k})),label:r(n)("trnreg.field_category"),placeholder:r(n)("trnreg.category_placeholder"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","items","label","placeholder"])]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[a(y,{modelValue:h.value.rounds_absent,"onUpdate:modelValue":e[67]||(e[67]=t=>h.value.rounds_absent=t),label:r(n)("trnreg.field_rounds_absent"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"6",class:"d-flex align-center"},{default:o(()=>[a(Nt,{modelValue:h.value.g_license,"onUpdate:modelValue":e[68]||(e[68]=t=>h.value.g_license=t),label:r(n)("trnreg.field_g_license"),color:"green-darken-2",density:"compact","hide-details":""},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12"},{default:o(()=>[a(Ol,{modelValue:h.value.note,"onUpdate:modelValue":e[69]||(e[69]=t=>h.value.note=t),label:r(n)("trnreg.field_note"),variant:"outlined",color:"green-darken-2",density:"compact",rows:"2"},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1}),a(sl,null,{default:o(()=>[a(qt),a(x,{variant:"text",onClick:Hl},{default:o(()=>[s(i(r(n)("trnreg.cancel_btn")),1)]),_:1}),a(x,{color:"green-darken-2",loading:Gt.value,onClick:Jl},{default:o(()=>[s(i(r(n)("trnreg.update_btn")),1)]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a(cl,{modelValue:Ye.value,"onUpdate:modelValue":e[120]||(e[120]=t=>Ye.value=t),"max-width":"900",scrollable:""},{default:o(()=>[a(le,null,{default:o(()=>[a(dl,null,{default:o(()=>[s(i(st.value==="create"?r(n)("trnreg.admin_new_tournament"):r(n)("trnreg.admin_edit_tournament")),1)]),_:1}),a(ae,null,{default:o(()=>[De.value?(u(),T(ee,{key:0,type:"error",class:"mb-3"},{default:o(()=>[s(i(De.value),1)]),_:1})):p("",!0),a(G,{dense:""},{default:o(()=>[a(m,{cols:"12",sm:"8"},{default:o(()=>[a(y,{modelValue:c.value.name,"onUpdate:modelValue":e[71]||(e[71]=t=>c.value.name=t),label:r(n)("trnreg.field_name"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.city,"onUpdate:modelValue":e[72]||(e[72]=t=>c.value.city=t),label:r(n)("trnreg.field_city"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12"},{default:o(()=>[a(y,{modelValue:c.value.address,"onUpdate:modelValue":e[73]||(e[73]=t=>c.value.address=t),label:r(n)("trnreg.field_address"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.date_start,"onUpdate:modelValue":e[74]||(e[74]=t=>c.value.date_start=t),type:"date",label:r(n)("trnreg.field_date_start"),variant:"outlined",color:"green-darken-2",density:"compact",required:"",class:"trnreg-required"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.date_end,"onUpdate:modelValue":e[75]||(e[75]=t=>c.value.date_end=t),type:"date",min:c.value.date_start||void 0,label:r(n)("trnreg.field_date_end"),variant:"outlined",color:"green-darken-2",density:"compact",onFocus:e[76]||
1(e[76]=t=>$l("date_end","date_start"))},null,8,["modelValue","min","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:qe.value,"onUpdate:modelValue":e[77]||(e[77]=t=>qe.value=t),type:"time",label:r(n)("trnreg.field_obligatory_presence"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.opening_registrations,"onUpdate:modelValue":e[78]||(e[78]=t=>c.value.opening_registrations=t),type:"date",label:r(n)("trnreg.field_opening_registrations"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.closing_registrations,"onUpdate:modelValue":e[79]||(e[79]=t=>c.value.closing_registrations=t),type:"date",min:c.value.opening_registrations||void 0,max:c.value.date_start||void 0,label:r(n)("trnreg.field_closing_registrations"),variant:"outlined",color:"green-darken-2",density:"compact",onFocus:e[80]||(e[80]=t=>$l("closing_registrations","opening_registrations"))},null,8,["modelValue","min","max","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:Ze.value,"onUpdate:modelValue":e[81]||(e[81]=t=>Ze.value=t),type:"time",label:r(n)("trnreg.field_closing_time"),hint:r(n)("trnreg.closing_time_hint"),"persistent-hint":"",variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label","hint"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(Le,{modelValue:c.value.system,"onUpdate:modelValue":e[82]||(e[82]=t=>c.value.system=t),items:tt.map(t=>({title:r(n)("trnreg.system_"+t),value:t})),label:r(n)("trnreg.field_system"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","items","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.rounds,"onUpdate:modelValue":e[83]||(e[83]=t=>c.value.rounds=t),type:"number",label:r(n)("trnreg.field_rounds"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(Le,{modelValue:c.value.time_control,"onUpdate:modelValue":e[84]||(e[84]=t=>c.value.time_control=t),items:E.map(t=>({title:r(n)("trnreg.tc_"+t),value:t})),label:r(n)("trnreg.field_time_control"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","items","label"])]),_:1}),a(m,{cols:"12",sm:"8"},{default:o(()=>[a(Le,{modelValue:c.value.swar_cadence_number,"onUpdate:modelValue":e[85]||(e[85]=t=>c.value.swar_cadence_number=t),items:ca.value,label:r(n)("trnreg.field_swar_cadence_number"),disabled:!c.value.time_control,hint:c.value.time_control?"":r(n)("trnreg.cadence_needs_time_control"),"persistent-hint":!c.value.time_control,clearable:"",variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","items","label","disabled","hint","persistent-hint"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.time_control_details,"onUpdate:modelValue":e[86]||(e[86]=t=>c.value.time_control_details=t),label:r(n)("trnreg.field_time_control_details"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12"},{default:o(()=>[d("div",Rr,i(r(n)("trnreg.field_categories")),1),(u(!0),_(D,null,J(c.value.categories,(t,k)=>(u(),_("div",{key:k,class:"d-flex align-center ga-2 mb-2"},[a(y,{modelValue:c.value.categories[k],"onUpdate:modelValue":be=>c.value.categories[k]=be,density:"compact",variant:"outlined",color:"green-darken-2","hide-details":""},null,8,["modelValue","onUpdate:modelValue"]),a(x,{icon:"",size:"small",variant:"text",color:"red-darken-2",onClick:be=>ha(k)},{default:o(()=>[a(ve,null,{default:o(()=>e[128]||(e[128]=[s("mdi-close")])),_:1})]),_:2},1032,["onClick"])]))),128)),a(x,{size:"small",variant:"text",color:"green-darken-2","prepend-icon":"mdi-plus",onClick:ka},{default:o(()=>[s(i(r(n)("trnreg.add_category")),1)]),_:1}),a(Nt,{modelValue:c.value.export_per_category,"onUpdate:modelValue":e[87]||(e[87]=t=>c.value.export_per_category=t),label:r(n)("trnreg.field_export_per_category"),hint:r(n)("trnreg.exp
1ort_per_category_hint"),"persistent-hint":"",color:"green-darken-2",density:"compact"},null,8,["modelValue","label","hint"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.url,"onUpdate:modelValue":e[88]||(e[88]=t=>c.value.url=t),label:r(n)("trnreg.field_url"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.organizing_club,"onUpdate:modelValue":e[89]||(e[89]=t=>c.value.organizing_club=t),label:r(n)("trnreg.field_organizing_club"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(mn,{modelValue:c.value.federation,"onUpdate:modelValue":e[90]||(e[90]=t=>c.value.federation=t),items:pt,label:r(n)("trnreg.field_federation"),hint:r(n)("trnreg.federation_hint"),"persistent-hint":"",maxlength:"10",variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label","hint"])]),_:1}),a(m,{cols:"12"},{default:o(()=>[a(Nt,{modelValue:c.value.fide_homologated,"onUpdate:modelValue":e[91]||(e[91]=t=>c.value.fide_homologated=t),label:r(n)("trnreg.field_fide_homologated"),hint:r(n)("trnreg.fide_homologated_hint"),"persistent-hint":"",color:"green-darken-2",density:"compact"},null,8,["modelValue","label","hint"])]),_:1}),c.value.fide_homologated?(u(),_(D,{key:0},[a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.event_code_fide_a,"onUpdate:modelValue":e[92]||(e[92]=t=>c.value.event_code_fide_a=t),label:r(n)("trnreg.field_event_code_fide_a"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.event_code_fide_b,"onUpdate:modelValue":e[93]||(e[93]=t=>c.value.event_code_fide_b=t),label:r(n)("trnreg.field_event_code_fide_b"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.event_code_fide_c,"onUpdate:modelValue":e[94]||(e[94]=t=>c.value.event_code_fide_c=t),label:r(n)("trnreg.field_event_code_fide_c"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",class:"text-caption text-medium-emphasis mt-n2"},{default:o(()=>[s(i(r(n)("trnreg.rule_event_code_required")),1)]),_:1})],64)):p("",!0),a(m,{cols:"12"},{default:o(()=>[d("div",$r,i(r(n)("trnreg.section_arbiters")),1)]),_:1}),a(m,{cols:"12",sm:"8"},{default:o(()=>[d("div",Ir,[a(y,{modelValue:w.value.chief_arbiter.query,"onUpdate:modelValue":e[95]||(e[95]=t=>w.value.chief_arbiter.query=t),label:r(n)("trnreg.field_chief_arbiter_search"),variant:"outlined",color:"green-darken-2",density:"compact",autocomplete:"off",hint:r(n)("trnreg.lookup_hint"),"persistent-hint":"",onInput:e[96]||(e[96]=t=>$t("chief_arbiter")),onBlur:e[97]||(e[97]=t=>Ft("chief_arbiter"))},null,8,["modelValue","label","hint"]),w.value.chief_arbiter.searching?(u(),_("span",Ar,i(r(n)("trnreg.lookup_searching")),1)):p("",!0),w.value.chief_arbiter.results.length?(u(),_("ul",Fr,[(u(!0),_(D,null,J(w.value.chief_arbiter.results,t=>(u(),_("li",{key:t.fide_id||t.national_id||t.name,onMousedown:_e(k=>It("chief_arbiter",t),["prevent"])},[s(i(t.name)+" ",1),d("span",Dr,i(t.fide_id||"")+" "+i(t.club||""),1)],40,Er))),128))])):p("",!0),!w.value.chief_arbiter.searching&&w.value.chief_arbiter.query.trim().length>=2&&!w.value.chief_arbiter.results.length?(u(),_("div",qr,i(r(n)("trnreg.lookup_no_results")),1)):p("",!0)]),d("div",Lr,[c.value.chief_arbiter_name||c.value.chief_arbiter_person_id?(u(),_(D,{key:0},[s(i(r(n)("trnreg.selected_person"))+": ",1),d("strong",null,i(c.value.chief_arbiter_name),1),d("span",Nr,"("+i(r(n)("trnreg.field_fide_id"))+": "+i(c.value.chief_arbiter_person_id||r(n)("trnreg.no_fide_id"))+")",1),a(x,{size:"x-small",variant:"text",color:"red-darken-2",onClick:e[98]||(e[98]=t=>At("chief_arbiter"))},{default:o(()=>[s(i(r(n)("trnreg.clear_selection")),1)]),_:1})],64)):(u(),_("span",Pr,i(r(n)("trnreg.no_person_selected")),1))])]),_:1}
1),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.chief_arbiter_email,"onUpdate:modelValue":e[99]||(e[99]=t=>c.value.chief_arbiter_email=t),label:r(n)("trnreg.field_chief_arbiter_email"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.chief_arbiter_phone,"onUpdate:modelValue":e[100]||(e[100]=t=>c.value.chief_arbiter_phone=t),label:r(n)("trnreg.field_chief_arbiter_phone"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"8",class:"d-flex align-start"},{default:o(()=>[a(x,{size:"small",variant:"tonal",color:"green-darken-2","prepend-icon":"mdi-account-arrow-down",disabled:!c.value.chief_arbiter_name,onClick:ya},{default:o(()=>[s(i(r(n)("trnreg.fill_as_chief_organizer")),1)]),_:1},8,["disabled"])]),_:1}),a(m,{cols:"12",sm:"8"},{default:o(()=>[d("div",Mr,[a(y,{modelValue:w.value.deputy_arbiter_1.query,"onUpdate:modelValue":e[101]||(e[101]=t=>w.value.deputy_arbiter_1.query=t),label:r(n)("trnreg.field_deputy_arbiter_1_search"),variant:"outlined",color:"green-darken-2",density:"compact",autocomplete:"off",hint:r(n)("trnreg.lookup_hint"),"persistent-hint":"",onInput:e[102]||(e[102]=t=>$t("deputy_arbiter_1")),onBlur:e[103]||(e[103]=t=>Ft("deputy_arbiter_1"))},null,8,["modelValue","label","hint"]),w.value.deputy_arbiter_1.searching?(u(),_("span",Br,i(r(n)("trnreg.lookup_searching")),1)):p("",!0),w.value.deputy_arbiter_1.results.length?(u(),_("ul",Or,[(u(!0),_(D,null,J(w.value.deputy_arbiter_1.results,t=>(u(),_("li",{key:t.fide_id||t.national_id||t.name,onMousedown:_e(k=>It("deputy_arbiter_1",t),["prevent"])},[s(i(t.name)+" ",1),d("span",jr,i(t.fide_id||"")+" "+i(t.club||""),1)],40,Qr))),128))])):p("",!0),!w.value.deputy_arbiter_1.searching&&w.value.deputy_arbiter_1.query.trim().length>=2&&!w.value.deputy_arbiter_1.results.length?(u(),_("div",Kr,i(r(n)("trnreg.lookup_no_results")),1)):p("",!0)]),d("div",Wr,[c.value.deputy_arbiter_1_name||c.value.deputy_arbiter_1_person_id?(u(),_(D,{key:0},[s(i(r(n)("trnreg.selected_person"))+": ",1),d("strong",null,i(c.value.deputy_arbiter_1_name),1),d("span",Gr,"("+i(r(n)("trnreg.field_fide_id"))+": "+i(c.value.deputy_arbiter_1_person_id||r(n)("trnreg.no_fide_id"))+")",1),a(x,{size:"x-small",variant:"text",color:"red-darken-2",onClick:e[104]||(e[104]=t=>At("deputy_arbiter_1"))},{default:o(()=>[s(i(r(n)("trnreg.clear_selection")),1)]),_:1})],64)):(u(),_("span",Hr,i(r(n)("trnreg.no_person_selected")),1))])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.deputy_arbiter_1_email,"onUpdate:modelValue":e[105]||(e[105]=t=>c.value.deputy_arbiter_1_email=t),label:r(n)("trnreg.field_deputy_arbiter_1_email"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"8"},{default:o(()=>[d("div",Yr,[a(y,{modelValue:w.value.deputy_arbiter_2.query,"onUpdate:modelValue":e[106]||(e[106]=t=>w.value.deputy_arbiter_2.query=t),label:r(n)("trnreg.field_deputy_arbiter_2_search"),variant:"outlined",color:"green-darken-2",density:"compact",autocomplete:"off",hint:r(n)("trnreg.lookup_hint"),"persistent-hint":"",onInput:e[107]||(e[107]=t=>$t("deputy_arbiter_2")),onBlur:e[108]||(e[108]=t=>Ft("deputy_arbiter_2"))},null,8,["modelValue","label","hint"]),w.value.deputy_arbiter_2.searching?(u(),_("span",Zr,i(r(n)("trnreg.lookup_searching")),1)):p("",!0),w.value.deputy_arbiter_2.results.length?(u(),_("ul",Xr,[(u(!0),_(D,null,J(w.value.deputy_arbiter_2.results,t=>(u(),_("li",{key:t.fide_id||t.national_id||t.name,onMousedown:_e(k=>It("deputy_arbiter_2",t),["prevent"])},[s(i(t.name)+" ",1),d("span",eo,i(t.fide_id||"")+" "+i(t.club||""),1)],40,Jr))),128))])):p("",!0),!w.value.deputy_arbiter_2.searching&&w.value.deputy_arbiter_2.query.trim().length>=2&&!w.value.deputy_arbiter_2.results.length?(u(),_("div",to,i(r(n)("trnreg.lookup_no_results")),1)):p("",!0)]),d("div",lo,[c.value.deputy_arbiter_2_name||c.value.deputy_arbiter_2_person_id?(u(),_(D,{key:0},[s(i(r(n)("trnreg.selected_person"))+": ",1),d("strong",null,i(c.value.deputy_arbiter_2_name),1),d("span",ao,"("+i(r(n)("trnreg.field_fide_id"))+": "+i(c.value.deputy_arbiter_2_person_id||r(n)("trnreg.no_fide_id"))+")",1),a(x,{size:"x-small",variant:"text",color:"red-darken-2",onClick:e[109]||(e[109]=t=>At("deputy_arbiter_2"))},{default:o(()=>[s(i(r(n)("trnreg.clear_selection")),1)]),_:1})],64)):(u(),_("span",no,i(r(n)("trnreg.no_person_selected")),1))])]),_:1}
1),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.deputy_arbiter_2_email,"onUpdate:modelValue":e[110]||(e[110]=t=>c.value.deputy_arbiter_2_email=t),label:r(n)("trnreg.field_deputy_arbiter_2_email"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12"},{default:o(()=>[d("div",ro,i(r(n)("trnreg.section_organizer")),1)]),_:1}),a(m,{cols:"12",sm:"6"},{default:o(()=>[d("div",oo,[a(y,{modelValue:w.value.chief_organizer.query,"onUpdate:modelValue":e[111]||(e[111]=t=>w.value.chief_organizer.query=t),label:r(n)("trnreg.field_chief_organizer_search"),variant:"outlined",color:"green-darken-2",density:"compact",autocomplete:"off",hint:r(n)("trnreg.lookup_hint"),"persistent-hint":"",onInput:e[112]||(e[112]=t=>$t("chief_organizer")),onBlur:e[113]||(e[113]=t=>Ft("chief_organizer"))},null,8,["modelValue","label","hint"]),w.value.chief_organizer.searching?(u(),_("span",io,i(r(n)("trnreg.lookup_searching")),1)):p("",!0),w.value.chief_organizer.results.length?(u(),_("ul",uo,[(u(!0),_(D,null,J(w.value.chief_organizer.results,t=>(u(),_("li",{key:t.fide_id||t.national_id||t.name,onMousedown:_e(k=>It("chief_organizer",t),["prevent"])},[s(i(t.name)+" ",1),d("span",co,i(t.fide_id||"")+" "+i(t.club||""),1)],40,so))),128))])):p("",!0),!w.value.chief_organizer.searching&&w.value.chief_organizer.query.trim().length>=2&&!w.value.chief_organizer.results.length?(u(),_("div",mo,i(r(n)("trnreg.lookup_no_results")),1)):p("",!0)]),d("div",_o,[c.value.chief_organizer_name||c.value.chief_organizer_person_id?(u(),_(D,{key:0},[s(i(r(n)("trnreg.selected_person"))+": ",1),d("strong",null,i(c.value.chief_organizer_name),1),d("span",vo,"("+i(r(n)("trnreg.field_fide_id"))+": "+i(c.value.chief_organizer_person_id||r(n)("trnreg.no_fide_id"))+")",1),a(x,{size:"x-small",variant:"text",color:"red-darken-2",onClick:e[114]||(e[114]=t=>At("chief_organizer"))},{default:o(()=>[s(i(r(n)("trnreg.clear_selection")),1)]),_:1})],64)):(u(),_("span",go,i(r(n)("trnreg.no_person_selected")),1))])]),_:1}),a(m,{cols:"12",sm:"3"},{default:o(()=>[a(y,{modelValue:c.value.chief_organizer_email,"onUpdate:modelValue":e[115]||(e[115]=t=>c.value.chief_organizer_email=t),label:r(n)("trnreg.field_chief_organizer_email"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"3"},{default:o(()=>[a(y,{modelValue:c.value.chief_organizer_phone,"onUpdate:modelValue":e[116]||(e[116]=t=>c.value.chief_organizer_phone=t),label:r(n)("trnreg.field_chief_organizer_phone"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12"},{default:o(()=>[d("div",fo,i(r(n)("trnreg.section_email_copies")),1)]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.email_copy_1,"onUpdate:modelValue":e[117]||(e[117]=t=>c.value.email_copy_1=t),label:r(n)("trnreg.field_email_copy_1"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.email_copy_2,"onUpdate:modelValue":e[118]||(e[118]=t=>c.value.email_copy_2=t),label:r(n)("trnreg.field_email_copy_2"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1}),a(m,{cols:"12",sm:"4"},{default:o(()=>[a(y,{modelValue:c.value.email_copy_3,"onUpdate:modelValue":e[119]||(e[119]=t=>c.value.email_copy_3=t),label:r(n)("trnreg.field_email_copy_3"),variant:"outlined",color:"green-darken-2",density:"compact"},null,8,["modelValue","label"])]),_:1})]),_:1})]),_:1}),a(sl,null,{default:o(()=>[a(qt),a(x,{variant:"text",onClick:pa},{default:o(()=>[s(i(r(n)("trnreg.cancel_btn")),1)]),_:1}),a(x,{color:"green-darken-2",loading:ll.value,onClick:Va},{default:o(()=>[s(i(r(n)("trnreg.save_btn")),1)]),_:1},8,["loading"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),a(cl,{modelValue:it.value,"onUpdate:modelValue":e[122]||(e[122]=t=>it.value=t),"max-width":"480"},{default:o(()=>[se.value?(u(),T(le,{key:0},{default:o(()=>[a(dl,{class:"text-red-darken-2"},{default:o(()=>[s(i(r(n)("trnreg.admin_delete_tournament_title")),1)]),_:1}),a(ae,null,{default:o(()=>[d("p",null,i(r(n)("trnreg.admin_delete_tournament_warning")),1),d("p",po,i(se.value.name),1),dt.value?(u(),T(ee,{key:0,t
1ype:"error",class:"mb-3"},{default:o(()=>[s(i(dt.value),1)]),_:1})):p("",!0),a(y,{modelValue:ut.value,"onUpdate:modelValue":e[121]||(e[121]=t=>ut.value=t),label:r(n)("trnreg.admin_delete_tournament_type_name"),variant:"outlined",color:"red-darken-2",density:"compact",autocomplete:"off"},null,8,["modelValue","label"])]),_:1}),a(sl,null,{default:o(()=>[a(qt),a(x,{variant:"text",onClick:da},{default:o(()=>[s(i(r(n)("trnreg.cancel_btn")),1)]),_:1}),a(x,{color:"red-darken-2",disabled:ut.value!==se.value.name,loading:tl.value,onClick:sa},{default:o(()=>[s(i(r(n)("trnreg.admin_delete_tournament_confirm_btn")),1)]),_:1},8,["disabled","loading"])]),_:1})]),_:1})):p("",!0)]),_:1},8,["modelValue"])]),_:1}))}},Mo=Oa(bo,[["__scopeId","data-v-d5d5abdc"]]);export{Mo 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.