@golstats/gsc-reports 1.0.110 → 1.0.112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{FilterConditions-55d68355-DMqzcKBO-i2MMq9cG-VxWu25xG.js → FilterConditions-55d68355-DMqzcKBO-BP3T-S5X-BNQBxe_x.js} +1 -1
- package/dist/{FilterField-59a73e38-CNaE03Ge-Dv8D5kfs-Xx1i02y6.js → FilterField-59a73e38-CNaE03Ge-CWGsvphp-CaynxT4U.js} +1 -1
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-CG0YsapG-CwUI6ctR.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-DpQ3voNn-CjTBBZvu.js} +1 -1
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +2 -2
- package/dist/{index-Cp5q6aub.js → index-vdEA6u28.js} +30 -12
- package/package.json +2 -2
package/dist/gsc-reports.umd.js
CHANGED
|
@@ -7982,7 +7982,7 @@ uniform ${gi} ${vi} u_${$i};
|
|
|
7982
7982
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...r){const a=new this(e);return r.forEach(v=>a.set(v)),a}static accessor(e){const r=(this[dZ]=this[dZ]={accessors:{}}).accessors,a=this.prototype;function v($){const h=s9($);r[h]||(aZe(a,$),r[h]=!0)}return tu.isArray(e)?e.forEach(v):v(e),this}};H_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),tu.reduceDescriptors(H_.prototype,({value:e},r)=>{let a=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(v){this[a]=v}}}),tu.freezeMethods(H_);function HP(e,r){const a=this||o9,v=r||a,$=H_.from(v.headers);let h=v.data;return tu.forEach(e,function(u){h=u.call(a,h,$.normalize(),r?r.status:void 0)}),$.normalize(),h}function pZ(e){return!!(e&&e.__CANCEL__)}function Yk(e,r,a){Am.call(this,e??"canceled",Am.ERR_CANCELED,r,a),this.name="CanceledError"}tu.inherits(Yk,Am,{__CANCEL__:!0});function hZ(e,r,a){const v=a.config.validateStatus;!a.status||!v||v(a.status)?e(a):r(new Am("Request failed with status code "+a.status,[Am.ERR_BAD_REQUEST,Am.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function nZe(e){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}function iZe(e,r){e=e||10;const a=new Array(e),v=new Array(e);let $=0,h=0,u;return r=r!==void 0?r:1e3,function(i){const p=Date.now(),l=v[h];u||(u=p),a[$]=i,v[$]=p;let n=h,k=0;for(;n!==$;)k+=a[n++],n=n%e;if($=($+1)%e,$===h&&(h=(h+1)%e),p-u<r)return;const T=l&&p-l;return T?Math.round(k*1e3/T):void 0}}function oZe(e,r){let a=0,v=1e3/r,$,h;const u=(i,p=Date.now())=>{a=p,$=null,h&&(clearTimeout(h),h=null),e(...i)};return[(...i)=>{const p=Date.now(),l=p-a;l>=v?u(i,p):($=i,h||(h=setTimeout(()=>{h=null,u($)},v-l)))},()=>$&&u($)]}const dN=(e,r,a=3)=>{let v=0;const $=iZe(50,250);return oZe(h=>{const u=h.loaded,i=h.lengthComputable?h.total:void 0,p=u-v,l=$(p),n=u<=i;v=u;const k={loaded:u,total:i,progress:i?u/i:void 0,bytes:p,rate:l||void 0,estimated:l&&i&&n?(i-u)/l:void 0,event:h,lengthComputable:i!=null,[r?"download":"upload"]:!0};e(k)},a)},fZ=(e,r)=>{const a=e!=null;return[v=>r[0]({lengthComputable:a,total:e,loaded:v}),r[1]]},mZ=e=>(...r)=>tu.asap(()=>e(...r)),sZe=Wx.hasStandardBrowserEnv?((e,r)=>a=>(a=new URL(a,Wx.origin),e.protocol===a.protocol&&e.host===a.host&&(r||e.port===a.port)))(new URL(Wx.origin),Wx.navigator&&/(msie|trident)/i.test(Wx.navigator.userAgent)):()=>!0,lZe=Wx.hasStandardBrowserEnv?{write(e,r,a,v,$,h,u){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(r)}`];tu.isNumber(a)&&i.push(`expires=${new Date(a).toUTCString()}`),tu.isString(v)&&i.push(`path=${v}`),tu.isString($)&&i.push(`domain=${$}`),h===!0&&i.push("secure"),tu.isString(u)&&i.push(`SameSite=${u}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function cZe(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function uZe(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function yZ(e,r,a){let v=!cZe(r);return e&&(v||a==!1)?uZe(e,r):r}const gZ=e=>e instanceof H_?{...e}:e;function LS(e,r){r=r||{};const a={};function v(l,n,k,T){return tu.isPlainObject(l)&&tu.isPlainObject(n)?tu.merge.call({caseless:T},l,n):tu.isPlainObject(n)?tu.merge({},n):tu.isArray(n)?n.slice():n}function $(l,n,k,T){if(tu.isUndefined(n)){if(!tu.isUndefined(l))return v(void 0,l,k,T)}else return v(l,n,k,T)}function h(l,n){if(!tu.isUndefined(n))return v(void 0,n)}function u(l,n){if(tu.isUndefined(n)){if(!tu.isUndefined(l))return v(void 0,l)}else return v(void 0,n)}function i(l,n,k){if(k in r)return v(l,n);if(k in e)return v(void 0,l)}const p={url:h,method:h,data:h,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:i,headers:(l,n,k)=>$(gZ(l),gZ(n),k,!0)};return tu.forEach(Object.keys({...e,...r}),function(l){const n=p[l]||$,k=n(e[l],r[l],l);tu.isUndefined(k)&&n!==i||(a[l]=k)}),a}const vZ=e=>{const r=LS({},e);let{data:a,withXSRFToken:v,xsrfHeaderName:$,xsrfCookieName:h,headers:u,auth:i}=r;if(r.headers=u=H_.from(u),r.url=sZ(yZ(r.baseURL,r.url,r.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&u.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),tu.isFormData(a)){if(Wx.hasStandardBrowserEnv||Wx.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(tu.isFunction(a.getHeaders)){const p=a.getHeaders(),l=["content-type","content-length"];Object.entries(p).forEach(([n,k])=>{l.includes(n.toLowerCase())&&u.set(n,k)})}}if(Wx.hasStandardBrowserEnv&&(v&&tu.isFunction(v)&&(v=v(r)),v||v!==!1&&sZe(r.url))){const p=$&&h&&lZe.read(h);p&&u.set($,p)}return r},dZe=typeof XMLHttpRequest<"u",pZe=dZe&&function(e){return new Promise(function(r,a){const v=vZ(e);let $=v.data;const h=H_.from(v.headers).normalize();let{responseType:u,onUploadProgress:i,onDownloadProgress:p}=v,l,n,k,T,x;function d(){T&&T(),x&&x(),v.cancelToken&&v.cancelToken.unsubscribe(l),v.signal&&v.signal.removeEventListener("abort",l)}let o=new XMLHttpRequest;o.open(v.method.toUpperCase(),v.url,!0),o.timeout=v.timeout;function c(){if(!o)return;const f=H_.from("getAllResponseHeaders"in o&&o.getAllResponseHeaders()),g={data:!u||u==="text"||u==="json"?o.responseText:o.response,status:o.status,statusText:o.statusText,headers:f,config:e,request:o};hZ(function(S){r(S),d()},function(S){a(S),d()},g),o=null}"onloadend"in o?o.onloadend=c:o.onreadystatechange=function(){!o||o.readyState!==4||o.status===0&&!(o.responseURL&&o.responseURL.indexOf("file:")===0)||setTimeout(c)},o.onabort=function(){o&&(a(new Am("Request aborted",Am.ECONNABORTED,e,o)),o=null)},o.onerror=function(f){const g=f&&f.message?f.message:"Network Error",S=new Am(g,Am.ERR_NETWORK,e,o);S.event=f||null,a(S),o=null},o.ontimeout=function(){let f=v.timeout?"timeout of "+v.timeout+"ms exceeded":"timeout exceeded";const g=v.transitional||cZ;v.timeoutErrorMessage&&(f=v.timeoutErrorMessage),a(new Am(f,g.clarifyTimeoutError?Am.ETIMEDOUT:Am.ECONNABORTED,e,o)),o=null},$===void 0&&h.setContentType(null),"setRequestHeader"in o&&tu.forEach(h.toJSON(),function(f,g){o.setRequestHeader(g,f)}),tu.isUndefined(v.withCredentials)||(o.withCredentials=!!v.withCredentials),u&&u!=="json"&&(o.responseType=v.responseType),p&&([k,x]=dN(p,!0),o.addEventListener("progress",k)),i&&o.upload&&([n,T]=dN(i),o.upload.addEventListener("progress",n),o.upload.addEventListener("loadend",T)),(v.cancelToken||v.signal)&&(l=f=>{o&&(a(!f||f.type?new Yk(null,e,o):f),o.abort(),o=null)},v.cancelToken&&v.cancelToken.subscribe(l),v.signal&&(v.signal.aborted?l():v.signal.addEventListener("abort",l)));const s=nZe(v.url);if(s&&Wx.protocols.indexOf(s)===-1){a(new Am("Unsupported protocol "+s+":",Am.ERR_BAD_REQUEST,e));return}o.send($||null)})},hZe=(e,r)=>{const{length:a}=e=e?e.filter(Boolean):[];if(r||a){let v=new AbortController,$;const h=function(l){if(!$){$=!0,i();const n=l instanceof Error?l:this.reason;v.abort(n instanceof Am?n:new Yk(n instanceof Error?n.message:n))}};let u=r&&setTimeout(()=>{u=null,h(new Am(`timeout ${r} of ms exceeded`,Am.ETIMEDOUT))},r);const i=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(h):l.removeEventListener("abort",h)}),e=null)};e.forEach(l=>l.addEventListener("abort",h));const{signal:p}=v;return p.unsubscribe=()=>tu.asap(i),p}},fZe=function*(e,r){let a=e.byteLength;if(a<r){yield e;return}let v=0,$;for(;v<a;)$=v+r,yield e.slice(v,$),v=$},mZe=async function*(e,r){for await(const a of yZe(e))yield*fZe(a,r)},yZe=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const r=e.getReader();try{for(;;){const{done:a,value:v}=await r.read();if(a)break;yield v}}finally{await r.cancel()}},bZ=(e,r,a,v)=>{const $=mZe(e,r);let h=0,u,i=p=>{u||(u=!0,v&&v(p))};return new ReadableStream({async pull(p){try{const{done:l,value:n}=await $.next();if(l){i(),p.close();return}let k=n.byteLength;if(a){let T=h+=k;a(T)}p.enqueue(new Uint8Array(n))}catch(l){throw i(l),l}},cancel(p){return i(p),$.return()}},{highWaterMark:2})},xZ=64*1024,{isFunction:pN}=tu,gZe=(({Request:e,Response:r})=>({Request:e,Response:r}))(tu.global),{ReadableStream:_Z,TextEncoder:wZ}=tu.global,TZ=(e,...r)=>{try{return!!e(...r)}catch{return!1}},vZe=e=>{e=tu.merge.call({skipUndefined:!0},gZe,e);const{fetch:r,Request:a,Response:v}=e,$=r?pN(r):typeof fetch=="function",h=pN(a),u=pN(v);if(!$)return!1;const i=$&&pN(_Z),p=$&&(typeof wZ=="function"?(d=>o=>d.encode(o))(new wZ):async d=>new Uint8Array(await new a(d).arrayBuffer())),l=h&&i&&TZ(()=>{let d=!1;const o=new a(Wx.origin,{body:new _Z,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!o}),n=u&&i&&TZ(()=>tu.isReadableStream(new v("").body)),k={stream:n&&(d=>d.body)};$&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!k[d]&&(k[d]=(o,c)=>{let s=o&&o[d];if(s)return s.call(o);throw new Am(`Response type '${d}' is not supported`,Am.ERR_NOT_SUPPORT,c)})});const T=async d=>{if(d==null)return 0;if(tu.isBlob(d))return d.size;if(tu.isSpecCompliantForm(d))return(await new a(Wx.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(tu.isArrayBufferView(d)||tu.isArrayBuffer(d))return d.byteLength;if(tu.isURLSearchParams(d)&&(d=d+""),tu.isString(d))return(await p(d)).byteLength},x=async(d,o)=>tu.toFiniteNumber(d.getContentLength())??T(o);return async d=>{let{url:o,method:c,data:s,signal:f,cancelToken:g,timeout:S,onDownloadProgress:L,onUploadProgress:E,responseType:P,headers:V,withCredentials:I="same-origin",fetchOptions:j}=vZ(d),F=r||fetch;P=P?(P+"").toLowerCase():"text";let W=hZe([f,g&&g.toAbortSignal()],S),U=null;const z=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let X;try{if(E&&l&&c!=="get"&&c!=="head"&&(X=await x(V,s))!==0){let be=new a(o,{method:"POST",body:s,duplex:"half"}),xe;if(tu.isFormData(s)&&(xe=be.headers.get("content-type"))&&V.setContentType(xe),be.body){const[Ae,je]=fZ(X,dN(mZ(E)));s=bZ(be.body,xZ,Ae,je)}}tu.isString(I)||(I=I?"include":"omit");const N=h&&"credentials"in a.prototype,Y={...j,signal:W,method:c.toUpperCase(),headers:V.normalize().toJSON(),body:s,duplex:"half",credentials:N?I:void 0};U=h&&new a(o,Y);let se=await(h?F(U,j):F(o,Y));const me=n&&(P==="stream"||P==="response");if(n&&(L||me&&z)){const be={};["status","statusText","headers"].forEach(_e=>{be[_e]=se[_e]});const xe=tu.toFiniteNumber(se.headers.get("content-length")),[Ae,je]=L&&fZ(xe,dN(mZ(L),!0))||[];se=new v(bZ(se.body,xZ,Ae,()=>{je&&je(),z&&z()}),be)}P=P||"text";let ge=await k[tu.findKey(k,P)||"text"](se,d);return!me&&z&&z(),await new Promise((be,xe)=>{hZ(be,xe,{data:ge,headers:H_.from(se.headers),status:se.status,statusText:se.statusText,config:d,request:U})})}catch(N){throw z&&z(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new Am("Network Error",Am.ERR_NETWORK,d,U),{cause:N.cause||N}):Am.from(N,N&&N.code,d,U)}}},bZe=new Map,SZ=e=>{let r=e&&e.env||{};const{fetch:a,Request:v,Response:$}=r,h=[v,$,a];let u=h.length,i=u,p,l,n=bZe;for(;i--;)p=h[i],l=n.get(p),l===void 0&&n.set(p,l=i?new Map:vZe(r)),n=l;return l};SZ();const YP={http:RGe,xhr:pZe,fetch:{get:SZ}};tu.forEach(YP,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});const kZ=e=>`- ${e}`,xZe=e=>tu.isFunction(e)||e===null||e===!1;function _Ze(e,r){e=tu.isArray(e)?e:[e];const{length:a}=e;let v,$;const h={};for(let u=0;u<a;u++){v=e[u];let i;if($=v,!xZe(v)&&($=YP[(i=String(v)).toLowerCase()],$===void 0))throw new Am(`Unknown adapter '${i}'`);if($&&(tu.isFunction($)||($=$.get(r))))break;h[i||"#"+u]=$}if(!$){const u=Object.entries(h).map(([p,l])=>`adapter ${p} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=a?u.length>1?`since :
|
|
7983
7983
|
`+u.map(kZ).join(`
|
|
7984
7984
|
`):" "+kZ(u[0]):"as no adapter specified";throw new Am("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return $}const LZ={getAdapter:_Ze,adapters:YP};function QP(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Yk(null,e)}function CZ(e){return QP(e),e.headers=H_.from(e.headers),e.data=HP.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),LZ.getAdapter(e.adapter||o9.adapter,e)(e).then(function(r){return QP(e),r.data=HP.call(e,e.transformResponse,r),r.headers=H_.from(r.headers),r},function(r){return pZ(r)||(QP(e),r&&r.response&&(r.response.data=HP.call(e,e.transformResponse,r.response),r.response.headers=H_.from(r.response.headers))),Promise.reject(r)})}const OZ="1.13.0",hN={};["object","boolean","number","function","string","symbol"].forEach((e,r)=>{hN[e]=function(a){return typeof a===e||"a"+(r<1?"n ":" ")+e}});const NZ={};hN.transitional=function(e,r,a){function v($,h){return"[Axios v"+OZ+"] Transitional option '"+$+"'"+h+(a?". "+a:"")}return($,h,u)=>{if(e===!1)throw new Am(v(h," has been removed"+(r?" in "+r:"")),Am.ERR_DEPRECATED);return r&&!NZ[h]&&(NZ[h]=!0,console.warn(v(h," has been deprecated since v"+r+" and will be removed in the near future"))),e?e($,h,u):!0}},hN.spelling=function(e){return(r,a)=>(console.warn(`${a} is likely a misspelling of ${e}`),!0)};function wZe(e,r,a){if(typeof e!="object")throw new Am("options must be an object",Am.ERR_BAD_OPTION_VALUE);const v=Object.keys(e);let $=v.length;for(;$-- >0;){const h=v[$],u=r[h];if(u){const i=e[h],p=i===void 0||u(i,h,e);if(p!==!0)throw new Am("option "+h+" must be "+p,Am.ERR_BAD_OPTION_VALUE);continue}if(a!==!0)throw new Am("Unknown option "+h,Am.ERR_BAD_OPTION)}}const fN={assertOptions:wZe,validators:hN},A5=fN.validators;let CS=class{constructor(e){this.defaults=e||{},this.interceptors={request:new lZ,response:new lZ}}async request(e,r){try{return await this._request(e,r)}catch(a){if(a instanceof Error){let v={};Error.captureStackTrace?Error.captureStackTrace(v):v=new Error;const $=v.stack?v.stack.replace(/^.+\n/,""):"";try{a.stack?$&&!String(a.stack).endsWith($.replace(/^.+\n.+\n/,""))&&(a.stack+=`
|
|
7985
|
-
`+$):a.stack=$}catch{}}throw a}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=LS(this.defaults,r);const{transitional:a,paramsSerializer:v,headers:$}=r;a!==void 0&&fN.assertOptions(a,{silentJSONParsing:A5.transitional(A5.boolean),forcedJSONParsing:A5.transitional(A5.boolean),clarifyTimeoutError:A5.transitional(A5.boolean)},!1),v!=null&&(tu.isFunction(v)?r.paramsSerializer={serialize:v}:fN.assertOptions(v,{encode:A5.function,serialize:A5.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fN.assertOptions(r,{baseUrl:A5.spelling("baseURL"),withXsrfToken:A5.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let h=$&&tu.merge($.common,$[r.method]);$&&tu.forEach(["delete","get","head","post","put","patch","common"],x=>{delete $[x]}),r.headers=H_.concat(h,$);const u=[];let i=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(i=i&&x.synchronous,u.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let l,n=0,k;if(!i){const x=[CZ.bind(this),void 0];for(x.unshift(...u),x.push(...p),k=x.length,l=Promise.resolve(r);n<k;)l=l.then(x[n++],x[n++]);return l}k=u.length;let T=r;for(;n<k;){const x=u[n++],d=u[n++];try{T=x(T)}catch(o){d.call(this,o);break}}try{l=CZ.call(this,T)}catch(x){return Promise.reject(x)}for(n=0,k=p.length;n<k;)l=l.then(p[n++],p[n++]);return l}getUri(e){e=LS(this.defaults,e);const r=yZ(e.baseURL,e.url,e.allowAbsoluteUrls);return sZ(r,e.params,e.paramsSerializer)}};tu.forEach(["delete","get","head","options"],function(e){CS.prototype[e]=function(r,a){return this.request(LS(a||{},{method:e,url:r,data:(a||{}).data}))}}),tu.forEach(["post","put","patch"],function(e){function r(a){return function(v,$,h){return this.request(LS(h||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:v,data:$}))}}CS.prototype[e]=r(),CS.prototype[e+"Form"]=r(!0)});let TZe=class sQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function($){a=$});const v=this;this.promise.then($=>{if(!v._listeners)return;let h=v._listeners.length;for(;h-- >0;)v._listeners[h]($);v._listeners=null}),this.promise.then=$=>{let h;const u=new Promise(i=>{v.subscribe(i),h=i}).then($);return u.cancel=function(){v.unsubscribe(h)},u},r(function($,h,u){v.reason||(v.reason=new Yk($,h,u),a(v.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const a=this._listeners.indexOf(r);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const r=new AbortController,a=v=>{r.abort(v)};return this.subscribe(a),r.signal.unsubscribe=()=>this.unsubscribe(a),r.signal}static source(){let r;return{token:new sQ(function(a){r=a}),cancel:r}}};function SZe(e){return function(r){return e.apply(null,r)}}function kZe(e){return tu.isObject(e)&&e.isAxiosError===!0}const $P={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($P).forEach(([e,r])=>{$P[r]=e});function EZ(e){const r=new CS(e),a=XG(CS.prototype.request,r);return tu.extend(a,CS.prototype,r,{allOwnKeys:!0}),tu.extend(a,r,null,{allOwnKeys:!0}),a.create=function(v){return EZ(LS(e,v))},a}const xv=EZ(o9);xv.Axios=CS,xv.CanceledError=Yk,xv.CancelToken=TZe,xv.isCancel=pZ,xv.VERSION=OZ,xv.toFormData=cN,xv.AxiosError=Am,xv.Cancel=xv.CanceledError,xv.all=function(e){return Promise.all(e)},xv.spread=SZe,xv.isAxiosError=kZe,xv.mergeConfig=LS,xv.AxiosHeaders=H_,xv.formToJSON=e=>uZ(tu.isHTMLForm(e)?new FormData(e):e),xv.getAdapter=LZ.getAdapter,xv.HttpStatusCode=$P,xv.default=xv;const{Axios:Zwt,AxiosError:Jwt,CanceledError:Hwt,isCancel:Ywt,CancelToken:Qwt,VERSION:$wt,all:e5t,Cancel:t5t,isAxiosError:r5t,spread:a5t,toFormData:n5t,AxiosHeaders:i5t,HttpStatusCode:o5t,formToJSON:s5t,getAdapter:l5t,mergeConfig:c5t}=xv,LZe=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let eA=null;function CZe(){return eA||(eA=LZe.reduce((e,r,a)=>(e[a]=r,e),{})),eA}const OZe=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let tA=null;function NZe(){return tA||(tA=OZe.reduce((e,r,a)=>(e[a]=r,e),{})),tA}const mN={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},EZe={class:"modal-confirmation"},zZe={class:"modal-confirmation__container"},MZe={class:"modal-confirmation__title"},VZe={class:"modal-confirmation"},PZe={class:"modal-confirmation__container"},AZe={class:"modal-confirmation__title"},RZe={class:"specific-plays-titlecontainer"},UZe={class:"specific-plays-title"},FZe={key:0,class:"specific-plays-title-elegibility"},IZe={key:1},qZe={class:"specific-plays-controls"},jZe={class:"specific-plays-controls11"},WZe={class:"radio-container"},DZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},KZe={class:"radio-label"},BZe=["src"],XZe={class:"radio-container"},GZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZZe={class:"radio-label"},JZe=["src"],HZe={class:"cont-app-value-incement-second"},YZe={class:"contappvalueincementsecond-value"},QZe={key:0},$Ze={class:"contappvalueincementsecond-controls-container"},eJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},tJe={class:"text-icon-info"},rJe={class:"cont-app-value-incement-second"},aJe={class:"contappvalueincementsecond-value"},nJe={key:0},iJe={class:"contappvalueincementsecond-controls-container"},oJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},sJe={class:"text-icon-info"},lJe={class:"cont-app-value-incement-second"},cJe={class:"contappvalueincementsecond-value"},uJe={key:0},dJe={class:"contappvalueincementsecond-controls-container"},pJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},hJe={class:"specific-plays-field__soccer-field"},fJe={class:"game-teams"},mJe={class:"game-teams__team home"},yJe={key:0,class:"team-logo"},gJe=["src"],vJe={class:"game-teams__team away"},bJe={key:0,class:"team-logo"},xJe=["src"],_Je={class:"specific-plays-field__play-buttons__container"},wJe={key:1,class:"specific-plays-radio-container-movil"},TJe={class:"radio-container"},SJe={class:"radio-label"},kJe=["src"],LJe={class:"radio-container"},CJe={class:"radio-label"},OJe=["src"],NJe={key:0,class:"h-separator"},EJe={key:1,class:"corner-info"},zJe={class:"corner-info__team"},MJe=["src"],VJe={class:"corner-info__details"},PJe={class:"corner-info__details__player"},AJe={class:"corner-info__details__how-was"},yN=.6,RJe=5,UJe=10,FJe=600,IJe=600,qJe=5,jJe={__name:"GSCSpecificPlays",props:{widthContainer:{type:Number,default:1280},selectedCategoryId:{type:Number,default:31},teamIdForAnalysis:{type:Number,default:1},playIdForAnalysis:{type:Number,default:null},seasonIdForAnalysis:{type:Number,default:1325},tournamentSelected:{type:Object,default:()=>({})},advancedFilters:{type:Object,default:()=>({areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0})},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})},isGameOnly:{type:Boolean,default:!1},game:{type:Object,default:()=>({id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"})},gameIdForAnalysis:{type:Number,default:null},isAgainstMode:{type:Boolean,default:!1},areFiltersOpen:{type:Boolean,default:!1},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},isFieldOnly:{type:Boolean,default:!0},isTemplateMode:{type:Boolean,default:!1},isCornerInfoVisible:{type:Boolean,default:!1},isNullCornerData:{type:Boolean,default:!1}},emits:["open-media-player","corners-filled","changelateralidad"],setup(e,{emit:r}){let a=0;const v=e,$=CZe(),h=NZe(),u=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:v.tournamentSelected.is_female==1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:v.tournamentSelected.is_female==1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],i=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),p=u.reduce(($t,Rt)=>(Rt.categoriesIds.forEach(sr=>{$t.set(sr,Rt.text)}),$t),new Map),l={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},n=r,k=t.ref(null),T=t.ref("0"),x=t.ref(["-1","0"]),d=t.ref(new Map),o=t.ref(!v.isTacticVisible),c=t.ref(!1),s=t.ref([]),f=t.ref(!0),g=t.ref(!0),S=t.ref(!1),L=t.ref(!1),E=t.ref(new Map),P=t.computed(()=>{if(v.gameIdForAnalysis&&v.playIdForAnalysis&&s.value){const $t=s.value.find(Rt=>Rt.game_id===v.gameIdForAnalysis);if($t){if($t.corners.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!1;if($t.cornersAgainstTeam.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!0}}return v.isAgainstMode}),V=t.computed(()=>{const $t=[];return U.value&&(f.value&&$t.push(v.teamIdForAnalysis),g.value&&$t.push(v.teamIdForAnalysis!==U.value.home_team?U.value.home_team:U.value.visiting_team)),$t}),I=t.computed(()=>v.widthContainer<=768?"cont-data768":"cont-data"),j=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-collectors768":$t<=900?"cont-collectors900":"cont-collectors"}),F=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-who-connected768":$t<=900?"cont-who-connected900":"cont-who-connected"}),W=t.computed(()=>s.value?s.value.findIndex($t=>$t.isSelected):null),U=t.computed(()=>s.value?s.value[W.value]:null),z=t.ref(null),X=t.computed(()=>{const $t=s.value[W.value];let Rt=!1;if($t){const sr=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(Zt=>Zt.isSelected);if(sr&&sr.playConnections){ge(sr);const Zt=sr.playConnections;let Tt=[Zt.mainPlay];return Zt.relatedPlays&&Tt.push(...Zt.relatedPlays),Tt.sort((Pt,Ut)=>Pt.touchOrder-Ut.touchOrder),Tt=Tt.filter(Pt=>{let Ut=!0;return Rt?!1:(N.value?Ut=!Pt.isTeamForAnalysis&&Pt.y1<=yN||Pt.isTeamForAnalysis&&Pt.y1>=yN:Ut=Pt.isTeamForAnalysis&&Pt.y1<=yN||!Pt.isTeamForAnalysis&&Pt.y1>=yN,Rt=!Ut,Ut)}),Tt.forEach((Pt,Ut)=>{Ut>0&&(Pt.previousPlayConnection=Tt[Ut-1]),Ut===Tt.length-1&&(Pt.isLastPlay=!0)}),Tt}}return[]}),N=t.computed(()=>{const $t=s.value[W.value];if($t){const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.isAgainst:!1}return!1}),Y=t.computed(()=>{const $t=s.value[W.value];if($t){me($t);const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.fieldPositions:null}return null}),se=t.ref({});function me($t){se.value=$t}function ge($t){z.value=$t}const be=t.computed(()=>Y.value?Y.value.get(T.value):[]),xe=t.computed(()=>{if(Y.value){const $t=Number(x.value[0]),Rt=Number(x.value[1]),sr=[];if(Rt!==$t)for(let Zt=$t;Zt<Rt;Zt++){const Tt=Y.value.get(Zt.toString()),Pt=Y.value.get((Zt+1).toString());Tt&&Pt&&sr.push({playersPositions:Tt,finalPlayersPositions:Pt,areFirstPositions:Zt===$t,areFinalPositions:Zt===Rt-1})}else sr.push({playersPositions:Y.value.get(x.value[0]),finalPlayersPositions:Y.value.get(x.value[0]),areFirstPositions:!0,areFinalPositions:!0});return sr}return[]}),Ae=t.computed(()=>Y.value?Array.from(Y.value.keys()):[]);t.watch(()=>v.advancedFilters,$t=>{o.value=$t.areConnectionsVisible,c.value=$t.arePathsVisible;const Rt=$t.secondsBeforeAndAfter.toString(),sr=$t.secondsBefore.toString(),Zt=$t.secondsAfter.toString();Ae.value.includes(Rt)&&(T.value=Rt),Ae.value.includes(sr)&&(x.value[0]=sr),Ae.value.includes(Zt)&&(x.value[1]=Zt)},{immediate:!0,deep:!0}),t.watch(()=>P.value,()=>{v.isNullCornerData||Et()}),t.watch(()=>v.teamIdForAnalysis,$t=>{$t&&!v.isNullCornerData&&Mt()},{immediate:!0});const je=t.computed(()=>U.value?v.teamIdForAnalysis===U.value.home_team:!0);t.watch(()=>W.value,($t,Rt)=>{if($t!==Rt&&(T.value="0",x.value=["-1","0"],U.value)){U.value.corners.forEach(Zt=>{Zt.isSelected=!1}),U.value.cornersAgainstTeam.forEach(Zt=>{Zt.isSelected=!1});const sr=(P.value?U.value.cornersAgainstTeam:U.value.corners).filter(Zt=>Zt.isVisible);sr.length>0&&(sr[0].isSelected=!0)}}),t.watch(()=>v.filters,$t=>{$t&&Ue()},{deep:!0,immediate:!0}),t.watch(()=>v.isTacticVisible,$t=>{o.value=!$t});function _e($t){n("changelateralidad",$t)}function Ue(){if(s.value)if(v.isSynchronization)s.value.forEach(($t,Rt)=>{$t.isVisible=!0,Rt===0&&($t.isSelected=!0,$t.isExpanded=!0,$t.corners.forEach(sr=>{sr.isVisible=!0}),$t.cornersAgainstTeam.forEach(sr=>{sr.isVisible=!0}))});else{let $t=!1;s.value.forEach(Rt=>{if(Rt.isSelected=!1,P.value&&Rt.isSoccerFieldDataRivalLoaded||!P.value&&Rt.isSoccerFieldDataLoaded){const sr=P.value?Rt.cornersAgainstTeam:Rt.corners;if((!v.filters.games.length||v.filters.games.includes(Rt.game_id))&&v.filters.playingAs.includes(Rt.playingAs)&&(v.filters.isMoment||v.filters.final.includes(Rt.finalResult))){let Zt=0;for(const Tt of sr){if(Tt.isSelected=!1,v.playIdForAnalysis&&Tt.play_id===v.playIdForAnalysis){Tt.isVisible=!0,Tt.isSelected=!0,Zt++;break}if(v.filters.cornertype!==Tt.init_category_id){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.howWas.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!P.value&&v.filters.players.length&&!v.filters.players.includes(Tt.player_id)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(Tt.playConnections){if(!v.filters.sections.includes(Tt.playConnections.mainPlay.timeSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.moment.includes(Tt.playConnections.mainPlay.matchResultAtMomentOfPlay)){Tt.isVisible=!1,Tt.isSelected=!1;continue}const Pt=Tt.playConnections.mainPlay;if(Pt&&!v.filters.isZoneFull&&!v.filters.zona.includes(Pt.fieldSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}}if(!v.filters.isWhatHappenedFull&&Tt.relatedCategoriesIds&&!v.filters.whathappened.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}Tt.isVisible=!0,Zt===0&&(Tt.isSelected=!0),Zt++}Rt.isVisible=Zt>0,Rt.isVisible&&!$t?(Rt.isSelected=!0,Rt.isExpanded=!0,$t=!0):Rt.isSelected=!1}else Rt.isVisible=!1,sr.forEach(Zt=>{Zt.isVisible=!1,Zt.isSelected=!1})}})}}function qe([$t,Rt]){const sr=Math.round(Number(Rt));if(sr===60){const Zt=Number($t)+1;return`${Zt<100?Zt<10?"00":"0":""}${Zt}:00.000`}return`${$t}:${sr<10?"0":""}${sr}.000`}function Re($t,Rt,sr,Zt){$t&&$t.forEach(Tt=>{Tt.isHomeTeam=Tt.teamId===U.value.home_team,Tt.attackDirection=Zt.get(Tt.playId).mainPlay.attackDirection,Tt.player=Rt.get(Tt.playerId)||sr.get(Tt.playerId)})}function De($t,Rt){const sr=Number(x.value[Rt])+$t;if(Ae.value.includes(sr.toString())){const Zt=[...x.value];Zt[Rt]=sr.toString(),Number(Zt[1])-Number(Zt[0])>=0&&(x.value=[...Zt])}}function Qe($t){const Rt=Number(T.value)+$t;Ae.value.includes(Rt.toString())&&(T.value=Rt.toString())}function rt($t){if(!$t.teams||$t.teams.length===0)return;const Rt=$t.teams[0].team_id,sr=$t.teams[1].team_id;if(v.teamIdForAnalysis===Rt&&$t.home_atk_direction===1||v.teamIdForAnalysis===sr&&$t.visiting_atk_direction===1)for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_LEFT:mN.TO_RIGHT);else for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_RIGHT:mN.TO_LEFT)}function dt(){L.value=!0}function ct(){L.value=!1}async function Ye(){try{if(U.value){const $t={messages:[{queue:"gs3.tendency",message:{key:"postmatch",action:"season",data:{season_id:v.seasonIdForAnalysis,game_id:U.value.game_id}}}]};await xv.post("https://6xh1ym8shh.execute-api.us-west-2.amazonaws.com/prod/pushInternalData",$t,l)}}catch($t){throw new Error($t)}finally{ct()}}function st(){S.value=!0}function lt(){S.value=!1}async function Ot(){try{if(U.value){const $t=U.value[`${P.value?"cornersAgainstTeam":"corners"}`].find(Rt=>Rt.isSelected);if($t){const Rt={play_id:$t.play_id,game_id:U.value.game_id,season_id:v.seasonIdForAnalysis,seconds:Number(T.value),moment_of_play:$t.moment_of_play};await xv.post(" https://bqsyfm7sij.execute-api.us-east-2.amazonaws.com/prod/sync",Rt,l)}}}catch($t){throw new Error($t)}finally{lt()}}async function Mt($t){try{const Rt=E.value.get(v.teamIdForAnalysis);if(Rt){s.value=Rt,Ue();return}a=$t||v.seasonIdForAnalysis;const sr=(await xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/games/teams/${v.teamIdForAnalysis}/corners`,l)).data,Zt={corners:0,cornersAgainst:0};s.value=sr.games?sr.games.reduce((Tt,Pt)=>{if(v.isGameOnly&&v.gameIdForAnalysis!==Pt.game_id)return Tt;const Ut={againstTeam:[],team:[]},vr=Pt.score[1]-Pt.score[0];Pt.dateMillis=new Date(Pt.date_time_utc),Pt.isVisible=!0,Pt.playingAs=Pt.home_team===v.teamIdForAnalysis?1:2,Pt.finalResult=vr===0?3:Pt.playingAs===1?vr>0?2:1:vr<0?2:1,Pt.corners.forEach(Tr=>{const Rr=Tr.team_id===v.teamIdForAnalysis;Tr.isAgainst=!Rr,(!v.playIdForAnalysis||v.playIdForAnalysis===Tr.play_id)&&(Rr?Ut.team.push(Tr):Ut.againstTeam.push(Tr))}),Pt.corners=Ut.team,Pt.cornersAgainstTeam=Ut.againstTeam;const ur=Pt.home_team===v.teamIdForAnalysis?1:2;Zt.corners+=Pt.corners.length,Zt.cornersAgainst+=Pt.cornersAgainstTeam.length;const gr={...Pt,isSelected:Tt.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:Pt.home_team===v.teamIdForAnalysis,canPlayVideos:v.canPlayVideos&&v.videoPrivilegesPlayingAs.has(ur)};return Tt.push(gr),Tt},[]):[],s.value=s.value.sort((Tt,Pt)=>Pt.dateMillis-Tt.dateMillis),qt(),n("corners-filled",Zt),await Et(),s.value.forEach(Tt=>{Tt.corners.concat(Tt.cornersAgainstTeam).forEach(Pt=>{if(Pt.playConnections){const[Ut,vr]=Pt.moment_of_play.split(":"),[ur,gr]=vr.split("."),Tr=Number(Ut)+45*Pt.playConnections.mainPlay.matchLapse;Pt.isSelected=!1,Pt.orderValue=+`${Tr}${ur}${gr}`}}),Tt.corners=Tt.corners.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue),Tt.cornersAgainstTeam=Tt.cornersAgainstTeam.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue)}),Ue()}catch(Rt){throw new Error(Rt)}}async function Et(){try{const $t=[];s.value.forEach(Rt=>{(P.value&&!Rt.isSoccerFieldDataRivalLoaded||!P.value&&!Rt.isSoccerFieldDataLoaded)&&$t.push(Gt(Rt))}),$t.length>0&&((await Promise.all($t)).forEach((Rt,sr)=>{lr(s.value[sr],Rt)}),Ue()),qt()}catch($t){throw new Error($t)}}function qt(){E.value.get(v.teamIdForAnalysis)||E.value.set(v.teamIdForAnalysis,s.value)}function Gt($t){return v.isSynchronization?xv.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${P.value?"received":"commited"}-${a}-${v.teamIdForAnalysis}-${$t.game_id}-large.json`):xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/corners/trends/teams/${v.teamIdForAnalysis}/${$t.game_id}${P.value?"?isR=1":""}`,l)}function Jt($t){const[Rt,sr]=$t.split(", ");let Zt="";const Tt=Rt.split(" ");for(const Pt of Tt)if(Zt+=` ${Pt}`,Pt.length>3)break;return sr&&Rt?`${sr.trim().charAt(0)}.${Zt}`:""}function Qt($t){let[Rt,sr]=$t.split(", ");sr=(sr==null?void 0:sr.trim())||"";let Zt="";const Tt=Rt.split(" "),Pt=sr.includes(" ")?sr.split(" ")[0]:sr;for(const Ut of Tt)if(Zt+=` ${Ut}`,Ut.length>3)break;return Pt&&Rt?`${Pt} ${Zt}`:""}async function lr($t,Rt){try{if($t&&Rt&&(!$t.isSoccerFieldDataLoaded||!$t.isSoccerFieldDataRivalLoaded)){const sr=new Map,Zt=new Map,Tt=new Map;rt(Rt.data),Rt.data.players&&Rt.data.players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Zt.set(ur.player_id,ur)}),Rt.data.rival_players&&Rt.data.rival_players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Tt.set(ur.player_id,ur)}),k.value=Rt.data.teams.find(ur=>ur.team_id===v.teamIdForAnalysis),k.value&&(k.value.rival=Rt.data.teams.find(ur=>ur.team_id!==v.teamIdForAnalysis));const Pt=Rt.data.data.reduce((ur,gr)=>{const Tr=gr.reduce((or,Or,Pr)=>(or[h[Pr]]=Or,or.isHomeTeam=or.teamId===$t.home_team,or),{}),Rr=Tr.playId===Tr.relatedPlayId,St=ur.get(Tr.relatedPlayId),Yt=Tr.momentOfPlay.split(":"),er=qe(Yt);return Tr.player=Zt.get(Tr.playerId)||Tt.get(Tr.playerId),Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis,Rr&&(Tr.attackDirection=d.value.get(Tr.matchLapse),sr.set(Tr.playId,er)),St?Rr?St.mainPlay=Tr:St.relatedPlays.length<qJe&&(St.relatedPlays.push(Tr),St.relatedPlays.length>1&&St.relatedPlays.sort((or,Or)=>or.touchOrder-Or.touchOrder)):ur.set(Tr.playId,{mainPlay:Rr?Tr:null,relatedPlays:Rr?[]:[Tr]}),ur},new Map),Ut=Rt.data.field_positions.reduce((ur,gr)=>{const Tr=gr.reduce((St,Yt,er)=>(St[$[er]]=Yt,St),{});Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis;const Rr=ur.get(Tr.playId);if(Rr){const St=Rr.get(Tr.momentOfPlay);St?St.push(Tr):Rr.set(Tr.momentOfPlay,[Tr])}else ur.set(Tr.playId,new Map([[Tr.momentOfPlay,[Tr]]]));return ur},new Map),vr=Array.from(sr.entries()).reduce((ur,[gr,Tr])=>{const Rr=[],St=[];let Yt=null;const er=Ut.get(gr);if(er){const or=v.isSynchronization?FJe:RJe,Or=v.isSynchronization?IJe:UJe;Array.from(er.keys()).sort().forEach(oa=>{(!Yt||St.length<Or)&&(oa===Tr?Yt=er.get(oa):Yt?St.length<Or&&St.push(er.get(oa)):(Rr.length===or&&Rr.shift(),Rr.push(er.get(oa))))});const Pr=new Map;Rr.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia-Rr.length}`,oa)}),Re(Yt,Zt,Tt,Pt),Pr.set("0",Yt),St.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia+1}`,oa)}),ur.set(gr,Pr)}return ur},new Map);$t[`${P.value?"cornersAgainstTeam":"corners"}`].forEach(ur=>{const gr=ur.related_categories.split(",").reduce((Rr,St,Yt)=>{const er=Number(St);return Yt===1&&(ur.howWasCorner=er),Rr.array.push(er),Rr.sett.add(er),Rr},{array:[],sett:new Set});for(const Rr of gr.array){const St=i.get(Rr),Yt=p.get(Rr);if(Yt&&(ur.whatHappenedName=Yt),St&&(ur.howWasCornerName=St),ur.howWasCornerName&&ur.whatHappenedName)break}ur.relatedCategoriesIds=gr.sett,ur.playConnections=Pt.get(ur.play_id),ur.fieldPositions=vr.get(ur.play_id),ur.player=Zt.get(ur.player_id)||Tt.get(ur.player_id);let Tr=ur.moment_of_play.split(".")[0];Tr.startsWith("0")&&(Tr=Tr.slice(1)),ur.formattedMomentOfPlay=Tr,ur.momentOfPlayNumber=Number(Tr.replace(":","."))}),!P.value&&!$t.isSoccerFieldDataLoaded&&($t.isSoccerFieldDataLoaded=!0),P.value&&!$t.isSoccerFieldDataRivalLoaded&&($t.isSoccerFieldDataRivalLoaded=!0)}}catch(sr){throw new Error(sr)}}function hr($t){const Rt=U.value[`${P.value?"cornersAgainstTeam":"corners"}`],sr={},Zt=Rt.reduce((Tt,Pt)=>(Pt.isVisible&&(Tt.add(Pt.play_id),Pt.isSelected&&(sr.playId=Pt.play_id)),Tt),new Set);n("open-media-player",{seasonId:a,mainSectionType:1,playListType:1,playsIds:Zt,playData:sr,categoryIds:P.value?["31_r","32_r"]:[31,32],teamId:v.teamIdForAnalysis,videosType:$t,isCarouselOnly:!0})}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.withDirectives(t.createElementVNode("div",EZe,[t.createElementVNode("div",zZe,[t.createElementVNode("div",MZe," ¿Estás seguro que deseas sincronizar el tracking del partido "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`]:"")+" vs "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`]:"")+" ? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:ct}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ye},"Sí")])])],512),[[t.vShow,L.value]]),t.withDirectives(t.createElementVNode("div",VZe,[t.createElementVNode("div",PZe,[t.createElementVNode("div",AZe," ¿Estás seguro que deseas sincronizar esta jugada en el segundo "+t.toDisplayString(T.value)+"? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:lt}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ot},"Sí")])])],512),[[t.vShow,S.value]]),t.createElementVNode("div",{class:t.normalizeClass(e.widthContainer<=768?"gsc-specific-plays-movil":"gsc-specific-plays")},[t.withDirectives(t.createElementVNode("div",RZe,[t.createElementVNode("div",UZe,[e.widthContainer<=768?(t.openBlock(),t.createElementBlock("span",FZe,"Elige que quieres ver:")):(t.openBlock(),t.createElementBlock("span",IZe,"Jugadas Específicas"))])],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(I.value)},[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(j.value)},[e.widthContainer>768?(t.openBlock(),t.createBlock(_Be,{key:0,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"])):(t.openBlock(),t.createBlock(mXe,{key:1,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"]))],2),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(F.value)},[e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:"button-tracking",onClick:dt}," Generar datos ")):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("div",qZe,[t.createElementVNode("div",jZe,[t.createVNode(t.unref(IP),{modelValue:o.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=sr=>o.value=sr),label:"Mostrar conexiones",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"]),e.widthContainer<=768&&e.isTacticVisible?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[1]||(Rt[1]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"])):t.createCommentVNode("",!0),e.widthContainer>768?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["specific-plays-radio-container",{"is-away-team":!je.value}])},[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",WZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[2]||(Rt[2]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-home":"outer-circle-away")},[f.value?(t.openBlock(),t.createElementBlock("svg",DZe,[...Rt[16]||(Rt[16]=[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",KZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,BZe)])]),t.createElementVNode("label",XZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[3]||(Rt[3]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[g.value?(t.openBlock(),t.createElementBlock("svg",GZe,[...Rt[17]||(Rt[17]=[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",ZZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,JZe)])])],64)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass(["specific-plays-controls22",e.widthContainer<=375?"specific-plays-controls22small":""])},[e.widthContainer>768&&e.isTacticVisible&&!e.isSynchronization?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[4]||(Rt[4]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:"13px","label-color":"#FFF"},null,8,["modelValue"])):t.createCommentVNode("",!0),e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[c.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[t.createElementVNode("div",tJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Inicio: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Inicio:")],64))]),Rt[29]||(Rt[29]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",rJe,[t.createElementVNode("div",aJe,[Number(x.value[0])>0?(t.openBlock(),t.createElementBlock("span",nJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[0]),1)]),Rt[25]||(Rt[25]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",iJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[7]||(Rt[7]=sr=>De(1,0))},[(t.openBlock(),t.createElementBlock("svg",oJe,[...Rt[23]||(Rt[23]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[8]||(Rt[8]=sr=>De(-1,0))},[...Rt[24]||(Rt[24]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])]),t.createElementVNode("div",sJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Fin: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Fin:")],64))]),Rt[30]||(Rt[30]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",lJe,[t.createElementVNode("div",cJe,[Number(x.value[1])>0?(t.openBlock(),t.createElementBlock("span",uJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[1]),1)]),Rt[28]||(Rt[28]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",dJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[9]||(Rt[9]=sr=>De(1,1))},[(t.openBlock(),t.createElementBlock("svg",pJe,[...Rt[26]||(Rt[26]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[10]||(Rt[10]=sr=>De(-1,1))},[...Rt[27]||(Rt[27]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2)):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[Rt[21]||(Rt[21]=t.createElementVNode("div",{class:"icon-info"},null,-1)),Rt[22]||(Rt[22]=t.createElementVNode("div",{class:"text-icon-info"},"Segundos antes/después del cobro:",-1)),t.createElementVNode("div",HZe,[t.createElementVNode("div",YZe,[Number(T.value)>0?(t.openBlock(),t.createElementBlock("span",QZe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(T.value),1)]),Rt[20]||(Rt[20]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",$Ze,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[5]||(Rt[5]=sr=>Qe(1))},[(t.openBlock(),t.createElementBlock("svg",eJe,[...Rt[18]||(Rt[18]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[6]||(Rt[6]=sr=>Qe(-1))},[...Rt[19]||(Rt[19]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2))],64)):t.createCommentVNode("",!0),e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:2,role:"button",class:"button-sync",onClick:st}," Guardar sincronización ")):t.createCommentVNode("",!0)],2)],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:"specific-plays-field",style:t.normalizeStyle(e.widthContainer<=768?"height: auto":"")},[t.createElementVNode("div",hJe,[t.createVNode(HXe,{"width-container":e.widthContainer,"play-connections":X.value,"players-positions":be.value,"players-positions-by-range":xe.value,"team-id-for-analysis":e.teamIdForAnalysis,"selected-category":e.filters.cornertype,"are-connections-visible":o.value,"are-position-paths-visible":c.value,"visible-teams-ids":V.value,"is-against-corner":N.value,onChangelateralidad:_e},null,8,["width-container","play-connections","players-positions","players-positions-by-range","team-id-for-analysis","selected-category","are-connections-visible","are-position-paths-visible","visible-teams-ids","is-against-corner"])]),t.createElementVNode("div",fJe,[t.createElementVNode("div",mJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",yJe,[t.createElementVNode("img",{src:se.value.home_team_logo,alt:""},null,8,gJe)])),Rt[31]||(Rt[31]=t.createElementVNode("div",{class:"bullet"},null,-1))]),t.createElementVNode("div",vJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",bJe,[t.createElementVNode("img",{src:se.value.visiting_team_logo,alt:""},null,8,xJe)])),Rt[32]||(Rt[32]=t.createElementVNode("div",{class:"bullet"},null,-1))])]),U.value&&U.value.canPlayVideos&&!e.isFieldOnly?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons",style:t.normalizeStyle(e.widthContainer<=768?"gap:5px; flex-direction: column;":"")},[Rt[36]||(Rt[36]=t.createElementVNode("div",{class:"specific-plays-field__play-buttons__text"},"Visualizar video:",-1)),t.createElementVNode("div",_Je,[U.value.video_types.includes(1)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons__button",onClick:Rt[11]||(Rt[11]=sr=>hr(1))},[...Rt[33]||(Rt[33]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Toma TV",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(3)?(t.openBlock(),t.createElementBlock("div",{key:1,class:"specific-plays-field__play-buttons__button",onClick:Rt[12]||(Rt[12]=sr=>hr(3))},[...Rt[34]||(Rt[34]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Táctica",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(2)?(t.openBlock(),t.createElementBlock("div",{key:2,class:"specific-plays-field__play-buttons__button",onClick:Rt[13]||(Rt[13]=sr=>hr(2))},[...Rt[35]||(Rt[35]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Panorámica",-1)])])):t.createCommentVNode("",!0)])],4)):t.createCommentVNode("",!0)],4),e.widthContainer<=768?(t.openBlock(),t.createElementBlock("div",wJe,[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",TJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[14]||(Rt[14]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[37]||(Rt[37]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),t.createElementVNode("span",SJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,kJe)])]),t.createElementVNode("label",LJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[15]||(Rt[15]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[38]||(Rt[38]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),t.createElementVNode("span",CJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,OJe)])])],64)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2)],2),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",NJe)):t.createCommentVNode("",!0),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",EJe,[t.createElementVNode("div",zJe,[t.createElementVNode("img",{class:"corner-info__team__logo",src:`https://golstatsimages.blob.core.windows.net/teams-80/${z.value.team_id}.png`},null,8,MJe)]),t.createElementVNode("div",VJe,[t.createElementVNode("div",PJe,[Rt[39]||(Rt[39]=t.createElementVNode("span",null," Tiro de esquina ",-1)),Rt[40]||(Rt[40]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.player.firstNameAndFirstLastName),1)]),t.createElementVNode("div",AJe,[t.createElementVNode("span",null,t.toDisplayString(z.value.howWasCornerName),1),Rt[41]||(Rt[41]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.whatHappenedName),1)])])])):t.createCommentVNode("",!0)],2)],64))}},zZ=j6(jJe,[["__scopeId","data-v-abec1cab"]]),WJe={class:"tooltip-options"},DJe={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:r}){const a=e,v=r,$=t.computed(()=>a.optionsType==="page");function h(){v("close-tooltip")}function u(i){v(i),h()}return(i,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"tooltip-overlay",onClick:h}),t.createElementVNode("div",WJe,[t.createElementVNode("ul",null,[$.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("li",{class:"option",onClick:p[0]||(p[0]=l=>u("change-sort"))},[...p[4]||(p[4]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Cambiar orden ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[1]||(p[1]=l=>u("delete-page"))},[...p[5]||(p[5]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("li",{class:"option",onClick:p[2]||(p[2]=l=>u("edit"))},[...p[6]||(p[6]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Editar ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[3]||(p[3]=l=>u("delete"))},[...p[7]||(p[7]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},MZ=t2(DJe,[["__scopeId","data-v-998e2429"]]),KJe={class:"report-view"},BJe={class:"report-view__header"},XJe={key:0,class:"report-view__header__logo"},GJe=["src"],ZJe={class:"report-view__header__name"},JJe={class:"report-view__content"},HJe={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:r}){const a=e,v=t.ref(!1),$=r,h=[1,2,3,4,6,8,14,13],u=t.computed(()=>!h.includes(a.viewId)),i=t.computed(()=>{if(a.game){const o=a.isHomeTeam?a.game.homeTeam:a.game.awayTeam;if(o&&o.logo)return o.logo}return""}),p=t.computed(()=>{const o=a.view.coreView;return o?o.id===9?a.view.w<4?a.view.title.replace("Mapeo de ",""):a.view.title:o.id===6?n(a.view):o.id===13?k(a.view):a.view.title:a.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function n(o){return a.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function k(o){try{if(!o)return"Tabla por Categoría";const c=o.dynamicFilters||[];if(!Array.isArray(c)||c.length<2)return"Tabla por Categoría";const s=c[1]||[],f=c[0]||2;if(s&&s.length>0){const g=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:f==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:f==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:f==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:f==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],S=(L,E)=>{if(L.length!==E.length)return!1;const P=[...L].sort(),V=[...E].sort();return P.every((I,j)=>I===V[j])};for(const L of g)if(S(s,L.value))return L.label}return"Tabla por Categoría"}catch(c){return console.error("Error en getTableCategoryTitle:",c),"Tabla por Categoría"}}function T(){d(),$("edit")}function x(){d(),$("delete")}function d(){v.value=!1}return(o,c)=>(t.openBlock(),t.createElementBlock("div",KJe,[t.createElementVNode("div",BJe,[v.value?(t.openBlock(),t.createBlock(MZ,{key:0,"options-type":"view",onClick:c[0]||(c[0]=t.withModifiers(s=>v.value=!1,["self"])),onMouseleave:c[1]||(c[1]=s=>v.value=!1),onCloseTooltip:d,onEdit:T,onDelete:x})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"report-view__header__team-and-name",style:t.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[i.value&&u.value?(t.openBlock(),t.createElementBlock("div",XJe,[t.createElementVNode("img",{src:i.value,alt:""},null,8,GJe)])):t.createCommentVNode("",!0),t.createElementVNode("div",ZJe,t.toDisplayString(p.value),1)],4),t.withDirectives(t.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:c[2]||(c[2]=s=>v.value=!0)},[...c[3]||(c[3]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[t.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),t.createElementVNode("div",JJe,[t.createElementVNode("div",{class:t.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9,"center-flex-column":![8,4,9].includes(e.viewId)})},[t.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},YJe=t2(HJe,[["__scopeId","data-v-59165937"]]);function QJe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gN={exports:{}},VZ;function $Je(){if(VZ)return gN.exports;VZ=1;function e(){}return e.prototype={on:function(r,a,v){var $=this.e||(this.e={});return($[r]||($[r]=[])).push({fn:a,ctx:v}),this},once:function(r,a,v){var $=this;function h(){$.off(r,h),a.apply(v,arguments)}return h._=a,this.on(r,h,v)},emit:function(r){var a=[].slice.call(arguments,1),v=((this.e||(this.e={}))[r]||[]).slice(),$=0,h=v.length;for($;$<h;$++)v[$].fn.apply(v[$].ctx,a);return this},off:function(r,a){var v=this.e||(this.e={}),$=v[r],h=[];if($&&a)for(var u=0,i=$.length;u<i;u++)$[u].fn!==a&&$[u].fn._!==a&&h.push($[u]);return h.length?v[r]=h:delete v[r],this}},gN.exports=e,gN.exports.TinyEmitter=e,gN.exports}var rA,PZ;function eHe(){if(PZ)return rA;PZ=1;var e=$Je();return rA=new e,rA}var tHe=eHe();const Sd=QJe(tHe);function rHe(e,r,a,v,$){const h=(...u)=>(console.warn("gridstack.js: Function `"+a+"` is deprecated in "+$+" and has been replaced with `"+v+"`. It will be **removed** in a future release"),r.apply(e,u));return h.prototype=r.prototype,h}class ru{static getElements(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(v&&!isNaN(+r[0])){const h=v.getElementById(r);return h?[h]:[]}let $=a.querySelectorAll(r);return!$.length&&r[0]!=="."&&r[0]!=="#"&&($=a.querySelectorAll("."+r),$.length||($=a.querySelectorAll("#"+r))),Array.from($)}return[r]}static getElement(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(!r.length)return null;if(v&&r[0]==="#")return v.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return a.querySelector(r);if(v&&!isNaN(+r[0]))return v.getElementById(r);let $=a.querySelector(r);return v&&!$&&($=v.getElementById(r)),$||($=a.querySelector("."+r)),$}return r}static lazyLoad(r){var a,v;return r.lazyLoad||((v=(a=r.grid)==null?void 0:a.opts)==null?void 0:v.lazyLoad)&&r.lazyLoad!==!1}static createDiv(r,a){const v=document.createElement("div");return r.forEach($=>{$&&v.classList.add($)}),a==null||a.appendChild(v),v}static shouldSizeToContent(r,a=!1){return(r==null?void 0:r.grid)&&(a?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,a){return!(r.y>=a.y+a.h||r.y+r.h<=a.y||r.x+r.w<=a.x||r.x>=a.x+a.w)}static isTouching(r,a){return ru.isIntercepted(r,{x:a.x-.5,y:a.y-.5,w:a.w+1,h:a.h+1})}static areaIntercept(r,a){const v=r.x>a.x?r.x:a.x,$=r.x+r.w<a.x+a.w?r.x+r.w:a.x+a.w;if($<=v)return 0;const h=r.y>a.y?r.y:a.y,u=r.y+r.h<a.y+a.h?r.y+r.h:a.y+a.h;return u<=h?0:($-v)*(u-h)}static area(r){return r.w*r.h}static sort(r,a=1){return r.sort((v,$)=>{const h=a*((v.y??1e4)-($.y??1e4));return h===0?a*((v.x??1e4)-($.x??1e4)):h})}static find(r,a){return a?r.find(v=>v.id===a):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let a,v="px";if(typeof r=="string")if(r==="auto"||r==="")a=0;else{const $=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!$)throw new Error(`Invalid height val = ${r}`);v=$[2]||"px",a=parseFloat($[1])}else a=r;return{h:a,unit:v}}static defaults(r,...a){return a.forEach(v=>{for(const $ in v){if(!v.hasOwnProperty($))return;r[$]===null||r[$]===void 0?r[$]=v[$]:typeof v[$]=="object"&&typeof r[$]=="object"&&ru.defaults(r[$],v[$])}}),r}static same(r,a){if(typeof r!="object")return r==a;if(typeof r!=typeof a||Object.keys(r).length!==Object.keys(a).length)return!1;for(const v in r)if(r[v]!==a[v])return!1;return!0}static copyPos(r,a,v=!1){return a.x!==void 0&&(r.x=a.x),a.y!==void 0&&(r.y=a.y),a.w!==void 0&&(r.w=a.w),a.h!==void 0&&(r.h=a.h),v&&(a.minW&&(r.minW=a.minW),a.minH&&(r.minH=a.minH),a.maxW&&(r.maxW=a.maxW),a.maxH&&(r.maxH=a.maxH)),r}static samePos(r,a){return r&&a&&r.x===a.x&&r.y===a.y&&(r.w||1)===(a.w||1)&&(r.h||1)===(a.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,a){if(!(typeof r!="object"||typeof a!="object"))for(let v in r){const $=r[v],h=a[v];v[0]==="_"||$===h?delete r[v]:$&&typeof $=="object"&&h!==void 0&&(ru.removeInternalAndSame($,h),Object.keys($).length||delete r[v])}}static removeInternalForSave(r,a=!0){for(let v in r)(v[0]==="_"||r[v]===null||r[v]===void 0)&&delete r[v];delete r.grid,a&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,a){let v=!1;return(...$)=>{v||(v=!0,setTimeout(()=>{r(...$),v=!1},a))}}static removePositioningStyles(r){const a=r.style;a.position&&a.removeProperty("position"),a.left&&a.removeProperty("left"),a.top&&a.removeProperty("top"),a.width&&a.removeProperty("width"),a.height&&a.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;const a=getComputedStyle(r);return/(auto|scroll)/.test(a.overflow+a.overflowY)?r:ru.getScrollElement(r.parentElement)}static updateScrollPosition(r,a,v){const $=ru.getScrollElement(r);if(!$)return;const h=r.getBoundingClientRect(),u=$.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,p=h.bottom-Math.min(u.bottom,i),l=h.top-Math.max(u.top,0),n=$.scrollTop;l<0&&v<0?r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=Math.abs(l)>Math.abs(v)?v:l:p>0&&v>0&&(r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=p>v?v:p),a.top+=$.scrollTop-n}static updateScrollResize(r,a,v){const $=ru.getScrollElement(a),h=$.clientHeight,u=$===ru.getScrollElement()?0:$.getBoundingClientRect().top,i=r.clientY-u,p=i<v,l=i>h-v;p?$.scrollBy({behavior:"smooth",top:i-v}):l&&$.scrollBy({behavior:"smooth",top:v-(h-i)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:{...r}}static cloneDeep(r){const a=["parentGrid","el","grid","subGrid","engine"],v=ru.clone(r);for(const $ in v)v.hasOwnProperty($)&&typeof v[$]=="object"&&$.substring(0,2)!=="__"&&!a.find(h=>h===$)&&(v[$]=ru.cloneDeep(r[$]));return v}static cloneNode(r){const a=r.cloneNode(!0);return a.removeAttribute("id"),a}static appendTo(r,a){let v;typeof a=="string"?v=ru.getElement(a):v=a,v&&v.appendChild(r)}static addElStyles(r,a){if(a instanceof Object)for(const v in a)a.hasOwnProperty(v)&&(Array.isArray(a[v])?a[v].forEach($=>{r.style[v]=$}):r.style[v]=a[v])}static initEvent(r,a){const v={type:a.type},$={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:a.target?a.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(h=>v[h]=r[h]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(h=>v[h]=r[h]),{...v,...$}}static simulateMouseEvent(r,a,v){const $=r,h=new MouseEvent(a,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:$.ctrlKey??!1,altKey:$.altKey??!1,shiftKey:$.shiftKey??!1,metaKey:$.metaKey??!1,button:0,relatedTarget:r.target});(v||r.target).dispatchEvent(h)}static getValuesFromTransformedElement(r){const a=document.createElement("div");ru.addElStyles(a,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(a);const v=a.getBoundingClientRect();return r.removeChild(a),a.remove(),{xScale:1/v.width,yScale:1/v.height,xOffset:v.left,yOffset:v.top}}static swap(r,a,v){if(!r)return;const $=r[a];r[a]=r[v],r[v]=$}static canBeRotated(r){var a;return!(!r||r.w===r.h||r.locked||r.noResize||(a=r.grid)!=null&&a.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}}class P4{constructor(r={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=r.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=r.maxRow,this._float=r.float,this.nodes=r.nodes||[],this.onChange=r.onChange}batchUpdate(r=!0,a=!0){return!!this.batchMode===r?this:(this.batchMode=r,r?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,a&&this._packNodes(),this._notify()),this)}_useEntireRowArea(r,a){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!r._moving||r._skipDown||a.y<=r.y)}_fixCollisions(r,a=r,v,$={}){if(this.sortNodes(-1),v=v||this.collide(r,a),!v)return!1;if(r._moving&&!$.nested&&!this.float&&this.swap(r,v))return!0;let h=a;!this._loading&&this._useEntireRowArea(r,a)&&(h={x:0,w:this.column,y:a.y,h:a.h},v=this.collide(r,h,$.skip));let u=!1;const i={nested:!0,pack:!1};let p=0;for(;v=v||this.collide(r,h,$.skip);){if(p++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(v.locked||this._loading||r._moving&&!r._skipDown&&a.y>r.y&&!this.float&&(!this.collide(v,{...v,y:r.y},r)||!this.collide(v,{...v,y:a.y-v.h},r))){r._skipDown=r._skipDown||a.y>r.y;const n={...a,y:v.y+v.h,...i};l=this._loading&&ru.samePos(r,n)?!0:this.moveNode(r,n),(v.locked||this._loading)&&l?ru.copyPos(a,r):!v.locked&&l&&$.pack&&(this._packNodes(),a.y=v.y+v.h,ru.copyPos(r,a)),u=u||l}else l=this.moveNode(v,{...v,y:a.y+a.h,skip:r,...i});if(!l)return u;v=void 0}return u}collide(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.find(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}collideAll(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.filter(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}directionCollideCoverage(r,a,v){if(!a.rect||!r._rect)return;const $=r._rect,h={...a.rect};h.y>$.y?(h.h+=h.y-$.y,h.y=$.y):h.h+=$.y-h.y,h.x>$.x?(h.w+=h.x-$.x,h.x=$.x):h.w+=$.x-h.x;let u,i=.5;for(let p of v){if(p.locked||!p._rect)break;const l=p._rect;let n=Number.MAX_VALUE,k=Number.MAX_VALUE;$.y<l.y?n=(h.y+h.h-l.y)/l.h:$.y+$.h>l.y+l.h&&(n=(l.y+l.h-h.y)/l.h),$.x<l.x?k=(h.x+h.w-l.x)/l.w:$.x+$.w>l.x+l.w&&(k=(l.x+l.w-h.x)/l.w);const T=Math.min(k,n);T>i&&(i=T,u=p)}return a.collide=u,u}cacheRects(r,a,v,$,h,u){return this.nodes.forEach(i=>i._rect={y:i.y*a+v,x:i.x*r+u,w:i.w*r-u-$,h:i.h*a-v-h}),this}swap(r,a){if(!a||a.locked||!r||r.locked)return!1;function v(){const h=a.x,u=a.y;return a.x=r.x,a.y=r.y,r.h!=a.h?(r.x=h,r.y=a.y+a.h):r.w!=a.w?(r.x=a.x+a.w,r.y=u):(r.x=h,r.y=u),r._dirty=a._dirty=!0,!0}let $;if(r.w===a.w&&r.h===a.h&&(r.x===a.x||r.y===a.y)&&($=ru.isTouching(r,a)))return v();if($!==!1){if(r.w===a.w&&r.x===a.x&&($||($=ru.isTouching(r,a)))){if(a.y<r.y){const h=r;r=a,a=h}return v()}if($!==!1){if(r.h===a.h&&r.y===a.y&&($||($=ru.isTouching(r,a)))){if(a.x<r.x){const h=r;r=a,a=h}return v()}return!1}}}isAreaEmpty(r,a,v,$){const h={x:r||0,y:a||0,w:v||1,h:$||1};return!this.collide(h)}compact(r="compact",a=!0){if(this.nodes.length===0)return this;a&&this.sortNodes();const v=this.batchMode;v||this.batchUpdate();const $=this._inColumnResize;$||(this._inColumnResize=!0);const h=this.nodes;return this.nodes=[],h.forEach((u,i,p)=>{let l;u.locked||(u.autoPosition=!0,r==="list"&&i&&(l=p[i-1])),this.addNode(u,!1,l)}),$||delete this._inColumnResize,v||this.batchUpdate(!1),this}set float(r){this._float!==r&&(this._float=r||!1,r||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(r=1){return this.nodes=ru.sort(this.nodes,r),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(r=>{if(r._updating||r._orig===void 0||r.y===r._orig.y)return;let a=r.y;for(;a>r._orig.y;)--a,this.collide(r,{x:r.x,y:a,w:r.w,h:r.h})||(r._dirty=!0,r.y=a)}):this.nodes.forEach((r,a)=>{if(!r.locked)for(;r.y>0;){const v=a===0?0:r.y-1;if(!(a===0||!this.collide(r,{x:r.x,y:v,w:r.w,h:r.h})))break;r._dirty=r.y!==v,r.y=v}}),this)}prepareNode(r,a){r._id=r._id??P4._idSeq++;const v=r.id;if(v){let h=1;for(;this.nodes.find(u=>u.id===r.id&&u!==r);)r.id=v+"_"+h++}(r.x===void 0||r.y===void 0||r.x===null||r.y===null)&&(r.autoPosition=!0);const $={x:0,y:0,w:1,h:1};return ru.defaults(r,$),r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,ru.sanitizeMinMax(r),typeof r.x=="string"&&(r.x=Number(r.x)),typeof r.y=="string"&&(r.y=Number(r.y)),typeof r.w=="string"&&(r.w=Number(r.w)),typeof r.h=="string"&&(r.h=Number(r.h)),isNaN(r.x)&&(r.x=$.x,r.autoPosition=!0),isNaN(r.y)&&(r.y=$.y,r.autoPosition=!0),isNaN(r.w)&&(r.w=$.w),isNaN(r.h)&&(r.h=$.h),this.nodeBoundFix(r,a),r}nodeBoundFix(r,a){const v=r._orig||ru.copyPos({},r);if(r.maxW&&(r.w=Math.min(r.w||1,r.maxW)),r.maxH&&(r.h=Math.min(r.h||1,r.maxH)),r.minW&&(r.w=Math.max(r.w||1,r.minW)),r.minH&&(r.h=Math.max(r.h||1,r.minH)),(r.x||0)+(r.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&r._id!=null&&this.findCacheLayout(r,this.defaultColumn)===-1){const $={...r};$.autoPosition||$.x===void 0?(delete $.x,delete $.y):$.x=Math.min(this.defaultColumn-1,$.x),$.w=Math.min(this.defaultColumn,$.w||1),this.cacheOneLayout($,this.defaultColumn)}return r.w>this.column?r.w=this.column:r.w<1&&(r.w=1),this.maxRow&&r.h>this.maxRow?r.h=this.maxRow:r.h<1&&(r.h=1),r.x<0&&(r.x=0),r.y<0&&(r.y=0),r.x+r.w>this.column&&(a?r.w=this.column-r.x:r.x=this.column-r.w),this.maxRow&&r.y+r.h>this.maxRow&&(a?r.h=this.maxRow-r.y:r.y=this.maxRow-r.h),ru.samePos(r,v)||(r._dirty=!0),this}getDirtyNodes(r){return r?this.nodes.filter(a=>a._dirty&&!ru.samePos(a,a._orig)):this.nodes.filter(a=>a._dirty)}_notify(r){if(this.batchMode||!this.onChange)return this;const a=(r||[]).concat(this.getDirtyNodes());return this.onChange(a),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(r=>{delete r._dirty,delete r._lastTried}),this)}saveInitial(){return this.nodes.forEach(r=>{r._orig=ru.copyPos({},r),delete r._dirty}),this._hasLocked=this.nodes.some(r=>r.locked),this}restoreInitial(){return this.nodes.forEach(r=>{!r._orig||ru.samePos(r,r._orig)||(ru.copyPos(r,r._orig),r._dirty=!0)}),this._notify(),this}findEmptyPosition(r,a=this.nodes,v=this.column,$){const h=$?$.y*v+($.x+$.w):0;let u=!1;for(let i=h;!u;++i){const p=i%v,l=Math.floor(i/v);if(p+r.w>v)continue;const n={x:p,y:l,w:r.w,h:r.h};a.find(k=>ru.isIntercepted(n,k))||((r.x!==p||r.y!==l)&&(r._dirty=!0),r.x=p,r.y=l,delete r.autoPosition,u=!0)}return u}addNode(r,a=!1,v){const $=this.nodes.find(u=>u._id===r._id);if($)return $;this._inColumnResize?this.nodeBoundFix(r):this.prepareNode(r),delete r._temporaryRemoved,delete r._removeDOM;let h;return r.autoPosition&&this.findEmptyPosition(r,this.nodes,this.column,v)&&(delete r.autoPosition,h=!0),this.nodes.push(r),a&&this.addedNodes.push(r),h||this._fixCollisions(r),this.batchMode||this._packNodes()._notify(),r}removeNode(r,a=!0,v=!1){return this.nodes.find($=>$._id===r._id)?(v&&this.removedNodes.push(r),a&&(r._removeDOM=!0),this.nodes=this.nodes.filter($=>$._id!==r._id),r._isAboutToRemove||this._packNodes(),this._notify([r]),this):this}removeAll(r=!0,a=!0){if(delete this._layouts,!this.nodes.length)return this;r&&this.nodes.forEach($=>$._removeDOM=!0);const v=this.nodes;return this.removedNodes=a?v:[],this.nodes=[],this._notify(v)}moveNodeCheck(r,a){if(!this.changedPosConstrain(r,a))return!1;if(a.pack=!0,!this.maxRow)return this.moveNode(r,a);let v;const $=new P4({column:this.column,float:this.float,nodes:this.nodes.map(u=>u._id===r._id?(v={...u},v):{...u})});if(!v)return!1;const h=$.moveNode(v,a)&&$.getRow()<=Math.max(this.getRow(),this.maxRow);if(!h&&!a.resizing&&a.collide){const u=a.collide.el.gridstackNode;if(this.swap(r,u))return this._notify(),!0}return h?($.nodes.filter(u=>u._dirty).forEach(u=>{const i=this.nodes.find(p=>p._id===u._id);i&&(ru.copyPos(i,u),i._dirty=!0)}),this._notify(),!0):!1}willItFit(r){if(delete r._willFitPos,!this.maxRow)return!0;const a=new P4({column:this.column,float:this.float,nodes:this.nodes.map($=>({...$}))}),v={...r};return this.cleanupNode(v),delete v.el,delete v._id,delete v.content,delete v.grid,a.addNode(v),a.getRow()<=this.maxRow?(r._willFitPos=ru.copyPos({},v),!0):!1}changedPosConstrain(r,a){return a.w=a.w||r.w,a.h=a.h||r.h,r.x!==a.x||r.y!==a.y?!0:(r.maxW&&(a.w=Math.min(a.w,r.maxW)),r.maxH&&(a.h=Math.min(a.h,r.maxH)),r.minW&&(a.w=Math.max(a.w,r.minW)),r.minH&&(a.h=Math.max(a.h,r.minH)),r.w!==a.w||r.h!==a.h)}moveNode(r,a){var v,$;if(!r||!a)return!1;let h;a.pack===void 0&&!this.batchMode&&(h=a.pack=!0),typeof a.x!="number"&&(a.x=r.x),typeof a.y!="number"&&(a.y=r.y),typeof a.w!="number"&&(a.w=r.w),typeof a.h!="number"&&(a.h=r.h);const u=r.w!==a.w||r.h!==a.h,i=ru.copyPos({},r,!0);if(ru.copyPos(i,a),this.nodeBoundFix(i,u),ru.copyPos(a,i),!a.forceCollide&&ru.samePos(r,a))return!1;const p=ru.copyPos({},r),l=this.collideAll(r,i,a.skip);let n=!0;if(l.length){const k=r._moving&&!a.nested;let T=k?this.directionCollideCoverage(r,a,l):l[0];if(k&&T&&($=(v=r.grid)==null?void 0:v.opts)!=null&&$.subGridDynamic&&!r.grid._isTemp){const x=ru.areaIntercept(a.rect,T._rect),d=ru.area(a.rect),o=ru.area(T._rect);x/(d<o?d:o)>.8&&(T.grid.makeSubGrid(T.el,void 0,r),T=void 0)}T?n=!this._fixCollisions(r,i,T,a):(n=!1,h&&delete a.pack)}return n&&!ru.samePos(r,i)&&(r._dirty=!0,ru.copyPos(r,i)),a.pack&&this._packNodes()._notify(),!ru.samePos(r,p)}getRow(){return this.nodes.reduce((r,a)=>Math.max(r,a.y+a.h),0)}beginUpdate(r){return r._updating||(r._updating=!0,delete r._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const r=this.nodes.find(a=>a._updating);return r&&(delete r._updating,delete r._skipDown),this}save(r=!0,a,v){var $;const h=(($=this._layouts)==null?void 0:$.length)||0;let u;h&&(v?v!==this.column&&(u=this._layouts[v]):this.column!==h-1&&(u=this._layouts[h-1]));const i=[];return this.sortNodes(),this.nodes.forEach(p=>{const l=u==null?void 0:u.find(k=>k._id===p._id),n={...p,...l||{}};ru.removeInternalForSave(n,!r),a&&a(p,n),i.push(n)}),i}layoutsNodesChange(r){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((a,v)=>{if(!a||v===this.column)return this;if(v<this.column)this._layouts[v]=void 0;else{const $=v/this.column;r.forEach(h=>{if(!h._orig)return;const u=a.find(i=>i._id===h._id);u&&(u.y>=0&&h.y!==h._orig.y&&(u.y+=h.y-h._orig.y),h.x!==h._orig.x&&(u.x=Math.round(h.x*$)),h.w!==h._orig.w&&(u.w=Math.round(h.w*$)))})}}),this)}columnChanged(r,a,v="moveScale"){var $;if(!this.nodes.length||!a||r===a)return this;const h=v==="compact"||v==="list";h&&this.sortNodes(1),a<r&&this.cacheLayout(this.nodes,r),this.batchUpdate();let u=[],i=h?this.nodes:ru.sort(this.nodes,-1);if(a>r&&this._layouts){const p=this._layouts[a]||[],l=this._layouts.length-1;!p.length&&r!==l&&($=this._layouts[l])!=null&&$.length&&(r=l,this._layouts[l].forEach(n=>{const k=i.find(T=>T._id===n._id);k&&(!h&&!n.autoPosition&&(k.x=n.x??k.x,k.y=n.y??k.y),k.w=n.w??k.w,(n.x==null||n.y===void 0)&&(k.autoPosition=!0))})),p.forEach(n=>{const k=i.findIndex(T=>T._id===n._id);if(k!==-1){const T=i[k];if(h){T.w=n.w;return}(n.autoPosition||isNaN(n.x)||isNaN(n.y))&&this.findEmptyPosition(n,u),n.autoPosition||(T.x=n.x??T.x,T.y=n.y??T.y,T.w=n.w??T.w,u.push(T)),i.splice(k,1)}})}if(h)this.compact(v,!1);else{if(i.length)if(typeof v=="function")v(a,r,u,i);else{const p=h||v==="none"?1:a/r,l=v==="move"||v==="moveScale",n=v==="scale"||v==="moveScale";i.forEach(k=>{k.x=a===1?0:l?Math.round(k.x*p):Math.min(k.x,a-1),k.w=a===1||r===1?1:n?Math.round(k.w*p)||1:Math.min(k.w,a),u.push(k)}),i=[]}u=ru.sort(u,-1),this._inColumnResize=!0,this.nodes=[],u.forEach(p=>{this.addNode(p,!1),delete p._orig})}return this.nodes.forEach(p=>delete p._orig),this.batchUpdate(!1,!h),delete this._inColumnResize,this}cacheLayout(r,a,v=!1){const $=[];return r.forEach((h,u)=>{if(h._id===void 0){const i=h.id?this.nodes.find(p=>p.id===h.id):void 0;h._id=(i==null?void 0:i._id)??P4._idSeq++}$[u]={x:h.x,y:h.y,w:h.w,_id:h._id}}),this._layouts=v?[]:this._layouts||[],this._layouts[a]=$,this}cacheOneLayout(r,a){r._id=r._id??P4._idSeq++;const v={x:r.x,y:r.y,w:r.w,_id:r._id};(r.autoPosition||r.x===void 0)&&(delete v.x,delete v.y,r.autoPosition&&(v.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[a]=this._layouts[a]||[];const $=this.findCacheLayout(r,a);return $===-1?this._layouts[a].push(v):this._layouts[a][$]=v,this}findCacheLayout(r,a){var v,$;return(($=(v=this._layouts)==null?void 0:v[a])==null?void 0:$.findIndex(h=>h._id===r._id))??-1}removeNodeFromLayoutCache(r){if(this._layouts)for(let a=0;a<this._layouts.length;a++){const v=this.findCacheLayout(r,a);v!==-1&&this._layouts[a].splice(v,1)}}cleanupNode(r){for(const a in r)a[0]==="_"&&a!=="_id"&&delete r[a];return this}}P4._idSeq=0;const T3={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Nf{}const Xw=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class R5{}function vN(e,r){e.touches.length>1||(e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e.changedTouches[0],r))}function AZ(e,r){e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e,r)}function bN(e){R5.touchHandled||(R5.touchHandled=!0,vN(e,"mousedown"))}function xN(e){R5.touchHandled&&vN(e,"mousemove")}function _N(e){if(!R5.touchHandled)return;R5.pointerLeaveTimeout&&(window.clearTimeout(R5.pointerLeaveTimeout),delete R5.pointerLeaveTimeout);const r=!!Nf.dragElement;vN(e,"mouseup"),r||vN(e,"click"),R5.touchHandled=!1}function wN(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function RZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&AZ(e,"mouseenter")}function UZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&(R5.pointerLeaveTimeout=window.setTimeout(()=>{delete R5.pointerLeaveTimeout,AZ(e,"mouseleave")},10))}class TN{constructor(r,a,v){this.host=r,this.dir=a,this.option=v,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const r=this.el=document.createElement("div");return r.classList.add("ui-resizable-handle"),r.classList.add(`${TN.prefix}${this.dir}`),r.style.zIndex="100",r.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Xw&&(this.el.addEventListener("touchstart",bN),this.el.addEventListener("pointerdown",wN)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Xw&&(this.el.removeEventListener("touchstart",bN),this.el.removeEventListener("pointerdown",wN)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(r){this.mouseDownEvent=r,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.addEventListener("touchmove",xN),this.el.addEventListener("touchend",_N)),r.stopPropagation(),r.preventDefault()}_mouseMove(r){const a=this.mouseDownEvent;this.moving?this._triggerEvent("move",r):Math.abs(r.x-a.x)+Math.abs(r.y-a.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",r),document.addEventListener("keydown",this._keyEvent)),r.stopPropagation()}_mouseUp(r){this.moving&&(this._triggerEvent("stop",r),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.removeEventListener("touchmove",xN),this.el.removeEventListener("touchend",_N)),delete this.moving,delete this.mouseDownEvent,r.stopPropagation(),r.preventDefault()}_keyEvent(r){var a,v;r.key==="Escape"&&((v=(a=this.host.gridstackNode)==null?void 0:a.grid)==null||v.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(r,a){return this.option[r]&&this.option[r](a),this}}TN.prefix="ui-resizable-";class aA{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,a){this._eventRegister[r]=a}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,a){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](a)}}class l9 extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this.rectScale={x:1,y:1},this._ui=()=>{const v=this.el.parentElement.getBoundingClientRect(),$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=this.temporalRect||$;return{position:{left:(h.left-v.left)*this.rectScale.x,top:(h.top-v.top)*this.rectScale.y},size:{width:h.width*this.rectScale.x,height:h.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(r){const a=r.handles&&r.handles!==this.option.handles,v=r.autoHide&&r.autoHide!==this.option.autoHide;return Object.keys(r).forEach($=>this.option[$]=r[$]),a&&(this._removeHandlers(),this._setupHandlers()),v&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(r){return r?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Nf.overResizeElement===this&&delete Nf.overResizeElement),this}_mouseOver(r){Nf.overResizeElement||Nf.dragElement||(Nf.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(r){Nf.overResizeElement===this&&(delete Nf.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(r=>r.trim()).map(r=>new TN(this.el,r,{start:a=>{this._resizeStart(a)},stop:a=>{this._resizeStop(a)},move:a=>{this._resizing(a,r)}})),this}_resizeStart(r){this.sizeToContent=ru.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=ru.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=r,this._setupHelper(),this._applyChange();const a=ru.initEvent(r,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(a,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",a),this}_resizing(r,a){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(r,a),this._applyChange();const v=ru.initEvent(r,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(v,this._ui()),this.triggerEvent("resize",v),this}_resizeStop(r){const a=ru.initEvent(r,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(a),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",a),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=l9._originStyleProp.map(v=>this.el.style[v]),this.parentOriginStylePosition=this.el.parentElement.style.position;const r=this.el.parentElement,a=ru.getValuesFromTransformedElement(r);return this.rectScale={x:a.xScale,y:a.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return l9._originStyleProp.forEach((r,a)=>{this.el.style[r]=this.elOriginStyleVal[a]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(r,a){const v=this.startEvent,$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=r.clientX-v.clientX,u=this.sizeToContent?0:r.clientY-v.clientY;let i,p;a.indexOf("e")>-1?$.width+=h:a.indexOf("w")>-1&&($.width-=h,$.left+=h,i=!0),a.indexOf("s")>-1?$.height+=u:a.indexOf("n")>-1&&($.height-=u,$.top+=u,p=!0);const l=this._constrainSize($.width,$.height,i,p);return Math.round($.width)!==Math.round(l.width)&&(a.indexOf("w")>-1&&($.left+=$.width-l.width),$.width=l.width),Math.round($.height)!==Math.round(l.height)&&(a.indexOf("n")>-1&&($.top+=$.height-l.height),$.height=l.height),$}_constrainSize(r,a,v,$){const h=this.option,u=(v?h.maxWidthMoveLeft:h.maxWidth)||Number.MAX_SAFE_INTEGER,i=h.minWidth/this.rectScale.x||r,p=($?h.maxHeightMoveUp:h.maxHeight)||Number.MAX_SAFE_INTEGER,l=h.minHeight/this.rectScale.y||a,n=Math.min(u,Math.max(i,r)),k=Math.min(p,Math.max(l,a));return{width:n,height:k}}_applyChange(){let r={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const a=this.el.parentElement,{left:v,top:$}=a.getBoundingClientRect();r={left:v,top:$,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(a=>{const v=this.temporalRect[a],$=a==="width"||a==="left"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1;this.el.style[a]=(v-r[a])*$+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(r=>r.destroy()),delete this.handlers,this}}l9._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const aHe='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class c9 extends aA{constructor(r,a={}){var v;super(),this.el=r,this.option=a,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const $=(v=a==null?void 0:a.handle)==null?void 0:v.substring(1),h=r.gridstackNode;this.dragEls=!$||r.classList.contains($)?[r]:h!=null&&h.subGrid?[r.querySelector(a.handle)||r]:Array.from(r.querySelectorAll(a.handle)),this.dragEls.length===0&&(this.dragEls=[r]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(r=>{r.addEventListener("mousedown",this._mouseDown),Xw&&(r.addEventListener("touchstart",bN),r.addEventListener("pointerdown",wN))}),this.el.classList.remove("ui-draggable-disabled"))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(a=>{a.removeEventListener("mousedown",this._mouseDown),Xw&&(a.removeEventListener("touchstart",bN),a.removeEventListener("pointerdown",wN))}),r||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this}_mouseDown(r){if(!Nf.mouseHandled)return r.button!==0||!this.dragEls.find(a=>a===r.target)&&r.target.closest(aHe)||this.option.cancel&&r.target.closest(this.option.cancel)||(this.mouseDownEvent=r,delete this.dragging,delete Nf.dragElement,delete Nf.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(r.currentTarget.addEventListener("touchmove",xN),r.currentTarget.addEventListener("touchend",_N)),r.preventDefault(),document.activeElement&&document.activeElement.blur(),Nf.mouseHandled=!0),!0}_callDrag(r){if(!this.dragging)return;const a=ru.initEvent(r,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(a,this.ui()),this.triggerEvent("drag",a)}_mouseMove(r){var a;const v=this.mouseDownEvent;if(this.lastDrag=r,this.dragging)if(this._dragFollow(r),Nf.pauseDrag){const $=Number.isInteger(Nf.pauseDrag)?Nf.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(r),$)}else this._callDrag(r);else if(Math.abs(r.x-v.x)+Math.abs(r.y-v.y)>3){this.dragging=!0,Nf.dragElement=this;const $=(a=this.el.gridstackNode)==null?void 0:a.grid;$?Nf.dropElement=$.el.ddElement.ddDroppable:delete Nf.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=ru.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(r,this.el,this.helperContainment),this._setupHelperStyle(r);const h=ru.initEvent(r,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(h,this.ui()),this.triggerEvent("dragstart",h),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(r){var a,v;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&r.currentTarget&&(r.currentTarget.removeEventListener("touchmove",xN,!0),r.currentTarget.removeEventListener("touchend",_N,!0)),this.dragging){delete this.dragging,(a=this.el.gridstackNode)==null||delete a._origRotate,document.removeEventListener("keydown",this._keyEvent),((v=Nf.dropElement)==null?void 0:v.el)===this.el.parentElement&&delete Nf.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const $=ru.initEvent(r,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop($),this.triggerEvent("dragstop",$),Nf.dropElement&&Nf.dropElement.drop(r)}delete this.helper,delete this.mouseDownEvent,delete Nf.dragElement,delete Nf.dropElement,delete Nf.mouseHandled,r.preventDefault()}_keyEvent(r){var a,v;const $=this.el.gridstackNode,h=($==null?void 0:$.grid)||((v=(a=Nf.dropElement)==null?void 0:a.el)==null?void 0:v.gridstack);if(r.key==="Escape")$&&$._origRotate&&($._orig=$._origRotate,delete $._origRotate),h==null||h.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if($&&h&&(r.key==="r"||r.key==="R")){if(!ru.canBeRotated($))return;$._origRotate=$._origRotate||{...$._orig},delete $._moving,h.setAnimation(!1).rotate($.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),$._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,$.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",ru.swap($._orig,"w","h"),delete $._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let r=this.el;return typeof this.option.helper=="function"?r=this.option.helper(this.el):this.option.helper==="clone"&&(r=ru.cloneNode(this.el)),r.parentElement||ru.appendTo(r,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=c9.originStyleProp.map(a=>this.el.style[a]),r}_setupHelperStyle(r){var a,v;this.helper.classList.add("ui-draggable-dragging"),(v=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||v.el.classList.add("grid-stack-dragging");const $=this.helper.style;return $.pointerEvents="none",$.width=this.dragOffset.width+"px",$.height=this.dragOffset.height+"px",$.willChange="left, top",$.position="fixed",this._dragFollow(r),$.transition="none",setTimeout(()=>{this.helper&&($.transition=null)},0),this}_removeHelperStyle(){var r,a,v;this.helper.classList.remove("ui-draggable-dragging"),(a=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||a.el.classList.remove("grid-stack-dragging");const $=(v=this.helper)==null?void 0:v.gridstackNode;if(!($!=null&&$._isAboutToRemove)&&this.dragElementOriginStyle){const h=this.helper,u=this.dragElementOriginStyle.transition||null;h.style.transition=this.dragElementOriginStyle.transition="none",c9.originStyleProp.forEach(i=>h.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>h.style.transition=u,50)}return delete this.dragElementOriginStyle,this}_dragFollow(r){const a={left:0,top:0},v=this.helper.style,$=this.dragOffset;v.left=(r.clientX+$.offsetLeft-a.left)*this.dragTransform.xScale+"px",v.top=(r.clientY+$.offsetTop-a.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(r,a,v){let $=0,h=0;v&&($=this.dragTransform.xOffset,h=this.dragTransform.yOffset);const u=a.getBoundingClientRect();return{left:u.left,top:u.top,offsetLeft:-r.clientX+u.left-$,offsetTop:-r.clientY+u.top-h,width:u.width*this.dragTransform.xScale,height:u.height*this.dragTransform.yScale}}ui(){const r=this.el.parentElement.getBoundingClientRect(),a=this.helper.getBoundingClientRect();return{position:{top:(a.top-r.top)*this.dragTransform.yScale,left:(a.left-r.left)*this.dragTransform.xScale}}}}c9.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class nHe extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.addEventListener("pointerenter",RZ),this.el.addEventListener("pointerleave",UZ)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.removeEventListener("pointerenter",RZ),this.el.removeEventListener("pointerleave",UZ)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this._setupAccept(),this}_mouseEnter(r){if(!Nf.dragElement||!this._canDrop(Nf.dragElement.el))return;r.preventDefault(),r.stopPropagation(),Nf.dropElement&&Nf.dropElement!==this&&Nf.dropElement._mouseLeave(r,!0),Nf.dropElement=this;const a=ru.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(Nf.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,a=!1){var v;if(!Nf.dragElement||Nf.dropElement!==this)return;r.preventDefault(),r.stopPropagation();const $=ru.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out($,this._ui(Nf.dragElement)),this.triggerEvent("dropout",$),Nf.dropElement===this&&(delete Nf.dropElement,!a)){let h,u=this.el.parentElement;for(;!h&&u;)h=(v=u.ddElement)==null?void 0:v.ddDroppable,u=u.parentElement;h&&h._mouseEnter(r)}}drop(r){r.preventDefault();const a=ru.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(Nf.dragElement)),this.triggerEvent("drop",a)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return{draggable:r.el,...r.ui()}}}class nA{static init(r){return r.ddElement||(r.ddElement=new nA(r)),r.ddElement}constructor(r){this.el=r}on(r,a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,a),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new c9(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new l9(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new nHe(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class iHe{resizable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddResizable&&h.ddResizable[a]();else if(a==="destroy")h.ddResizable&&h.cleanResizable();else if(a==="option")h.setupResizable({[v]:$});else{const u=h.el.gridstackNode.grid;let i=h.el.getAttribute("gs-resize-handles")||u.opts.resizable.handles||"e,s,se";i==="all"&&(i="n,e,s,w,se,sw,ne,nw");const p=!u.opts.alwaysShowResizeHandle;h.setupResizable({...u.opts.resizable,handles:i,autoHide:p,start:a.start,stop:a.stop,resize:a.resize})}}),this}draggable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddDraggable&&h.ddDraggable[a]();else if(a==="destroy")h.ddDraggable&&h.cleanDraggable();else if(a==="option")h.setupDraggable({[v]:$});else{const u=h.el.gridstackNode.grid;h.setupDraggable({...u.opts.draggable,start:a.start,stop:a.stop,drag:a.drag})}}),this}dragIn(r,a){return this._getDDElements(r).forEach(v=>v.setupDraggable(a)),this}droppable(r,a,v,$){return typeof a.accept=="function"&&!a._accept&&(a._accept=a.accept,a.accept=h=>a._accept(h)),this._getDDElements(r,a).forEach(h=>{a==="disable"||a==="enable"?h.ddDroppable&&h.ddDroppable[a]():a==="destroy"?h.ddDroppable&&h.cleanDroppable():a==="option"?h.setupDroppable({[v]:$}):h.setupDroppable(a)}),this}isDroppable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,a,v){return this._getDDElements(r).forEach($=>$.on(a,h=>{v(h,Nf.dragElement?Nf.dragElement.el:h.target,Nf.dragElement?Nf.dragElement.helper:null)})),this}off(r,a){return this._getDDElements(r).forEach(v=>v.off(a)),this}_getDDElements(r,a){const v=r.gridstack||a!=="destroy"&&a!=="disable",$=ru.getElements(r);return $.length?$.map(h=>h.ddElement||(v?nA.init(h):null)).filter(h=>h):[]}}/*!
|
|
7985
|
+
`+$):a.stack=$}catch{}}throw a}}_request(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=LS(this.defaults,r);const{transitional:a,paramsSerializer:v,headers:$}=r;a!==void 0&&fN.assertOptions(a,{silentJSONParsing:A5.transitional(A5.boolean),forcedJSONParsing:A5.transitional(A5.boolean),clarifyTimeoutError:A5.transitional(A5.boolean)},!1),v!=null&&(tu.isFunction(v)?r.paramsSerializer={serialize:v}:fN.assertOptions(v,{encode:A5.function,serialize:A5.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),fN.assertOptions(r,{baseUrl:A5.spelling("baseURL"),withXsrfToken:A5.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let h=$&&tu.merge($.common,$[r.method]);$&&tu.forEach(["delete","get","head","post","put","patch","common"],x=>{delete $[x]}),r.headers=H_.concat(h,$);const u=[];let i=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(r)===!1||(i=i&&x.synchronous,u.unshift(x.fulfilled,x.rejected))});const p=[];this.interceptors.response.forEach(function(x){p.push(x.fulfilled,x.rejected)});let l,n=0,k;if(!i){const x=[CZ.bind(this),void 0];for(x.unshift(...u),x.push(...p),k=x.length,l=Promise.resolve(r);n<k;)l=l.then(x[n++],x[n++]);return l}k=u.length;let T=r;for(;n<k;){const x=u[n++],d=u[n++];try{T=x(T)}catch(o){d.call(this,o);break}}try{l=CZ.call(this,T)}catch(x){return Promise.reject(x)}for(n=0,k=p.length;n<k;)l=l.then(p[n++],p[n++]);return l}getUri(e){e=LS(this.defaults,e);const r=yZ(e.baseURL,e.url,e.allowAbsoluteUrls);return sZ(r,e.params,e.paramsSerializer)}};tu.forEach(["delete","get","head","options"],function(e){CS.prototype[e]=function(r,a){return this.request(LS(a||{},{method:e,url:r,data:(a||{}).data}))}}),tu.forEach(["post","put","patch"],function(e){function r(a){return function(v,$,h){return this.request(LS(h||{},{method:e,headers:a?{"Content-Type":"multipart/form-data"}:{},url:v,data:$}))}}CS.prototype[e]=r(),CS.prototype[e+"Form"]=r(!0)});let TZe=class sQ{constructor(r){if(typeof r!="function")throw new TypeError("executor must be a function.");let a;this.promise=new Promise(function($){a=$});const v=this;this.promise.then($=>{if(!v._listeners)return;let h=v._listeners.length;for(;h-- >0;)v._listeners[h]($);v._listeners=null}),this.promise.then=$=>{let h;const u=new Promise(i=>{v.subscribe(i),h=i}).then($);return u.cancel=function(){v.unsubscribe(h)},u},r(function($,h,u){v.reason||(v.reason=new Yk($,h,u),a(v.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(r){if(this.reason){r(this.reason);return}this._listeners?this._listeners.push(r):this._listeners=[r]}unsubscribe(r){if(!this._listeners)return;const a=this._listeners.indexOf(r);a!==-1&&this._listeners.splice(a,1)}toAbortSignal(){const r=new AbortController,a=v=>{r.abort(v)};return this.subscribe(a),r.signal.unsubscribe=()=>this.unsubscribe(a),r.signal}static source(){let r;return{token:new sQ(function(a){r=a}),cancel:r}}};function SZe(e){return function(r){return e.apply(null,r)}}function kZe(e){return tu.isObject(e)&&e.isAxiosError===!0}const $P={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries($P).forEach(([e,r])=>{$P[r]=e});function EZ(e){const r=new CS(e),a=XG(CS.prototype.request,r);return tu.extend(a,CS.prototype,r,{allOwnKeys:!0}),tu.extend(a,r,null,{allOwnKeys:!0}),a.create=function(v){return EZ(LS(e,v))},a}const xv=EZ(o9);xv.Axios=CS,xv.CanceledError=Yk,xv.CancelToken=TZe,xv.isCancel=pZ,xv.VERSION=OZ,xv.toFormData=cN,xv.AxiosError=Am,xv.Cancel=xv.CanceledError,xv.all=function(e){return Promise.all(e)},xv.spread=SZe,xv.isAxiosError=kZe,xv.mergeConfig=LS,xv.AxiosHeaders=H_,xv.formToJSON=e=>uZ(tu.isHTMLForm(e)?new FormData(e):e),xv.getAdapter=LZ.getAdapter,xv.HttpStatusCode=$P,xv.default=xv;const{Axios:Zwt,AxiosError:Jwt,CanceledError:Hwt,isCancel:Ywt,CancelToken:Qwt,VERSION:$wt,all:e5t,Cancel:t5t,isAxiosError:r5t,spread:a5t,toFormData:n5t,AxiosHeaders:i5t,HttpStatusCode:o5t,formToJSON:s5t,getAdapter:l5t,mergeConfig:c5t}=xv,LZe=["gameId","playerId","teamId","x","y","momentOfPlay","section","playId","timeSection"];let eA=null;function CZe(){return eA||(eA=LZe.reduce((e,r,a)=>(e[a]=r,e),{})),eA}const OZe=["playId","playerId","teamId","gameId","categoryId","relatedCategoriesIds","x1","y1","x2","y2","x3","y3","fieldSection","momentOfPlay","playingAs","matchLapse","matchResult","matchResultAtMomentOfPlay","relatedPlayId","touchOrder","timeSection"];let tA=null;function NZe(){return tA||(tA=OZe.reduce((e,r,a)=>(e[a]=r,e),{})),tA}const mN={TO_RIGHT:"toRight",TO_LEFT:"toLeft"},EZe={class:"modal-confirmation"},zZe={class:"modal-confirmation__container"},MZe={class:"modal-confirmation__title"},VZe={class:"modal-confirmation"},PZe={class:"modal-confirmation__container"},AZe={class:"modal-confirmation__title"},RZe={class:"specific-plays-titlecontainer"},UZe={class:"specific-plays-title"},FZe={key:0,class:"specific-plays-title-elegibility"},IZe={key:1},qZe={class:"specific-plays-controls"},jZe={class:"specific-plays-controls11"},WZe={class:"radio-container"},DZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},KZe={class:"radio-label"},BZe=["src"],XZe={class:"radio-container"},GZe={key:0,width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ZZe={class:"radio-label"},JZe=["src"],HZe={class:"cont-app-value-incement-second"},YZe={class:"contappvalueincementsecond-value"},QZe={key:0},$Ze={class:"contappvalueincementsecond-controls-container"},eJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},tJe={class:"text-icon-info"},rJe={class:"cont-app-value-incement-second"},aJe={class:"contappvalueincementsecond-value"},nJe={key:0},iJe={class:"contappvalueincementsecond-controls-container"},oJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},sJe={class:"text-icon-info"},lJe={class:"cont-app-value-incement-second"},cJe={class:"contappvalueincementsecond-value"},uJe={key:0},dJe={class:"contappvalueincementsecond-controls-container"},pJe={"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{"margin-left":"4px"}},hJe={class:"specific-plays-field__soccer-field"},fJe={class:"game-teams"},mJe={class:"game-teams__team home"},yJe={key:0,class:"team-logo"},gJe=["src"],vJe={class:"game-teams__team away"},bJe={key:0,class:"team-logo"},xJe=["src"],_Je={class:"specific-plays-field__play-buttons__container"},wJe={key:1,class:"specific-plays-radio-container-movil"},TJe={class:"radio-container"},SJe={class:"radio-label"},kJe=["src"],LJe={class:"radio-container"},CJe={class:"radio-label"},OJe=["src"],NJe={key:0,class:"h-separator"},EJe={key:1,class:"corner-info"},zJe={class:"corner-info__team"},MJe=["src"],VJe={class:"corner-info__details"},PJe={class:"corner-info__details__player"},AJe={class:"corner-info__details__how-was"},yN=.6,RJe=5,UJe=10,FJe=600,IJe=600,qJe=5,jJe={__name:"GSCSpecificPlays",props:{widthContainer:{type:Number,default:1280},selectedCategoryId:{type:Number,default:31},teamIdForAnalysis:{type:Number,default:1},playIdForAnalysis:{type:Number,default:null},seasonIdForAnalysis:{type:Number,default:1325},tournamentSelected:{type:Object,default:()=>({})},advancedFilters:{type:Object,default:()=>({areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0})},filters:{type:Object,default:()=>({isMoment:!1,final:[1,2,3],moment:[1,2,3],playingAs:[1,2],sections:[1,2,3,4,5,6],games:[],players:[],cornertype:31,howWas:[120,126,327,133],zona:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35],whathappened:[583,585,587,589,584,586,588,590,122,128,136,142,123,129,137,143,124,130,138,144,125,131,139,14,146,147,327,133],isWhatHappenedFull:!0,isZoneFull:!0})},isGameOnly:{type:Boolean,default:!1},game:{type:Object,default:()=>({id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"})},gameIdForAnalysis:{type:Number,default:null},isAgainstMode:{type:Boolean,default:!1},areFiltersOpen:{type:Boolean,default:!1},isTacticVisible:{type:Boolean,default:!0},isSynchronization:{type:Boolean,default:!1},canPlayVideos:{type:Boolean,default:!0},videoPrivilegesPlayingAs:{type:Set,default:()=>new Set([1,2])},isFieldOnly:{type:Boolean,default:!0},isTemplateMode:{type:Boolean,default:!1},isCornerInfoVisible:{type:Boolean,default:!1},isNullCornerData:{type:Boolean,default:!1}},emits:["open-media-player","corners-filled","changelateralidad"],setup(e,{emit:r}){let a=0;const v=e,$=CZe(),h=NZe(),u=[{text:"Rematado fue gol",categoriesIds:[583,585,587,589]},{text:"Rematado no fue gol",categoriesIds:[584,586,588,590]},{text:"Rematado sin destino",categoriesIds:[122,128,136,142]},{text:v.tournamentSelected.is_female==1?"Ganado por portera rival":"Ganado por portero rival",categoriesIds:[123,129,137,143]},{text:v.tournamentSelected.is_female==1?"Ganado por jugadora rival":"Ganado por jugador rival",categoriesIds:[124,130,138,144]},{text:"Sin destino",categoriesIds:[125,131,139,145]}],i=new Map([[120,"Comba hacia afuera"],[134,"Comba hacia afuera"],[126,"Comba hacia adentro"],[140,"Comba hacia adentro"],[327,"Raz de área"],[146,"Raz de área"],[133,"En corto"],[147,"En corto"]]),p=u.reduce(($t,Rt)=>(Rt.categoriesIds.forEach(sr=>{$t.set(sr,Rt.text)}),$t),new Map),l={headers:{Authorization:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"}},n=r,k=t.ref(null),T=t.ref("0"),x=t.ref(["-1","0"]),d=t.ref(new Map),o=t.ref(!v.isTacticVisible),c=t.ref(!1),s=t.ref([]),f=t.ref(!0),g=t.ref(!0),S=t.ref(!1),L=t.ref(!1),E=t.ref(new Map),P=t.computed(()=>{if(v.gameIdForAnalysis&&v.playIdForAnalysis&&s.value){const $t=s.value.find(Rt=>Rt.game_id===v.gameIdForAnalysis);if($t){if($t.corners.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!1;if($t.cornersAgainstTeam.find(Rt=>Rt.play_id===v.playIdForAnalysis))return!0}}return v.isAgainstMode}),V=t.computed(()=>{const $t=[];return U.value&&(f.value&&$t.push(v.teamIdForAnalysis),g.value&&$t.push(v.teamIdForAnalysis!==U.value.home_team?U.value.home_team:U.value.visiting_team)),$t}),I=t.computed(()=>v.widthContainer<=768?"cont-data768":"cont-data"),j=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-collectors768":$t<=900?"cont-collectors900":"cont-collectors"}),F=t.computed(()=>{const $t=v.widthContainer;return $t<=768?"cont-who-connected768":$t<=900?"cont-who-connected900":"cont-who-connected"}),W=t.computed(()=>s.value?s.value.findIndex($t=>$t.isSelected):null),U=t.computed(()=>s.value?s.value[W.value]:null),z=t.ref(null),X=t.computed(()=>{const $t=s.value[W.value];let Rt=!1;if($t){const sr=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(Zt=>Zt.isSelected);if(sr&&sr.playConnections){ge(sr);const Zt=sr.playConnections;let Tt=[Zt.mainPlay];return Zt.relatedPlays&&Tt.push(...Zt.relatedPlays),Tt.sort((Pt,Ut)=>Pt.touchOrder-Ut.touchOrder),Tt=Tt.filter(Pt=>{let Ut=!0;return Rt?!1:(N.value?Ut=!Pt.isTeamForAnalysis&&Pt.y1<=yN||Pt.isTeamForAnalysis&&Pt.y1>=yN:Ut=Pt.isTeamForAnalysis&&Pt.y1<=yN||!Pt.isTeamForAnalysis&&Pt.y1>=yN,Rt=!Ut,Ut)}),Tt.forEach((Pt,Ut)=>{Ut>0&&(Pt.previousPlayConnection=Tt[Ut-1]),Ut===Tt.length-1&&(Pt.isLastPlay=!0)}),Tt}}return[]}),N=t.computed(()=>{const $t=s.value[W.value];if($t){const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.isAgainst:!1}return!1}),Y=t.computed(()=>{const $t=s.value[W.value];if($t){me($t);const Rt=$t[`${P.value?"cornersAgainstTeam":"corners"}`].find(sr=>sr.isSelected);return Rt?Rt.fieldPositions:null}return null}),se=t.ref({});function me($t){se.value=$t}function ge($t){z.value=$t}const be=t.computed(()=>Y.value?Y.value.get(T.value):[]),xe=t.computed(()=>{if(Y.value){const $t=Number(x.value[0]),Rt=Number(x.value[1]),sr=[];if(Rt!==$t)for(let Zt=$t;Zt<Rt;Zt++){const Tt=Y.value.get(Zt.toString()),Pt=Y.value.get((Zt+1).toString());Tt&&Pt&&sr.push({playersPositions:Tt,finalPlayersPositions:Pt,areFirstPositions:Zt===$t,areFinalPositions:Zt===Rt-1})}else sr.push({playersPositions:Y.value.get(x.value[0]),finalPlayersPositions:Y.value.get(x.value[0]),areFirstPositions:!0,areFinalPositions:!0});return sr}return[]}),Ae=t.computed(()=>Y.value?Array.from(Y.value.keys()):[]);t.watch(()=>v.advancedFilters,$t=>{o.value=$t.areConnectionsVisible,c.value=$t.arePathsVisible;const Rt=$t.secondsBeforeAndAfter.toString(),sr=$t.secondsBefore.toString(),Zt=$t.secondsAfter.toString();Ae.value.includes(Rt)&&(T.value=Rt),Ae.value.includes(sr)&&(x.value[0]=sr),Ae.value.includes(Zt)&&(x.value[1]=Zt)},{immediate:!0,deep:!0}),t.watch(()=>P.value,()=>{v.isNullCornerData||Et()}),t.watch(()=>v.teamIdForAnalysis,$t=>{$t&&!v.isNullCornerData&&Mt()},{immediate:!0});const je=t.computed(()=>U.value?v.teamIdForAnalysis===U.value.home_team:!0);t.watch(()=>W.value,($t,Rt)=>{if($t!==Rt&&(T.value="0",x.value=["-1","0"],U.value)){U.value.corners.forEach(Zt=>{Zt.isSelected=!1}),U.value.cornersAgainstTeam.forEach(Zt=>{Zt.isSelected=!1});const sr=(P.value?U.value.cornersAgainstTeam:U.value.corners).filter(Zt=>Zt.isVisible);sr.length>0&&(sr[0].isSelected=!0)}}),t.watch(()=>v.filters,$t=>{$t&&Ue()},{deep:!0,immediate:!0}),t.watch(()=>v.isTacticVisible,$t=>{o.value=!$t});function _e($t){n("changelateralidad",$t)}function Ue(){if(s.value)if(v.isSynchronization)s.value.forEach(($t,Rt)=>{$t.isVisible=!0,Rt===0&&($t.isSelected=!0,$t.isExpanded=!0,$t.corners.forEach(sr=>{sr.isVisible=!0}),$t.cornersAgainstTeam.forEach(sr=>{sr.isVisible=!0}))});else{let $t=!1;s.value.forEach(Rt=>{if(Rt.isSelected=!1,P.value&&Rt.isSoccerFieldDataRivalLoaded||!P.value&&Rt.isSoccerFieldDataLoaded){const sr=P.value?Rt.cornersAgainstTeam:Rt.corners;if((!v.filters.games.length||v.filters.games.includes(Rt.game_id))&&v.filters.playingAs.includes(Rt.playingAs)&&(v.filters.isMoment||v.filters.final.includes(Rt.finalResult))){let Zt=0;for(const Tt of sr){if(Tt.isSelected=!1,v.playIdForAnalysis&&Tt.play_id===v.playIdForAnalysis){Tt.isVisible=!0,Tt.isSelected=!0,Zt++;break}if(v.filters.cornertype!==Tt.init_category_id){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.howWas.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!P.value&&v.filters.players.length&&!v.filters.players.includes(Tt.player_id)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(Tt.playConnections){if(!v.filters.sections.includes(Tt.playConnections.mainPlay.timeSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}if(!v.filters.moment.includes(Tt.playConnections.mainPlay.matchResultAtMomentOfPlay)){Tt.isVisible=!1,Tt.isSelected=!1;continue}const Pt=Tt.playConnections.mainPlay;if(Pt&&!v.filters.isZoneFull&&!v.filters.zona.includes(Pt.fieldSection)){Tt.isVisible=!1,Tt.isSelected=!1;continue}}if(!v.filters.isWhatHappenedFull&&Tt.relatedCategoriesIds&&!v.filters.whathappened.some(Pt=>Tt.relatedCategoriesIds.has(Pt))){Tt.isVisible=!1,Tt.isSelected=!1;continue}Tt.isVisible=!0,Zt===0&&(Tt.isSelected=!0),Zt++}Rt.isVisible=Zt>0,Rt.isVisible&&!$t?(Rt.isSelected=!0,Rt.isExpanded=!0,$t=!0):Rt.isSelected=!1}else Rt.isVisible=!1,sr.forEach(Zt=>{Zt.isVisible=!1,Zt.isSelected=!1})}})}}function qe([$t,Rt]){const sr=Math.round(Number(Rt));if(sr===60){const Zt=Number($t)+1;return`${Zt<100?Zt<10?"00":"0":""}${Zt}:00.000`}return`${$t}:${sr<10?"0":""}${sr}.000`}function Re($t,Rt,sr,Zt){$t&&$t.forEach(Tt=>{Tt.isHomeTeam=Tt.teamId===U.value.home_team,Tt.attackDirection=Zt.get(Tt.playId).mainPlay.attackDirection,Tt.player=Rt.get(Tt.playerId)||sr.get(Tt.playerId)})}function De($t,Rt){const sr=Number(x.value[Rt])+$t;if(Ae.value.includes(sr.toString())){const Zt=[...x.value];Zt[Rt]=sr.toString(),Number(Zt[1])-Number(Zt[0])>=0&&(x.value=[...Zt])}}function Qe($t){const Rt=Number(T.value)+$t;Ae.value.includes(Rt.toString())&&(T.value=Rt.toString())}function rt($t){if(!$t.teams||$t.teams.length===0)return;const Rt=$t.teams[0].team_id,sr=$t.teams[1].team_id;if(v.teamIdForAnalysis===Rt&&$t.home_atk_direction===1||v.teamIdForAnalysis===sr&&$t.visiting_atk_direction===1)for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_LEFT:mN.TO_RIGHT);else for(let Zt=1;Zt<5;Zt++)d.value.set(Zt,Zt%2===0?mN.TO_RIGHT:mN.TO_LEFT)}function dt(){L.value=!0}function ct(){L.value=!1}async function Ye(){try{if(U.value){const $t={messages:[{queue:"gs3.tendency",message:{key:"postmatch",action:"season",data:{season_id:v.seasonIdForAnalysis,game_id:U.value.game_id}}}]};await xv.post("https://6xh1ym8shh.execute-api.us-west-2.amazonaws.com/prod/pushInternalData",$t,l)}}catch($t){throw new Error($t)}finally{ct()}}function st(){S.value=!0}function lt(){S.value=!1}async function Ot(){try{if(U.value){const $t=U.value[`${P.value?"cornersAgainstTeam":"corners"}`].find(Rt=>Rt.isSelected);if($t){const Rt={play_id:$t.play_id,game_id:U.value.game_id,season_id:v.seasonIdForAnalysis,seconds:Number(T.value),moment_of_play:$t.moment_of_play};await xv.post(" https://bqsyfm7sij.execute-api.us-east-2.amazonaws.com/prod/sync",Rt,l)}}}catch($t){throw new Error($t)}finally{lt()}}async function Mt($t){try{const Rt=E.value.get(v.teamIdForAnalysis);if(Rt){s.value=Rt,Ue();return}a=$t||v.seasonIdForAnalysis;const sr=(await xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/games/teams/${v.teamIdForAnalysis}/corners`,l)).data,Zt={corners:0,cornersAgainst:0};s.value=sr.games?sr.games.reduce((Tt,Pt)=>{if(v.isGameOnly&&v.gameIdForAnalysis!==Pt.game_id)return Tt;const Ut={againstTeam:[],team:[]},vr=Pt.score[1]-Pt.score[0];Pt.dateMillis=new Date(Pt.date_time_utc),Pt.isVisible=!0,Pt.playingAs=Pt.home_team===v.teamIdForAnalysis?1:2,Pt.finalResult=vr===0?3:Pt.playingAs===1?vr>0?2:1:vr<0?2:1,Pt.corners.forEach(Tr=>{const Rr=Tr.team_id===v.teamIdForAnalysis;Tr.isAgainst=!Rr,(!v.playIdForAnalysis||v.playIdForAnalysis===Tr.play_id)&&(Rr?Ut.team.push(Tr):Ut.againstTeam.push(Tr))}),Pt.corners=Ut.team,Pt.cornersAgainstTeam=Ut.againstTeam;const ur=Pt.home_team===v.teamIdForAnalysis?1:2;Zt.corners+=Pt.corners.length,Zt.cornersAgainst+=Pt.cornersAgainstTeam.length;const gr={...Pt,isSelected:Tt.length===0,isExpanded:!1,isTeamForAnalysisHomeTeam:Pt.home_team===v.teamIdForAnalysis,canPlayVideos:v.canPlayVideos&&v.videoPrivilegesPlayingAs.has(ur)};return Tt.push(gr),Tt},[]):[],s.value=s.value.sort((Tt,Pt)=>Pt.dateMillis-Tt.dateMillis),qt(),n("corners-filled",Zt),await Et(),s.value.forEach(Tt=>{Tt.corners.concat(Tt.cornersAgainstTeam).forEach(Pt=>{if(Pt.playConnections){const[Ut,vr]=Pt.moment_of_play.split(":"),[ur,gr]=vr.split("."),Tr=Number(Ut)+45*Pt.playConnections.mainPlay.matchLapse;Pt.isSelected=!1,Pt.orderValue=+`${Tr}${ur}${gr}`}}),Tt.corners=Tt.corners.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue),Tt.cornersAgainstTeam=Tt.cornersAgainstTeam.sort((Pt,Ut)=>Pt.orderValue-Ut.orderValue)}),Ue()}catch(Rt){throw new Error(Rt)}}async function Et(){try{const $t=[];s.value.forEach(Rt=>{(P.value&&!Rt.isSoccerFieldDataRivalLoaded||!P.value&&!Rt.isSoccerFieldDataLoaded)&&$t.push(Gt(Rt))}),$t.length>0&&((await Promise.all($t)).forEach((Rt,sr)=>{lr(s.value[sr],Rt)}),Ue()),qt()}catch($t){throw new Error($t)}}function qt(){E.value.get(v.teamIdForAnalysis)||E.value.set(v.teamIdForAnalysis,s.value)}function Gt($t){return v.isSynchronization?xv.get(`https://golstats-microservices.s3.us-west-2.amazonaws.com/tendency/corners-${P.value?"received":"commited"}-${a}-${v.teamIdForAnalysis}-${$t.game_id}-large.json`):xv.get(`https://1qvtl1japi.execute-api.us-east-2.amazonaws.com/prod/seasons/${a}/corners/trends/teams/${v.teamIdForAnalysis}/${$t.game_id}${P.value?"?isR=1":""}`,l)}function Jt($t){const[Rt,sr]=$t.split(", ");let Zt="";const Tt=Rt.split(" ");for(const Pt of Tt)if(Zt+=` ${Pt}`,Pt.length>3)break;return sr&&Rt?`${sr.trim().charAt(0)}.${Zt}`:""}function Qt($t){let[Rt,sr]=$t.split(", ");sr=(sr==null?void 0:sr.trim())||"";let Zt="";const Tt=Rt.split(" "),Pt=sr.includes(" ")?sr.split(" ")[0]:sr;for(const Ut of Tt)if(Zt+=` ${Ut}`,Ut.length>3)break;return Pt&&Rt?`${Pt} ${Zt}`:""}async function lr($t,Rt){try{if($t&&Rt&&(!$t.isSoccerFieldDataLoaded||!$t.isSoccerFieldDataRivalLoaded)){const sr=new Map,Zt=new Map,Tt=new Map;rt(Rt.data),Rt.data.players&&Rt.data.players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Zt.set(ur.player_id,ur)}),Rt.data.rival_players&&Rt.data.rival_players.forEach(ur=>{ur.shortName=Jt(ur.name),ur.firstNameAndFirstLastName=Qt(ur.name),Tt.set(ur.player_id,ur)}),k.value=Rt.data.teams.find(ur=>ur.team_id===v.teamIdForAnalysis),k.value&&(k.value.rival=Rt.data.teams.find(ur=>ur.team_id!==v.teamIdForAnalysis));const Pt=Rt.data.data.reduce((ur,gr)=>{const Tr=gr.reduce((or,Or,Pr)=>(or[h[Pr]]=Or,or.isHomeTeam=or.teamId===$t.home_team,or),{}),Rr=Tr.playId===Tr.relatedPlayId,St=ur.get(Tr.relatedPlayId),Yt=Tr.momentOfPlay.split(":"),er=qe(Yt);return Tr.player=Zt.get(Tr.playerId)||Tt.get(Tr.playerId),Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis,Rr&&(Tr.attackDirection=d.value.get(Tr.matchLapse),sr.set(Tr.playId,er)),St?Rr?St.mainPlay=Tr:St.relatedPlays.length<qJe&&(St.relatedPlays.push(Tr),St.relatedPlays.length>1&&St.relatedPlays.sort((or,Or)=>or.touchOrder-Or.touchOrder)):ur.set(Tr.playId,{mainPlay:Rr?Tr:null,relatedPlays:Rr?[]:[Tr]}),ur},new Map),Ut=Rt.data.field_positions.reduce((ur,gr)=>{const Tr=gr.reduce((St,Yt,er)=>(St[$[er]]=Yt,St),{});Tr.isTeamForAnalysis=Tr.teamId===v.teamIdForAnalysis;const Rr=ur.get(Tr.playId);if(Rr){const St=Rr.get(Tr.momentOfPlay);St?St.push(Tr):Rr.set(Tr.momentOfPlay,[Tr])}else ur.set(Tr.playId,new Map([[Tr.momentOfPlay,[Tr]]]));return ur},new Map),vr=Array.from(sr.entries()).reduce((ur,[gr,Tr])=>{const Rr=[],St=[];let Yt=null;const er=Ut.get(gr);if(er){const or=v.isSynchronization?FJe:RJe,Or=v.isSynchronization?IJe:UJe;Array.from(er.keys()).sort().forEach(oa=>{(!Yt||St.length<Or)&&(oa===Tr?Yt=er.get(oa):Yt?St.length<Or&&St.push(er.get(oa)):(Rr.length===or&&Rr.shift(),Rr.push(er.get(oa))))});const Pr=new Map;Rr.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia-Rr.length}`,oa)}),Re(Yt,Zt,Tt,Pt),Pr.set("0",Yt),St.forEach((oa,Ia)=>{Re(oa,Zt,Tt,Pt),Pr.set(`${Ia+1}`,oa)}),ur.set(gr,Pr)}return ur},new Map);$t[`${P.value?"cornersAgainstTeam":"corners"}`].forEach(ur=>{const gr=ur.related_categories.split(",").reduce((Rr,St,Yt)=>{const er=Number(St);return Yt===1&&(ur.howWasCorner=er),Rr.array.push(er),Rr.sett.add(er),Rr},{array:[],sett:new Set});for(const Rr of gr.array){const St=i.get(Rr),Yt=p.get(Rr);if(Yt&&(ur.whatHappenedName=Yt),St&&(ur.howWasCornerName=St),ur.howWasCornerName&&ur.whatHappenedName)break}ur.relatedCategoriesIds=gr.sett,ur.playConnections=Pt.get(ur.play_id),ur.fieldPositions=vr.get(ur.play_id),ur.player=Zt.get(ur.player_id)||Tt.get(ur.player_id);let Tr=ur.moment_of_play.split(".")[0];Tr.startsWith("0")&&(Tr=Tr.slice(1)),ur.formattedMomentOfPlay=Tr,ur.momentOfPlayNumber=Number(Tr.replace(":","."))}),!P.value&&!$t.isSoccerFieldDataLoaded&&($t.isSoccerFieldDataLoaded=!0),P.value&&!$t.isSoccerFieldDataRivalLoaded&&($t.isSoccerFieldDataRivalLoaded=!0)}}catch(sr){throw new Error(sr)}}function hr($t){const Rt=U.value[`${P.value?"cornersAgainstTeam":"corners"}`],sr={},Zt=Rt.reduce((Tt,Pt)=>(Pt.isVisible&&(Tt.add(Pt.play_id),Pt.isSelected&&(sr.playId=Pt.play_id)),Tt),new Set);n("open-media-player",{seasonId:a,mainSectionType:1,playListType:1,playsIds:Zt,playData:sr,categoryIds:P.value?["31_r","32_r"]:[31,32],teamId:v.teamIdForAnalysis,videosType:$t,isCarouselOnly:!0})}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.withDirectives(t.createElementVNode("div",EZe,[t.createElementVNode("div",zZe,[t.createElementVNode("div",MZe," ¿Estás seguro que deseas sincronizar el tracking del partido "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`]:"")+" vs "+t.toDisplayString(U.value?U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`]:"")+" ? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:ct}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ye},"Sí")])])],512),[[t.vShow,L.value]]),t.withDirectives(t.createElementVNode("div",VZe,[t.createElementVNode("div",PZe,[t.createElementVNode("div",AZe," ¿Estás seguro que deseas sincronizar esta jugada en el segundo "+t.toDisplayString(T.value)+"? ",1),t.createElementVNode("div",{class:"modal-confirmation__buttons"},[t.createElementVNode("div",{class:"modal-confirmation__buttons__button cancel",onClick:lt}," No "),t.createElementVNode("div",{class:"modal-confirmation__buttons__button",onClick:Ot},"Sí")])])],512),[[t.vShow,S.value]]),t.createElementVNode("div",{class:t.normalizeClass(e.widthContainer<=768?"gsc-specific-plays-movil":"gsc-specific-plays")},[t.withDirectives(t.createElementVNode("div",RZe,[t.createElementVNode("div",UZe,[e.widthContainer<=768?(t.openBlock(),t.createElementBlock("span",FZe,"Elige que quieres ver:")):(t.openBlock(),t.createElementBlock("span",IZe,"Jugadas Específicas"))])],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(I.value)},[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(j.value)},[e.widthContainer>768?(t.openBlock(),t.createBlock(_Be,{key:0,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"])):(t.openBlock(),t.createBlock(mXe,{key:1,"is-against-mode":P.value,"games-by-team":s.value,"are-filters-open":e.areFiltersOpen},null,8,["is-against-mode","games-by-team","are-filters-open"]))],2),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:t.normalizeClass(F.value)},[e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:"button-tracking",onClick:dt}," Generar datos ")):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("div",qZe,[t.createElementVNode("div",jZe,[t.createVNode(t.unref(IP),{modelValue:o.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=sr=>o.value=sr),label:"Mostrar conexiones",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"]),e.widthContainer<=768&&e.isTacticVisible?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[1]||(Rt[1]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:e.widthContainer>400?"13px":"12px","label-color":"#FFF"},null,8,["modelValue","labelFontSize"])):t.createCommentVNode("",!0),e.widthContainer>768?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["specific-plays-radio-container",{"is-away-team":!je.value}])},[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",WZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[2]||(Rt[2]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-home":"outer-circle-away")},[f.value?(t.openBlock(),t.createElementBlock("svg",DZe,[...Rt[16]||(Rt[16]=[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",KZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,BZe)])]),t.createElementVNode("label",XZe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[3]||(Rt[3]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[g.value?(t.openBlock(),t.createElementBlock("svg",GZe,[...Rt[17]||(Rt[17]=[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"},null,-1)])])):t.createCommentVNode("",!0)],2),t.createElementVNode("span",ZZe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,JZe)])])],64)):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass(["specific-plays-controls22",e.widthContainer<=375?"specific-plays-controls22small":""])},[e.widthContainer>768&&e.isTacticVisible&&!e.isSynchronization?(t.openBlock(),t.createBlock(t.unref(IP),{key:0,modelValue:c.value,"onUpdate:modelValue":Rt[4]||(Rt[4]=sr=>c.value=sr),label:"Mostrar recorrido",fontFamily:"Poppins-Regular",labelFontSize:"13px","label-color":"#FFF"},null,8,["modelValue"])):t.createCommentVNode("",!0),e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[c.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[t.createElementVNode("div",tJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Inicio: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Inicio:")],64))]),Rt[29]||(Rt[29]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",rJe,[t.createElementVNode("div",aJe,[Number(x.value[0])>0?(t.openBlock(),t.createElementBlock("span",nJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[0]),1)]),Rt[25]||(Rt[25]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",iJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[7]||(Rt[7]=sr=>De(1,0))},[(t.openBlock(),t.createElementBlock("svg",oJe,[...Rt[23]||(Rt[23]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[8]||(Rt[8]=sr=>De(-1,0))},[...Rt[24]||(Rt[24]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])]),t.createElementVNode("div",sJe,[e.widthContainer>990||e.widthContainer<=768&&e.widthContainer>=420?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createTextVNode("Fin: ")],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode("Fin:")],64))]),Rt[30]||(Rt[30]=t.createElementVNode("div",{class:"icon-info"},null,-1)),t.createElementVNode("div",lJe,[t.createElementVNode("div",cJe,[Number(x.value[1])>0?(t.openBlock(),t.createElementBlock("span",uJe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(x.value[1]),1)]),Rt[28]||(Rt[28]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",dJe,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[9]||(Rt[9]=sr=>De(1,1))},[(t.openBlock(),t.createElementBlock("svg",pJe,[...Rt[26]||(Rt[26]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[10]||(Rt[10]=sr=>De(-1,1))},[...Rt[27]||(Rt[27]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2)):(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(e.widthContainer<=768?"specify-control-incement-second-container-mobil":"specify-control-incement-second-container")},[Rt[21]||(Rt[21]=t.createElementVNode("div",{class:"icon-info"},null,-1)),Rt[22]||(Rt[22]=t.createElementVNode("div",{class:"text-icon-info"},"Segundos antes/después del cobro:",-1)),t.createElementVNode("div",HZe,[t.createElementVNode("div",YZe,[Number(T.value)>0?(t.openBlock(),t.createElementBlock("span",QZe,"+")):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(T.value),1)]),Rt[20]||(Rt[20]=t.createElementVNode("div",{class:"contappvalueincementsecond-label"},"seg",-1)),t.createElementVNode("div",$Ze,[t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-mas",onClick:Rt[5]||(Rt[5]=sr=>Qe(1))},[(t.openBlock(),t.createElementBlock("svg",eJe,[...Rt[18]||(Rt[18]=[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(90 5.36523 6.26377)"},null,-1)])]))]),t.createElementVNode("div",{class:"contappvalueincementsecond-controls-container-menos",onClick:Rt[6]||(Rt[6]=sr=>Qe(-1))},[...Rt[19]||(Rt[19]=[t.createElementVNode("svg",{"data-v-b548a08d":"",width:"15",height:"15",viewBox:"-2 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-b548a08d":"",d:"M6.36523 13.788L1.10146 8.52429C0.479824 7.90265 0.479824 6.88541 1.10147 6.26377L6.36523 1",stroke:"#9ca3af",transform:"rotate(270 5.36523 6.26377)"})],-1)])])])])],2))],64)):t.createCommentVNode("",!0),e.isSynchronization?(t.openBlock(),t.createElementBlock("div",{key:2,role:"button",class:"button-sync",onClick:st}," Guardar sincronización ")):t.createCommentVNode("",!0)],2)],512),[[t.vShow,!e.isFieldOnly]]),t.createElementVNode("div",{class:"specific-plays-field",style:t.normalizeStyle(e.widthContainer<=768?"height: auto":"")},[t.createElementVNode("div",hJe,[t.createVNode(HXe,{"width-container":e.widthContainer,"play-connections":X.value,"players-positions":be.value,"players-positions-by-range":xe.value,"team-id-for-analysis":e.teamIdForAnalysis,"selected-category":e.filters.cornertype,"are-connections-visible":o.value,"are-position-paths-visible":c.value,"visible-teams-ids":V.value,"is-against-corner":N.value,onChangelateralidad:_e},null,8,["width-container","play-connections","players-positions","players-positions-by-range","team-id-for-analysis","selected-category","are-connections-visible","are-position-paths-visible","visible-teams-ids","is-against-corner"])]),t.createElementVNode("div",fJe,[t.createElementVNode("div",mJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",yJe,[t.createElementVNode("img",{src:se.value.home_team_logo,alt:""},null,8,gJe)])),Rt[31]||(Rt[31]=t.createElementVNode("div",{class:"bullet"},null,-1))]),t.createElementVNode("div",vJe,[e.isTemplateMode?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",bJe,[t.createElementVNode("img",{src:se.value.visiting_team_logo,alt:""},null,8,xJe)])),Rt[32]||(Rt[32]=t.createElementVNode("div",{class:"bullet"},null,-1))])]),U.value&&U.value.canPlayVideos&&!e.isFieldOnly?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons",style:t.normalizeStyle(e.widthContainer<=768?"gap:5px; flex-direction: column;":"")},[Rt[36]||(Rt[36]=t.createElementVNode("div",{class:"specific-plays-field__play-buttons__text"},"Visualizar video:",-1)),t.createElementVNode("div",_Je,[U.value.video_types.includes(1)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"specific-plays-field__play-buttons__button",onClick:Rt[11]||(Rt[11]=sr=>hr(1))},[...Rt[33]||(Rt[33]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Toma TV",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(3)?(t.openBlock(),t.createElementBlock("div",{key:1,class:"specific-plays-field__play-buttons__button",onClick:Rt[12]||(Rt[12]=sr=>hr(3))},[...Rt[34]||(Rt[34]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Táctica",-1)])])):t.createCommentVNode("",!0),U.value.video_types.includes(2)?(t.openBlock(),t.createElementBlock("div",{key:2,class:"specific-plays-field__play-buttons__button",onClick:Rt[13]||(Rt[13]=sr=>hr(2))},[...Rt[35]||(Rt[35]=[t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__icon"},[t.createElementVNode("img",{src:FP,alt:""})],-1),t.createElementVNode("div",{class:"specific-plays-field__play-buttons__button__text"},"Panorámica",-1)])])):t.createCommentVNode("",!0)])],4)):t.createCommentVNode("",!0)],4),e.widthContainer<=768?(t.openBlock(),t.createElementBlock("div",wJe,[U.value&&e.isTacticVisible?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",TJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[14]||(Rt[14]=sr=>f.value=sr),type:"checkbox",name:"radio",checked:"",style:{display:"none"}},null,512),[[t.vModelCheckbox,f.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[37]||(Rt[37]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),t.createElementVNode("span",SJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"home":"visiting"}_team_logo`]},null,8,kJe)])]),t.createElementVNode("label",LJe,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Rt[15]||(Rt[15]=sr=>g.value=sr),type:"checkbox",name:"radio",style:{display:"none"}},null,512),[[t.vModelCheckbox,g.value]]),t.createElementVNode("span",{class:t.normalizeClass(je.value?"outer-circle-away":"outer-circle-home")},[...Rt[38]||(Rt[38]=[t.createElementVNode("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:"#0d1d29"})],-1)])],2),t.createElementVNode("span",CJe,[t.createTextVNode(t.toDisplayString(U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_acronym`])+" ",1),t.createElementVNode("img",{class:"imgclassvalue",width:"25",src:U.value[`${U.value.isTeamForAnalysisHomeTeam?"visiting":"home"}_team_logo`]},null,8,OJe)])])],64)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2)],2),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",NJe)):t.createCommentVNode("",!0),z.value&&e.isCornerInfoVisible?(t.openBlock(),t.createElementBlock("div",EJe,[t.createElementVNode("div",zJe,[t.createElementVNode("img",{class:"corner-info__team__logo",src:`https://golstatsimages.blob.core.windows.net/teams-80/${z.value.team_id}.png`},null,8,MJe)]),t.createElementVNode("div",VJe,[t.createElementVNode("div",PJe,[Rt[39]||(Rt[39]=t.createElementVNode("span",null," Tiro de esquina ",-1)),Rt[40]||(Rt[40]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.player.firstNameAndFirstLastName),1)]),t.createElementVNode("div",AJe,[t.createElementVNode("span",null,t.toDisplayString(z.value.howWasCornerName),1),Rt[41]||(Rt[41]=t.createElementVNode("span",{class:"separator"}," | ",-1)),t.createElementVNode("span",null,t.toDisplayString(z.value.whatHappenedName),1)])])])):t.createCommentVNode("",!0)],2)],64))}},zZ=j6(jJe,[["__scopeId","data-v-abec1cab"]]),WJe={class:"tooltip-options"},DJe={__name:"TooltipOptions",props:{optionsType:{type:String,default:"page"}},emits:["close-tooltip","change-sort","delete-page","edit","clone","delete"],setup(e,{emit:r}){const a=e,v=r,$=t.computed(()=>a.optionsType==="page");function h(){v("close-tooltip")}function u(i){v(i),h()}return(i,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"tooltip-overlay",onClick:h}),t.createElementVNode("div",WJe,[t.createElementVNode("ul",null,[$.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("li",{class:"option",onClick:p[0]||(p[0]=l=>u("change-sort"))},[...p[4]||(p[4]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Cambiar orden ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[1]||(p[1]=l=>u("delete-page"))},[...p[5]||(p[5]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("li",{class:"option",onClick:p[2]||(p[2]=l=>u("edit"))},[...p[6]||(p[6]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-rename.svg",alt:"Renombrar template",class:"icon"},null,-1),t.createTextVNode(" Editar ",-1)])]),t.createElementVNode("li",{class:"option",onClick:p[3]||(p[3]=l=>u("delete"))},[...p[7]||(p[7]=[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/icn-delete.svg",alt:"Eliminar template",class:"icon"},null,-1),t.createTextVNode(" Eliminar ",-1)])])],64))])])],64))}},MZ=t2(DJe,[["__scopeId","data-v-998e2429"]]),KJe={class:"report-view"},BJe={class:"report-view__header"},XJe={key:0,class:"report-view__header__logo"},GJe=["src"],ZJe={class:"report-view__header__name"},JJe={class:"report-view__content"},HJe={__name:"ReportView",props:{view:{type:Object,default:()=>({title:"View Title"})},isEmpty:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},game:{type:Object,default:()=>null},isHomeTeam:{type:Boolean,default:!0},isFilterVisible:{type:Boolean,default:!1},viewId:{type:Number,default:0},isPostMatch:{type:Boolean,default:!1}},emits:["edit","delete"],setup(e,{emit:r}){const a=e,v=t.ref(!1),$=r,h=[1,2,3,4,6,8,14,13],u=t.computed(()=>!h.includes(a.viewId)),i=t.computed(()=>{if(a.game){const o=a.isHomeTeam?a.game.homeTeam:a.game.awayTeam;if(o&&o.logo)return o.logo}return""}),p=t.computed(()=>{const o=a.view.coreView;return o?o.id===9?a.view.w<4?a.view.title.replace("Mapeo de ",""):a.view.title:o.id===6?n(a.view):o.id===13?k(a.view):a.view.title:a.view.title}),l=new Map([[1,"último"],[2,"penúltimo"],[3,"antepenúltimo"]]);function n(o){return a.isPostMatch?o.title:`${o.title} ${l.get(o.componentProps.gameNumber)+" partido"||""}`}function k(o){try{if(!o)return"Tabla por Categoría";const c=o.dynamicFilters||[];if(!Array.isArray(c)||c.length<2)return"Tabla por Categoría";const s=c[1]||[],f=c[0]||2;if(s&&s.length>0){const g=[{value:[213,214,215,216],label:"Pases acertados por lapsos"},{value:[217],label:"Pases filtrados por lapsos"},{value:[218,219,220,221],label:"Pases no acertados por lapsos"},{value:[485,486,487,488],label:"Balones recuperados en disputa por lapsos"},{value:[489,490,491,492],label:"Balones recuperados sin disputa por lapsos"},{value:[496,497,498,499],label:"Balones perdidos en disputa por lapsos"},{value:[500,501,502,503],label:"Balones perdidos sin disputa por lapsos"},{value:[12,55,"35_r","54_r"],label:"Goles por lapsos"},{value:[511,512],label:f==2?"Tiros a gol totales por lapsos":"Tiros a gol recibidos totales por lapsos"},{value:[537,540,544,547],label:f==2?"Tiros a gol a destino por lapsos":"Tiros a gol recibidos a destino por lapsos"},{value:[13],label:f==2?"Centros por izquierda por lapsos":"Centros por derecha recibidos por lapsos"},{value:[25],label:f==2?"Centros por derecha por lapsos":"Centros por izquierda recibidos por lapsos"},{value:[11],label:"Balones ganados en área rival por lapsos"},{value:[607,608,12,55,"35_r","54_r"],label:"Oportunidad de gol por lapsos"},{value:["40_r"],label:"Goles recibidos por lapsos"},{value:["487_r","488_r","491_r","492_r"],label:"Balones recuperados en cancha rival por lapsos"},{value:["485_r","486_r","489_r","490_r"],label:"Balones recuperados en cancha propia por lapsos"}],S=(L,E)=>{if(L.length!==E.length)return!1;const P=[...L].sort(),V=[...E].sort();return P.every((I,j)=>I===V[j])};for(const L of g)if(S(s,L.value))return L.label}return"Tabla por Categoría"}catch(c){return console.error("Error en getTableCategoryTitle:",c),"Tabla por Categoría"}}function T(){d(),$("edit")}function x(){d(),$("delete")}function d(){v.value=!1}return(o,c)=>(t.openBlock(),t.createElementBlock("div",KJe,[t.createElementVNode("div",BJe,[v.value?(t.openBlock(),t.createBlock(MZ,{key:0,"options-type":"view",onClick:c[0]||(c[0]=t.withModifiers(s=>v.value=!1,["self"])),onMouseleave:c[1]||(c[1]=s=>v.value=!1),onCloseTooltip:d,onEdit:T,onDelete:x})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"report-view__header__team-and-name",style:t.normalizeStyle(e.isTemplateMode?{"max-width":"80%"}:{"max-width":"100%"})},[i.value&&u.value?(t.openBlock(),t.createElementBlock("div",XJe,[t.createElementVNode("img",{src:i.value,alt:""},null,8,GJe)])):t.createCommentVNode("",!0),t.createElementVNode("div",ZJe,t.toDisplayString(p.value),1)],4),t.withDirectives(t.createElementVNode("div",{role:"button",class:"report-view__header__actions",onClick:c[2]||(c[2]=s=>v.value=!0)},[...c[3]||(c[3]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])],512),[[t.vShow,e.isTemplateMode&&!e.isFilterVisible]])]),t.createElementVNode("div",JJe,[t.createElementVNode("div",{class:t.normalizeClass({"field-possession-component":e.viewId===8,"timeline-component":e.viewId===4,"field-data-by-zones-component":e.viewId===9,"center-flex-column":![8,4,9].includes(e.viewId)})},[t.renderSlot(o.$slots,"default",{},void 0,!0)],2)])]))}},YJe=t2(HJe,[["__scopeId","data-v-103aa713"]]);function QJe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gN={exports:{}},VZ;function $Je(){if(VZ)return gN.exports;VZ=1;function e(){}return e.prototype={on:function(r,a,v){var $=this.e||(this.e={});return($[r]||($[r]=[])).push({fn:a,ctx:v}),this},once:function(r,a,v){var $=this;function h(){$.off(r,h),a.apply(v,arguments)}return h._=a,this.on(r,h,v)},emit:function(r){var a=[].slice.call(arguments,1),v=((this.e||(this.e={}))[r]||[]).slice(),$=0,h=v.length;for($;$<h;$++)v[$].fn.apply(v[$].ctx,a);return this},off:function(r,a){var v=this.e||(this.e={}),$=v[r],h=[];if($&&a)for(var u=0,i=$.length;u<i;u++)$[u].fn!==a&&$[u].fn._!==a&&h.push($[u]);return h.length?v[r]=h:delete v[r],this}},gN.exports=e,gN.exports.TinyEmitter=e,gN.exports}var rA,PZ;function eHe(){if(PZ)return rA;PZ=1;var e=$Je();return rA=new e,rA}var tHe=eHe();const Sd=QJe(tHe);function rHe(e,r,a,v,$){const h=(...u)=>(console.warn("gridstack.js: Function `"+a+"` is deprecated in "+$+" and has been replaced with `"+v+"`. It will be **removed** in a future release"),r.apply(e,u));return h.prototype=r.prototype,h}class ru{static getElements(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(v&&!isNaN(+r[0])){const h=v.getElementById(r);return h?[h]:[]}let $=a.querySelectorAll(r);return!$.length&&r[0]!=="."&&r[0]!=="#"&&($=a.querySelectorAll("."+r),$.length||($=a.querySelectorAll("#"+r))),Array.from($)}return[r]}static getElement(r,a=document){if(typeof r=="string"){const v="getElementById"in a?a:void 0;if(!r.length)return null;if(v&&r[0]==="#")return v.getElementById(r.substring(1));if(r[0]==="#"||r[0]==="."||r[0]==="[")return a.querySelector(r);if(v&&!isNaN(+r[0]))return v.getElementById(r);let $=a.querySelector(r);return v&&!$&&($=v.getElementById(r)),$||($=a.querySelector("."+r)),$}return r}static lazyLoad(r){var a,v;return r.lazyLoad||((v=(a=r.grid)==null?void 0:a.opts)==null?void 0:v.lazyLoad)&&r.lazyLoad!==!1}static createDiv(r,a){const v=document.createElement("div");return r.forEach($=>{$&&v.classList.add($)}),a==null||a.appendChild(v),v}static shouldSizeToContent(r,a=!1){return(r==null?void 0:r.grid)&&(a?r.sizeToContent===!0||r.grid.opts.sizeToContent===!0&&r.sizeToContent===void 0:!!r.sizeToContent||r.grid.opts.sizeToContent&&r.sizeToContent!==!1)}static isIntercepted(r,a){return!(r.y>=a.y+a.h||r.y+r.h<=a.y||r.x+r.w<=a.x||r.x>=a.x+a.w)}static isTouching(r,a){return ru.isIntercepted(r,{x:a.x-.5,y:a.y-.5,w:a.w+1,h:a.h+1})}static areaIntercept(r,a){const v=r.x>a.x?r.x:a.x,$=r.x+r.w<a.x+a.w?r.x+r.w:a.x+a.w;if($<=v)return 0;const h=r.y>a.y?r.y:a.y,u=r.y+r.h<a.y+a.h?r.y+r.h:a.y+a.h;return u<=h?0:($-v)*(u-h)}static area(r){return r.w*r.h}static sort(r,a=1){return r.sort((v,$)=>{const h=a*((v.y??1e4)-($.y??1e4));return h===0?a*((v.x??1e4)-($.x??1e4)):h})}static find(r,a){return a?r.find(v=>v.id===a):void 0}static toBool(r){return typeof r=="boolean"?r:typeof r=="string"?(r=r.toLowerCase(),!(r===""||r==="no"||r==="false"||r==="0")):!!r}static toNumber(r){return r===null||r.length===0?void 0:Number(r)}static parseHeight(r){let a,v="px";if(typeof r=="string")if(r==="auto"||r==="")a=0;else{const $=r.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!$)throw new Error(`Invalid height val = ${r}`);v=$[2]||"px",a=parseFloat($[1])}else a=r;return{h:a,unit:v}}static defaults(r,...a){return a.forEach(v=>{for(const $ in v){if(!v.hasOwnProperty($))return;r[$]===null||r[$]===void 0?r[$]=v[$]:typeof v[$]=="object"&&typeof r[$]=="object"&&ru.defaults(r[$],v[$])}}),r}static same(r,a){if(typeof r!="object")return r==a;if(typeof r!=typeof a||Object.keys(r).length!==Object.keys(a).length)return!1;for(const v in r)if(r[v]!==a[v])return!1;return!0}static copyPos(r,a,v=!1){return a.x!==void 0&&(r.x=a.x),a.y!==void 0&&(r.y=a.y),a.w!==void 0&&(r.w=a.w),a.h!==void 0&&(r.h=a.h),v&&(a.minW&&(r.minW=a.minW),a.minH&&(r.minH=a.minH),a.maxW&&(r.maxW=a.maxW),a.maxH&&(r.maxH=a.maxH)),r}static samePos(r,a){return r&&a&&r.x===a.x&&r.y===a.y&&(r.w||1)===(a.w||1)&&(r.h||1)===(a.h||1)}static sanitizeMinMax(r){r.minW||delete r.minW,r.minH||delete r.minH,r.maxW||delete r.maxW,r.maxH||delete r.maxH}static removeInternalAndSame(r,a){if(!(typeof r!="object"||typeof a!="object"))for(let v in r){const $=r[v],h=a[v];v[0]==="_"||$===h?delete r[v]:$&&typeof $=="object"&&h!==void 0&&(ru.removeInternalAndSame($,h),Object.keys($).length||delete r[v])}}static removeInternalForSave(r,a=!0){for(let v in r)(v[0]==="_"||r[v]===null||r[v]===void 0)&&delete r[v];delete r.grid,a&&delete r.el,r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,r.locked||delete r.locked,(r.w===1||r.w===r.minW)&&delete r.w,(r.h===1||r.h===r.minH)&&delete r.h}static throttle(r,a){let v=!1;return(...$)=>{v||(v=!0,setTimeout(()=>{r(...$),v=!1},a))}}static removePositioningStyles(r){const a=r.style;a.position&&a.removeProperty("position"),a.left&&a.removeProperty("left"),a.top&&a.removeProperty("top"),a.width&&a.removeProperty("width"),a.height&&a.removeProperty("height")}static getScrollElement(r){if(!r)return document.scrollingElement||document.documentElement;const a=getComputedStyle(r);return/(auto|scroll)/.test(a.overflow+a.overflowY)?r:ru.getScrollElement(r.parentElement)}static updateScrollPosition(r,a,v){const $=ru.getScrollElement(r);if(!$)return;const h=r.getBoundingClientRect(),u=$.getBoundingClientRect(),i=window.innerHeight||document.documentElement.clientHeight,p=h.bottom-Math.min(u.bottom,i),l=h.top-Math.max(u.top,0),n=$.scrollTop;l<0&&v<0?r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=Math.abs(l)>Math.abs(v)?v:l:p>0&&v>0&&(r.offsetHeight>u.height?$.scrollTop+=v:$.scrollTop+=p>v?v:p),a.top+=$.scrollTop-n}static updateScrollResize(r,a,v){const $=ru.getScrollElement(a),h=$.clientHeight,u=$===ru.getScrollElement()?0:$.getBoundingClientRect().top,i=r.clientY-u,p=i<v,l=i>h-v;p?$.scrollBy({behavior:"smooth",top:i-v}):l&&$.scrollBy({behavior:"smooth",top:v-(h-i)})}static clone(r){return r==null||typeof r!="object"?r:r instanceof Array?[...r]:{...r}}static cloneDeep(r){const a=["parentGrid","el","grid","subGrid","engine"],v=ru.clone(r);for(const $ in v)v.hasOwnProperty($)&&typeof v[$]=="object"&&$.substring(0,2)!=="__"&&!a.find(h=>h===$)&&(v[$]=ru.cloneDeep(r[$]));return v}static cloneNode(r){const a=r.cloneNode(!0);return a.removeAttribute("id"),a}static appendTo(r,a){let v;typeof a=="string"?v=ru.getElement(a):v=a,v&&v.appendChild(r)}static addElStyles(r,a){if(a instanceof Object)for(const v in a)a.hasOwnProperty(v)&&(Array.isArray(a[v])?a[v].forEach($=>{r.style[v]=$}):r.style[v]=a[v])}static initEvent(r,a){const v={type:a.type},$={button:0,which:0,buttons:1,bubbles:!0,cancelable:!0,target:a.target?a.target:r.target};return["altKey","ctrlKey","metaKey","shiftKey"].forEach(h=>v[h]=r[h]),["pageX","pageY","clientX","clientY","screenX","screenY"].forEach(h=>v[h]=r[h]),{...v,...$}}static simulateMouseEvent(r,a,v){const $=r,h=new MouseEvent(a,{bubbles:!0,composed:!0,cancelable:!0,view:window,detail:1,screenX:r.screenX,screenY:r.screenY,clientX:r.clientX,clientY:r.clientY,ctrlKey:$.ctrlKey??!1,altKey:$.altKey??!1,shiftKey:$.shiftKey??!1,metaKey:$.metaKey??!1,button:0,relatedTarget:r.target});(v||r.target).dispatchEvent(h)}static getValuesFromTransformedElement(r){const a=document.createElement("div");ru.addElStyles(a,{opacity:"0",position:"fixed",top:"0px",left:"0px",width:"1px",height:"1px",zIndex:"-999999"}),r.appendChild(a);const v=a.getBoundingClientRect();return r.removeChild(a),a.remove(),{xScale:1/v.width,yScale:1/v.height,xOffset:v.left,yOffset:v.top}}static swap(r,a,v){if(!r)return;const $=r[a];r[a]=r[v],r[v]=$}static canBeRotated(r){var a;return!(!r||r.w===r.h||r.locked||r.noResize||(a=r.grid)!=null&&a.opts.disableResize||r.minW&&r.minW===r.maxW||r.minH&&r.minH===r.maxH)}}class P4{constructor(r={}){this.addedNodes=[],this.removedNodes=[],this.defaultColumn=12,this.column=r.column||this.defaultColumn,this.column>this.defaultColumn&&(this.defaultColumn=this.column),this.maxRow=r.maxRow,this._float=r.float,this.nodes=r.nodes||[],this.onChange=r.onChange}batchUpdate(r=!0,a=!0){return!!this.batchMode===r?this:(this.batchMode=r,r?(this._prevFloat=this._float,this._float=!0,this.cleanNodes(),this.saveInitial()):(this._float=this._prevFloat,delete this._prevFloat,a&&this._packNodes(),this._notify()),this)}_useEntireRowArea(r,a){return(!this.float||this.batchMode&&!this._prevFloat)&&!this._hasLocked&&(!r._moving||r._skipDown||a.y<=r.y)}_fixCollisions(r,a=r,v,$={}){if(this.sortNodes(-1),v=v||this.collide(r,a),!v)return!1;if(r._moving&&!$.nested&&!this.float&&this.swap(r,v))return!0;let h=a;!this._loading&&this._useEntireRowArea(r,a)&&(h={x:0,w:this.column,y:a.y,h:a.h},v=this.collide(r,h,$.skip));let u=!1;const i={nested:!0,pack:!1};let p=0;for(;v=v||this.collide(r,h,$.skip);){if(p++>this.nodes.length*2)throw new Error("Infinite collide check");let l;if(v.locked||this._loading||r._moving&&!r._skipDown&&a.y>r.y&&!this.float&&(!this.collide(v,{...v,y:r.y},r)||!this.collide(v,{...v,y:a.y-v.h},r))){r._skipDown=r._skipDown||a.y>r.y;const n={...a,y:v.y+v.h,...i};l=this._loading&&ru.samePos(r,n)?!0:this.moveNode(r,n),(v.locked||this._loading)&&l?ru.copyPos(a,r):!v.locked&&l&&$.pack&&(this._packNodes(),a.y=v.y+v.h,ru.copyPos(r,a)),u=u||l}else l=this.moveNode(v,{...v,y:a.y+a.h,skip:r,...i});if(!l)return u;v=void 0}return u}collide(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.find(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}collideAll(r,a=r,v){const $=r._id,h=v==null?void 0:v._id;return this.nodes.filter(u=>u._id!==$&&u._id!==h&&ru.isIntercepted(u,a))}directionCollideCoverage(r,a,v){if(!a.rect||!r._rect)return;const $=r._rect,h={...a.rect};h.y>$.y?(h.h+=h.y-$.y,h.y=$.y):h.h+=$.y-h.y,h.x>$.x?(h.w+=h.x-$.x,h.x=$.x):h.w+=$.x-h.x;let u,i=.5;for(let p of v){if(p.locked||!p._rect)break;const l=p._rect;let n=Number.MAX_VALUE,k=Number.MAX_VALUE;$.y<l.y?n=(h.y+h.h-l.y)/l.h:$.y+$.h>l.y+l.h&&(n=(l.y+l.h-h.y)/l.h),$.x<l.x?k=(h.x+h.w-l.x)/l.w:$.x+$.w>l.x+l.w&&(k=(l.x+l.w-h.x)/l.w);const T=Math.min(k,n);T>i&&(i=T,u=p)}return a.collide=u,u}cacheRects(r,a,v,$,h,u){return this.nodes.forEach(i=>i._rect={y:i.y*a+v,x:i.x*r+u,w:i.w*r-u-$,h:i.h*a-v-h}),this}swap(r,a){if(!a||a.locked||!r||r.locked)return!1;function v(){const h=a.x,u=a.y;return a.x=r.x,a.y=r.y,r.h!=a.h?(r.x=h,r.y=a.y+a.h):r.w!=a.w?(r.x=a.x+a.w,r.y=u):(r.x=h,r.y=u),r._dirty=a._dirty=!0,!0}let $;if(r.w===a.w&&r.h===a.h&&(r.x===a.x||r.y===a.y)&&($=ru.isTouching(r,a)))return v();if($!==!1){if(r.w===a.w&&r.x===a.x&&($||($=ru.isTouching(r,a)))){if(a.y<r.y){const h=r;r=a,a=h}return v()}if($!==!1){if(r.h===a.h&&r.y===a.y&&($||($=ru.isTouching(r,a)))){if(a.x<r.x){const h=r;r=a,a=h}return v()}return!1}}}isAreaEmpty(r,a,v,$){const h={x:r||0,y:a||0,w:v||1,h:$||1};return!this.collide(h)}compact(r="compact",a=!0){if(this.nodes.length===0)return this;a&&this.sortNodes();const v=this.batchMode;v||this.batchUpdate();const $=this._inColumnResize;$||(this._inColumnResize=!0);const h=this.nodes;return this.nodes=[],h.forEach((u,i,p)=>{let l;u.locked||(u.autoPosition=!0,r==="list"&&i&&(l=p[i-1])),this.addNode(u,!1,l)}),$||delete this._inColumnResize,v||this.batchUpdate(!1),this}set float(r){this._float!==r&&(this._float=r||!1,r||this._packNodes()._notify())}get float(){return this._float||!1}sortNodes(r=1){return this.nodes=ru.sort(this.nodes,r),this}_packNodes(){return this.batchMode?this:(this.sortNodes(),this.float?this.nodes.forEach(r=>{if(r._updating||r._orig===void 0||r.y===r._orig.y)return;let a=r.y;for(;a>r._orig.y;)--a,this.collide(r,{x:r.x,y:a,w:r.w,h:r.h})||(r._dirty=!0,r.y=a)}):this.nodes.forEach((r,a)=>{if(!r.locked)for(;r.y>0;){const v=a===0?0:r.y-1;if(!(a===0||!this.collide(r,{x:r.x,y:v,w:r.w,h:r.h})))break;r._dirty=r.y!==v,r.y=v}}),this)}prepareNode(r,a){r._id=r._id??P4._idSeq++;const v=r.id;if(v){let h=1;for(;this.nodes.find(u=>u.id===r.id&&u!==r);)r.id=v+"_"+h++}(r.x===void 0||r.y===void 0||r.x===null||r.y===null)&&(r.autoPosition=!0);const $={x:0,y:0,w:1,h:1};return ru.defaults(r,$),r.autoPosition||delete r.autoPosition,r.noResize||delete r.noResize,r.noMove||delete r.noMove,ru.sanitizeMinMax(r),typeof r.x=="string"&&(r.x=Number(r.x)),typeof r.y=="string"&&(r.y=Number(r.y)),typeof r.w=="string"&&(r.w=Number(r.w)),typeof r.h=="string"&&(r.h=Number(r.h)),isNaN(r.x)&&(r.x=$.x,r.autoPosition=!0),isNaN(r.y)&&(r.y=$.y,r.autoPosition=!0),isNaN(r.w)&&(r.w=$.w),isNaN(r.h)&&(r.h=$.h),this.nodeBoundFix(r,a),r}nodeBoundFix(r,a){const v=r._orig||ru.copyPos({},r);if(r.maxW&&(r.w=Math.min(r.w||1,r.maxW)),r.maxH&&(r.h=Math.min(r.h||1,r.maxH)),r.minW&&(r.w=Math.max(r.w||1,r.minW)),r.minH&&(r.h=Math.max(r.h||1,r.minH)),(r.x||0)+(r.w||1)>this.column&&this.column<this.defaultColumn&&!this._inColumnResize&&!this.skipCacheUpdate&&r._id!=null&&this.findCacheLayout(r,this.defaultColumn)===-1){const $={...r};$.autoPosition||$.x===void 0?(delete $.x,delete $.y):$.x=Math.min(this.defaultColumn-1,$.x),$.w=Math.min(this.defaultColumn,$.w||1),this.cacheOneLayout($,this.defaultColumn)}return r.w>this.column?r.w=this.column:r.w<1&&(r.w=1),this.maxRow&&r.h>this.maxRow?r.h=this.maxRow:r.h<1&&(r.h=1),r.x<0&&(r.x=0),r.y<0&&(r.y=0),r.x+r.w>this.column&&(a?r.w=this.column-r.x:r.x=this.column-r.w),this.maxRow&&r.y+r.h>this.maxRow&&(a?r.h=this.maxRow-r.y:r.y=this.maxRow-r.h),ru.samePos(r,v)||(r._dirty=!0),this}getDirtyNodes(r){return r?this.nodes.filter(a=>a._dirty&&!ru.samePos(a,a._orig)):this.nodes.filter(a=>a._dirty)}_notify(r){if(this.batchMode||!this.onChange)return this;const a=(r||[]).concat(this.getDirtyNodes());return this.onChange(a),this}cleanNodes(){return this.batchMode?this:(this.nodes.forEach(r=>{delete r._dirty,delete r._lastTried}),this)}saveInitial(){return this.nodes.forEach(r=>{r._orig=ru.copyPos({},r),delete r._dirty}),this._hasLocked=this.nodes.some(r=>r.locked),this}restoreInitial(){return this.nodes.forEach(r=>{!r._orig||ru.samePos(r,r._orig)||(ru.copyPos(r,r._orig),r._dirty=!0)}),this._notify(),this}findEmptyPosition(r,a=this.nodes,v=this.column,$){const h=$?$.y*v+($.x+$.w):0;let u=!1;for(let i=h;!u;++i){const p=i%v,l=Math.floor(i/v);if(p+r.w>v)continue;const n={x:p,y:l,w:r.w,h:r.h};a.find(k=>ru.isIntercepted(n,k))||((r.x!==p||r.y!==l)&&(r._dirty=!0),r.x=p,r.y=l,delete r.autoPosition,u=!0)}return u}addNode(r,a=!1,v){const $=this.nodes.find(u=>u._id===r._id);if($)return $;this._inColumnResize?this.nodeBoundFix(r):this.prepareNode(r),delete r._temporaryRemoved,delete r._removeDOM;let h;return r.autoPosition&&this.findEmptyPosition(r,this.nodes,this.column,v)&&(delete r.autoPosition,h=!0),this.nodes.push(r),a&&this.addedNodes.push(r),h||this._fixCollisions(r),this.batchMode||this._packNodes()._notify(),r}removeNode(r,a=!0,v=!1){return this.nodes.find($=>$._id===r._id)?(v&&this.removedNodes.push(r),a&&(r._removeDOM=!0),this.nodes=this.nodes.filter($=>$._id!==r._id),r._isAboutToRemove||this._packNodes(),this._notify([r]),this):this}removeAll(r=!0,a=!0){if(delete this._layouts,!this.nodes.length)return this;r&&this.nodes.forEach($=>$._removeDOM=!0);const v=this.nodes;return this.removedNodes=a?v:[],this.nodes=[],this._notify(v)}moveNodeCheck(r,a){if(!this.changedPosConstrain(r,a))return!1;if(a.pack=!0,!this.maxRow)return this.moveNode(r,a);let v;const $=new P4({column:this.column,float:this.float,nodes:this.nodes.map(u=>u._id===r._id?(v={...u},v):{...u})});if(!v)return!1;const h=$.moveNode(v,a)&&$.getRow()<=Math.max(this.getRow(),this.maxRow);if(!h&&!a.resizing&&a.collide){const u=a.collide.el.gridstackNode;if(this.swap(r,u))return this._notify(),!0}return h?($.nodes.filter(u=>u._dirty).forEach(u=>{const i=this.nodes.find(p=>p._id===u._id);i&&(ru.copyPos(i,u),i._dirty=!0)}),this._notify(),!0):!1}willItFit(r){if(delete r._willFitPos,!this.maxRow)return!0;const a=new P4({column:this.column,float:this.float,nodes:this.nodes.map($=>({...$}))}),v={...r};return this.cleanupNode(v),delete v.el,delete v._id,delete v.content,delete v.grid,a.addNode(v),a.getRow()<=this.maxRow?(r._willFitPos=ru.copyPos({},v),!0):!1}changedPosConstrain(r,a){return a.w=a.w||r.w,a.h=a.h||r.h,r.x!==a.x||r.y!==a.y?!0:(r.maxW&&(a.w=Math.min(a.w,r.maxW)),r.maxH&&(a.h=Math.min(a.h,r.maxH)),r.minW&&(a.w=Math.max(a.w,r.minW)),r.minH&&(a.h=Math.max(a.h,r.minH)),r.w!==a.w||r.h!==a.h)}moveNode(r,a){var v,$;if(!r||!a)return!1;let h;a.pack===void 0&&!this.batchMode&&(h=a.pack=!0),typeof a.x!="number"&&(a.x=r.x),typeof a.y!="number"&&(a.y=r.y),typeof a.w!="number"&&(a.w=r.w),typeof a.h!="number"&&(a.h=r.h);const u=r.w!==a.w||r.h!==a.h,i=ru.copyPos({},r,!0);if(ru.copyPos(i,a),this.nodeBoundFix(i,u),ru.copyPos(a,i),!a.forceCollide&&ru.samePos(r,a))return!1;const p=ru.copyPos({},r),l=this.collideAll(r,i,a.skip);let n=!0;if(l.length){const k=r._moving&&!a.nested;let T=k?this.directionCollideCoverage(r,a,l):l[0];if(k&&T&&($=(v=r.grid)==null?void 0:v.opts)!=null&&$.subGridDynamic&&!r.grid._isTemp){const x=ru.areaIntercept(a.rect,T._rect),d=ru.area(a.rect),o=ru.area(T._rect);x/(d<o?d:o)>.8&&(T.grid.makeSubGrid(T.el,void 0,r),T=void 0)}T?n=!this._fixCollisions(r,i,T,a):(n=!1,h&&delete a.pack)}return n&&!ru.samePos(r,i)&&(r._dirty=!0,ru.copyPos(r,i)),a.pack&&this._packNodes()._notify(),!ru.samePos(r,p)}getRow(){return this.nodes.reduce((r,a)=>Math.max(r,a.y+a.h),0)}beginUpdate(r){return r._updating||(r._updating=!0,delete r._skipDown,this.batchMode||this.saveInitial()),this}endUpdate(){const r=this.nodes.find(a=>a._updating);return r&&(delete r._updating,delete r._skipDown),this}save(r=!0,a,v){var $;const h=(($=this._layouts)==null?void 0:$.length)||0;let u;h&&(v?v!==this.column&&(u=this._layouts[v]):this.column!==h-1&&(u=this._layouts[h-1]));const i=[];return this.sortNodes(),this.nodes.forEach(p=>{const l=u==null?void 0:u.find(k=>k._id===p._id),n={...p,...l||{}};ru.removeInternalForSave(n,!r),a&&a(p,n),i.push(n)}),i}layoutsNodesChange(r){return!this._layouts||this._inColumnResize?this:(this._layouts.forEach((a,v)=>{if(!a||v===this.column)return this;if(v<this.column)this._layouts[v]=void 0;else{const $=v/this.column;r.forEach(h=>{if(!h._orig)return;const u=a.find(i=>i._id===h._id);u&&(u.y>=0&&h.y!==h._orig.y&&(u.y+=h.y-h._orig.y),h.x!==h._orig.x&&(u.x=Math.round(h.x*$)),h.w!==h._orig.w&&(u.w=Math.round(h.w*$)))})}}),this)}columnChanged(r,a,v="moveScale"){var $;if(!this.nodes.length||!a||r===a)return this;const h=v==="compact"||v==="list";h&&this.sortNodes(1),a<r&&this.cacheLayout(this.nodes,r),this.batchUpdate();let u=[],i=h?this.nodes:ru.sort(this.nodes,-1);if(a>r&&this._layouts){const p=this._layouts[a]||[],l=this._layouts.length-1;!p.length&&r!==l&&($=this._layouts[l])!=null&&$.length&&(r=l,this._layouts[l].forEach(n=>{const k=i.find(T=>T._id===n._id);k&&(!h&&!n.autoPosition&&(k.x=n.x??k.x,k.y=n.y??k.y),k.w=n.w??k.w,(n.x==null||n.y===void 0)&&(k.autoPosition=!0))})),p.forEach(n=>{const k=i.findIndex(T=>T._id===n._id);if(k!==-1){const T=i[k];if(h){T.w=n.w;return}(n.autoPosition||isNaN(n.x)||isNaN(n.y))&&this.findEmptyPosition(n,u),n.autoPosition||(T.x=n.x??T.x,T.y=n.y??T.y,T.w=n.w??T.w,u.push(T)),i.splice(k,1)}})}if(h)this.compact(v,!1);else{if(i.length)if(typeof v=="function")v(a,r,u,i);else{const p=h||v==="none"?1:a/r,l=v==="move"||v==="moveScale",n=v==="scale"||v==="moveScale";i.forEach(k=>{k.x=a===1?0:l?Math.round(k.x*p):Math.min(k.x,a-1),k.w=a===1||r===1?1:n?Math.round(k.w*p)||1:Math.min(k.w,a),u.push(k)}),i=[]}u=ru.sort(u,-1),this._inColumnResize=!0,this.nodes=[],u.forEach(p=>{this.addNode(p,!1),delete p._orig})}return this.nodes.forEach(p=>delete p._orig),this.batchUpdate(!1,!h),delete this._inColumnResize,this}cacheLayout(r,a,v=!1){const $=[];return r.forEach((h,u)=>{if(h._id===void 0){const i=h.id?this.nodes.find(p=>p.id===h.id):void 0;h._id=(i==null?void 0:i._id)??P4._idSeq++}$[u]={x:h.x,y:h.y,w:h.w,_id:h._id}}),this._layouts=v?[]:this._layouts||[],this._layouts[a]=$,this}cacheOneLayout(r,a){r._id=r._id??P4._idSeq++;const v={x:r.x,y:r.y,w:r.w,_id:r._id};(r.autoPosition||r.x===void 0)&&(delete v.x,delete v.y,r.autoPosition&&(v.autoPosition=!0)),this._layouts=this._layouts||[],this._layouts[a]=this._layouts[a]||[];const $=this.findCacheLayout(r,a);return $===-1?this._layouts[a].push(v):this._layouts[a][$]=v,this}findCacheLayout(r,a){var v,$;return(($=(v=this._layouts)==null?void 0:v[a])==null?void 0:$.findIndex(h=>h._id===r._id))??-1}removeNodeFromLayoutCache(r){if(this._layouts)for(let a=0;a<this._layouts.length;a++){const v=this.findCacheLayout(r,a);v!==-1&&this._layouts[a].splice(v,1)}}cleanupNode(r){for(const a in r)a[0]==="_"&&a!=="_id"&&delete r[a];return this}}P4._idSeq=0;const T3={alwaysShowResizeHandle:"mobile",animate:!0,auto:!0,cellHeight:"auto",cellHeightThrottle:100,cellHeightUnit:"px",column:12,draggable:{handle:".grid-stack-item-content",appendTo:"body",scroll:!0},handle:".grid-stack-item-content",itemClass:"grid-stack-item",margin:10,marginUnit:"px",maxRow:0,minRow:0,placeholderClass:"grid-stack-placeholder",placeholderText:"",removableOptions:{accept:"grid-stack-item",decline:"grid-stack-non-removable"},resizable:{handles:"se"},rtl:"auto"};class Nf{}const Xw=typeof window<"u"&&typeof document<"u"&&("ontouchstart"in document||"ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0);class R5{}function vN(e,r){e.touches.length>1||(e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e.changedTouches[0],r))}function AZ(e,r){e.cancelable&&e.preventDefault(),ru.simulateMouseEvent(e,r)}function bN(e){R5.touchHandled||(R5.touchHandled=!0,vN(e,"mousedown"))}function xN(e){R5.touchHandled&&vN(e,"mousemove")}function _N(e){if(!R5.touchHandled)return;R5.pointerLeaveTimeout&&(window.clearTimeout(R5.pointerLeaveTimeout),delete R5.pointerLeaveTimeout);const r=!!Nf.dragElement;vN(e,"mouseup"),r||vN(e,"click"),R5.touchHandled=!1}function wN(e){e.pointerType!=="mouse"&&e.target.releasePointerCapture(e.pointerId)}function RZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&AZ(e,"mouseenter")}function UZ(e){Nf.dragElement&&e.pointerType!=="mouse"&&(R5.pointerLeaveTimeout=window.setTimeout(()=>{delete R5.pointerLeaveTimeout,AZ(e,"mouseleave")},10))}class TN{constructor(r,a,v){this.host=r,this.dir=a,this.option=v,this.moving=!1,this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this._init()}_init(){const r=this.el=document.createElement("div");return r.classList.add("ui-resizable-handle"),r.classList.add(`${TN.prefix}${this.dir}`),r.style.zIndex="100",r.style.userSelect="none",this.host.appendChild(this.el),this.el.addEventListener("mousedown",this._mouseDown),Xw&&(this.el.addEventListener("touchstart",bN),this.el.addEventListener("pointerdown",wN)),this}destroy(){return this.moving&&this._mouseUp(this.mouseDownEvent),this.el.removeEventListener("mousedown",this._mouseDown),Xw&&(this.el.removeEventListener("touchstart",bN),this.el.removeEventListener("pointerdown",wN)),this.host.removeChild(this.el),delete this.el,delete this.host,this}_mouseDown(r){this.mouseDownEvent=r,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.addEventListener("touchmove",xN),this.el.addEventListener("touchend",_N)),r.stopPropagation(),r.preventDefault()}_mouseMove(r){const a=this.mouseDownEvent;this.moving?this._triggerEvent("move",r):Math.abs(r.x-a.x)+Math.abs(r.y-a.y)>2&&(this.moving=!0,this._triggerEvent("start",this.mouseDownEvent),this._triggerEvent("move",r),document.addEventListener("keydown",this._keyEvent)),r.stopPropagation()}_mouseUp(r){this.moving&&(this._triggerEvent("stop",r),document.removeEventListener("keydown",this._keyEvent)),document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&(this.el.removeEventListener("touchmove",xN),this.el.removeEventListener("touchend",_N)),delete this.moving,delete this.mouseDownEvent,r.stopPropagation(),r.preventDefault()}_keyEvent(r){var a,v;r.key==="Escape"&&((v=(a=this.host.gridstackNode)==null?void 0:a.grid)==null||v.engine.restoreInitial(),this._mouseUp(this.mouseDownEvent))}_triggerEvent(r,a){return this.option[r]&&this.option[r](a),this}}TN.prefix="ui-resizable-";class aA{constructor(){this._eventRegister={}}get disabled(){return this._disabled}on(r,a){this._eventRegister[r]=a}off(r){delete this._eventRegister[r]}enable(){this._disabled=!1}disable(){this._disabled=!0}destroy(){delete this._eventRegister}triggerEvent(r,a){if(!this.disabled&&this._eventRegister&&this._eventRegister[r])return this._eventRegister[r](a)}}class l9 extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this.rectScale={x:1,y:1},this._ui=()=>{const v=this.el.parentElement.getBoundingClientRect(),$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=this.temporalRect||$;return{position:{left:(h.left-v.left)*this.rectScale.x,top:(h.top-v.top)*this.rectScale.y},size:{width:h.width*this.rectScale.x,height:h.height*this.rectScale.y}}},this._mouseOver=this._mouseOver.bind(this),this._mouseOut=this._mouseOut.bind(this),this.enable(),this._setupAutoHide(this.option.autoHide),this._setupHandlers()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){super.enable(),this.el.classList.remove("ui-resizable-disabled"),this._setupAutoHide(this.option.autoHide)}disable(){super.disable(),this.el.classList.add("ui-resizable-disabled"),this._setupAutoHide(!1)}destroy(){this._removeHandlers(),this._setupAutoHide(!1),delete this.el,super.destroy()}updateOption(r){const a=r.handles&&r.handles!==this.option.handles,v=r.autoHide&&r.autoHide!==this.option.autoHide;return Object.keys(r).forEach($=>this.option[$]=r[$]),a&&(this._removeHandlers(),this._setupHandlers()),v&&this._setupAutoHide(this.option.autoHide),this}_setupAutoHide(r){return r?(this.el.classList.add("ui-resizable-autohide"),this.el.addEventListener("mouseover",this._mouseOver),this.el.addEventListener("mouseout",this._mouseOut)):(this.el.classList.remove("ui-resizable-autohide"),this.el.removeEventListener("mouseover",this._mouseOver),this.el.removeEventListener("mouseout",this._mouseOut),Nf.overResizeElement===this&&delete Nf.overResizeElement),this}_mouseOver(r){Nf.overResizeElement||Nf.dragElement||(Nf.overResizeElement=this,this.el.classList.remove("ui-resizable-autohide"))}_mouseOut(r){Nf.overResizeElement===this&&(delete Nf.overResizeElement,this.el.classList.add("ui-resizable-autohide"))}_setupHandlers(){return this.handlers=this.option.handles.split(",").map(r=>r.trim()).map(r=>new TN(this.el,r,{start:a=>{this._resizeStart(a)},stop:a=>{this._resizeStop(a)},move:a=>{this._resizing(a,r)}})),this}_resizeStart(r){this.sizeToContent=ru.shouldSizeToContent(this.el.gridstackNode,!0),this.originalRect=this.el.getBoundingClientRect(),this.scrollEl=ru.getScrollElement(this.el),this.scrollY=this.scrollEl.scrollTop,this.scrolled=0,this.startEvent=r,this._setupHelper(),this._applyChange();const a=ru.initEvent(r,{type:"resizestart",target:this.el});return this.option.start&&this.option.start(a,this._ui()),this.el.classList.add("ui-resizable-resizing"),this.triggerEvent("resizestart",a),this}_resizing(r,a){this.scrolled=this.scrollEl.scrollTop-this.scrollY,this.temporalRect=this._getChange(r,a),this._applyChange();const v=ru.initEvent(r,{type:"resize",target:this.el});return this.option.resize&&this.option.resize(v,this._ui()),this.triggerEvent("resize",v),this}_resizeStop(r){const a=ru.initEvent(r,{type:"resizestop",target:this.el});return this._cleanHelper(),this.option.stop&&this.option.stop(a),this.el.classList.remove("ui-resizable-resizing"),this.triggerEvent("resizestop",a),delete this.startEvent,delete this.originalRect,delete this.temporalRect,delete this.scrollY,delete this.scrolled,this}_setupHelper(){this.elOriginStyleVal=l9._originStyleProp.map(v=>this.el.style[v]),this.parentOriginStylePosition=this.el.parentElement.style.position;const r=this.el.parentElement,a=ru.getValuesFromTransformedElement(r);return this.rectScale={x:a.xScale,y:a.yScale},getComputedStyle(this.el.parentElement).position.match(/static/)&&(this.el.parentElement.style.position="relative"),this.el.style.position="absolute",this.el.style.opacity="0.8",this}_cleanHelper(){return l9._originStyleProp.forEach((r,a)=>{this.el.style[r]=this.elOriginStyleVal[a]||null}),this.el.parentElement.style.position=this.parentOriginStylePosition||null,this}_getChange(r,a){const v=this.startEvent,$={width:this.originalRect.width,height:this.originalRect.height+this.scrolled,left:this.originalRect.left,top:this.originalRect.top-this.scrolled},h=r.clientX-v.clientX,u=this.sizeToContent?0:r.clientY-v.clientY;let i,p;a.indexOf("e")>-1?$.width+=h:a.indexOf("w")>-1&&($.width-=h,$.left+=h,i=!0),a.indexOf("s")>-1?$.height+=u:a.indexOf("n")>-1&&($.height-=u,$.top+=u,p=!0);const l=this._constrainSize($.width,$.height,i,p);return Math.round($.width)!==Math.round(l.width)&&(a.indexOf("w")>-1&&($.left+=$.width-l.width),$.width=l.width),Math.round($.height)!==Math.round(l.height)&&(a.indexOf("n")>-1&&($.top+=$.height-l.height),$.height=l.height),$}_constrainSize(r,a,v,$){const h=this.option,u=(v?h.maxWidthMoveLeft:h.maxWidth)||Number.MAX_SAFE_INTEGER,i=h.minWidth/this.rectScale.x||r,p=($?h.maxHeightMoveUp:h.maxHeight)||Number.MAX_SAFE_INTEGER,l=h.minHeight/this.rectScale.y||a,n=Math.min(u,Math.max(i,r)),k=Math.min(p,Math.max(l,a));return{width:n,height:k}}_applyChange(){let r={left:0,top:0,width:0,height:0};if(this.el.style.position==="absolute"){const a=this.el.parentElement,{left:v,top:$}=a.getBoundingClientRect();r={left:v,top:$,width:0,height:0}}return this.temporalRect?(Object.keys(this.temporalRect).forEach(a=>{const v=this.temporalRect[a],$=a==="width"||a==="left"?this.rectScale.x:a==="height"||a==="top"?this.rectScale.y:1;this.el.style[a]=(v-r[a])*$+"px"}),this):this}_removeHandlers(){return this.handlers.forEach(r=>r.destroy()),delete this.handlers,this}}l9._originStyleProp=["width","height","position","left","top","opacity","zIndex"];const aHe='input,textarea,button,select,option,[contenteditable="true"],.ui-resizable-handle';class c9 extends aA{constructor(r,a={}){var v;super(),this.el=r,this.option=a,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0};const $=(v=a==null?void 0:a.handle)==null?void 0:v.substring(1),h=r.gridstackNode;this.dragEls=!$||r.classList.contains($)?[r]:h!=null&&h.subGrid?[r.querySelector(a.handle)||r]:Array.from(r.querySelectorAll(a.handle)),this.dragEls.length===0&&(this.dragEls=[r]),this._mouseDown=this._mouseDown.bind(this),this._mouseMove=this._mouseMove.bind(this),this._mouseUp=this._mouseUp.bind(this),this._keyEvent=this._keyEvent.bind(this),this.enable()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.dragEls.forEach(r=>{r.addEventListener("mousedown",this._mouseDown),Xw&&(r.addEventListener("touchstart",bN),r.addEventListener("pointerdown",wN))}),this.el.classList.remove("ui-draggable-disabled"))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.dragEls.forEach(a=>{a.removeEventListener("mousedown",this._mouseDown),Xw&&(a.removeEventListener("touchstart",bN),a.removeEventListener("pointerdown",wN))}),r||this.el.classList.add("ui-draggable-disabled"))}destroy(){this.dragTimeout&&window.clearTimeout(this.dragTimeout),delete this.dragTimeout,this.mouseDownEvent&&this._mouseUp(this.mouseDownEvent),this.disable(!0),delete this.el,delete this.helper,delete this.option,super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this}_mouseDown(r){if(!Nf.mouseHandled)return r.button!==0||!this.dragEls.find(a=>a===r.target)&&r.target.closest(aHe)||this.option.cancel&&r.target.closest(this.option.cancel)||(this.mouseDownEvent=r,delete this.dragging,delete Nf.dragElement,delete Nf.dropElement,document.addEventListener("mousemove",this._mouseMove,{capture:!0,passive:!0}),document.addEventListener("mouseup",this._mouseUp,!0),Xw&&(r.currentTarget.addEventListener("touchmove",xN),r.currentTarget.addEventListener("touchend",_N)),r.preventDefault(),document.activeElement&&document.activeElement.blur(),Nf.mouseHandled=!0),!0}_callDrag(r){if(!this.dragging)return;const a=ru.initEvent(r,{target:this.el,type:"drag"});this.option.drag&&this.option.drag(a,this.ui()),this.triggerEvent("drag",a)}_mouseMove(r){var a;const v=this.mouseDownEvent;if(this.lastDrag=r,this.dragging)if(this._dragFollow(r),Nf.pauseDrag){const $=Number.isInteger(Nf.pauseDrag)?Nf.pauseDrag:100;this.dragTimeout&&window.clearTimeout(this.dragTimeout),this.dragTimeout=window.setTimeout(()=>this._callDrag(r),$)}else this._callDrag(r);else if(Math.abs(r.x-v.x)+Math.abs(r.y-v.y)>3){this.dragging=!0,Nf.dragElement=this;const $=(a=this.el.gridstackNode)==null?void 0:a.grid;$?Nf.dropElement=$.el.ddElement.ddDroppable:delete Nf.dropElement,this.helper=this._createHelper(),this._setupHelperContainmentStyle(),this.dragTransform=ru.getValuesFromTransformedElement(this.helperContainment),this.dragOffset=this._getDragOffset(r,this.el,this.helperContainment),this._setupHelperStyle(r);const h=ru.initEvent(r,{target:this.el,type:"dragstart"});this.option.start&&this.option.start(h,this.ui()),this.triggerEvent("dragstart",h),document.addEventListener("keydown",this._keyEvent)}return!0}_mouseUp(r){var a,v;if(document.removeEventListener("mousemove",this._mouseMove,!0),document.removeEventListener("mouseup",this._mouseUp,!0),Xw&&r.currentTarget&&(r.currentTarget.removeEventListener("touchmove",xN,!0),r.currentTarget.removeEventListener("touchend",_N,!0)),this.dragging){delete this.dragging,(a=this.el.gridstackNode)==null||delete a._origRotate,document.removeEventListener("keydown",this._keyEvent),((v=Nf.dropElement)==null?void 0:v.el)===this.el.parentElement&&delete Nf.dropElement,this.helperContainment.style.position=this.parentOriginStylePosition||null,this.helper!==this.el&&this.helper.remove(),this._removeHelperStyle();const $=ru.initEvent(r,{target:this.el,type:"dragstop"});this.option.stop&&this.option.stop($),this.triggerEvent("dragstop",$),Nf.dropElement&&Nf.dropElement.drop(r)}delete this.helper,delete this.mouseDownEvent,delete Nf.dragElement,delete Nf.dropElement,delete Nf.mouseHandled,r.preventDefault()}_keyEvent(r){var a,v;const $=this.el.gridstackNode,h=($==null?void 0:$.grid)||((v=(a=Nf.dropElement)==null?void 0:a.el)==null?void 0:v.gridstack);if(r.key==="Escape")$&&$._origRotate&&($._orig=$._origRotate,delete $._origRotate),h==null||h.cancelDrag(),this._mouseUp(this.mouseDownEvent);else if($&&h&&(r.key==="r"||r.key==="R")){if(!ru.canBeRotated($))return;$._origRotate=$._origRotate||{...$._orig},delete $._moving,h.setAnimation(!1).rotate($.el,{top:-this.dragOffset.offsetTop,left:-this.dragOffset.offsetLeft}).setAnimation(),$._moving=!0,this.dragOffset=this._getDragOffset(this.lastDrag,$.el,this.helperContainment),this.helper.style.width=this.dragOffset.width+"px",this.helper.style.height=this.dragOffset.height+"px",ru.swap($._orig,"w","h"),delete $._rect,this._mouseMove(this.lastDrag)}}_createHelper(){let r=this.el;return typeof this.option.helper=="function"?r=this.option.helper(this.el):this.option.helper==="clone"&&(r=ru.cloneNode(this.el)),r.parentElement||ru.appendTo(r,this.option.appendTo==="parent"?this.el.parentElement:this.option.appendTo),this.dragElementOriginStyle=c9.originStyleProp.map(a=>this.el.style[a]),r}_setupHelperStyle(r){var a,v;this.helper.classList.add("ui-draggable-dragging"),(v=(a=this.el.gridstackNode)==null?void 0:a.grid)==null||v.el.classList.add("grid-stack-dragging");const $=this.helper.style;return $.pointerEvents="none",$.width=this.dragOffset.width+"px",$.height=this.dragOffset.height+"px",$.willChange="left, top",$.position="fixed",this._dragFollow(r),$.transition="none",setTimeout(()=>{this.helper&&($.transition=null)},0),this}_removeHelperStyle(){var r,a,v;this.helper.classList.remove("ui-draggable-dragging"),(a=(r=this.el.gridstackNode)==null?void 0:r.grid)==null||a.el.classList.remove("grid-stack-dragging");const $=(v=this.helper)==null?void 0:v.gridstackNode;if(!($!=null&&$._isAboutToRemove)&&this.dragElementOriginStyle){const h=this.helper,u=this.dragElementOriginStyle.transition||null;h.style.transition=this.dragElementOriginStyle.transition="none",c9.originStyleProp.forEach(i=>h.style[i]=this.dragElementOriginStyle[i]||null),setTimeout(()=>h.style.transition=u,50)}return delete this.dragElementOriginStyle,this}_dragFollow(r){const a={left:0,top:0},v=this.helper.style,$=this.dragOffset;v.left=(r.clientX+$.offsetLeft-a.left)*this.dragTransform.xScale+"px",v.top=(r.clientY+$.offsetTop-a.top)*this.dragTransform.yScale+"px"}_setupHelperContainmentStyle(){return this.helperContainment=this.helper.parentElement,this.helper.style.position!=="fixed"&&(this.parentOriginStylePosition=this.helperContainment.style.position,getComputedStyle(this.helperContainment).position.match(/static/)&&(this.helperContainment.style.position="relative")),this}_getDragOffset(r,a,v){let $=0,h=0;v&&($=this.dragTransform.xOffset,h=this.dragTransform.yOffset);const u=a.getBoundingClientRect();return{left:u.left,top:u.top,offsetLeft:-r.clientX+u.left-$,offsetTop:-r.clientY+u.top-h,width:u.width*this.dragTransform.xScale,height:u.height*this.dragTransform.yScale}}ui(){const r=this.el.parentElement.getBoundingClientRect(),a=this.helper.getBoundingClientRect();return{position:{top:(a.top-r.top)*this.dragTransform.yScale,left:(a.left-r.left)*this.dragTransform.xScale}}}}c9.originStyleProp=["width","height","transform","transform-origin","transition","pointerEvents","position","left","top","minWidth","willChange"];class nHe extends aA{constructor(r,a={}){super(),this.el=r,this.option=a,this._mouseEnter=this._mouseEnter.bind(this),this._mouseLeave=this._mouseLeave.bind(this),this.enable(),this._setupAccept()}on(r,a){super.on(r,a)}off(r){super.off(r)}enable(){this.disabled!==!1&&(super.enable(),this.el.classList.add("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),this.el.addEventListener("mouseenter",this._mouseEnter),this.el.addEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.addEventListener("pointerenter",RZ),this.el.addEventListener("pointerleave",UZ)))}disable(r=!1){this.disabled!==!0&&(super.disable(),this.el.classList.remove("ui-droppable"),r||this.el.classList.add("ui-droppable-disabled"),this.el.removeEventListener("mouseenter",this._mouseEnter),this.el.removeEventListener("mouseleave",this._mouseLeave),Xw&&(this.el.removeEventListener("pointerenter",RZ),this.el.removeEventListener("pointerleave",UZ)))}destroy(){this.disable(!0),this.el.classList.remove("ui-droppable"),this.el.classList.remove("ui-droppable-disabled"),super.destroy()}updateOption(r){return Object.keys(r).forEach(a=>this.option[a]=r[a]),this._setupAccept(),this}_mouseEnter(r){if(!Nf.dragElement||!this._canDrop(Nf.dragElement.el))return;r.preventDefault(),r.stopPropagation(),Nf.dropElement&&Nf.dropElement!==this&&Nf.dropElement._mouseLeave(r,!0),Nf.dropElement=this;const a=ru.initEvent(r,{target:this.el,type:"dropover"});this.option.over&&this.option.over(a,this._ui(Nf.dragElement)),this.triggerEvent("dropover",a),this.el.classList.add("ui-droppable-over")}_mouseLeave(r,a=!1){var v;if(!Nf.dragElement||Nf.dropElement!==this)return;r.preventDefault(),r.stopPropagation();const $=ru.initEvent(r,{target:this.el,type:"dropout"});if(this.option.out&&this.option.out($,this._ui(Nf.dragElement)),this.triggerEvent("dropout",$),Nf.dropElement===this&&(delete Nf.dropElement,!a)){let h,u=this.el.parentElement;for(;!h&&u;)h=(v=u.ddElement)==null?void 0:v.ddDroppable,u=u.parentElement;h&&h._mouseEnter(r)}}drop(r){r.preventDefault();const a=ru.initEvent(r,{target:this.el,type:"drop"});this.option.drop&&this.option.drop(a,this._ui(Nf.dragElement)),this.triggerEvent("drop",a)}_canDrop(r){return r&&(!this.accept||this.accept(r))}_setupAccept(){return this.option.accept?(typeof this.option.accept=="string"?this.accept=r=>r.classList.contains(this.option.accept)||r.matches(this.option.accept):this.accept=this.option.accept,this):this}_ui(r){return{draggable:r.el,...r.ui()}}}class nA{static init(r){return r.ddElement||(r.ddElement=new nA(r)),r.ddElement}constructor(r){this.el=r}on(r,a){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.on(r,a):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.on(r,a):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.on(r,a),this}off(r){return this.ddDraggable&&["drag","dragstart","dragstop"].indexOf(r)>-1?this.ddDraggable.off(r):this.ddDroppable&&["drop","dropover","dropout"].indexOf(r)>-1?this.ddDroppable.off(r):this.ddResizable&&["resizestart","resize","resizestop"].indexOf(r)>-1&&this.ddResizable.off(r),this}setupDraggable(r){return this.ddDraggable?this.ddDraggable.updateOption(r):this.ddDraggable=new c9(this.el,r),this}cleanDraggable(){return this.ddDraggable&&(this.ddDraggable.destroy(),delete this.ddDraggable),this}setupResizable(r){return this.ddResizable?this.ddResizable.updateOption(r):this.ddResizable=new l9(this.el,r),this}cleanResizable(){return this.ddResizable&&(this.ddResizable.destroy(),delete this.ddResizable),this}setupDroppable(r){return this.ddDroppable?this.ddDroppable.updateOption(r):this.ddDroppable=new nHe(this.el,r),this}cleanDroppable(){return this.ddDroppable&&(this.ddDroppable.destroy(),delete this.ddDroppable),this}}class iHe{resizable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddResizable&&h.ddResizable[a]();else if(a==="destroy")h.ddResizable&&h.cleanResizable();else if(a==="option")h.setupResizable({[v]:$});else{const u=h.el.gridstackNode.grid;let i=h.el.getAttribute("gs-resize-handles")||u.opts.resizable.handles||"e,s,se";i==="all"&&(i="n,e,s,w,se,sw,ne,nw");const p=!u.opts.alwaysShowResizeHandle;h.setupResizable({...u.opts.resizable,handles:i,autoHide:p,start:a.start,stop:a.stop,resize:a.resize})}}),this}draggable(r,a,v,$){return this._getDDElements(r,a).forEach(h=>{if(a==="disable"||a==="enable")h.ddDraggable&&h.ddDraggable[a]();else if(a==="destroy")h.ddDraggable&&h.cleanDraggable();else if(a==="option")h.setupDraggable({[v]:$});else{const u=h.el.gridstackNode.grid;h.setupDraggable({...u.opts.draggable,start:a.start,stop:a.stop,drag:a.drag})}}),this}dragIn(r,a){return this._getDDElements(r).forEach(v=>v.setupDraggable(a)),this}droppable(r,a,v,$){return typeof a.accept=="function"&&!a._accept&&(a._accept=a.accept,a.accept=h=>a._accept(h)),this._getDDElements(r,a).forEach(h=>{a==="disable"||a==="enable"?h.ddDroppable&&h.ddDroppable[a]():a==="destroy"?h.ddDroppable&&h.cleanDroppable():a==="option"?h.setupDroppable({[v]:$}):h.setupDroppable(a)}),this}isDroppable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDroppable&&!r.ddElement.ddDroppable.disabled)}isDraggable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddDraggable&&!r.ddElement.ddDraggable.disabled)}isResizable(r){var a;return!!((a=r==null?void 0:r.ddElement)!=null&&a.ddResizable&&!r.ddElement.ddResizable.disabled)}on(r,a,v){return this._getDDElements(r).forEach($=>$.on(a,h=>{v(h,Nf.dragElement?Nf.dragElement.el:h.target,Nf.dragElement?Nf.dragElement.helper:null)})),this}off(r,a){return this._getDDElements(r).forEach(v=>v.off(a)),this}_getDDElements(r,a){const v=r.gridstack||a!=="destroy"&&a!=="disable",$=ru.getElements(r);return $.length?$.map(h=>h.ddElement||(v?nA.init(h):null)).filter(h=>h):[]}}/*!
|
|
7986
7986
|
* GridStack 12.3.2
|
|
7987
7987
|
* https://gridstackjs.com/
|
|
7988
7988
|
*
|
|
@@ -7990,7 +7990,7 @@ uniform ${gi} ${vi} u_${$i};
|
|
|
7990
7990
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
7991
7991
|
*/const u_=new iHe;class Rh{static init(r={},a=".grid-stack"){if(typeof document>"u")return null;const v=Rh.getGridElement(a);return v?(v.gridstack||(v.gridstack=new Rh(v,ru.cloneDeep(r))),v.gridstack):(console.error(typeof a=="string"?'GridStack.initAll() no grid was found with selector "'+a+`" - element missing or wrong selector ?
|
|
7992
7992
|
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`:"GridStack.init() no grid element was passed."),null)}static initAll(r={},a=".grid-stack"){const v=[];return typeof document>"u"||(Rh.getGridElements(a).forEach($=>{$.gridstack||($.gridstack=new Rh($,ru.cloneDeep(r))),v.push($.gridstack)}),v.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+a+`" - element missing or wrong selector ?
|
|
7993
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),v}static addGrid(r,a={}){if(!r)return null;let v=r;if(v.gridstack){const $=v.gridstack;return a&&($.opts={...$.opts,...a}),a.children!==void 0&&$.load(a.children),$}return(!r.classList.contains("grid-stack")||Rh.addRemoveCB)&&(Rh.addRemoveCB?v=Rh.addRemoveCB(r,a,!0,!0):v=ru.createDiv(["grid-stack",a.class],r)),Rh.init(a,v)}static registerEngine(r){Rh.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=ru.createDiv([this.opts.placeholderClass,T3.itemClass,this.opts.itemClass]);const r=ru.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,a={}){var v;this.el=r,this.opts=a,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},r.gridstack=this,this.opts=a=a||{},r.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),a.row&&(a.minRow=a.maxRow=a.row,delete a.row);const $=ru.toNumber(r.getAttribute("gs-row"));a.column==="auto"&&delete a.column,a.alwaysShowResizeHandle!==void 0&&(a._alwaysShowResizeHandle=a.alwaysShowResizeHandle);const h=a.columnOpts;if(h){const n=h.breakpoints;!h.columnWidth&&!(n!=null&&n.length)?delete a.columnOpts:(h.columnMax=h.columnMax||12,(n==null?void 0:n.length)>1&&n.sort((k,T)=>(T.w||0)-(k.w||0)))}const u={...ru.cloneDeep(T3),column:ru.toNumber(r.getAttribute("gs-column"))||T3.column,minRow:$||ru.toNumber(r.getAttribute("gs-min-row"))||T3.minRow,maxRow:$||ru.toNumber(r.getAttribute("gs-max-row"))||T3.maxRow,staticGrid:ru.toBool(r.getAttribute("gs-static"))||T3.staticGrid,sizeToContent:ru.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(a.handleClass?"."+a.handleClass:a.handle?a.handle:"")||T3.draggable.handle},removableOptions:{accept:a.itemClass||T3.removableOptions.accept,decline:T3.removableOptions.decline}};r.getAttribute("gs-animate")&&(u.animate=ru.toBool(r.getAttribute("gs-animate"))),a=ru.defaults(a,u),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(a),a.rtl==="auto"&&(a.rtl=r.style.direction==="rtl"),a.rtl&&this.el.classList.add("grid-stack-rtl");const i=this.el.closest("."+T3.itemClass),p=i==null?void 0:i.gridstackNode;if(p&&(p.subGrid=this,this.parentGridNode=p,this.el.classList.add("grid-stack-nested"),p.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=a.cellHeight==="auto",this._isAutoCellHeight||a.cellHeight==="initial")this.cellHeight(void 0);else{typeof a.cellHeight=="number"&&a.cellHeightUnit&&a.cellHeightUnit!==T3.cellHeightUnit&&(a.cellHeight=a.cellHeight+a.cellHeightUnit,delete a.cellHeightUnit);const n=a.cellHeight;delete a.cellHeight,this.cellHeight(n)}a.alwaysShowResizeHandle==="mobile"&&(a.alwaysShowResizeHandle=Xw),this._setStaticClass();const l=a.engineClass||Rh.engineClass||P4;if(this.engine=new l({column:this.getColumn(),float:a.float,maxRow:a.maxRow,onChange:n=>{n.forEach(k=>{const T=k.el;T&&(k._removeDOM?(T&&T.remove(),delete k._removeDOM):this._writePosAttr(T,k))}),this._updateContainerHeight()}}),a.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(n=>this._prepareElement(n)),delete this.engine._loading,this.batchUpdate(!1)),a.children){const n=a.children;delete a.children,n.length&&this.load(n)}this.setAnimation(),a.subGridDynamic&&!Nf.pauseDrag&&(Nf.pauseDrag=!0),((v=a.draggable)==null?void 0:v.pause)!==void 0&&(Nf.pauseDrag=a.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(r=this.opts){this.el.classList.add("gs-"+r.column),typeof r.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/r.column}%`)}addWidget(r){if(!r)return;if(typeof r=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(r.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(r);let a,v=r;if(v.grid=this,v.el?a=v.el:Rh.addRemoveCB?a=Rh.addRemoveCB(this.el,r,!0,!1):a=this.createWidgetDivs(v),!a)return;if(v=a.gridstackNode,v&&a.parentElement===this.el&&this.engine.nodes.find(h=>h._id===v._id))return a;const $=this._readAttr(a);return ru.defaults(r,$),this.engine.prepareNode(r),this.el.appendChild(a),this.makeWidget(a,r),a}createWidgetDivs(r){const a=ru.createDiv(["grid-stack-item",this.opts.itemClass]),v=ru.createDiv(["grid-stack-item-content"],a);return ru.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([$])=>{var h,u;$.isIntersecting&&((h=r.visibleObservable)==null||h.disconnect(),delete r.visibleObservable,Rh.renderCB(v,r),(u=r.grid)==null||u.prepareDragDrop(r.el))}),window.setTimeout(()=>{var $;return($=r.visibleObservable)==null?void 0:$.observe(a)})):Rh.renderCB(v,r),a}makeSubGrid(r,a,v,$=!0){var h,u,i;let p=r.gridstackNode;if(p||(p=this.makeWidget(r).gridstackNode),(h=p.subGrid)!=null&&h.el)return p.subGrid;let l,n=this;for(;n&&!l;)l=(u=n.opts)==null?void 0:u.subGridOpts,n=(i=n.parentGridNode)==null?void 0:i.grid;a=ru.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...a||p.subGridOpts||{}}),p.subGridOpts=a;let k;a.column==="auto"&&(k=!0,a.column=Math.max(p.w||1,(v==null?void 0:v.w)||1),delete a.columnOpts);let T=p.el.querySelector(".grid-stack-item-content"),x,d;if($&&(this._removeDD(p.el),d={...p,x:0,y:0},ru.removeInternalForSave(d),delete d.subGridOpts,p.content&&(d.content=p.content,delete p.content),Rh.addRemoveCB?x=Rh.addRemoveCB(this.el,d,!0,!1):(x=ru.createDiv(["grid-stack-item"]),x.appendChild(T),T=ru.createDiv(["grid-stack-item-content"],p.el)),this.prepareDragDrop(p.el)),v){const c=k?a.column:p.w,s=p.h+v.h,f=p.el.style;f.transition="none",this.update(p.el,{w:c,h:s}),setTimeout(()=>f.transition=null)}const o=p.subGrid=Rh.addGrid(T,a);return v!=null&&v._moving&&(o._isTemp=!0),k&&(o._autoColumn=!0),$&&o.makeWidget(x,d),v&&(v._moving?window.setTimeout(()=>ru.simulateMouseEvent(v._event,"mouseenter",o.el),0):o.makeWidget(p.el,p)),this.resizeToContentCheck(!1,p),o}removeAsSubGrid(r){var a;const v=(a=this.parentGridNode)==null?void 0:a.grid;v&&(v.batchUpdate(),v.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach($=>{$.x+=this.parentGridNode.x,$.y+=this.parentGridNode.y,v.makeWidget($.el,$)}),v.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>ru.simulateMouseEvent(r._event,"mouseenter",v.el),0))}save(r=!0,a=!1,v=Rh.saveCB,$){const h=this.engine.save(r,v,$);if(h.forEach(u=>{var i;if(r&&u.el&&!u.subGrid&&!v){const p=u.el.querySelector(".grid-stack-item-content");u.content=p==null?void 0:p.innerHTML,u.content||delete u.content}else if(!r&&!v&&delete u.content,(i=u.subGrid)!=null&&i.el){const p=u.w||u.subGrid.getColumn(),l=u.subGrid.save(r,a,v,p);u.subGridOpts=a?l:{children:l},delete u.subGrid}delete u.el}),a){const u=ru.cloneDeep(this.opts);u.marginBottom===u.marginTop&&u.marginRight===u.marginLeft&&u.marginTop===u.marginRight&&(u.margin=u.marginTop,delete u.marginTop,delete u.marginRight,delete u.marginBottom,delete u.marginLeft),u.rtl===(this.el.style.direction==="rtl")&&(u.rtl="auto"),this._isAutoCellHeight&&(u.cellHeight="auto"),this._autoColumn&&(u.column="auto");const i=u._alwaysShowResizeHandle;return delete u._alwaysShowResizeHandle,i!==void 0?u.alwaysShowResizeHandle=i:delete u.alwaysShowResizeHandle,ru.removeInternalAndSame(u,T3),u.children=h,u}return h}load(r,a=Rh.addRemoveCB||!0){r=ru.cloneDeep(r);const v=this.getColumn();r.forEach(n=>{n.w=n.w||n.minW||1,n.h=n.h||n.minH||1}),r=ru.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let $=0;r.forEach(n=>{$=Math.max($,(n.x||0)+n.w)}),$>this.engine.defaultColumn&&(this.engine.defaultColumn=$),$>v&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged($,v,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,$,!0));const h=Rh.addRemoveCB;typeof a=="function"&&(Rh.addRemoveCB=a);const u=[];this.batchUpdate();const i=!this.engine.nodes.length,p=i&&this.opts.animate;p&&this.setAnimation(!1),!i&&a&&[...this.engine.nodes].forEach(n=>{n.id&&(ru.find(r,n.id)||(Rh.addRemoveCB&&Rh.addRemoveCB(this.el,n,!1,!1),u.push(n),this.removeWidget(n.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(n=>ru.find(r,n.id)?(l.push(n),!1):!0),r.forEach(n=>{var k;const T=ru.find(l,n.id);if(T){if(ru.shouldSizeToContent(T)&&(n.h=T.h),this.engine.nodeBoundFix(n),(n.autoPosition||n.x===void 0||n.y===void 0)&&(n.w=n.w||T.w,n.h=n.h||T.h,this.engine.findEmptyPosition(n)),this.engine.nodes.push(T),ru.samePos(T,n)&&this.engine.nodes.length>1&&(this.moveNode(T,{...n,forceCollide:!0}),ru.copyPos(n,T)),this.update(T.el,n),(k=n.subGridOpts)!=null&&k.children){const x=T.el.querySelector(".grid-stack");x&&x.gridstack&&x.gridstack.load(n.subGridOpts.children)}}else a&&this.addWidget(n)}),delete this.engine._loading,this.engine.removedNodes=u,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,h?Rh.addRemoveCB=h:delete Rh.addRemoveCB,p&&this.setAnimation(!0,!0),this}batchUpdate(r=!0){return this.engine.batchUpdate(r),r||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(r=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!r||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const a=this.el.querySelector("."+this.opts.itemClass);if(a){const $=ru.toNumber(a.getAttribute("gs-h"))||1;return Math.round(a.offsetHeight/$)}const v=parseInt(this.el.getAttribute("gs-current-row"));return v?Math.round(this.el.getBoundingClientRect().height/v):this.opts.cellHeight}cellHeight(r){if(r!==void 0&&this._isAutoCellHeight!==(r==="auto")&&(this._isAutoCellHeight=r==="auto",this._updateResizeEvent()),(r==="initial"||r==="auto")&&(r=void 0),r===void 0){const v=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+v}const a=ru.parseHeight(r);return this.opts.cellHeightUnit===a.unit&&this.opts.cellHeight===a.h?this:(this.opts.cellHeightUnit=a.unit,this.opts.cellHeight=a.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(r=!1){var a;return r&&(a=this.opts.columnOpts)!=null&&a.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,a;const v=this.opts.columnOpts;if(!v||!v.columnWidth&&!((r=v.breakpoints)!=null&&r.length))return!1;const $=this.getColumn();let h=$;const u=this._widthOrContainer(!0);if(v.columnWidth)h=Math.min(Math.round(u/v.columnWidth)||1,v.columnMax);else{h=v.columnMax;let i=0;for(;i<v.breakpoints.length&&u<=v.breakpoints[i].w;)h=v.breakpoints[i++].c||$}if(h!==$){const i=(a=v.breakpoints)==null?void 0:a.find(p=>p.c===h);return this.column(h,(i==null?void 0:i.layout)||v.layout),!0}return!1}compact(r="compact",a=!0){return this.engine.compact(r,a),this._triggerChangeEvent(),this}column(r,a="moveScale"){if(!r||r<1||this.opts.column===r)return this;const v=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+v),this._updateColumnVar(),this.engine.columnChanged(v,r,a),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=a,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(r=>r.matches("."+this.opts.itemClass)&&!r.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(r=!0){var a;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),r?this.el.parentNode.removeChild(this.el):(this.removeAll(r),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(a=this._placeholder)==null||delete a.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(r){return this.opts.float!==r&&(this.opts.float=this.engine.float=r,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(r,a=!1){const v=this.el.getBoundingClientRect();let $;a?$={top:v.top+document.documentElement.scrollTop,left:v.left}:$={top:this.el.offsetTop,left:this.el.offsetLeft};const h=r.left-$.left,u=r.top-$.top,i=v.width/this.getColumn(),p=v.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(h/i),y:Math.floor(u/p)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,a,v,$){return this.engine.isAreaEmpty(r,a,v,$)}makeWidget(r,a){const v=Rh.getElement(r);if(!v||v.gridstackNode)return v;v.parentElement||this.el.appendChild(v),this._prepareElement(v,!0,a);const $=v.gridstackNode;this._updateContainerHeight(),$.subGridOpts&&this.makeSubGrid(v,$.subGridOpts,void 0,!1);let h;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(h=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),h&&delete this._ignoreLayoutsNodeChange,v}on(r,a){return r.indexOf(" ")!==-1?(r.split(" ").forEach(v=>this.on(v,a)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=v=>a(v):this._gsEventHandler[r]=v=>{v.detail&&a(v,v.detail)},this.el.addEventListener(r,this._gsEventHandler[r])):r==="drag"||r==="dragstart"||r==="dragstop"||r==="resizestart"||r==="resize"||r==="resizestop"||r==="dropped"||r==="resizecontent"?this._gsEventHandler[r]=a:console.error("GridStack.on("+r+") event not supported"),this)}off(r){return r.indexOf(" ")!==-1?(r.split(" ").forEach(a=>this.off(a)),this):((r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable")&&this._gsEventHandler[r]&&this.el.removeEventListener(r,this._gsEventHandler[r]),delete this._gsEventHandler[r],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(r=>this.off(r)),this}removeWidget(r,a=!0,v=!0){return r?(Rh.getElements(r).forEach($=>{if($.parentElement&&$.parentElement!==this.el)return;let h=$.gridstackNode;h||(h=this.engine.nodes.find(u=>$===u.el)),h&&(a&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,h,!1,!1),delete $.gridstackNode,this._removeDD($),this.engine.removeNode(h,a,v),a&&$.parentElement&&$.remove())}),v&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,a=!0){return this.engine.nodes.forEach(v=>{r&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,v,!1,!1),delete v.el.gridstackNode,this.opts.staticGrid||this._removeDD(v.el)}),this.engine.removeAll(r,a),a&&this._triggerRemoveEvent(),this}setAnimation(r=this.opts.animate,a){return a?setTimeout(()=>{this.opts&&this.setAnimation(r)}):r?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=r,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(r,a=!0,v=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach($=>{this.prepareDragDrop($.el),$.subGrid&&v&&$.subGrid.setStatic(r,a,v)}),a&&this._setStaticClass(),this)}updateOptions(r){var a;const v=this.opts;return r===v?this:(r.acceptWidgets!==void 0&&(v.acceptWidgets=r.acceptWidgets,this._setupAcceptWidget()),r.animate!==void 0&&this.setAnimation(r.animate),r.cellHeight&&this.cellHeight(r.cellHeight),r.class!==void 0&&r.class!==v.class&&(v.class&&this.el.classList.remove(v.class),r.class&&this.el.classList.add(r.class)),r.columnOpts?(this.opts.columnOpts=r.columnOpts,this.checkDynamicColumn()):r.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof r.column=="number"&&this.column(r.column),r.margin!==void 0&&this.margin(r.margin),r.staticGrid!==void 0&&this.setStatic(r.staticGrid),r.disableDrag!==void 0&&!r.staticGrid&&this.enableMove(!r.disableDrag),r.disableResize!==void 0&&!r.staticGrid&&this.enableResize(!r.disableResize),r.float!==void 0&&this.float(r.float),r.row!==void 0?(v.minRow=v.maxRow=v.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(v.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(v.maxRow=r.maxRow)),(a=r.children)!=null&&a.length&&this.load(r.children),this)}update(r,a){return Rh.getElements(r).forEach(v=>{var $;const h=v==null?void 0:v.gridstackNode;if(!h)return;const u={...ru.copyPos({},h),...ru.cloneDeep(a)};this.engine.nodeBoundFix(u),delete u.autoPosition;const i=["x","y","w","h"];let p;if(i.some(k=>u[k]!==void 0&&u[k]!==h[k])&&(p={},i.forEach(k=>{p[k]=u[k]!==void 0?u[k]:h[k],delete u[k]})),!p&&(u.minW||u.minH||u.maxW||u.maxH)&&(p={}),u.content!==void 0){const k=v.querySelector(".grid-stack-item-content");k&&k.textContent!==u.content&&(h.content=u.content,Rh.renderCB(k,u),($=h.subGrid)!=null&&$.el&&(k.appendChild(h.subGrid.el),h.subGrid._updateContainerHeight())),delete u.content}let l=!1,n=!1;for(const k in u)k[0]!=="_"&&h[k]!==u[k]&&(h[k]=u[k],l=!0,n=n||!this.opts.staticGrid&&(k==="noResize"||k==="noMove"||k==="locked"));if(ru.sanitizeMinMax(h),p){const k=p.w!==void 0&&p.w!==h.w;this.moveNode(h,p),k&&h.subGrid?h.subGrid.onResize(this.hasAnimationCSS()?h.w:void 0):this.resizeToContentCheck(k,h),delete h._orig}(p||l)&&this._writeAttr(v,h),n&&this.prepareDragDrop(h.el),Rh.updateCB&&Rh.updateCB(h)}),this}moveNode(r,a){const v=r._updating;v||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,a),this._updateContainerHeight(),v||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var a,v;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const $=r.gridstackNode;if(!$)return;const h=$.grid;if(!h||r.parentElement!==h.el)return;const u=h.getCellHeight(!0);if(!u)return;let i=$.h?$.h*u:r.clientHeight,p;if($.resizeToContentParent&&(p=r.querySelector($.resizeToContentParent)),p||(p=r.querySelector(Rh.resizeToContentParent)),!p)return;const l=r.clientHeight-p.clientHeight,n=$.h?$.h*u-l:p.clientHeight;let k;if($.subGrid){k=$.subGrid.getRow()*$.subGrid.getCellHeight(!0);const d=$.subGrid.el.getBoundingClientRect(),o=r.getBoundingClientRect();k+=d.top-o.top}else{if((v=(a=$.subGridOpts)==null?void 0:a.children)!=null&&v.length)return;{const d=p.firstElementChild;if(!d){console.error(`Error: GridStack.resizeToContent() widget id:${$.id} '${Rh.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}k=d.getBoundingClientRect().height||n}}if(n===k)return;i+=k-n;let T=Math.ceil(i/u);const x=Number.isInteger($.sizeToContent)?$.sizeToContent:0;x&&T>x&&(T=x,r.classList.add("size-to-content-max")),$.minH&&T<$.minH?T=$.minH:$.maxH&&T>$.maxH&&(T=$.maxH),T!==$.h&&(h._ignoreLayoutsNodeChange=!0,h.moveNode($,{h:T}),delete h._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){Rh.resizeToContentCB?Rh.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,a){return Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;if(!ru.canBeRotated($))return;const h={w:$.h,h:$.w,minH:$.minW,minW:$.minH,maxH:$.maxW,maxW:$.maxH};if(a){const i=a.left>0?Math.floor(a.left/this.cellWidth()):0,p=a.top>0?Math.floor(a.top/this.opts.cellHeight):0;h.x=$.x+i-($.h-(p+1)),h.y=$.y+p-i}Object.keys(h).forEach(i=>{h[i]===void 0&&delete h[i]});const u=$._orig;this.update(v,h),$._orig=u}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const a=ru.parseHeight(r);if(this.opts.marginUnit===a.unit&&this.opts.margin===a.h)return}return this.opts.margin=r,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(r){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const a=arguments;let v=0,$={x:a[v++],y:a[v++],w:a[v++],h:a[v++],autoPosition:a[v++]};return this.willItFit($)}return this.engine.willItFit(r)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const r=this.engine.getDirtyNodes(!0);return r&&r.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(r),this._triggerEvent("change",r)),this.engine.saveInitial(),this}_triggerAddEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.addedNodes)!=null&&r.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(v=>{delete v._dirty});const a=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",a)}return this}_triggerRemoveEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.removedNodes)!=null&&r.length){const a=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",a)}return this}_triggerEvent(r,a){const v=a?new CustomEvent(r,{bubbles:!1,detail:a}):new Event(r);let $=this;for(;$.parentGridNode;)$=$.parentGridNode.grid;return $.el.dispatchEvent(v),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let a=this.getRow()+this._extraDragRow;const v=this.opts.cellHeight,$=this.opts.cellHeightUnit;if(!v)return this;if(!r&&!this.opts.minRow){const h=ru.parseHeight(getComputedStyle(this.el).minHeight);if(h.h>0&&h.unit===$){const u=Math.floor(h.h/v);a<u&&(a=u)}}return this.el.setAttribute("gs-current-row",String(a)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),a&&(this.el.style[r?"minHeight":"height"]=a*v+$),r&&ru.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,a=!1,v){v=v||this._readAttr(r),r.gridstackNode=v,v.el=r,v.grid=this,v=this.engine.addNode(v,a),this._writeAttr(r,v),r.classList.add(T3.itemClass,this.opts.itemClass);const $=ru.shouldSizeToContent(v);return $?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),$&&this.resizeToContentCheck(!1,v),ru.lazyLoad(v)||this.prepareDragDrop(v.el),this}_writePosAttr(r,a){return(!a._moving&&!a._resizing||this._placeholder===r)&&(r.style.top=a.y?a.y===1?"var(--gs-cell-height)":`calc(${a.y} * var(--gs-cell-height))`:null,r.style.left=a.x?a.x===1?"var(--gs-column-width)":`calc(${a.x} * var(--gs-column-width))`:null,r.style.width=a.w>1?`calc(${a.w} * var(--gs-column-width))`:null,r.style.height=a.h>1?`calc(${a.h} * var(--gs-cell-height))`:null),a.x>0?r.setAttribute("gs-x",String(a.x)):r.removeAttribute("gs-x"),a.y>0?r.setAttribute("gs-y",String(a.y)):r.removeAttribute("gs-y"),a.w>1?r.setAttribute("gs-w",String(a.w)):r.removeAttribute("gs-w"),a.h>1?r.setAttribute("gs-h",String(a.h)):r.removeAttribute("gs-h"),this}_writeAttr(r,a){if(!a)return this;this._writePosAttr(r,a);const v={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const $ in v)a[$]?r.setAttribute(v[$],String(a[$])):r.removeAttribute(v[$]);return this}_readAttr(r,a=!0){const v={};v.x=ru.toNumber(r.getAttribute("gs-x")),v.y=ru.toNumber(r.getAttribute("gs-y")),v.w=ru.toNumber(r.getAttribute("gs-w")),v.h=ru.toNumber(r.getAttribute("gs-h")),v.autoPosition=ru.toBool(r.getAttribute("gs-auto-position")),v.noResize=ru.toBool(r.getAttribute("gs-no-resize")),v.noMove=ru.toBool(r.getAttribute("gs-no-move")),v.locked=ru.toBool(r.getAttribute("gs-locked"));const $=r.getAttribute("gs-size-to-content");$&&($==="true"||$==="false"?v.sizeToContent=ru.toBool($):v.sizeToContent=parseInt($,10)),v.id=r.getAttribute("gs-id"),v.maxW=ru.toNumber(r.getAttribute("gs-max-w")),v.minW=ru.toNumber(r.getAttribute("gs-min-w")),v.maxH=ru.toNumber(r.getAttribute("gs-max-h")),v.minH=ru.toNumber(r.getAttribute("gs-min-h")),a&&(v.w===1&&r.removeAttribute("gs-w"),v.h===1&&r.removeAttribute("gs-h"),v.maxW&&r.removeAttribute("gs-max-w"),v.minW&&r.removeAttribute("gs-min-w"),v.maxH&&r.removeAttribute("gs-max-h"),v.minH&&r.removeAttribute("gs-min-h"));for(const h in v){if(!v.hasOwnProperty(h))return;!v[h]&&v[h]!==0&&h!=="sizeToContent"&&delete v[h]}return v}_setStaticClass(){const r=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...r),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...r),this.el.removeAttribute("gs-static")),this}onResize(r=(a=>(a=this.el)==null?void 0:a.clientWidth)()){if(!r||this.prevWidth===r)return;this.prevWidth=r,this.batchUpdate();let a=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),a=!0):a=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(v=>{v.subGrid&&v.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(a),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(r=!1,a=void 0){if(this.engine){if(r&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,a),this.animationDelay);if(a)ru.shouldSizeToContent(a)&&this.resizeToContentCBCheck(a.el);else if(this.engine.nodes.some(v=>ru.shouldSizeToContent(v))){const v=[...this.engine.nodes];this.batchUpdate(),v.forEach($=>{ru.shouldSizeToContent($)&&this.resizeToContentCBCheck($.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,a?[a]:this.engine.nodes)}}_updateResizeEvent(r=!1){const a=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(v=>v.sizeToContent));return!r&&a&&!this.resizeObserver?(this._sizeThrottle=ru.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(r||!a)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(r=".grid-stack-item"){return ru.getElement(r)}static getElements(r=".grid-stack-item"){return ru.getElements(r)}static getGridElement(r){return Rh.getElement(r)}static getGridElements(r){return ru.getElements(r)}_initMargin(){let r,a=0,v=[];typeof this.opts.margin=="string"&&(v=this.opts.margin.split(" ")),v.length===2?(this.opts.marginTop=this.opts.marginBottom=v[0],this.opts.marginLeft=this.opts.marginRight=v[1]):v.length===4?(this.opts.marginTop=v[0],this.opts.marginRight=v[1],this.opts.marginBottom=v[2],this.opts.marginLeft=v[3]):(r=ru.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,a=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(h=>{this.opts[h]===void 0?this.opts[h]=a:(r=ru.parseHeight(this.opts[h]),this.opts[h]=r.h,delete this.opts.margin)}),this.opts.marginUnit=r.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const $=this.el.style;return $.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return u_}static setupDragIn(r,a,v,$=document){(a==null?void 0:a.pause)!==void 0&&(Nf.pauseDrag=a.pause),a={appendTo:"body",helper:"clone",...a||{}},(typeof r=="string"?ru.getElements(r,$):r).forEach((h,u)=>{u_.isDraggable(h)||u_.dragIn(h,a),v!=null&&v[u]&&(h.gridstackNode=v[u])})}movable(r,a){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(a?delete $.noMove:$.noMove=!0,this.prepareDragDrop($.el))}),this)}resizable(r,a){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(a?delete $.noResize:$.noResize=!0,this.prepareDragDrop($.el))}),this)}disable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!1,r),this.enableResize(!1,r),this._triggerEvent("disable"),this}enable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!0,r),this.enableResize(!0,r),this._triggerEvent("enable"),this}enableMove(r,a=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&a&&v.subGrid.enableMove(r,a)}),this)}enableResize(r,a=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&a&&v.subGrid.enableResize(r,a)}),this)}cancelDrag(){var r;const a=(r=this._placeholder)==null?void 0:r.gridstackNode;a&&(a._isExternal?(a._isAboutToRemove=!0,this.engine.removeNode(a)):a._isAboutToRemove&&Rh._itemRemoving(a.el,!1),this.engine.restoreInitial())}_removeDD(r){return u_.draggable(r,"destroy").resizable(r,"destroy"),r.gridstackNode&&delete r.gridstackNode._initDD,delete r.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return u_.droppable(this.el,"destroy"),this;let r,a;const v=($,h,u)=>{var i;u=u||h;const p=u.gridstackNode;if(!p)return;if(!((i=p.grid)!=null&&i.el)){u.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const x=u.getBoundingClientRect();u.style.left=x.x+(this.dragTransform.xScale-1)*($.clientX-x.x)/this.dragTransform.xScale+"px",u.style.top=x.y+(this.dragTransform.yScale-1)*($.clientY-x.y)/this.dragTransform.yScale+"px",u.style.transformOrigin="0px 0px"}let{top:l,left:n}=u.getBoundingClientRect();const k=this.el.getBoundingClientRect();n-=k.left,l-=k.top;const T={position:{top:l*this.dragTransform.xScale,left:n*this.dragTransform.yScale}};if(p._temporaryRemoved){if(p.x=Math.max(0,Math.round(n/a)),p.y=Math.max(0,Math.round(l/r)),delete p.autoPosition,this.engine.nodeBoundFix(p),!this.engine.willItFit(p)){if(p.autoPosition=!0,!this.engine.willItFit(p)){u_.off(h,"drag");return}p._willFitPos&&(ru.copyPos(p,p._willFitPos),delete p._willFitPos)}this._onStartMoving(u,$,T,p,a,r)}else this._dragOrResize(u,$,T,p,a,r)};return u_.droppable(this.el,{accept:$=>{const h=$.gridstackNode||this._readAttr($,!1);if((h==null?void 0:h.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let u=!0;if(typeof this.opts.acceptWidgets=="function")u=this.opts.acceptWidgets($);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;u=$.matches(i)}if(u&&h&&this.opts.maxRow){const i={w:h.w,h:h.h,minW:h.minW,minH:h.minH};u=this.engine.willItFit(i)}return u}}).on(this.el,"dropover",($,h,u)=>{let i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((i==null?void 0:i.grid)===this&&!i._temporaryRemoved)return!1;if(i!=null&&i._sidebarOrig&&(i.w=i._sidebarOrig.w,i.h=i._sidebarOrig.h),i!=null&&i.grid&&i.grid!==this&&!i._temporaryRemoved&&i.grid._leave(h,u),u=u||h,a=this.cellWidth(),r=this.getCellHeight(!0),!i){const n=u.getAttribute("data-gs-widget")||u.getAttribute("gridstacknode");if(n){try{i=JSON.parse(n)}catch{console.error("Gridstack dropover: Bad JSON format: ",n)}u.removeAttribute("data-gs-widget"),u.removeAttribute("gridstacknode")}i||(i=this._readAttr(u)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,u.gridstackNode=i);const p=i.w||Math.round(u.offsetWidth/a)||1,l=i.h||Math.round(u.offsetHeight/r)||1;return i.grid&&i.grid!==this?(h._gridstackNodeOrig||(h._gridstackNodeOrig=i),h.gridstackNode=i={...i,w:p,h:l,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=p,i.h=l,i._temporaryRemoved=!0),Rh._itemRemoving(i.el,!1),u_.on(h,"drag",v),v($,h,u),!1}).on(this.el,"dropout",($,h,u)=>{const i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(h,u),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",($,h,u)=>{var i,p,l;const n=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._isExternal)return!1;const k=!!this.placeholder.parentElement,T=h!==u;this.placeholder.remove(),delete this.placeholder.gridstackNode,k&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const x=h._gridstackNodeOrig;if(delete h._gridstackNodeOrig,k&&x!=null&&x.grid&&x.grid!==this){const o=x.grid;o.engine.removeNodeFromLayoutCache(x),o.engine.removedNodes.push(x),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!n||(k&&(this.engine.cleanupNode(n),n.grid=this),(i=n.grid)==null||delete i._isTemp,u_.off(h,"drag"),u!==h?(u.remove(),h=u):h.remove(),this._removeDD(h),!k))return!1;const d=(l=(p=n.subGrid)==null?void 0:p.el)==null?void 0:l.gridstack;return ru.copyPos(n,this._readAttr(this.placeholder)),ru.removePositioningStyles(h),T&&(n.content||n.subGridOpts||Rh.addRemoveCB)?(delete n.el,h=this.addWidget(n)):(this._prepareElement(h,!0,n),this.el.appendChild(h),this.resizeToContentCheck(!1,n),d&&(d.parentGridNode=n),this._updateContainerHeight()),this.engine.addedNodes.push(n),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...$,type:"dropped"},x&&x.grid?x:void 0,n),!1}),this}static _itemRemoving(r,a){if(!r)return;const v=r?r.gridstackNode:void 0;!(v!=null&&v.grid)||r.classList.contains(v.grid.opts.removableOptions.decline)||(a?v._isAboutToRemove=!0:delete v._isAboutToRemove,a?r.classList.add("grid-stack-item-removing"):r.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const r=document.querySelector(this.opts.removable);return r?(!this.opts.staticGrid&&!u_.isDroppable(r)&&u_.droppable(r,this.opts.removableOptions).on(r,"dropover",(a,v)=>Rh._itemRemoving(v,!0)).on(r,"dropout",(a,v)=>Rh._itemRemoving(v,!1)),this):this}prepareDragDrop(r,a=!1){const v=r==null?void 0:r.gridstackNode;if(!v)return;const $=v.noMove||this.opts.disableDrag,h=v.noResize||this.opts.disableResize,u=this.opts.staticGrid||$&&h;if((a||u)&&(v._initDD&&(this._removeDD(r),delete v._initDD),u&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!a))return this;if(!v._initDD){let i,p;const l=(T,x)=>{this.triggerEvent(T,T.target),i=this.cellWidth(),p=this.getCellHeight(!0),this._onStartMoving(r,T,x,v,i,p)},n=(T,x)=>{this._dragOrResize(r,T,x,v,i,p)},k=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete v._moving,delete v._resizing,delete v._event,delete v._lastTried;const x=v.w!==v._orig.w,d=T.target;if(!(!d.gridstackNode||d.gridstackNode.grid!==this)){if(v.el=d,v._isAboutToRemove){const o=r.gridstackNode.grid;o._gsEventHandler[T.type]&&o._gsEventHandler[T.type](T,d),o.engine.nodes.push(v),o.removeWidget(r,!0,!0)}else ru.removePositioningStyles(d),v._temporaryRemoved?(this._writePosAttr(d,v),this.engine.addNode(v)):this._writePosAttr(d,v),this.triggerEvent(T,d);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(v.sizeToContent)&&(v.sizeToContent=v.h),this.resizeToContentCheck(x,v))}};u_.draggable(r,{start:l,stop:k,drag:n}).resizable(r,{start:l,stop:k,resize:n}),v._initDD=!0}return u_.draggable(r,$?"disable":"enable").resizable(r,h?"disable":"enable"),this}_onStartMoving(r,a,v,$,h,u){var i;if(this.engine.cleanNodes().beginUpdate($),this._writePosAttr(this.placeholder,$),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=$,(i=$.grid)!=null&&i.el)this.dragTransform=ru.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const p=this.placeholder.closest(".grid-stack");this.dragTransform=ru.getValuesFromTransformedElement(p)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if($.el=this.placeholder,$._lastUiPosition=v.position,$._prevYPix=v.position.top,$._moving=a.type==="dragstart",$._resizing=a.type==="resizestart",delete $._lastTried,a.type==="dropover"&&$._temporaryRemoved&&(this.engine.addNode($),$._moving=!0),this.engine.cacheRects(h,u,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),a.type==="resizestart"){const p=this.getColumn()-$.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-$.y;u_.resizable(r,"option","minWidth",h*Math.min($.minW||1,p)).resizable(r,"option","minHeight",u*Math.min($.minH||1,l)).resizable(r,"option","maxWidth",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,p)).resizable(r,"option","maxWidthMoveLeft",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,$.x+$.w)).resizable(r,"option","maxHeight",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(r,"option","maxHeightMoveUp",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,$.y+$.h))}}_dragOrResize(r,a,v,$,h,u){const i={...$._orig};let p,l=this.opts.marginLeft,n=this.opts.marginRight,k=this.opts.marginTop,T=this.opts.marginBottom;const x=Math.round(u*.1),d=Math.round(h*.1);if(l=Math.min(l,d),n=Math.min(n,d),k=Math.min(k,x),T=Math.min(T,x),a.type==="drag"){if($._temporaryRemoved)return;const c=v.position.top-$._prevYPix;$._prevYPix=v.position.top,this.opts.draggable.scroll!==!1&&ru.updateScrollPosition(r,v.position,c);const s=v.position.left+(v.position.left>$._lastUiPosition.left?-n:l),f=v.position.top+(v.position.top>$._lastUiPosition.top?-T:k);i.x=Math.round(s/h),i.y=Math.round(f/u);const g=this._extraDragRow;if(this.engine.collide($,i)){const S=this.getRow();let L=Math.max(0,i.y+$.h-S);this.opts.maxRow&&S+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-S)),this._extraDragRow=L}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),$.x===i.x&&$.y===i.y)return}else if(a.type==="resize"){if(i.x<0||(ru.updateScrollResize(a,r,u),i.w=Math.round((v.size.width-l)/h),i.h=Math.round((v.size.height-k)/u),$.w===i.w&&$.h===i.h)||$._lastTried&&$._lastTried.w===i.w&&$._lastTried.h===i.h)return;const c=v.position.left+l,s=v.position.top+k;i.x=Math.round(c/h),i.y=Math.round(s/u),p=!0}$._event=a,$._lastTried=i;const o={x:v.position.left+l,y:v.position.top+k,w:(v.size?v.size.width:$.w*h)-l-n,h:(v.size?v.size.height:$.h*u)-k-T};if(this.engine.moveNodeCheck($,{...i,cellWidth:h,cellHeight:u,rect:o,resizing:p})){$._lastUiPosition=v.position,this.engine.cacheRects(h,u,k,n,T,l),delete $._skipDown,p&&$.subGrid&&$.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const c=a.target;$._sidebarOrig||this._writePosAttr(c,$),this.triggerEvent(a,c)}}triggerEvent(r,a){let v=this;for(;v.parentGridNode;)v=v.parentGridNode.grid;v._gsEventHandler[r.type]&&v._gsEventHandler[r.type](r,a)}_leave(r,a){a=a||r;const v=a.gridstackNode;if(!v||(a.style.transform=a.style.transformOrigin=null,u_.off(r,"drag"),v._temporaryRemoved))return;v._temporaryRemoved=!0,this.engine.removeNode(v),v.el=v._isExternal&&a?a:r;const $=v._sidebarOrig;v._isExternal&&this.engine.cleanupNode(v),v._sidebarOrig=$,this.opts.removable===!0&&Rh._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):v._isExternal&&this.engine.restoreInitial()}commit(){return rHe(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}Rh.renderCB=(e,r)=>{e&&r!=null&&r.content&&(e.textContent=r.content)},Rh.resizeToContentParent=".grid-stack-item-content",Rh.Utils=ru,Rh.Engine=P4,Rh.GDRev="12.3.2";const oHe=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],A4=e=>oHe.find(r=>r.id===e),R4=new Map([[9,{id:9,analysisTypes:new Map([["2-20",{analysisType:"successfulPasses",name:"Pases acertados",title:"Mapeo de pases acertados",titleShort:"Pases acertados"}],["3-21",{analysisType:"unsuccessfulPasses",name:"Pases no acertados",title:"Mapeo de pases no acertados",titleShort:"Pases no acertados"}],["222-223-224-225",{analysisType:"recoveredBalls",name:"Balones recuperados",title:"Mapeo de balones recuperados",titleShort:"Balones recuperados"}],["226-227-228-229",{analysisType:"lostBalls",name:"Balones perdidos",title:"Mapeo de balones perdidos",titleShort:"Balones perdidos"}]])}],[1,{general:"General",offensive:"Ofensivo",defensive:"Defensivo",possession:"Posesión",stoppedBall:"Balón parado",penalties:"Infracción"}]]);class Qk{constructor(r,a=[],v,$=null,h=!1,u=!1,i=null,p=null,l=null){Lw(this,"id",""),Lw(this,"childViews",[]),Lw(this,"viewId",0),Lw(this,"dynamicFilters",null),Lw(this,"componentSpecificFilters",new Map),Lw(this,"isPostMatch",!1),Lw(this,"isTemplateMode",!1),Lw(this,"filtresJSON",null),Lw(this,"token",null),Lw(this,"_isUpdating",!1),Lw(this,"filters",null),this.id=r,this.viewId=v,this.childViews=a,this.dynamicFilters=$,this.isPostMatch=h,this.isTemplateMode=u,this.filtresJSON=i,this.token=p,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new Qk(this.id,[r],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(r,a){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.event_type_id===a)}hasCategoryId(r,a){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.category_id===a)}getId(){return this.id}setViewId(r){this.viewId=r}setFiltersJSON(r){this.filtresJSON=r}setDynamicFilters(r,a=null){a?this.componentSpecificFilters.set(a,[...r]):this.dynamicFilters=r}setFilters(r){this.filters=r}getComponentDynamicFilters(r){return r&&this.componentSpecificFilters.has(r)?this.componentSpecificFilters.get(r):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(r=>r.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(r=>!r.view.isHomeTeam)}addSpecificPlays(r){if(r.view.componentProps&&this.filters){const a=this.filters.selectedTeam.value;if(console.log("teamSelected: ",a),a===3){console.log("this.getHomeTeamViews(): ",this.getHomeTeamViews()),console.log("this.getAwayTeamViews(): ",this.getAwayTeamViews());const v=this.getHomeTeamViews().length,$=this.getAwayTeamViews().length;v===0&&$>0&&this.getAwayTeamViews().forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=!0,h.view.isHomeTeam=!0,h.view.filterMultiple&&(h.view.filterMultiple.isHomeTeam=!0)}),v<this.filters.howManyCorners?this.childViews.length===0?(r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.howManyCorners=this.filters.howManyCorners,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):this.childViews.reduce((h,u,i,p)=>{let l={isAgainstMode:u.view.isAgainstMode,advancedFilters:u.view.componentProps.advancedFilters,isHomeTeamForAnalysis:u.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:u.view.isHomeTeam};return h&&(h.isHomeTeam&&!u.view.isHomeTeam?(u.view.componentProps.isAgainstMode=this.filters.isAgainstMode,u.view.componentProps.advancedFilters=this.filters.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=!0,u.view.isHomeTeam=!0,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!h.isHomeTeam&&!u.view.isHomeTeam&&(u.view.componentProps.isAgainstMode=h.isAgainstMode,u.view.componentProps.advancedFilters=h.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=h.isHomeTeamForAnalysis,u.view.isHomeTeam=h.isHomeTeam,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,selectedCategory:u.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===p.length-1&&(r.view.componentProps.advancedFilters=l.advancedFilters,r.view.componentProps.isAgainstMode=l.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=l.isHomeTeamForAnalysis,r.view.isHomeTeam=l.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),l},null):(r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})}else{const v=a===1;r.view.componentProps.isHomeTeamForAnalysis=v,r.view.isHomeTeam=v,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}}}console.log("++++++++++++++++++++++++++++++++++++++++++++++++++++++"),console.log("view: ",r)}addLastTouch(r){if(r.view.componentProps&&this.filters){let a=null;const v=this.filters.selectedCategories.map(h=>h.value),$=this.filters.selectedTeam.value;if($===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(p=>{p.view.componentProps.isHomeTeamForAnalysis=!0,p.view.isHomeTeam=!0,p.view.filterMultiple&&(p.view.filterMultiple.isHomeTeam=!0)});const h=this.getHomeTeamViews(),u=this.getAwayTeamViews();let i=!0;for(let p=0;p<v.length;p++){a=v[p];const l=h.find(k=>k.view.componentProps.categories[0].name===a.name),n=u.find(k=>k.view.componentProps.categories[0].name===a.name);if(!l||!n){i=!l;break}}i?this.childViews.length===0?(r.view.componentProps.categories=[a],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=a.name,r.view.titleShort=a.name,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:a,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((p,l,n,k)=>{let T={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return p&&(p.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[a],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=a.name,r.view.titleShort=a.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:a,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!p.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=p.categories,l.view.componentProps.analysisType=p.analysisType,l.view.componentProps.isHomeTeamForAnalysis=p.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=p.isAssistZoneVisible,l.view.componentProps.howManyGames=p.howManyGames,l.view.title=p.title,l.view.titleShort=p.titleShort,l.view.isHomeTeam=p.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),n===k.length-1&&(r.view.componentProps.categories=T.categories,r.view.componentProps.analysisType=T.analysisType,r.view.componentProps.isHomeTeamForAnalysis=T.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=T.isAssistZoneVisible,r.view.componentProps.howManyGames=T.howManyGames,r.view.title=T.title,r.view.titleShort=T.titleShort,r.view.isHomeTeam=T.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:r.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),T},null):(r.view.componentProps.categories=[a],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=a.name,r.view.titleShort=a.name,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:a,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const h=$===1,u=h?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=h,r.view.isHomeTeam=h;for(let i=0;i<v.length;i++){const p=v[i];if(!u.find(l=>l.view.componentProps.categories[0].name===p.name)){r.view.componentProps.categories=[p],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=p.name,r.view.titleShort=p.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:p,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,a=!1){var v,$,h,u,i,p,l,n,k,T;if(r.view.filterAndViewsContainer=this,Sd.emit("component-added-to-container",this),this.viewId===5&&r.view.componentProps&&!a&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===15&&r.view.componentProps&&!a&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===17&&r.view.componentProps&&!a){this.dynamicFilters[0]!==void 0&&(r.view.componentProps.infavoragainstteam=!this.dynamicFilters[0]),this.dynamicFilters[1]!==void 0&&(r.view.componentProps.lateralidad=this.dynamicFilters[1]===32?"right":"left");const x=this.dynamicFilters[2]!==void 0?this.dynamicFilters[2]:this.dynamicFilters[0]||1,d=r.view.componentProps.game;if(x===3){const o=this.childViews.filter(c=>{var s;return((s=c.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;d&&(r.view.componentProps.teamselected=o?d.home_team:d.away_team),r.view.filterMultiple={isHomeTeam:o}}else d&&(r.view.componentProps.teamselected=x===2?d.away_team:d.home_team),r.view.filterMultiple={isHomeTeam:x===1}}if(this.viewId===10&&r.view.componentProps&&!a&&(r.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,r.isHomeTeam=r.view.componentProps.isHomeTeamForAnalysis,r.view.filterMultiple={isHomeTeam:r.view.componentProps.isHomeTeamForAnalysis},r.view.filtersJSON=this.filtresJSON),this.viewId===7&&r.view.componentProps&&!a){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d[0]===1?"offensive":"defensive",c=d[1]===1;r.view.componentProps.analysisType=o,r.view.componentProps.isHomeTeamForAnalysis=c,r.isHomeTeam=c,r.view.filterMultiple={isHomeTeam:c},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===1&&r.view.componentProps&&!a){const x=this.dynamicFilters[0]||[];if(x&&x.length>0){let d;if(Array.isArray(x)){const c=this.childViews.map(f=>{var g;return(g=f.view.componentProps)==null?void 0:g.type}).filter(f=>f!==void 0),s=x.filter(f=>!c.includes(f));s.length>0?d=s[0]:d=x[0]}else d=x;const o=R4.get(this.viewId);r.view.componentProps.type=d,r.view.componentProps.default=!1,r.view.title=`Comparativa ${o[d]}`,r.view.filterMultiple={category:d}}}if(this.viewId===9&&r.view.componentProps&&!a){const x=this.dynamicFilters[0].map(s=>s.join("-"));let d="";const o=this.dynamicFilters[1],c=R4.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(L=>{L.view.componentProps.isHomeTeamForAnalysis=!0,L.view.isHomeTeam=!0,L.view.filterMultiple&&(L.view.filterMultiple.isHomeTeam=!0)});let s=null;const f=this.getHomeTeamViews(),g=this.getAwayTeamViews();let S=!0;for(let L=0;L<x.length;L++){d=x[L],s=c.analysisTypes.get(x[L]);const E=f.find(V=>V.view.componentProps.analysisType===s.analysisType),P=g.find(V=>V.view.componentProps.analysisType===s.analysisType);if(!E||!P){S=!E;break}}S?this.childViews.length===0?(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))}):this.childViews.reduce((L,E,P,V)=>{let I={analysisType:E.view.componentProps.analysisType,title:E.view.title,isHomeTeamForAnalysis:E.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:E.view.isHomeTeam};return L&&(L.isHomeTeam&&!E.view.isHomeTeam?(E.view.componentProps.analysisType=s.analysisType,E.view.componentProps.isHomeTeamForAnalysis=!0,E.view.title=s.title,r.view.titleShort=s.titleShort,E.view.isHomeTeam=!0,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}):!L.isHomeTeam&&!E.view.isHomeTeam&&(E.view.componentProps.analysisType=L.analysisType,E.view.componentProps.isHomeTeamForAnalysis=L.isHomeTeamForAnalysis,E.view.title=L.title,E.view.titleShort=L.titleShort,E.view.isHomeTeam=L.isHomeTeam,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}),P===V.length-1&&(r.view.componentProps.analysisType=I.analysisType,r.view.componentProps.isHomeTeamForAnalysis=I.isHomeTeamForAnalysis,r.view.title=I.title,r.view.titleShort=I.titleShort,r.view.isHomeTeam=I.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))})),I},null):(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))})}else{const s=o===1,f=s?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=s,r.view.isHomeTeam=s;for(let g=0;g<x.length;g++){const S=c.analysisTypes.get(x[g]);if(!f.find(L=>L.view.componentProps.analysisType===S.analysisType)){r.view.componentProps.analysisType=S.analysisType,r.view.title=S.title,r.view.titleShort=S.titleShort,r.view.filterMultiple={categoryIds:x[g].split("-").map(L=>parseInt(L)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!a&&r.view.componentProps){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id),r.view.componentProps.game&&(r.view.componentProps.gameid=r.view.componentProps.game.id,r.view.componentProps.season=r.view.componentProps.game.season_id,r.view.componentProps.teamView=d[1]===2?r.view.componentProps.game.awayTeam.team_id:d[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let c=null;if(Array.isArray(o)){if(o.length>0){const g=this.childViews.map(L=>{var E;const P=(E=L.view.componentProps)==null?void 0:E.categoryView;return P&&P.length>0?P[0].id:null}).filter(L=>L!==null),S=o.filter(L=>!g.includes(L));S.length>0&&(c=S[0])}}else{const g=o;g&&(this.childViews.find(S=>{var L;const E=(L=S.view.componentProps)==null?void 0:L.categoryView;return E&&E.length>0&&E[0].id===g})||(c=g))}let s=null;if(c)try{s=A4(c)}catch{}const f=d&&d.length>1?d[1]:1;r.view.filterMultiple={categoryId:c,teamType:f},r.view.componentProps.categoryView=s?[{id:c,name:s.name}]:c?[{id:c,name:`Category ${c}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&r.view.componentProps&&!a&&r.view.game&&(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),r.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,r.view.componentProps.game=(v=r.view)==null?void 0:v.game,r.view.componentProps.teamSelected={teamId:(h=($=r.view)==null?void 0:$.game)==null?void 0:h.home_team},r.view.componentProps.isDefault=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&r.view.componentProps&&!a&&(r.view.componentProps.isdefault=!0,r.view.componentProps.seasonid=2010,r.view.teamids=[1,2],r.view.componentProps.categoryids=[20,2],r.view.componentProps.teamsshow=[1,2],r.view.componentProps.analysistype=1,r.view.componentProps.gameid="",r.view.componentProps.teams=[],r.view.componentProps.game=""),this.viewId===15&&r.view.componentProps&&!a&&(r.view.componentProps.isdefault=!0,r.view.componentProps.view=1,r.view.numitems=3,r.view.typegame=1,r.view.componentProps.token=this.token,r.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===17&&r.view.componentProps&&!a&&(console.log("6666666666666666666666666666 ddddddddddddddd LLEGO AQUI MERO ESTE COMPOENNETE ES: ---->>>> ",r.view.componentProps),r.view.componentProps.forseason=!1,r.view.componentProps.forteam=!0,r.view.componentProps.tournamentselected={id:1},r.view.componentProps.forgame=!1,r.view.componentProps.filters={},r.view.componentProps.showBallGo=!0,r.view.componentProps.showHeatMap=!0,r.view.componentProps.ballOnOff=!1,r.view.componentProps.showdefault=!0),this.viewId===14&&r.view.componentProps&&!a&&(r.view.componentProps.isReports=!0,r.view.componentProps.isDefault=!0,r.view.componentProps.type=0,r.view.componentProps.typeView=1,r.view.componentProps.showVideos=!1,r.view.componentProps.currentSeason=2010,r.view.componentProps.localTeam=2,r.view.componentProps.awayTeam=1),this.viewId===6&&r.view.componentProps&&!a){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:[];if(o&&o.length>0){let c=0;for(const s of o)if(!this.childViews.find(f=>f.view.componentProps.gameNumber===s)){c=s;break}c&&(r.view.componentProps.gameNumber=c,r.view.filterMultiple={gameNumber:c})}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===3&&r.view.componentProps&&!a&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:!1;r.view.componentProps.desplegable=o,r.view.componentProps.key=o,r.view.componentProps.game=(u=r.view)==null?void 0:u.game,r.view.componentProps.defaultShields=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===4&&r.view.componentProps&&!a&&r.view.game){if(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),this.isPostMatch){r.view.componentProps.key=!1,r.view.componentProps.isDefault=!1,r.view.componentProps.token=this.token,r.view.componentProps.gameId=(p=(i=r.view)==null?void 0:i.game)==null?void 0:p.game_id,r.view.componentProps.homeTeam=(n=(l=r.view)==null?void 0:l.game)==null?void 0:n.home_team,r.view.componentProps.awayTeam=(T=(k=r.view)==null?void 0:k.game)==null?void 0:T.visiting_team;const o=this.getComponentDynamicFilters(r.view.id),c=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const s=c&&c.length>0?c[0]:[],f=this.hasEventTypeId(s,1),g=this.hasCategoryId(s,8),S=this.hasCategoryId(s,9),L=this.hasEventTypeId(s,3);r.view.componentProps.goals=f,r.view.componentProps.yellowCards=g,r.view.componentProps.redCards=S,r.view.componentProps.substitutions=L}const x=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,d=x&&x.length>0?x[0]:[];r.view.componentProps.selectedEvents=d,r.view.componentProps.key=d.length>0,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:x})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Sd.emit("view-added")}getHowManyViewsToAdd(r,a=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const v=r[0];return v===2||v===3?v:1}if(this.viewId===4)return r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0?1:0;if(this.viewId===9){const v=r[0],$=r[1];if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&a){const v=a.selectedCategories||[],$=a.selectedTeam.value;if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const v=r[0]||[],$=r[1]||1;if(!v||v.length===0)return 0;if(Array.isArray(v)){const h=this.childViews.map(u=>{var i;const p=(i=u.view.componentProps)==null?void 0:i.categoryView;return p&&p.length>0?p[0].id:null}).filter(u=>u!==null);return v.filter(u=>!h.includes(u)).length}else{const h=v;return this.childViews.find(u=>{var i,p;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,n=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return l&&l.length>0&&l[0].id===h&&n===$})?0:1}}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return 0;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length}else{const $=v;return this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})?0:1}}return 0}getRequiresAddView(r,a){if(console.log("getRequiresAddView - viewId:",this.viewId),console.log("filters:",a),this.viewId===5)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===17){const v=r[2]||1,$=r[2];return v===3||$===3?this.childViews.length<2:this.childViews.length===0}if(this.viewId===10)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return r[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const v=r[0];return v?v.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const v=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&v}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&a){const v=[a.selectedCategories,a.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(v,a.totalCategoriesSelected)}if(this.viewId===18&&a){console.log("getRequiresAddView - GSCShotMapAnalysis"),console.log("dynamicFilters:",r),console.log("filters:",a);const v=[a.howManyCorners,a.selectedTeam.value],$=this.getRequiresAddViewMultipleAndBothTeams(v,a.howManyCorners);return console.count("before aux18 return"),console.log("aux18:",$),$}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return!1;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length>0}else{const $=v;return!this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})}}if(this.viewId===2){const v=r[0]||[];if(Array.isArray(v)){if(v.length>0){const $=this.childViews.map(h=>{var u;const i=(u=h.view.componentProps)==null?void 0:u.categoryView;return i&&i.length>0?i[0].id:null}).filter(h=>h!==null);return v.filter(h=>!$.includes(h)).length>0}return!1}else{const $=v,h=r[1]||1;return $?!this.childViews.find(u=>{var i,p;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,n=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return l&&l.length>0&&l[0].id===$&&n===h}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,a=null){const v=this.childViews.filter(l=>l.view.isHomeTeam),$=this.childViews.filter(l=>!l.view.isHomeTeam),h=a||r[0].length,u=r[1],i=h*(u===1||u===2?1:2),p=u===3?v.length+$.length:v.length||$.length;return i>p}getRequiresLessViews(r){if(this.viewId===5)return r[0]!==3&&this.childViews.length>1;if(this.viewId===15)return r[0]!==3&&this.childViews.length>1;if(this.viewId===17)return r[0]!==3&&this.childViews.length>1;if(this.viewId===6){const a=r[0];return a===2||a===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const a=this.childViews[0],v=document.querySelector(`[gs-id="${a.view.id}"]`),$=a.grid;if(a&&v&&$){const h=r[0],u=`min_column${h?"_2":""}`,i=`min_row${h?"_2":""}`,p=`max_column${h?"_2":""}`,l=`max_row${h?"_2":""}`,n=`colspan${h?"_2":""}`,k=`rowspan${h?"_2":""}`,T=a.view.coreView[n],x=a.view.coreView[k],d=a.view.coreView[u],o=a.view.coreView[i],c=a.view.coreView[p],s=a.view.coreView[l];a.view.w=T,a.view.h=x,a.view.maxWidth=c,a.view.maxHeight=s,a.view.minWidth=d,a.view.minHeight=o,v.setAttribute("gs-w",T),v.setAttribute("gs-h",x),v.setAttribute("gs-max-w",c),v.setAttribute("gs-max-h",s),v.setAttribute("gs-min-w",d),v.setAttribute("gs-min-h",o),$.update(v,{h:x,w:T,"gs-max-h":s,"gs-max-w":c,"gs-min-h":o,"gs-min-w":d})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,a=null){var v,$;if(!this._isUpdating){this._isUpdating=!0,a?this.componentSpecificFilters.set(a,[...r]):this.dynamicFilters=r,Sd.emit("component-added-to-container",this);try{if(this.viewId===5){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType===1})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,l=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&l&&(i.removeWidget(l),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const n=this.childViews[0];n.view.componentProps&&(n.view.componentProps.preMatchType=h,n.view.filterMultiple={isHomeTeam:n.view.componentProps.preMatchType})}else this.childViews.forEach((u,i)=>{u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType}})}if(this.viewId===15){const h=r[0]||1;if(a){const u=this.childViews.find(i=>i.view.id===a);u&&u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(h<3){if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const i=this.childViews.pop(),p=i.grid,l=i.page,n=document.querySelector(`[gs-id="${i.view.id}"]`);if(p&&n&&(p.removeWidget(n),l)){const k=l.items.findIndex(T=>T.id===i.view.id);k!==-1&&l.items.splice(k,1)}}const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}}else if(this.childViews.length===2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else if(this.childViews.length<2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else{for(;this.childViews.length>2;){const u=this.childViews.pop(),i=u.grid,p=u.page,l=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&l&&(i.removeWidget(l),p)){const n=p.items.findIndex(k=>k.id===u.view.id);n!==-1&&p.items.splice(n,1)}}this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})})}}if(this.viewId===17){const h=r[0]||1,u=r[2],i=h===3||u===3;if(a){const p=this.childViews.find(l=>l.view.id===a);if(p&&p.view.componentProps&&(r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left"),r[2]!==void 0)){const l=r[2],n=p.view.componentProps.game;if(l===3){if(((v=p.view.filterMultiple)==null?void 0:v.isHomeTeam)!==void 0){const k=p.view.filterMultiple.isHomeTeam;n&&(p.view.componentProps.teamselected=(typeof k=="boolean"?k:k===1)?n.home_team:n.away_team)}}else n&&(p.view.componentProps.teamselected=l===2?n.away_team:n.home_team);p.view.filterMultiple={isHomeTeam:l===1||l===3&&(($=p.view.filterMultiple)==null?void 0:$.isHomeTeam)}}}else if(i)if(this.childViews.length===2)this.childViews.forEach((p,l)=>{p.view.componentProps&&(p.view.componentProps.teamselected=l+1,p.view.filterMultiple={isHomeTeam:l===0})});else if(this.childViews.length<2)this.childViews.forEach((p,l)=>{p.view.componentProps&&(p.view.componentProps.teamselected=l+1,p.view.filterMultiple={isHomeTeam:l===0})});else{for(;this.childViews.length>2;){const p=this.childViews.pop(),l=p.grid,n=p.page,k=document.querySelector(`[gs-id="${p.view.id}"]`);if(l&&k&&(l.removeWidget(k),n)){const T=n.items.findIndex(x=>x.id===p.view.id);T!==-1&&n.items.splice(T,1)}}this.childViews.forEach((p,l)=>{p.view.componentProps&&(p.view.componentProps.teamselected=l+1,p.view.filterMultiple={isHomeTeam:l===0})})}else if(this.childViews.length===1){const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const l=p.view.componentProps.game;if(r[2]!==void 0&&l){const n=r[2];p.view.componentProps.teamselected=n===2?l.away_team:l.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}else if(this.childViews.length>1){for(;this.childViews.length>1;){const l=this.childViews.pop(),n=l.grid,k=l.page,T=document.querySelector(`[gs-id="${l.view.id}"]`);if(n&&T&&(n.removeWidget(T),k)){const x=k.items.findIndex(d=>d.id===l.view.id);x!==-1&&k.items.splice(x,1)}}const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const l=p.view.componentProps.game;if(r[2]!==void 0&&l){const n=r[2];p.view.componentProps.teamselected=n===2?l.away_team:l.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}}if(this.viewId===10){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.isHomeTeamForAnalysis=h===1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,l=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&l&&(i.removeWidget(l),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const n=this.childViews[0];n.view.componentProps&&(n.view.componentProps.isHomeTeamForAnalysis=h===1,n.view.filterMultiple={isHomeTeam:n.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const h=r[1];if(h===3)this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.isHomeTeam=i%2===0,u.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam}});else{const u=h===1;if(this.childViews.length>0){const i=this.childViews[0];i.view.componentProps.isHomeTeamForAnalysis=u,i.view.isHomeTeam=u,i.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",i.view.filterMultiple={isHomeTeam:u},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const h=r[0],u=r[1];if(u===3){if(this.childViews.length>h.length){const i=h.map(p=>{const l=p.join("-");return R4.get(this.viewId).analysisTypes.get(l).analysisType});this.childViews.reduce((p,l)=>(i.includes(l.view.componentProps.analysisType)||p.push(l.view.componentProps.analysisType),p),[]).forEach(p=>{const l=this.childViews.findIndex(n=>n.view.componentProps.analysisType===p);if(l!==-1){const n=this.childViews[l];this.removeChildView(n)}})}}else{const i=u===1,p=this.getHomeTeamViews(),l=this.getAwayTeamViews();if(i&&p.length===0)l.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=i,n.view.isHomeTeam=i,n.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(!i&&l.length===0)p.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=i,n.view.isHomeTeam=i,n.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(p.length===l.length)i||p.forEach(n=>{n.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}}),(i?l:p).forEach(n=>{this.removeChildView(n)});else{const n=i?this.getHomeTeamViews():this.getAwayTeamViews();if(n.length>h.length){const k=h.map(T=>{const x=T.join("-");return R4.get(this.viewId).analysisTypes.get(x).analysisType});n.forEach(T=>{k.includes(T.view.componentProps.analysisType)?T.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}:this.removeChildView(T)})}else n.forEach(k=>{k.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}})}}}if(this.viewId===2){const h=r[0]||[];if(Array.isArray(h)){const u=this.childViews.map(i=>{var p,l;const n=(p=i.view.componentProps)==null?void 0:p.categoryView,k=((l=i.view.filterMultiple)==null?void 0:l.teamType)||1,T=n&&n.length>0?n[0].id:null;return T?{categoryId:T,teamType:k,viewId:i.view.id}:null}).filter(i=>i!==null);if(a){const i=this.childViews.find(p=>p.view.id===a);if(i){const p=r[1]||1,l=h[0];if(l){let n=null;try{n=A4(l)}catch{}i.view.filterMultiple={categoryId:l,teamType:p},i.view.componentProps.game&&(p===1?i.view.componentProps.teamView=i.view.componentProps.game.homeTeam.team_id:p===2?i.view.componentProps.teamView=i.view.componentProps.game.awayTeam.team_id:i.view.componentProps.teamView=0),i.view.componentProps.categoryView=n?[{id:l,name:n.name}]:[{id:l,name:`Category ${l}`}]}}}if(!a){const i=r[1]||1;this.childViews.forEach(p=>{var l;const n=(l=p.view.componentProps)==null?void 0:l.categoryView;if(n&&n.length>0){const k=n[0].id;h.includes(k)&&(p.view.filterMultiple={categoryId:k,teamType:i})}})}if(u.map(i=>i.categoryId).filter(i=>!h.includes(i)).forEach(i=>{this.childViews.filter(p=>{var l;const n=(l=p.view.componentProps)==null?void 0:l.categoryView;return n&&n.length>0&&n[0].id===i}).forEach(p=>{this.removeChildView(p),Sd.emit("component-removed",{viewId:p.view.id,categoryId:i})})}),a){const i=h[0];if(i){const p=this.childViews.find(l=>l.view.id===a);if(p){let l=null;try{l=A4(i)}catch{}const n=r[1]||1;p.view.filterMultiple={categoryId:i,teamType:n},p.view.componentProps.game&&(p.view.componentProps.teamView=n===2?p.view.componentProps.game.awayTeam.team_id:n===1?p.view.componentProps.game.homeTeam.team_id:0),p.view.componentProps.categoryView=l?[{id:i,name:l.name}]:[{id:i,name:`Category ${i}`}]}}}}else{const u=h;if(u&&a){const i=this.childViews.find(p=>p.view.id===a);if(i){let p=null;try{p=A4(u)}catch{}const l=r[1]||1;i.view.filterMultiple={categoryId:u,teamType:l},i.view.componentProps.game&&(i.view.componentProps.teamView=l===2?i.view.componentProps.game.awayTeam.team_id:l===1?i.view.componentProps.game.homeTeam.team_id:0),i.view.componentProps.categoryView=p?[{id:u,name:p.name}]:[{id:u,name:`Category ${u}`}]}}}}if(this.viewId===8){const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.areInactiveVisible=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}if(this.viewId===1){const h=r[0]||[];if(a){this.setDynamicFilters(r,a);const u=this.childViews.find(i=>i.view.id===a);u&&this.updateComparative(u,r)}else if(this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.type)||u.push(i.view.componentProps.type),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.type===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const l=this.childViews[p+1],n=this.childViews[p];l&&(n.view.componentProps.type=l.view.componentProps.type,n.view.title=l.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(h))this.childViews.length>0&&h.length>0&&this.childViews.forEach((u,i)=>{if(u.view.componentProps&&i<h.length){const p=h[i],l=R4.get(this.viewId);u.view.componentProps.type=p,u.view.componentProps.default=!1,u.view.title=`Comparativa ${l[p]}`,u.view.filterMultiple={category:p}}});else{const u=h;if(u&&this.childViews.length>0){const i=this.childViews[0];if(i.view.componentProps){const p=R4.get(this.viewId);i.view.componentProps.type=u,i.view.componentProps.default=!1,i.view.title=`Comparativa ${p[u]}`,i.view.filterMultiple={category:u}}}}}if(this.viewId===6){const h=r[0]||[];if(a){this.setDynamicFilters(r,a);const u=this.childViews.find(i=>i.view.id===a);u&&this.updateGSCLineupsReports(u,r)}else{if(Array.isArray(h))if(h.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.gameNumber)||u.push(i.view.componentProps.gameNumber),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.gameNumber===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const l=this.childViews[p+1],n=this.childViews[p];l&&(n.view.componentProps.gameNumber=l.view.componentProps.gameNumber,n.view.filterMultiple={gameNumber:l.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(a){this.setDynamicFilters(r,a);const h=this.childViews.find(u=>u.view.id===a);h&&this.updateMatchSummary(h,r)}else{const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.desplegable=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const h=r[1]||[];if(a){this.setDynamicFilters(r,a);const u=this.childViews.find(i=>i.view.id===a);u&&(u.view.componentProps&&(u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now()),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))}else this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const h=r[0]||1,u=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(a){this.setDynamicFilters(r,a);const i=this.childViews.find(p=>p.view.id===a);i&&i.view.componentProps&&(i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))}else this.childViews.forEach(i=>{i.view.componentProps&&(i.view.componentProps._isReactive||(i.view.componentProps=t.reactive(i.view.componentProps),i.view.componentProps._isReactive=!0),i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))})}if(this.viewId===4){const h=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(a){const u=this.childViews.find(i=>i.view.id===a);u&&u.view.componentProps.selectedEvents}else if(!h&&this.childViews.length>0)this.childViews.forEach(u=>{this.removeChildView(u)});else if(h&&this.childViews.length===0){const u={pageId:null,view:{id:this.viewId,name:"Timeline",title:"Timeline",colspan:12,rowspan:6,max_column:12,max_row:12,min_column:6,min_row:4},filterAndWidgetContainer:this};Sd.emit("add-view",u)}else this.childViews.forEach(u=>{this.updateTimeline(u,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,a=!1){const v=this.childViews.findIndex($=>$.view.id===r.view.id);if(v!==-1){const $=this.childViews[v];this.childViews.splice(v,1),$.view.id&&this.componentSpecificFilters.delete($.view.id);const h=$.grid,u=$.page,i=document.querySelector(`[gs-id="${$.view.id}"]`);if(h&&i&&(h.removeWidget(i),u&&!a)){const p=u.items.findIndex(l=>l.id===$.view.id);p!==-1&&(u.items.splice(p,1),u.items.length===0&&Sd.emit("empty-page",u))}}}updateView({view:r,dynamicFilters:a,filtersJSON:v,filters:$}){this.setFiltersJSON(v),this.dynamicFilters=a;const h=this.childViews.find(u=>{var i;return((i=u.view)==null?void 0:i.id)===r.view.id});if(h){h.view.filtersJSON=v,h.view.coreView&&(h.view.coreView.filtersJSON=v);let u=a;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i),this.updateSummary({dynamicFilters:u})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}this.viewId===5?this.updateVolumetricField(h,u):this.viewId===7?this.updateGoalData(h,u):this.viewId===9?this.updateFieldDataByZones(h,a):this.viewId===10?this.updateXg(h,u):this.viewId===3?this.updateMatchSummary(h,u):this.viewId===4?this.updateTimeline(h,u):this.viewId===8?this.updateFieldPosesion(h,u):this.viewId===1?this.updateComparative(h,u):this.viewId===2?this.updateGSCtops(h,u):this.viewId===6?this.updateGSCLineupsReports(h,u):this.viewId===16?this.updateLastTouchSingle(h,$):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(h,$)}}updateComparative(r,a){if(r.view.componentProps){const v=a[0]||[];if(v&&v.length>0){let $;if(Array.isArray(v)){const u=this.childViews.findIndex(i=>i.view.id===r.view.id);u>=0&&u<v.length?$=v[u]:$=v[0]}else $=v;const h=R4.get(this.viewId);r.view.componentProps.type=$,r.view.componentProps.default=!1,r.view.title=`Comparativa ${h[$]}`,r.view.filterMultiple={category:$}}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a})}}updateVolumetricField(r,a){if(r.view.componentProps){const v=a[0]||1;r.view.isHomeTeam=v===1,r.view.componentProps.preMatchType=v,r.view.filterMultiple={isHomeTeam:v},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,a){if(r.view.componentProps){const v=a[0]===1?"offensive":"defensive",$=a[1]===1;r.view.componentProps.analysisType=v,r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={isHomeTeam:$},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,a){if(r.view.componentProps){const v=a[0],$=a[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={categoryIds:v,isHomeTeam:$},v&&v.length){const h=v.join("-"),u=R4.get(this.viewId).analysisTypes.get(h);u&&(r.view.componentProps.analysisType=u.analysisType,r.view.title=u.title,r.view.titleShort=u.titleShort)}}}updateXg(r,a){const v=a[0]===1;r.view.componentProps&&(r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:v})}updateMatchSummary(r,a){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=a&&a.length>0?a[0]:!1;r.view.componentProps.desplegable=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a})}}updateTimeline(r,a){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(r.view.id)||a,$=v&&v.length>0?v[0]:[];r.view.componentProps.selectedEvents=$,r.view.componentProps.key=$.length>0;const h=this.hasEventTypeId($,1),u=this.hasCategoryId($,8),i=this.hasCategoryId($,9),p=this.hasEventTypeId($,3);r.view.componentProps.goals=h,r.view.componentProps.yellowCards=u,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=p,r.view.componentProps._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:v}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:v}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldPosesion(r,a){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=a&&a.length>0?a[0]:!1;r.view.componentProps.areInactiveVisible=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a})}}updateGSCtops(r,a){if(r.view.componentProps){const v=a[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=a[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}else{const $=v;if($){let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=a[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}}}updateGSCLineupsReports(r,a){if(r.view.componentProps){const v=a[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$}}else{const $=v;$&&(r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$)}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,a){if(!r||!a)return null;for(const v of a){const $=v.join("-"),h=R4.get(this.viewId);if(h&&h.analysisTypes){const u=h.analysisTypes.get($);if(u&&u.analysisType===r)return v[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach($=>{$.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,$.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,$.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,$.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map($=>$.value),a=r.map($=>$.name),v=this.filters.selectedTeam.value;if(v===3)this.childViews.length>r&&this.childViews.reduce(($,h)=>(a.includes(h.view.componentProps.categories[0].name)||$.push(h.view.componentProps.categories[0].name),$),[]).forEach($=>{const h=this.childViews.findIndex(u=>u.view.componentProps.categories[0].name===$);if(h!==-1){const u=this.childViews[h];this.removeChildView(u)}});else{const $=v===1,h=this.getHomeTeamViews(),u=this.getAwayTeamViews();if($&&h.length===0)u.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(!$&&u.length===0)h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(h.length===u.length)$||h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$}),($?u:h).forEach(i=>{this.removeChildView(i)});else{const i=$?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const p=r.map(l=>l.name);i.forEach(l=>{p.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=$:this.removeChildView(l)})}else i.forEach(p=>{p.view.filterMultiple.isHomeTeam=$})}}}updateLastTouchSingle(r,a){if(r.view.componentProps){const v=a.selectedTeam.value===1,$=a.selectedCategory.value;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.categories=[$],r.view.componentProps.analysisType=a.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=a.isAssistZoneVisible,r.view.componentProps.howManyGames=a.howManyGamesSelected.value,r.view.title=$.name,r.view.titleShort=$.name,r.view.isHomeTeam=v,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:$,selectedGamePhase:a.selectedGamePhase,howManyGamesSelected:a.howManyGamesSelected,isAssistZoneVisible:a.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(console.log("updateSpecificPlaysFilters called"),!this.filters){console.warn("No filters available in updateCornershFilters");return}this.childViews.forEach(a=>{a.view.componentProps.advancedFilters=this.filters.advancedFilters,a.view.componentProps.howManyCorners=this.filters.howManyCorners,a.view.componentProps.isAgainstMode=this.filters.isAgainstMode,a.view.filterMultiple.advancedFilters=this.filters.advancedFilters,a.view.filterMultiple.isAgainstMode=this.filters.isAgainstMode});const r=this.filters.selectedTeam.value;if(r===3){const a=this.getHomeTeamViews(),v=this.getAwayTeamViews();if(a.length+v.length>this.filters.howManyCorners*2){const $=[];a.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),v.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),$.forEach(h=>{this.removeChildView(h)})}}else{const a=r===1,v=this.getHomeTeamViews(),$=this.getAwayTeamViews();if(a&&v.length===0)$.forEach(h=>{console.log("awayView before update:",h),h.view.componentProps.isHomeTeamForAnalysis=a,h.view.isHomeTeam=a,h.view.filterMultiple.isHomeTeam=a});else if(!a&&$.length===0)v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=a,h.view.isHomeTeam=a,h.view.filterMultiple.isHomeTeam=a});else if(v.length===$.length)a||v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=a,h.view.isHomeTeam=a,h.view.filterMultiple.isHomeTeam=a}),(a?$:v).forEach(h=>{this.removeChildView(h)});else{const h=a?this.getHomeTeamViews():this.getAwayTeamViews();h.length>this.filters.howManyCorners?h.forEach((u,i)=>{i>=this.filters.howManyCorners?this.removeChildView(u):u.view.filterMultiple.isHomeTeam=a}):h.forEach(u=>{u.view.filterMultiple.isHomeTeam=a})}}}updateSpecificPlaysFiltersSingle(r,a){if(console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),console.log("view:",r),console.log("filter:",a),console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),a.selectedTeam&&r.view.componentProps){const v=a.selectedTeam.value===1;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=a.advancedFilters,r.view.componentProps.isAgainstMode=a.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:a.advancedFilters,isAgainstMode:a.isAgainstMode}}}}const sHe={class:"template-page__header"},lHe={class:"template-page__header__name"},cHe=["value"],uHe={class:"template-page__header__details"},dHe={class:"template-page__header__details__teams"},pHe={class:"template-page__header__details__teams__team"},hHe={key:0,class:"template-page__header__details__teams__team__logo"},fHe=["src"],mHe={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yHe={class:"template-page__header__details__teams__team"},gHe={key:0,class:"template-page__header__details__teams__team__logo"},vHe=["src"],bHe={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xHe={class:"template-page__content"},_He=["id"],wHe=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-max-w","gs-max-h","gs-min-w","gs-min-h","gs-no-resize","gs-no-move","gs-auto-position"],THe=t.defineComponent({__name:"TemplateReportPage",props:{token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},game:{type:Object,default:()=>null},lastGames:{type:Array,default:()=>null},id:{type:[String,Number],default:()=>String(Date.now())},page:{type:Object,default:()=>({title:"Page 1",items:[{name:"Tabla jugadores",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]})},isPostMatch:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},isFilterVisible:{type:Boolean,default:!1}},emits:["intersection-changed","delete-page","change-sort","edit-view","view-changed","component-props-updated","delete-view","dynamic-filters-changed"],setup(e,{emit:r}){var a,v,$,h,u,i,p;const l=t.ref(null);let n=null;const k=e,T=t.ref(!1),x=r,d=t.computed(()=>k.page.items.reduce((je,_e)=>(je.set(_e.id,_e),je),new Map)),o=t.computed(()=>{var je,_e,Ue,qe;return k.game&&k.game.homeTeam&&k.game.awayTeam?{homeTeam:{name:((je=k.game.homeTeam)==null?void 0:je.acronym)||"LOC",logo:((_e=k.game.homeTeam)==null?void 0:_e.logo)||null},awayTeam:{name:((Ue=k.game.awayTeam)==null?void 0:Ue.acronym)||"VIS",logo:((qe=k.game.awayTeam)==null?void 0:qe.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let c=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const je={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(qe=>{qe.forEach(Re=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},50)})},je);const _e=l.value;_e&&c.observe(_e);const Ue=document.querySelector(".container-main");Ue&&Ue.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}function I(je){k.page.title=je.target.value,x("view-changed")}const j={game_id:0,season_id:0,prematch:!1},F={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},W=new Map([[5,{component:jI,componentName:"GSCVolumetricField",props:{isGamePreMatch:!k.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:k.isTemplateMode,isTemplateMode:k.isTemplateMode,preMatchType:1}}],[2,{component:zj,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:k.game?k.game.id:F.gameId,game:k.game,season:k.game?(a=k==null?void 0:k.game)==null?void 0:a.season_id:F.seasonId,teamView:0,useDummyData:k.isTemplateMode}}],[8,{component:PW,componentName:"FieldPosesion",props:{widthSection:600,game:F,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:FK,componentName:"GSCLineupsReports",props:{selectedOption:k.isPostMatch?"Postmatch":"Prematch",game:j,gamehome:j,gameaway:j}}],[3,{component:UW,componentName:"GSCMatchSummary",props:{game:F,defaultShields:!0,desplegable:!1}}],[4,{component:_D,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:F.gameId,homeTeam:F.homeTeam.team_id,awayTeam:F.awayTeam.team_id,token:k.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:LB,componentName:"GSCGoalData",props:{game:k.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!k.isPostMatch,analysisType:1}}],[9,{component:IK,componentName:"GSCFieldDataByZones",props:{game:k.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!k.isPostMatch,negative:!0}}],[10,{component:nP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[13,{component:HF,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:k.game?(v=k==null?void 0:k.game)==null?void 0:v.season_id:0,teamsIds:[8,13],categoryIds:[20,2],analysisType:1,teamsshow:[1],gameId:90401,teams:[{id:8,name:"MAZ",logo:"https://golstatsimages.blob.core.windows.net/teams-80/8.png"},{id:13,name:"SNL",logo:"https://golstatsimages.blob.core.windows.net/teams-80/13.png"}]}}],[14,{component:lF,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:LX,componentName:"GSCStrengths",props:{token:k.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[17,{component:FG,componentName:"GSCCornersGeneralTrend",props:{game:k.game?{id:k.game.id||k.game.game_id||k.game.gameId||null,home_team:k.game.home_team||null,away_team:k.game.visiting_team||null,season:k.game.seasonId||k.game.season_id||null,game_status:k.game.game_status||k.game.status||null,home_acronym:k.game.home_team_acronym||(($=k.game.homeTeam)==null?void 0:$.acronym)||null,away_acronym:k.game.visiting_team_acronym||((h=k.game.awayTeam)==null?void 0:h.acronym)||null,logo_home:((u=k.game.homeTeam)==null?void 0:u.logo)||null,logo_away:((i=k.game.awayTeam)==null?void 0:i.logo)||null}:null,infavoragainstteam:!0,forseason:!1,forteam:!0,showdefault:!0,tournamentselected:{id:1},forgame:!1,lateralidad:"right",teamselected:2,filters:{},showBallGo:!0,showHeatMap:!0,ballOnOff:!1}}],[10,{component:nP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[1,{component:TB,componentName:"GSCComparativeReports",props:{gameId:k.game?k.game.id:"",homeLogo:k.game?k.game.homeTeam.logo:"",awayLogo:k.game?k.game.awayTeam.logo:"",seasonId:k.game?(p=k==null?void 0:k.game)==null?void 0:p.season_id:0,typeGame:k.isPostMatch,type:"stoppedBall",default:k.isTemplateMode}}],[16,{component:VX,componentName:"GSCLastTouch",props:{categories:[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}],gameIdsForAnalysis:[],isAssistZoneVisible:!1,seasonId:2010,analysisType:"offensive",teamIdForAnalysis:17,gameDataUTC:"2025-11-08T03:00:00Z",isHomeTeamForAnalysis:!0,isTemplateMode:k.isTemplateMode,isPreMatch:!k.isPostMatch}}],[18,{component:zZ,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:k.isTemplateMode,isPreMatch:!k.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,isAgainstMode:!1,game:{id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"},advancedFilters:{areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0}}}]]);function U(je){var _e,Ue,qe;if(((_e=je==null?void 0:je.coreView)==null?void 0:_e.id)===17&&je.dynamicFilters&&je.dynamicFilters[2]!==void 0){const Re=je.dynamicFilters[2];if(Re===1)return!0;if(Re===2)return!1;if(Re===3&&((Ue=je.filterMultiple)==null?void 0:Ue.isHomeTeam)!==void 0)return typeof je.filterMultiple.isHomeTeam=="boolean"?je.filterMultiple.isHomeTeam:je.filterMultiple.isHomeTeam===1}return(qe=je.componentProps)!=null&&qe.preMatchType?je.componentProps.preMatchType===1:je.isHomeTeam}function z(je){if(je)if(typeof je=="string"){let _e=null;switch(je){case"GSCVolumetricField":_e=jI;break;case"GSCGoalData":_e=LB;break;case"GscTopPlayer":_e=zj;break;case"FieldPosesion":_e=PW;break;case"GSCLineupsReports":_e=FK;break;case"GSCMatchSummary":_e=UW;break;case"GSCTimelineReports":_e=_D;break;case"GSCFieldDataByZones":_e=IK;break;case"GSCGeneraltable":_e=lF;break;case"GSCTimelapseTable":_e=HF;break;case"GSCGameXg":_e=nP;break;case"GSCComparativeReports":_e=TB;break;case"GSCStrengths":_e=LX;break;case"GSCCornersGeneralTrend":_e=FG;break;case"GSCLastTouch":_e=VX;break;case"GSCSpecificPlays":_e=zZ;break;default:_e=null}return _e}else return je;return null}function X({pageId:je,view:_e,filterAndWidgetContainer:Ue,applyMinimumSize:qe=!1,dynamicFilters:Re=[],filters:De=null}){if(k.page.id===je&&n){let Qe=!1;_e.id===3&&(Qe=Re[0]);const rt=`min_column${Qe?"_2":""}`,dt=`min_row${Qe?"_2":""}`,ct=`colspan${Qe?"_2":""}`,Ye=`rowspan${Qe?"_2":""}`,st={w:qe?_e[rt]:_e[ct],h:qe?_e[dt]:_e[Ye]};if(n.willItFit(0,0,st.w,st.h,!0)){const lt=n.addWidget(st),Ot=Number(lt.getAttribute("gs-x")||0),Mt=Number(lt.getAttribute("gs-y")||0);n.removeWidget(lt);const Et=W.get(_e.id),qt=t.reactive({...JSON.parse(JSON.stringify(Et.props))||{},_isReactive:!0}),Gt=t.reactive({pageId:je,grid:n,page:k.page,view:{name:_e.name,title:_e.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:Ot,y:Mt,w:st.w,h:st.h,maxWidth:_e.max_column,maxHeight:_e.max_row,minWidth:_e.min_column,minHeight:_e.min_row,componentName:Et.componentName,componentProps:qt,pageId:je,coreView:_e}});Ue.addView(Gt),Sd.emit("add-page-view",Gt)}else Sd.emit("add-page-and-view",{pageId:je,view:_e,filterAndWidgetContainer:Ue})}}function N(je){if(n){const _e=document.querySelector(`[gs-id="${je.id}"]`);_e&&(n.removeWidget(_e),x("delete-view",je))}}function Y(je){if(!je.filterAndViewsContainer&&je.coreView){const _e=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[je],je.coreView.id,je.dynamicFilters||[],k.isPostMatch,k.isTemplateMode,je.filtersJSON,null,je.filters);je.filterAndViewsContainer=_e}x("edit-view",je)}function se(){x("delete-page",k.page)}function me(){Sd.emit("change-sort",k.page)}function ge(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.itemId||Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function be(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function xe(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps||{}),_e._updateKey=Date.now())}const Ae=function(){Sd.off("add-view",X),Sd.off("force-component-update",ge),Sd.off("component-props-updated",be),Sd.off("dynamic-filters-changed",xe);const je=document.querySelector(".container-main");je&&je.removeEventListener("scroll",P),s&&clearTimeout(s),g&&clearTimeout(g)};return Sd.on("add-view",X),Sd.on("force-component-update",ge),Sd.on("component-props-updated",be),Sd.on("dynamic-filters-changed",xe),t.onMounted(async()=>{await t.nextTick(),n=Rh.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${k.id}`),n.on("change",(je,_e)=>{const Ue=_e[0];if(Ue){const qe=d.value.get(Ue.id);qe&&(qe.x=Ue.x,qe.y=Ue.y,qe.w=Ue.w,qe.h=Ue.h,x("view-changed"))}}),V(),k.page.grid=n,k.page.offListeners=Ae}),t.onUnmounted(()=>{c&&c.disconnect(),Ae(),s&&clearTimeout(s),g&&clearTimeout(g),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E)}),(je,_e)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"templatePage",ref:l,class:"template-page"},[t.createElementVNode("div",sHe,[T.value?(t.openBlock(),t.createBlock(MZ,{key:0,"options-type":"page",onClick:_e[0]||(_e[0]=t.withModifiers(Ue=>T.value=!1,["self"])),onMouseleave:_e[1]||(_e[1]=Ue=>T.value=!1),onCloseTooltip:_e[2]||(_e[2]=Ue=>T.value=!1),onDeletePage:se,onChangeSort:me})):t.createCommentVNode("",!0),t.createElementVNode("div",lHe,[_e[4]||(_e[4]=t.createElementVNode("div",null,[t.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M11.2986 12.9994C7.62909 14.8341 4.11744 16.0178 1.35547 16.4518L9.18763 20.0029C9.34545 20.0818 9.60192 20.0818 9.74002 20.0029L17.8878 16.3137C18.0457 16.2348 18.164 16.0572 18.164 15.8797V8.75781C16.2898 10.2177 13.9422 11.6776 11.2986 12.9994Z",fill:"white"}),t.createElementVNode("path",{d:"M4.7152 8.89735C4.7152 8.89735 10.9494 3.76802 16.8482 1.20335C15.0529 0.946887 11.3637 0.43395 9.3711 0.453678C4.41928 0.493135 1.06546 1.34145 1.06546 1.34145C0.90763 1.3809 0.769531 1.55846 0.769531 1.71629V8.12795C3.01857 6.56942 5.34651 5.56329 5.34651 5.56329C5.34651 5.56329 2.72264 7.06263 0.769531 8.81844V9.41028V14.1648C3.09748 13.9675 6.62886 12.7641 10.3575 10.7321C13.6719 8.91707 16.4733 6.84562 18.17 5.05035V2.40677C14.3032 3.37346 4.7152 8.89735 4.7152 8.89735Z",fill:"white"})])],-1)),_e[5]||(_e[5]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:I},null,40,cHe)]),t.createElementVNode("div",uHe,[t.createElementVNode("div",dHe,[t.createElementVNode("div",pHe,[o.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",hHe,[t.createElementVNode("img",{src:o.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,fHe)])):(t.openBlock(),t.createElementBlock("svg",mHe,[..._e[6]||(_e[6]=[t.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])])),t.createElementVNode("span",null,t.toDisplayString(o.value.homeTeam.name),1)]),_e[8]||(_e[8]=t.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),t.createElementVNode("div",yHe,[t.createElementVNode("span",null,t.toDisplayString(o.value.awayTeam.name),1),o.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",gHe,[t.createElementVNode("img",{src:o.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,vHe)])):(t.openBlock(),t.createElementBlock("svg",bHe,[..._e[7]||(_e[7]=[t.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])]))])]),e.isTemplateMode&&!e.isFilterVisible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:_e[3]||(_e[3]=Ue=>T.value=!0)},[..._e[9]||(_e[9]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",xHe,[t.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.page.items,Ue=>{var qe;return t.openBlock(),t.createElementBlock("div",{class:"grid-stack-item",key:Ue.key,"gs-id":Ue.id,"gs-x":Ue.x,"gs-y":Ue.y,"gs-w":Ue.w,"gs-h":Ue.h,"gs-max-w":Ue.maxWidth,"gs-max-h":Ue.maxHeight,"gs-min-w":Ue.minWidth,"gs-min-h":Ue.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!k.isTemplateMode,"gs-auto-position":Ue.x===0&&Ue.y===0},[t.createElementVNode("div",{class:t.normalizeClass(["grid-stack-item-content",{"is-selected":Ue.isSelected}])},[t.createVNode(YJe,{view:Ue,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":U(Ue),"is-filter-visible":e.isFilterVisible,"view-id":((qe=Ue==null?void 0:Ue.coreView)==null?void 0:qe.id)||0,onEdit:Re=>Y(Ue),onDelete:Re=>N(Ue)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(z(Ue.componentName)),t.mergeProps({ref_for:!0},Ue.componentProps,{key:`${Ue.id}-${Ue._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,wHe)}),128))],8,_He)])],512))}}),SHe=t2(THe,[["__scopeId","data-v-b0bc39a0"]]),kHe={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},LHe={key:0,class:"cover__main-logo cover__main-logo__home"},CHe={key:0,class:"team-logo"},OHe=["src"],NHe={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},EHe=["fill"],zHe={key:1,class:"cover__main-logo cover__main-logo__away"},MHe={key:0,class:"team-logo"},VHe=["src"],PHe={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},AHe=["fill"],RHe={class:"cover__title-subtitle"},UHe={class:"cover__title-subtitle__title"},FHe={class:"cover__title-subtitle__subtitle"},IHe={key:2,class:"cover-type-one"},qHe={class:"team-info-one"},jHe={class:"team-data"},WHe={key:0,class:"team-logo"},DHe=["src"],KHe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},BHe=["fill","opacity"],XHe={class:"team-name"},GHe={key:0,class:"team-events"},ZHe={class:"score-one"},JHe={key:0},HHe={class:"team-info-one"},YHe={class:"team-data"},QHe={key:0,class:"team-logo"},$He=["src"],eYe={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tYe=["fill","opacity"],rYe={class:"team-name"},aYe={key:0,class:"team-events"},nYe={key:3,class:"cover-type-two"},iYe={class:"team-data"},oYe={class:"team-info"},sYe={key:0,class:"team-logo"},lYe=["src"],cYe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uYe=["fill","opacity"],dYe={key:2,class:"team-score-two"},pYe={key:0,class:"team-goals"},hYe={class:"team-data"},fYe={class:"team-info"},mYe={key:0,class:"team-score-two"},yYe={key:1,class:"team-logo"},gYe=["src"],vYe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},bYe=["fill","opacity"],xYe={key:0,class:"team-goals"},_Ye={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:r}){const a=e,v=r,$=t.ref(null),h=t.computed(()=>[1,2].includes(a.coverId)),u=t.computed(()=>[1,3].includes(a.coverId)),i=t.computed(()=>a.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:a.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),p=t.computed(()=>a.game&&a.game.score?a.game.score:["0","0"]),l=t.computed(()=>{var I,j,F,W,U,z,X,N;if(a.game&&a.game.homeTeam&&a.game.awayTeam){const Y={homeTeam:{name:((I=a.game.homeTeam)==null?void 0:I.acronym)||"LOC",logo:((j=a.game.homeTeam)==null?void 0:j.logo)||null},awayTeam:{name:((F=a.game.awayTeam)==null?void 0:F.acronym)||"VIS",logo:((W=a.game.awayTeam)==null?void 0:W.logo)||null}};return h.value?(Y.homeTeam.goalsMinutes=o(a.game.minutes.home_goals_minutes),Y.homeTeam.totalYellowCards=((U=a.game.minutes.home_yellow_cards_minutes)==null?void 0:U.length)||0,Y.homeTeam.totalRedCards=((z=a.game.minutes.home_red_cards_minutes)==null?void 0:z.length)||0,Y.awayTeam.goalsMinutes=o(a.game.minutes.visiting_goals_minutes),Y.awayTeam.totalYellowCards=((X=a.game.minutes.away_yellow_cards_minutes)==null?void 0:X.length)||0,Y.awayTeam.totalRedCards=((N=a.game.minutes.away_red_cards_minutes)==null?void 0:N.length)||0):(Y.homeTeam.goalsEvents=d(a.game.report_minutes.home_goals_minutes),Y.awayTeam.goalsEvents=d(a.game.report_minutes.visiting_goals_minutes)),Y}return{homeTeam:{name:"LOC",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]},awayTeam:{name:"VIS",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]}}}),n=t.computed(()=>({"--background-image":u.value?"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-01@2x.jpg)":"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-02@2x.jpg)","--grid-template-columns-type-one":a.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":a.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":a.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":a.isPostMatch?"100%":"fit-content"})),k=t.computed(()=>a.isPostMatch?"Postmatch":"Prematch"),T=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],x=t.computed(()=>{if(a.game){let I=kHe[a.game.matchday_abbreviation];I||(I=a.game.matchday_abbreviation.replace("M","J"));const[j,F,W]=a.game.date.split("-");return`${I} - ${W} ${T[Number(F)-1]}, ${j}`}return"Jornada - Día 00 Mes"});function d(I){return!I||!Array.isArray(I)||I.length===0?"":I.map(j=>{const F=j.split(", ");let W=F[0].replace("'","");W=W.replace("+",""),W=W.replace("’","");const U=W.split(" "),{strings:z,numbers:X}=U.reduce((se,me)=>(isNaN(Number(me))?se.strings.push(me):se.numbers.push(me),se),{strings:[],numbers:[]}),N=z.join(" "),Y=X.length===1?`${X[0]}'`:`${X[0]}' ${X.slice(1).join(" + ")}'`;return{playerName:N,goalTime:F.length===1?Y:`${Y}, ${F.reduce((se,me,ge)=>ge===0?se:`${se}${me}${ge<F.length-1?", ":""}`,"")}`}})}function o(I){return!I||!Array.isArray(I)||I.length===0?"":I.reduce((j,F,W)=>{const U=F.split(" ");let z="";return U.length===3?z=U[2]:U.length===5&&(z=`${U[2]} ${U[3]} ${U[4]}`),z&&(j+=`${z}${W<I.length-1?", ":""}`),j},"")}let c=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const I={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(W=>{W.forEach(U=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",U.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",U.isIntersecting)},50)})},I);const j=$.value;j&&c.observe(j);const F=document.querySelector(".container-main");F&&F.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}return t.onMounted(()=>{V()}),t.onUnmounted(()=>{c&&c.disconnect();const I=document.querySelector(".container-main");I&&I.removeEventListener("scroll",P),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E),s&&clearTimeout(s),g&&clearTimeout(g)}),(I,j)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"coverPage",ref:$,class:"cover",style:t.normalizeStyle(n.value)},[h.value?(t.openBlock(),t.createElementBlock("div",LHe,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",CHe,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,OHe)])):(t.openBlock(),t.createElementBlock("svg",NHe,[t.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:i.value.homeTeam},null,8,EHe)]))])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("div",zHe,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",MHe,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,VHe)])):(t.openBlock(),t.createElementBlock("svg",PHe,[t.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:i.value.awayTeam},null,8,AHe)]))])):t.createCommentVNode("",!0),t.createElementVNode("div",RHe,[t.createElementVNode("div",UHe,[j[0]||(j[0]=t.createElementVNode("div",null,"Análisis",-1)),t.createElementVNode("div",null,t.toDisplayString(k.value),1)]),t.createElementVNode("div",FHe,t.toDisplayString(x.value),1)]),h.value?(t.openBlock(),t.createElementBlock("div",IHe,[t.createElementVNode("div",qHe,[t.createElementVNode("div",jHe,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",WHe,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,DHe)])):(t.openBlock(),t.createElementBlock("svg",KHe,[t.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:i.value.homeTeam,opacity:i.value.opacity},null,8,BHe)])),t.createElementVNode("div",XHe,t.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",GHe,[j[1]||(j[1]=t.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),t.createElementVNode("div",null,t.toDisplayString(l.value.homeTeam.goalsMinutes),1),j[2]||(j[2]=t.createElementVNode("div",{class:"separator"},null,-1)),j[3]||(j[3]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.homeTeam.totalYellowCards),1),j[4]||(j[4]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.homeTeam.totalRedCards),1)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",ZHe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",JHe,t.toDisplayString(p.value[0])+" : "+t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",HHe,[t.createElementVNode("div",YHe,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",QHe,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,$He)])):(t.openBlock(),t.createElementBlock("svg",eYe,[t.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:i.value.awayTeam,opacity:i.value.opacity},null,8,tYe)])),t.createElementVNode("div",rYe,t.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",aYe,[t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.totalYellowCards),1),j[5]||(j[5]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.totalRedCards),1),j[6]||(j[6]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),j[7]||(j[7]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.goalsMinutes),1),j[8]||(j[8]=t.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))])):t.createCommentVNode("",!0)])])):(t.openBlock(),t.createElementBlock("div",nYe,[t.createElementVNode("div",iYe,[t.createElementVNode("div",oYe,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",sYe,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,lYe)])):(t.openBlock(),t.createElementBlock("svg",cYe,[t.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:i.value.homeTeam,opacity:i.value.opacity},null,8,uYe)])),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",dYe,t.toDisplayString(p.value[0]),1)):t.createCommentVNode("",!0)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",pYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.homeTeam.goalsEvents,(F,W)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-${W}`,class:"goal"},[t.createElementVNode("div",null,t.toDisplayString(F.playerName),1),j[9]||(j[9]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(F.goalTime),1),j[10]||(j[10]=t.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))]))),128))])):t.createCommentVNode("",!0)]),j[13]||(j[13]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",hYe,[t.createElementVNode("div",fYe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",mYe,t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0),l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",yYe,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,gYe)])):(t.openBlock(),t.createElementBlock("svg",vYe,[t.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:i.value.awayTeam,opacity:i.value.opacity},null,8,bYe)]))]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",xYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.awayTeam.goalsEvents,(F,W)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-a-${W}`,class:"goal"},[j[11]||(j[11]=t.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),t.createElementVNode("div",null,t.toDisplayString(F.goalTime),1),j[12]||(j[12]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(F.playerName),1)]))),128))])):t.createCommentVNode("",!0)])]))],4))}},wYe=t2(_Ye,[["__scopeId","data-v-6680cbcf"]]),TYe={class:"table-category-filters"},SYe={key:0,class:"custom-radio-group filter-inline"},kYe={class:"radio-label"},LYe={class:"radio-options"},CYe=["name","value","onUpdate:modelValue","onClick"],OYe=["data-filter-type","onClick","onMousedown","onMouseup"],NYe={class:"select-display"},EYe={class:"select-label"},zYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},MYe={class:"simple-select-scroll-area"},VYe=["onClick"],PYe={class:"option-content"},AYe={class:"option-title"},RYe={key:0,class:"option-checkmark"},UYe={key:2,class:"filter-separator"},FYe={__name:"TableCategoryFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:13}},emits:["filters-changed","filter-updated"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref([]);let u=null;const i=(S,L)=>{if(!L)return!0;for(let E=0;E<S.length;E++)if(!p(S[E],L[E]))return!0;return!1},p=(S,L)=>{if(Array.isArray(S)&&Array.isArray(L)){if(S.length!==L.length)return!1;for(let E=0;E<S.length;E++)if(S[E]!==L[E])return!1;return!0}return S===L},l=t.ref(null),n=t.ref([]);let k=!1,T=null;const x=()=>{T=null},d=()=>{setTimeout(()=>{k=!1},1e3)},o=(S,L=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const E=v.filters[0].options,P=v.filters[1].options;S!=null?E.findIndex(V=>V.value===S)!==-1&&P[S]?(n.value=P[S],L&&!(()=>{const V=h.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!k&&n.value.length>0&&(h.value[1]=n.value[0].value,t.nextTick(()=>{}))):(n.value=[],h.value[1]=null):(n.value=[],h.value[1]=null)}},c=()=>{v.initialValues&&v.initialValues.length>0?h.value=[...v.initialValues]:h.value=v.filters.map(S=>{var L,E,P,V;return S.type==="select"?[]:S.type==="check"?!1:S.type==="radio-button"?((E=(L=S.options)==null?void 0:L[0])==null?void 0:E.value)||null:S.type==="select-simple"&&((V=(P=S.options)==null?void 0:P[0])==null?void 0:V.value)||null}),v.componentId===13&&h.value.some(S=>S!=null&&(Array.isArray(S)?S.length>0:S!==!1&&S!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};c(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!k){const S=!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})();o(h.value[0],S)}})},300),t.watch(()=>v.initialValues,S=>{const L=!p(h.value,S),E=S&&S.length>0&&!k&&L,P=v.isEditMode&&k;E&&!P?h.value=[...S]:k?T&&T.length>0&&(h.value=[...T]):P&&T&&T.length>0&&(h.value=[...T])},{deep:!0}),t.watch(()=>v.isEditMode,(S,L)=>{L===!0&&S===!1&&x()},{immediate:!0}),t.watch(h,(S,L)=>{S.some(E=>E!=null&&(Array.isArray(E)?E.length>0:E!==!1&&E!==""))&&i(S,u)&&(u=[...S],$("filters-changed",{componentId:v.componentId,filters:S,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(S,L)=>{S!==L&&L!==void 0?o(S,!0):L===void 0&&S!==null&&S!==void 0&&o(S,!1)},{immediate:!0}),t.watch(()=>h.value,(S,L)=>{v.filters.map((E,P)=>E.type==="radio-button"?P:-1).filter(E=>E!==-1).forEach(E=>{})},{deep:!0}),t.watch(n,()=>{},{deep:!0});const s=S=>{l.value===S?l.value=null:l.value=S},f=(S,L)=>{if(k=!0,d(),h.value[S]=L,(S===0||S===1)&&(T=[...h.value]),l.value=null,S===0){h.value[1]!==void 0&&(h.value[1]=null);const E=k;k=!1,o(L,!0),k=E,h.value[1]!==null&&h.value[1]!==void 0&&(T=[...h.value])}},g=()=>{k=!0,setTimeout(()=>{k=!1},1e3)};return r({getCurrentValues:()=>h.value,initializeValues:c}),(S,L)=>(t.openBlock(),t.createElementBlock("div",TYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(E,P)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:P},[E.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",SYe,[t.createElementVNode("div",kYe,t.toDisplayString(E.label),1),t.createElementVNode("div",LYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.options,V=>(t.openBlock(),t.createElementBlock("label",{key:V.value,class:t.normalizeClass(["radio-option-card",{active:h.value[P]===V.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"table-radio-"+P,value:V.value,"onUpdate:modelValue":I=>h.value[P]=I,onChange:L[0]||(L[0]=()=>{g()}),onClick:I=>console.log("Click en radio button",P,V.value,"Valor actual:",h.value[P])},null,40,CYe),[[t.vModelRadio,h.value[P]]]),t.createElementVNode("span",null,t.toDisplayString(V.label),1)],2))),128))])])):E.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":E.type,onClick:t.withModifiers(V=>s(P),["stop"]),onMousedown:V=>console.log("Mouse down en selector",P),onMouseup:V=>console.log("Mouse up en selector",P)},[t.createElementVNode("div",NYe,[L[2]||(L[2]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",EYe,t.toDisplayString(E.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:l.value===P}])},[...L[1]||(L[1]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===P?(t.openBlock(),t.createElementBlock("div",zYe,[t.createElementVNode("div",MYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P===1?n.value:E.options,V=>(t.openBlock(),t.createElementBlock("div",{key:V.value,class:t.normalizeClass(["option-card simple-select-option",{active:p(h.value[P],V.value)}]),onClick:t.withModifiers(I=>f(P,V.value),["stop"])},[t.createElementVNode("div",PYe,[t.createElementVNode("div",AYe,t.toDisplayString(V.label),1)]),p(h.value[P],V.value)?(t.openBlock(),t.createElementBlock("div",RYe,[...L[3]||(L[3]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,VYe))),128))])])):t.createCommentVNode("",!0)],40,OYe)):t.createCommentVNode("",!0),P===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",UYe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},IYe=t2(FYe,[["__scopeId","data-v-9d00f072"]]),qYe={class:"strengths-filters"},jYe={key:0,class:"custom-radio-group filter-inline"},WYe={class:"radio-label"},DYe={class:"radio-options"},KYe=["name","value","onUpdate:modelValue"],BYe={class:"filter-inline select-with-label"},XYe=["data-filter-type","onClick"],GYe={class:"select-display"},ZYe={class:"select-label"},JYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},HYe={class:"simple-select-scroll-area"},YYe=["onClick"],QYe={class:"option-content"},$Ye={class:"option-title"},eQe={key:0,class:"option-checkmark"},tQe={key:2,class:"filter-separator"},rQe={__name:"StrengthsFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:15}},emits:["filters-changed","filter-updated"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref([]);let l=!1,n=null;const k=(s,f)=>{if(Array.isArray(s)&&Array.isArray(f)){if(s.length!==f.length)return!1;for(let g=0;g<s.length;g++)if(s[g]!==f[g])return!1;return!0}return s===f},T=(s,f=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const g=v.filters[0].options,S=v.filters[1].options;s!=null?g.findIndex(L=>L.value===s)!==-1&&S[s]?(p.value=S[s],f&&!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!l&&p.value.length>0&&(h.value[1]=p.value[0].value,t.nextTick(()=>{}))):(p.value=[],h.value[1]=null):(p.value=[],h.value[1]=null)}},x=()=>{if(v.initialValues&&v.initialValues.length>0){const f=v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",f),f?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",v.initialValues),h.value=[...v.initialValues]):v.isEditMode?h.value=v.filters.map((g,S)=>{var L,E,P,V,I,j,F,W,U,z;const X=v.initialValues[S];if(console.log(`StrengthsFilters initializeValues - filter[${S}]:`,g==null?void 0:g.type,"filterData:",X),!X)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${S}, usando valor por defecto`),g.type==="select"?[]:g.type==="check"?!1:g.type==="radio-button"?((E=(L=g.options)==null?void 0:L[0])==null?void 0:E.value)||null:g.type==="select-simple"&&((V=(P=g.options)==null?void 0:P[0])==null?void 0:V.value)||null;if(g.type==="radio-button"&&X.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",X.selectedOption,"index:",S);const N=X.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",N),N}else{if(g.type==="radio-button"&&!X.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",X,"index:",S),X.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",X.selectedValue),X.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((j=(I=g.options)==null?void 0:I[0])==null?void 0:j.value)||null);if(g.type==="select-simple"&&X.selectedValue!==void 0)return Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue;if(g.type==="select"&&X.selectedOptions)return X.selectedOptions.map(N=>N.value);if(g.type==="check"&&X.isChecked!==void 0)return X.isChecked}return X.selectedValue!==void 0?X.selectedValue:g.type==="select"?[]:g.type==="check"?!1:g.type==="radio-button"?((W=(F=g.options)==null?void 0:F[0])==null?void 0:W.value)||null:g.type==="select-simple"&&((z=(U=g.options)==null?void 0:U[0])==null?void 0:z.value)||null}):h.value=[...v.initialValues]}else h.value=v.filters.map(f=>{var g,S,L,E;return f.type==="select"?[]:f.type==="check"?!1:f.type==="radio-button"?((S=(g=f.options)==null?void 0:g[0])==null?void 0:S.value)||null:f.type==="select-simple"&&((E=(L=f.options)==null?void 0:L[0])==null?void 0:E.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",h.value);const s=h.value.some(f=>f!=null&&(Array.isArray(f)?f.length>0:f!==!1&&f!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",s),s&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};x(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!l){const s=!(()=>{const f=h.value[1];return f==null?!1:Array.isArray(f)?f.length>0:f!==""})();T(h.value[0],s)}})},300),t.watch(()=>v.initialValues,(s,f)=>{if(!s||s.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",s),console.log("StrengthsFilters watch initialValues - oldValues:",f),console.log("StrengthsFilters watch initialValues - props.isEditMode:",v.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const g=s.length>0&&(typeof s[0]=="number"||typeof s[0]=="boolean"||s[0]===null||Array.isArray(s[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",g);const S=!k(h.value,s),L=s&&s.length>0&&!l&&S,E=v.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",S,"shouldUpdate:",L,"isEditModeProtection:",E),L&&!E?g?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",s),h.value=[...s]):v.isEditMode?h.value=v.filters.map((P,V)=>{const I=s[V];if(!I)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",V),h.value[V];if(P.type==="radio-button"&&I.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",I.selectedOption,"index:",V);const j=I.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",j),j}else{if(P.type==="select-simple"&&I.selectedValue!==void 0)return Array.isArray(I.selectedValue)?I.selectedValue[0]:I.selectedValue;if(P.type==="select"&&I.selectedOptions)return I.selectedOptions.map(j=>j.value);if(P.type==="check"&&I.isChecked!==void 0)return I.isChecked}return I.selectedValue!==void 0?I.selectedValue:h.value[V]}):h.value=[...s]:l?n&&n.length>0&&(h.value=[...n]):E&&n&&n.length>0&&(h.value=[...n])},{deep:!0}),t.watch(()=>v.isEditMode,(s,f)=>{f===!0&&s===!1&&(n=null)},{immediate:!0}),t.watch(h,s=>{s.some(f=>f!=null&&(Array.isArray(f)?f.length>0:f!==!1&&f!==""))&&(()=>{if(!u)return!0;for(let f=0;f<s.length;f++)if(!k(s[f],u[f]))return!0;return!1})()&&(u=[...s],$("filters-changed",{componentId:v.componentId,filters:s,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(s,f)=>{s!==f&&f!==void 0?T(s,!0):f===void 0&&s!==null&&s!==void 0&&T(s,!1)},{immediate:!0});const d=s=>{i.value===s?i.value=null:i.value=s},o=(s,f)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),h.value[s]=f,(s===0||s===1)&&(n=[...h.value]),i.value=null,s===0){h.value[1]!==void 0&&(h.value[1]=null);const g=l;l=!1,T(f,!0),l=g,h.value[1]!==null&&h.value[1]!==void 0&&(n=[...h.value])}},c=()=>{l=!0,setTimeout(()=>{l=!1},400)};return r({getCurrentValues:()=>h.value,initializeValues:x}),(s,f)=>(t.openBlock(),t.createElementBlock("div",qYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(g,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[g.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",jYe,[t.createElementVNode("div",WYe,t.toDisplayString(g.label),1),t.createElementVNode("div",DYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("label",{key:L.value,class:t.normalizeClass(["radio-option-card",{active:h.value[S]===L.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"strengths-radio-"+S,value:L.value,"onUpdate:modelValue":E=>h.value[S]=E,onChange:c},null,40,KYe),[[t.vModelRadio,h.value[S]]]),t.createElementVNode("span",null,t.toDisplayString(L.label),1)],2))),128))])])):g.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[f[4]||(f[4]=t.createElementVNode("div",{class:"filter-separator"},null,-1)),t.createElementVNode("div",BYe,[f[3]||(f[3]=t.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":g.type,onClick:t.withModifiers(L=>d(S),["stop"])},[t.createElementVNode("div",GYe,[f[1]||(f[1]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",ZYe,t.toDisplayString(g.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===S}])},[...f[0]||(f[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===S?(t.openBlock(),t.createElementBlock("div",JYe,[t.createElementVNode("div",HYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("div",{key:L.value,class:t.normalizeClass(["option-card simple-select-option",{active:k(h.value[S],L.value)}]),onClick:t.withModifiers(E=>o(S,L.value),["stop"])},[t.createElementVNode("div",QYe,[t.createElementVNode("div",$Ye,t.toDisplayString(L.label),1)]),k(h.value[S],L.value)?(t.openBlock(),t.createElementBlock("div",eQe,[...f[2]||(f[2]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,YYe))),128))])])):t.createCommentVNode("",!0)],8,XYe)])],64)):t.createCommentVNode("",!0),S===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",tQe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},aQe=t2(rQe,[["__scopeId","data-v-4c3876bd"]]),nQe=(e,r)=>{const a=e.__vccOpts||e;for(const[v,$]of r)a[v]=$;return a},iQe={key:1},oQe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sQe=["fill"],lQe={key:0,class:"checkbox__teams"},cQe={class:"checkbox__teams__logo"},uQe=["src"],dQe={class:"checkbox__teams__logo"},pQe=["src"],hQe={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:r}){const a=e;t.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const v=t.ref(!1),$=t.computed(()=>{const l={color:a.boxValueColor,"font-family":a.fontFamily,height:a.boxWidthAndHeight,width:a.boxWidthAndHeight,minWidth:a.boxWidthAndHeight,"border-radius":a.boxBorderRadius,"margin-top":a.boxMarginTop};return v.value?(l["background-color"]=a.boxBackgroundColor,l.border=`solid ${a.boxBorderWidth} ${a.boxBackgroundColor}`):l.border=`solid ${a.boxBorderWidth} ${a.boxBorderColor}`,l}),h=t.computed(()=>({"font-family":a.boxValueFontFamily,"font-size":a.boxValueFontSize,color:a.boxValueColor,"line-height":1})),u=t.computed(()=>{const l={color:a.labelColor,"font-family":a.fontFamily,"font-size":a.labelFontSize,"white-space":a.labelWhiteSpace,"text-align":a.boxPosition==="top"||a.boxPosition==="bottom"?"center":a.boxPosition};return(a.boxPosition==="left"||a.boxPosition==="right")&&(l[`margin-${a.boxPosition}`]=a.isBoxOnly?"0":a.teamsIds?"8px":"10px"),l});t.watch(()=>a.modelValue,l=>{l!==v.value&&(v.value=l)},{immediate:!0});function i(){a.avoidInteraction||!v.value&&a.avoidToCheck||(v.value=!v.value,r("update:modelValue",v.value))}function p(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:i},[t.createElementVNode("div",{class:"checkbox__box",style:t.normalizeStyle($.value)},[v.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[a.boxValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"checkbox__box__value",style:t.normalizeStyle(h.value)},t.toDisplayString(e.boxValue),5)):(t.openBlock(),t.createElementBlock("div",iQe,[(t.openBlock(),t.createElementBlock("svg",oQe,[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,sQe)]))]))],64)):t.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(t.openBlock(),t.createElementBlock("div",lQe,[t.createElementVNode("div",cQe,[t.createElementVNode("img",{src:p(e.teamsIds[0]),alt:""},null,8,uQe)]),t.createElementVNode("div",dQe,[t.createElementVNode("img",{src:p(e.teamsIds[1]),alt:""},null,8,pQe)])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"checkbox__label",style:t.normalizeStyle(u.value)},t.toDisplayString(e.label),5)],2))}},iA=nQe(hQe,[["__scopeId","data-v-b6f124d8"]]),fQe=(e,r)=>{const a=e.__vccOpts||e;for(const[v,$]of r)a[v]=$;return a},oA={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},FZ=()=>{t.useCssVars(e=>({"9d01acb4":e.height,"14e95081":e.borderWidthBtn,"38fec285":e.borderType,34353510:e.borderColor,"20d20dc6":e.borderRadius,17130967:e.width,"4ccb7d36":e.backgroundColor,"5d1e86a2":e.cursorType,ce65d4a2:e.fontSize,fe4ac47a:e.fontStyle,f98e44dc:e.fontFamily,"93b87770":e.marginLeftStat,c7f7beba:e.fontSizeStat}))},IZ=oA.setup;oA.setup=IZ?(e,r)=>(FZ(),IZ(e,r)):FZ;const mQe=e=>(t.pushScopeId("data-v-f3ee6b2b"),e=e(),t.popScopeId(),e),yQe=["src"],gQe={key:1,class:"text"},vQe=["src"],bQe={class:"stats"},xQe=mQe(()=>t.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),_Qe={class:"numstats"},wQe={class:"leyend"};function TQe(e,r,a,v,$,h){return t.openBlock(),t.createElementBlock("div",null,[a.type==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["button",$.status&&a.typeOnOff&&"button-active"]),style:t.normalizeStyle([h.customStyle,$.status&&a.typeOnOff&&h.customActive]),onClick:r[0]||(r[0]=(...u)=>h.btnClick&&h.btnClick(...u))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(t.openBlock(),t.createElementBlock("img",{key:0,class:"icon",style:t.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,yQe)):t.createCommentVNode("",!0),a.textValue?(t.openBlock(),t.createElementBlock("div",gQe,t.toDisplayString(a.textValue),1)):t.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(t.openBlock(),t.createElementBlock("img",{key:2,class:"icon",style:t.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,vQe)):t.createCommentVNode("",!0)],6)):t.createCommentVNode("",!0),a.type==1?(t.openBlock(),t.createElementBlock("div",{key:1,class:"button-target",onClick:r[1]||(r[1]=(...u)=>h.btnClick&&h.btnClick(...u))},[t.createElementVNode("div",bQe,[xQe,t.createElementVNode("div",_Qe,t.toDisplayString(a.textStat),1)]),t.createElementVNode("div",wQe,t.toDisplayString(a.textCategory),1)])):t.createCommentVNode("",!0)])}const SQe=fQe(oA,[["render",TQe],["__scopeId","data-v-f3ee6b2b"]]),kQe={class:"gsc-dropdown__main-container__item-selected"},LQe=["height","width"],CQe=["stroke"],OQe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},NQe=["fill"],EQe={class:"gsc-dropdown__items-container"},zQe=["onClick"],MQe={key:0,class:"gsc-dropdown__items-footer"},$k={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(r=>r in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listMarginTop:{type:String,default:"0"},listContainerPadding:{type:String,default:"0"},listItemPadding:{type:String,default:"10px 12px"},listItemMargin:{type:String,default:"0"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},listItemBorderRadius:{type:String,default:"0"},listAlignment:{type:String,default:"left"},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1},iconType:{type:Number,default:1,validator:function(e){return[1,2].includes(e)}}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:r}){const a=e,v=t.ref({}),$=t.ref(null),h=t.ref(a.isMultipleOption?-1:0),u=t.ref(!1);t.watch(()=>a.items,(x,d)=>{if(!a.modelValue&&(!a.onlyFirstTime||!d||!d.length)&&x&&x.length){if(a.defaultItemByProp){const o=a.items.findIndex(c=>c[a.defaultItemByProp.propName]===a.defaultItemByProp.value);o!==-1?(h.value=o,v.value=x[o]):(h.value=0,v.value=x[0])}else v.value=x[a.defaultItemByIndex];r("input",v.value)}},{immediate:!0}),t.watch(()=>a.modelValue,x=>{if(x){const d=a.items.findIndex(o=>typeof x=="object"?JSON.stringify(o)===JSON.stringify(x):o===x);d!==-1&&(h.value=d,v.value=a.items[d],r("update:modelValue",v.value))}},{immediate:!0});const i=t.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-container-padding":a.listContainerPadding,"--list-item-padding":a.listItemPadding,"--list-item-margin":a.listItemMargin,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-border-radius":a.listItemBorderRadius,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--list-margin-top":a.listMarginTop,"--list-left":a.listAlignment==="left"?"0":"auto","--list-right":a.listAlignment==="right"?"0":"auto","--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),p=t.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function l(){a.isDisabled||(u.value=!u.value)}function n(x){$.value&&!$.value.contains(x.target)&&(u.value=!1)}function k(x,d){a.isMultipleOption?h.value=-1:(h.value=d,u.value=!1),v.value=x,r("input",v.value),r("update:modelValue",v.value)}function T(){u.value=!1,r("click-ready")}return t.onMounted(()=>{document.addEventListener("click",n)}),t.onBeforeMount(()=>{document.removeEventListener("click",n)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropDown",ref:$,class:"gsc-dropdown",style:t.normalizeStyle(i.value)},[t.createElementVNode("div",{class:"gsc-dropdown__main-container",style:t.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[t.createElementVNode("div",kQe,[t.renderSlot(x.$slots,"default",{selectedItem:v.value})]),t.createElementVNode("div",{class:t.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":u.value}]),style:t.normalizeStyle(p.value)},[e.iconType===1?(t.openBlock(),t.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,CQe)],8,LQe)):(t.openBlock(),t.createElementBlock("svg",OQe,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,NQe)]))],6)],4),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",EQe,[t.createElementVNode("div",null,[t.createElementVNode("div",{class:"gsc-dropdown__items",style:t.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(o,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["gsc-dropdown__items__item",{selected:c===h.value}]),key:c,onClick:s=>k(o,c)},[t.renderSlot(x.$slots,"availableItem",{item:o})],10,zQe)),[[t.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(t.openBlock(),t.createElementBlock("div",MQe,[t.createVNode(t.unref(SQe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:T})])):t.createCommentVNode("",!0)])],512),[[t.vShow,u.value]])]),_:3})],4))}},sA={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"rgba(255, 255, 255, 0.2)",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!1,isFooterVisible:!1,hoverBackgroundColor:"#2E3B46",iconType:2},VQe=[{label:"Goles recibidos",value:{name:"Goles recibidos",color:"#336DFF",points:[1,2,3],categories:[40],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"}},{label:"Tiros a gol recibidos",value:{name:"Tiros a gol recibidos",color:"#7ED321",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Tiros a gol recibidos (portería)",value:{name:"Tiros a gol recibidos (portería)",color:"#990BFF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Centros totales recibidos",value:{name:"Centros totales recibidos",color:"#FF9226",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],negative:!1,translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"}},{label:"Centros acertados por el rival",value:{name:"Centros acertados por el rival",color:"#28A3B2",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],negative:!1,translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"}},{label:"Fuera de lugar provocados",value:{name:"Fuera de lugar provocados",color:"#00DD00",points:[1,2,3],categories:["33_r"],invert:[33],negative:!1,translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"}},{label:"Balones recuperados (en disputa)",value:{name:"Balones recuperados (en disputa)",color:"#FF3399",points:[1,2,3],categories:[483],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado",isDefaultSelected:!0}},{label:"Balones recuperados (sin disputa)",value:{name:"Balones recuperados (sin disputa)",color:"#B4005A",points:[1,2,3],categories:[484],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"}},{label:"1 vs 1 exitosos defensivos",value:{name:"1 vs 1 exitosos defensivos",color:"#3A3838",points:[1],categories:[5],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"1 vs 1 no exitosos defensivos",value:{name:"1 vs 1 no exitosos defensivos",color:"#008B31",points:[1],categories:[209],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"Balones ganados en área propia",value:{name:"Balones ganados en área propia",color:"#305496",points:[1,2],categories:[23],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"}},{label:"Juego aéreo resto del campo",value:{name:"Juego aéreo resto del campo",color:"#FF8A4C",points:[1,2,3],categories:[24],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"}},{label:"Barridas",value:{name:"Barridas",color:"#700000",points:[1],categories:[518],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"}},{label:"Rechaces",value:{name:"Rechaces",color:"#CC0000",points:[1,2,3],categories:[34],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}}],PQe=[{label:"Goles",value:{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}},{label:"Tiros a gol",value:{name:"Tiros a gol",color:"#7ED321",points:[1,2,3],categories:[510],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol",isDefaultSelected:!1}},{label:"Tiros a gol (portería)",value:{name:"Tiros a gol (portería)",color:"#990BFF",points:[1,2,3],categories:[537,540,544,547],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)",isDefaultSelected:!1}},{label:"Centros totales",value:{name:"Centros totales",color:"#FF9226",points:[1,2,3],categories:[13,25],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro",isDefaultSelected:!1}},{label:"Centros acertados",value:{name:"Centros acertados",color:"#28A3B2",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado",isDefaultSelected:!1}},{label:"Balones ganados en área rival",value:{name:"Balones ganados en área rival",color:"#FF0092",points:[1,2],categories:[11],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado",isDefaultSelected:!1}},{label:"1vs1 exitosos ofensivos",value:{name:"1vs1 exitosos ofensivos",color:"#3A3838",points:[1],categories:[4],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"1vs1 no exitosos ofensivos",value:{name:"1vs1 no exitosos ofensivos",color:"#008B31",points:[1],categories:[208],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"Remates con cabeza",value:{name:"Remates con cabeza",color:"#B4005A",points:[1,2,3],categories:[330,331,333,334,423,424,343,344],invert:[],negative:!1,translationKey:"",singleName:"Remate con cabeza",isDefaultSelected:!1}},{label:"Balón perdido en disputa",value:{name:"Balón perdido en disputa",color:"#9C08B0",points:[1,2,3],categories:[494],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido en disputa",isDefaultSelected:!1}},{label:"Balón perdido sin disputa",value:{name:"Balón perdido sin disputa",color:"#700000",points:[1,2,3],categories:[495],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido sin disputa",isDefaultSelected:!1}}],AQe={class:"last-touch"},RQe={class:"selected-item"},UQe={class:"available-item"},FQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},IQe={class:"selected-item"},qQe={class:"available-item"},jQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WQe={key:1},DQe={class:"selected-item"},KQe={class:"available-item"},BQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},XQe={class:"last-touch__how-many-games"},GQe={class:"selected-item"},ZQe={class:"available-item"},JQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},HQe={__name:"FilterLastTouch",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:r}){const a=e,v=r,$=t.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),h=t.ref({id:0,name:"Fases de juego",value:null}),u=t.ref(!1),i=t.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),p=t.ref(a.defaultFilters?null:i.value[0]),l=t.ref(null),n=t.computed(()=>({...sA})),k=t.computed(()=>({...sA,isFooterVisible:!a.isEditMode,isMultipleOption:!a.isEditMode})),T=t.computed(()=>{const ge=[];return x.value.options.forEach(be=>{be.forEach(xe=>{ge.push(xe)})}),ge}),x=t.ref(null),d=t.ref(null),o=t.ref(null),c=t.ref(null);t.watch(()=>a.viewConfig,ge=>{ge.filters&&(x.value||s(),d.value||f(),o.value||g(),c.value||P())},{immediate:!0});function s(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="categories");ge&&ge.options&&(x.value={label:ge.label,options:Object.entries(ge.options).reduce((be,[xe,Ae])=>(be.set(Number(xe),Ae),be),new Map)})}x.value={label:"Tipo de jugada",options:new Map([[2,PQe],[3,VQe]])}}function f(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="gamePhases");if(ge){d.value={label:ge.label,options:ge.options};return}}d.value={label:"Fases de juego",options:$.value}}function g(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="teamRadios");if(ge){o.value={options:ge.options},U(null,ge.options[0]);return}}o.value={label:"Equipo",options:a.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},U(null,o.value.options[0])}const S=t.ref(a.defaultFilters?null:o.value.options[0]),L=t.ref(a.defaultFilters?null:d.value.options[0]),E=t.ref(a.defaultFilters?null:x.value.options.get(L.value.value)[0]);function P(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="assistZoneCheckbox");if(ge){c.value={label:ge.label},z(ge.value);return}}c.value={label:"Zona de asistencia"}}const V=t.computed(()=>{const ge={selectedGamePhase:L.value,selectedTeam:S.value,isAssistZoneVisible:u.value,howManyGamesSelected:p.value};return a.isEditMode?(ge.selectedCategory=E.value,ge.totalCategoriesSelected=1):(ge.selectedCategories=l.value,ge.totalCategoriesSelected=0,x.value.options.forEach(be=>{be.forEach(xe=>{xe.isSelected&&(ge.totalCategoriesSelected+=1)})})),ge}),I=t.computed(()=>L.value?x.value.options.get(L.value.value)||[]:[]);t.watch(()=>V.value,ge=>{j()&&(console.log("before emit change:",{areAllFiltersFilled:j(),filters:ge,view:a.viewConfig}),v("change",{areAllFiltersFilled:j(),filters:ge,view:a.viewConfig}))},{deep:!0});function j(){return L.value&&(a.isEditMode&&E.value||!a.isEditMode&&l.value&&l.value.length)&&S.value&&p.value}function F(ge){L.value=ge,N(null)}function W(ge){S.value=ge}function U(ge,be){console.log("onChangeRadio:",be.value)}function z(ge){u.value=ge}function X(ge){p.value=ge}function N(ge){E.value=ge}function Y(ge,be){be.isSelected=ge,l.value=T.value.filter(xe=>xe.isSelected)}function se(){a.defaultFilters&&(u.value=a.defaultFilters.isAssistZoneVisible,p.value=i.value.find(ge=>ge.value===a.defaultFilters.howManyGamesSelected.value)||i.value[0],L.value=d.value.options.find(ge=>ge.value===a.defaultFilters.selectedGamePhase.value)||d.value.options[0],S.value=o.value.options.find(ge=>ge.value===(a.defaultFilters.isHomeTeam?1:2))||o.value.options[0],E.value=x.value.options.get(L.value.value).find(ge=>ge.value.name===a.defaultFilters.selectedCategory.name)||x.value.options.get(L.value.value)[0])}function me(){I.value.forEach(ge=>{ge.isSelected=!1}),u.value=!1,p.value=i.value[0],L.value=null,S.value=null,E.value=null,l.value=null}return t.onBeforeUnmount(()=>{me()}),t.onMounted(()=>{setTimeout(()=>{se()},500)}),(ge,be)=>(t.openBlock(),t.createElementBlock("div",AQe,[t.createVNode(t.unref($k),t.mergeProps(n.value,{items:d.value.options,"model-value":L.value,"onUpdate:modelValue":F}),{default:t.withCtx(()=>[t.createElementVNode("div",RQe,[be[0]||(be[0]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(L.value?L.value.label:d.value.label||h.value.name),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",UQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",FQe,[...be[1]||(be[1]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,L.value&&L.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(k.value,{items:I.value,"model-value":E.value,"onUpdate:modelValue":N}),{default:t.withCtx(()=>[t.createElementVNode("div",IQe,[be[2]||(be[2]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(x.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",qQe,[e.isEditMode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",jQe,[...be[3]||(be[3]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,E.value&&E.value.label===xe.label]])])],64)):(t.openBlock(),t.createElementBlock("div",WQe,[t.createVNode(t.unref(iA),{"model-value":xe.isSelected,label:xe.label,"onUpdate:modelValue":Ae=>Y(Ae,xe)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(n.value,{items:o.value.options,"model-value":S.value,"onUpdate:modelValue":W}),{default:t.withCtx(()=>[t.createElementVNode("div",DQe,[be[4]||(be[4]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(S.value?S.value.label:o.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",KQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",BQe,[...be[5]||(be[5]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,S.value&&S.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(iA),{"model-value":u.value,label:c.value.label,"onUpdate:modelValue":z},null,8,["model-value","label"]),t.withDirectives(t.createElementVNode("div",XQe,[t.createVNode(t.unref($k),t.mergeProps(n.value,{items:i.value,"model-value":p.value,"onUpdate:modelValue":X}),{default:t.withCtx(()=>[t.createElementVNode("div",GQe,[be[6]||(be[6]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(p.value?p.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",ZQe,[t.createElementVNode("div",null,t.toDisplayString(xe.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",JQe,[...be[7]||(be[7]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,p.value&&p.value.name===xe.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.isPostMatch]])]))}},YQe=t2(HQe,[["__scopeId","data-v-b006bd89"]]),QQe=(e,r)=>{const a=e.__vccOpts||e;for(const[v,$]of r)a[v]=$;return a},$Qe={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(e){return!Number.isNaN(e)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"},zIndexOpen:{type:Number,default:3},leftMenu:{type:String,default:"unset"}},emits:["update:modelValue"],setup(e,{emit:r}){const a=e;t.useCssVars(x=>({"398d9242":e.width,f164e302:p.value,"4bb88040":e.menuWidth}));const v=t.ref(null),$=t.ref(!1),h=t.ref(null),u=t.ref({}),i=t.computed(()=>{const x={top:"0px","--left-menu":a.leftMenu};if(v.value){const d=v.value.getBoundingClientRect();x.top=`${d.height+a.menuMarginTop}px`}return x}),p=t.computed(()=>$.value?a.zIndexOpen:1);t.watch(()=>a.modelValue,x=>{x!==$.value&&($.value=x)},{immediate:!0}),t.watch($,x=>{x||setTimeout(()=>{u.value["--translate-x"]="0px"},500)});function l(x){const d=window.innerWidth,o=x.boundingClientRect.x,c=x.boundingClientRect.x+x.boundingClientRect.width,s=o<=0?Math.abs(o)+4:c>=d?d-(c+10):0;u.value["--translate-x"]=`${s}px`}function n(){new IntersectionObserver(x=>{x[0].intersectionRatio>0&&l(x[0])}).observe(h.value)}function k(){$.value=!$.value,r("update:modelValue",$.value)}function T(){$.value=!1,r("update:modelValue",$.value)}return t.onMounted(()=>{t.nextTick(()=>{n()})}),(x,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[$.value?(t.openBlock(),t.createElementBlock("div",{key:0,id:"menu-overlay",onClick:T})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"menu-container",style:t.normalizeStyle(u.value)},[t.createElementVNode("div",{ref_key:"trigger",ref:v,class:"menu-container__trigger",onClick:k},[t.renderSlot(x.$slots,"trigger",{},void 0,!0)],512),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"menu",ref:h,class:"menu-container__menu",style:t.normalizeStyle(i.value)},[t.renderSlot(x.$slots,"menu",{},void 0,!0)],4),[[t.vShow,$.value]])]),_:3})],4)],64))}},e$e=QQe($Qe,[["__scopeId","data-v-18c0df61"]]),Kb={CORNERS_ADVANCED:"cornersAdvanced"},t$e={key:0,class:"button__icon"},r$e={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a$e=["stroke"],n$e=["stroke"],i$e=["stroke"],o$e={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s$e=["stroke"],l$e=["stroke"],c$e=["fill"],u$e={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d$e=["fill"],p$e={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h$e=["stroke"],f$e=["stroke"],m$e=["stroke"],y$e=["stroke"],g$e=["stroke"],v$e={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b$e={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x$e={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_$e={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w$e={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T$e={class:"button__text"},S$e={key:0,class:"info-container"},k$e={key:1,style:{width:"20px"}},L$e={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C$e=["fill"],O$e={__name:"ButtonFilter",props:{isActive:{type:Boolean,default:!1},showBadge:{type:Boolean,default:!0},showBadgeOnFilterFull:{type:Boolean,default:!0},text:{type:String,default:""},infoValue:{type:[String,Number],default:""},filtersTotal:{type:Number,default:0},textFontFamily:{type:String,default:"sans-serif"},textFontSize:{type:String,default:"14px"},fontColor:{type:String,default:"white"},infoBackgroundColor:{type:String,default:"#424D58"},infoFontColor:{type:String,default:"#CBEE6B"},infoFontFamily:{type:String,default:"sans-serif"},infoFontSize:{type:String,default:"10px"},infoBorderColor:{type:String,default:"#0D1D29"},infoBorderRadius:{type:String,default:"4px"},infoHeight:{type:String,default:"20px"},infoWidth:{type:String,default:"20px"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},backgroundColor:{type:String,default:"#0D1D29"},borderRadius:{type:String,default:"8px"},borderColor:{type:String,default:"#172531"},borderColorActive:{type:String,default:"white"},borderWidth:{type:String,default:"1px"},padding:{type:String,default:"12px"},arrowColor:{type:String,default:"#92929D"},iconColor:{type:String,default:"#92929D"},iconType:{type:String,default:"productivity"},showIcon:{type:Boolean,default:!0}},setup(e){const r=e,a=t.computed(()=>({"--height":r.height,"--width":r.width,"--text-font-family":r.textFontFamily,"--text-font-size":r.textFontSize,"--background-color":r.backgroundColor,"--border-radius":r.borderRadius,"--border-color":r.isActive?r.borderColorActive:r.borderColor,"--border-width":r.borderWidth,"--padding":r.padding,"--font-color":r.fontColor})),v=t.computed(()=>({"--info-background-color":r.infoValue?r.infoBackgroundColor:"transparent","--info-border-color":r.infoValue?r.infoBorderColor:"transparent","--info-border-radius":r.infoBorderRadius,"--info-font-family":r.infoFontFamily,"--info-font-size":r.infoFontSize,"--info-font-color":r.infoFontColor,"--info-height":r.infoHeight,"--info-width":r.infoWidth})),$=t.computed(()=>[Kb.PLAYS_TYPES,Kb.GOLSTATS,Kb.TOURNAMENTS,Kb.PLAYS,Kb.RESULTS,Kb.RESULTS_BY_TIME].includes(r.iconType)),h=t.computed(()=>[Kb.FIELD,Kb.GAMES].includes(r.iconType)),u=t.computed(()=>[Kb.DETAILS,Kb.UNIVERSE].includes(r.iconType)),i=t.computed(()=>[Kb.PERSONAL_DATA].includes(r.iconType)),p=t.computed(()=>[Kb.PRODUCTIVITY].includes(r.iconType)),l=t.computed(()=>(console.log("props.iconType",r.iconType),[Kb.CORNERS_ADVANCED].includes(r.iconType))),n=t.computed(()=>[Kb.HOW_WAS_CORNER].includes(r.iconType)),k=t.computed(()=>[Kb.TAKEN_CORNERS].includes(r.iconType)),T=t.computed(()=>[Kb.ZONE].includes(r.iconType)),x=t.computed(()=>[Kb.WHAT_HAPPENED].includes(r.iconType));return(d,o)=>(t.openBlock(),t.createElementBlock("div",{class:"button",style:t.normalizeStyle(a.value)},[e.showIcon?(t.openBlock(),t.createElementBlock("div",t$e,[i.value?(t.openBlock(),t.createElementBlock("svg",r$e,[t.createElementVNode("path",{d:"M12.6665 16.0001V14.3334C12.6665 13.4494 12.3153 12.6015 11.6902 11.9764C11.0651 11.3513 10.2173 11.0001 9.33323 11.0001H4.33329C3.44925 11.0001 2.60141 11.3513 1.9763 11.9764C1.35119 12.6015 1 13.4494 1 14.3334V16.0001",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,a$e),t.createElementVNode("path",{d:"M6.83329 7.66658C8.67422 7.66658 10.1666 6.17422 10.1666 4.33329C10.1666 2.49237 8.67422 1 6.83329 1C4.99237 1 3.5 2.49237 3.5 4.33329C3.5 6.17422 4.99237 7.66658 6.83329 7.66658Z",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,n$e),t.createElementVNode("path",{d:"M15.164 5.16663V10.1666M17.664 7.66659H12.6641",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,i$e)])):t.createCommentVNode("",!0),$.value||l.value?(t.openBlock(),t.createElementBlock("svg",o$e,[t.createElementVNode("path",{d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,s$e),t.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,l$e),t.createElementVNode("path",{d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:e.iconColor,stroke:"#353F47","stroke-width":"0.3"},null,8,c$e)])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createElementBlock("svg",u$e,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 0C13.1944 0 17 3.80558 17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0ZM8.49751 1.54553C4.65662 1.54553 1.54297 4.65919 1.54297 8.50008C1.54297 12.341 4.65662 15.4546 8.49751 15.4546C12.3384 15.4546 15.4521 12.341 15.4521 8.50008C15.4521 4.65919 12.3384 1.54553 8.49751 1.54553ZM8.49929 3.09082C8.92605 3.09082 9.27202 3.43678 9.27202 3.86355V8.12198L12.451 10.5945C12.7878 10.8565 12.8485 11.342 12.5865 11.6789C12.3245 12.0157 11.839 12.0764 11.5022 11.8144L8.02488 9.10986C7.83666 8.96347 7.72656 8.73837 7.72656 8.49991V3.86355C7.72656 3.43678 8.07252 3.09082 8.49929 3.09082Z",fill:e.iconColor},null,8,d$e)])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("svg",p$e,[t.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:e.iconColor},null,8,h$e),t.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,f$e),t.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,m$e),t.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:e.iconColor},null,8,y$e),t.createElementVNode("path",{d:"M13.5033 9.00032C13.5033 10.5651 12.2348 11.8337 10.67 11.8337C9.1052 11.8337 7.83667 10.5651 7.83667 9.00032C7.83667 7.43552 9.1052 6.16699 10.67 6.16699C12.2348 6.16699 13.5033 7.43552 13.5033 9.00032Z",stroke:e.iconColor},null,8,g$e)])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createElementBlock("svg",v$e,[...o[0]||(o[0]=[t.createElementVNode("path",{d:"M1.85113 13.0897C1.9303 13.2137 2.01739 13.3404 2.10447 13.4617C2.30239 13.7361 2.51878 14 2.74837 14.2507C3.74589 15.3298 5.01785 16.1504 6.41385 16.5963C6.4719 16.6148 6.52996 16.6332 6.58802 16.6491C6.60385 16.6544 6.61704 16.657 6.63024 16.6623C6.70413 16.6834 6.77538 16.7045 6.84927 16.723C7.54859 16.9077 8.27429 17 9.00264 17C9.73098 17 10.4593 16.9077 11.1586 16.7256C11.3064 16.686 11.4542 16.6438 11.5967 16.5989C11.9187 16.496 12.2353 16.372 12.5414 16.2322C12.7895 16.1187 13.0296 15.9921 13.2645 15.8549C14.2963 15.2533 15.2041 14.438 15.9034 13.467C15.9668 13.3799 16.0301 13.2876 16.0908 13.1926C16.1119 13.1609 16.133 13.1293 16.1541 13.095C16.9432 11.8681 17.405 10.4486 17.4868 8.98945C17.4947 8.84169 17.5 8.69393 17.5 8.54618C17.5 8.53034 17.5 8.51715 17.5 8.50132C17.5 6.90765 17.0646 5.37995 16.2386 4.04222C16.1198 3.85224 15.9932 3.66491 15.8612 3.48021C15.8586 3.47493 15.8559 3.4723 15.8533 3.46702C15.8084 3.40633 15.7636 3.34565 15.7161 3.2876C15.6712 3.22955 15.6237 3.1715 15.5789 3.1161C14.6526 1.98417 13.4466 1.10818 12.0928 0.580475C11.9556 0.525066 11.8105 0.474934 11.668 0.42744C10.8103 0.145118 9.91307 0 9.00264 0C8.09221 0 7.19497 0.14248 6.33732 0.424802C6.19482 0.472295 6.04967 0.525066 5.91245 0.577836C4.55604 1.10554 3.35005 1.98417 2.42378 3.11346C2.37364 3.17678 2.32086 3.24011 2.27072 3.30607C2.2285 3.35884 2.18892 3.41161 2.14933 3.46702C2.14933 3.46702 2.14933 3.46966 2.14669 3.4723C2.14669 3.47493 2.14405 3.47757 2.14142 3.48021C1.43418 4.44591 0.94598 5.53034 0.69792 6.68074C0.660975 6.85224 0.626669 7.02639 0.600279 7.20053C0.571251 7.39578 0.547501 7.59103 0.531667 7.78892C0.521111 7.91293 0.513195 8.03694 0.507917 8.16095C0.502639 8.27441 0.5 8.38786 0.5 8.50132V8.61214C0.502639 8.73615 0.507917 8.8628 0.513195 8.98945C0.595002 10.4486 1.05681 11.8681 1.84586 13.0923L1.85113 13.0897ZM1.82738 7.64908C1.82738 7.63325 1.83002 7.62005 1.83266 7.60422C1.84322 7.52771 1.85377 7.45119 1.86433 7.37731C1.86433 7.36412 1.86697 7.35092 1.86961 7.33773C1.8828 7.25594 1.89863 7.1715 1.91447 7.08971C1.91711 7.07124 1.92238 7.05541 1.92502 7.03694C1.94086 6.95778 1.95933 6.87599 1.9778 6.79683V6.78628C1.99891 6.70449 2.02266 6.62269 2.04378 6.5409C2.04905 6.52243 2.05433 6.5066 2.05961 6.48813C2.08336 6.40897 2.10711 6.32718 2.1335 6.24802L2.14142 6.22164C2.16517 6.14776 2.19156 6.07652 2.21794 6.00264C2.22322 5.98681 2.23114 5.97098 2.23642 5.95515C2.26545 5.87863 2.29711 5.79947 2.32878 5.72559C2.33406 5.70976 2.34197 5.69657 2.34725 5.68338C2.37628 5.61478 2.40795 5.54617 2.43962 5.47757C2.44489 5.46702 2.45017 5.45383 2.45545 5.44063C2.48975 5.36676 2.5267 5.29024 2.56628 5.21636C2.5742 5.20053 2.58212 5.1847 2.59267 5.16887C2.63226 5.09499 2.6692 5.02375 2.71143 4.94987V4.94195H2.7167L3.2656 6.63061L1.82738 7.67546C1.82738 7.67546 1.82738 7.65699 1.83002 7.64908H1.82738ZM4.08367 7.6095L5.62745 8.31926L6.52204 11.0712L5.62481 12.1108H2.74309C2.23642 11.2348 1.92238 10.2612 1.81683 9.25594L4.08367 7.6095ZM7.58026 1.41161C7.65942 1.39578 7.74123 1.37995 7.8204 1.36675C7.84151 1.36412 7.86262 1.35884 7.88109 1.3562C7.96026 1.34301 8.03679 1.33245 8.11596 1.32454C8.13971 1.3219 8.16346 1.31926 8.18721 1.31662C8.24791 1.30871 8.30596 1.30343 8.36666 1.29815C8.39305 1.29815 8.42207 1.29288 8.44846 1.29024C8.52235 1.28496 8.59361 1.27968 8.6675 1.27705C8.69916 1.27705 8.73347 1.27441 8.76514 1.27177C8.82319 1.27177 8.88125 1.26913 8.94194 1.26913C8.98153 1.26913 9.01847 1.26913 9.05806 1.26913C9.11611 1.26913 9.17681 1.26913 9.23487 1.27177C9.26653 1.27177 9.30084 1.27177 9.33251 1.27705C9.4064 1.27968 9.48029 1.28496 9.55154 1.29024C9.58057 1.29024 9.60696 1.29551 9.63334 1.29815C9.69404 1.30343 9.75473 1.30871 9.81279 1.31662C9.83654 1.31926 9.86029 1.3219 9.88668 1.32454C9.96585 1.33509 10.045 1.34565 10.1215 1.3562L10.1849 1.36675C10.264 1.37995 10.3459 1.39314 10.425 1.41161C10.4277 1.41161 10.4303 1.41161 10.4356 1.41161H10.4382L9 2.45646L7.56178 1.41161H7.56442C7.56442 1.41161 7.5697 1.41161 7.57234 1.41161H7.58026ZM9.00528 6.56728L11.1138 8.10026L10.3089 10.5805H7.70165L6.89677 8.10026L9.00528 6.56728ZM15.3018 4.94459V4.94987C15.3466 5.02111 15.3862 5.09499 15.4232 5.16887L15.4469 5.21636C15.4839 5.29024 15.5208 5.36676 15.5577 5.44063C15.563 5.45119 15.5683 5.46438 15.5736 5.47493C15.6052 5.54354 15.6369 5.61214 15.6659 5.68338C15.6712 5.69657 15.6791 5.7124 15.6844 5.72559C15.7161 5.80211 15.7478 5.87863 15.7768 5.95778C15.7821 5.97361 15.79 5.98945 15.7953 6.00528C15.8216 6.07916 15.848 6.1504 15.8718 6.22428C15.8744 6.23219 15.8771 6.24011 15.8797 6.25066C15.9061 6.32982 15.9298 6.40897 15.9536 6.49077C15.9589 6.50923 15.9641 6.52771 15.9694 6.54618C15.9905 6.62797 16.0143 6.70976 16.0328 6.78892C16.0328 6.7942 16.0328 6.79683 16.0328 6.80211C16.0512 6.88127 16.0697 6.96042 16.0855 7.03958L16.0961 7.09235C16.1119 7.17414 16.1278 7.25594 16.141 7.33773C16.141 7.35092 16.1462 7.36412 16.1462 7.37731C16.1568 7.45119 16.1673 7.52771 16.1779 7.60422C16.1779 7.62005 16.1805 7.63325 16.1832 7.64908C16.1832 7.65699 16.1832 7.66755 16.1858 7.67546L14.7476 6.63061L15.2965 4.93931L15.3018 4.94459ZM13.9295 7.61214L16.1937 9.25858C16.0882 10.2639 15.7715 11.2401 15.2675 12.1135H12.3858L11.4912 11.0739L12.3858 8.3219L13.9295 7.61214ZM14.3306 13.3879C14.3306 13.3879 14.3254 13.3931 14.3227 13.3958C14.2673 13.4565 14.2093 13.5172 14.1512 13.5752C14.138 13.5884 14.1248 13.6016 14.1116 13.6148C14.0536 13.6728 13.9929 13.7309 13.9322 13.7889C13.9216 13.7995 13.9111 13.81 13.8979 13.8206C13.8424 13.8707 13.7844 13.9235 13.729 13.971C13.7184 13.9789 13.7079 13.9894 13.6973 14C13.634 14.0554 13.5706 14.1055 13.5047 14.1583C13.4888 14.1715 13.473 14.1821 13.4598 14.1953C13.3938 14.2454 13.3278 14.2955 13.2619 14.3456C13.2619 14.3456 13.2566 14.3483 13.2566 14.3509C13.188 14.4011 13.1194 14.4486 13.0481 14.496C13.0323 14.5066 13.0165 14.5172 12.998 14.5277C12.9294 14.5726 12.8581 14.6174 12.7895 14.6623C12.7763 14.6702 12.7658 14.6781 12.7526 14.6834C12.6892 14.723 12.6233 14.7599 12.5573 14.7968C12.5441 14.8048 12.5283 14.8127 12.5151 14.8206C12.4438 14.8602 12.3699 14.8997 12.296 14.9367C12.2802 14.9446 12.2617 14.9525 12.2459 14.9631C12.1746 15 12.1007 15.0343 12.0295 15.0686C12.0242 15.0686 12.0189 15.0739 12.0137 15.0765H12.0084L12.5573 13.3879H14.3306ZM6.00217 15.0765L5.98898 15.0712C5.91509 15.0369 5.8412 15 5.76731 14.9631C5.75147 14.9551 5.73564 14.9472 5.71981 14.9393C5.64592 14.9024 5.57203 14.8628 5.49814 14.8206C5.48494 14.8127 5.47175 14.8048 5.45855 14.7995C5.39258 14.7625 5.32661 14.723 5.26063 14.6834C5.25008 14.6781 5.23688 14.6702 5.22633 14.6623C5.15508 14.6201 5.08646 14.5726 5.01521 14.5277C4.99938 14.5172 4.98355 14.5066 4.96771 14.496C4.89646 14.4486 4.82785 14.4011 4.75924 14.3509H4.75396C4.68799 14.2982 4.61937 14.248 4.5534 14.1953C4.53757 14.1821 4.52437 14.1715 4.50854 14.1583C4.44256 14.1055 4.37923 14.0554 4.3159 14C4.30534 13.9894 4.29478 13.9815 4.28159 13.971C4.22353 13.9208 4.16812 13.8707 4.1127 13.8206C4.10214 13.81 4.08895 13.7995 4.07839 13.7889C4.0177 13.7335 3.957 13.6755 3.89894 13.6148C3.88575 13.6016 3.87256 13.5884 3.85936 13.5752C3.8013 13.5172 3.74589 13.4591 3.69047 13.3984C3.68783 13.3958 3.68519 13.3931 3.67991 13.3879H5.45328L6.00217 15.0765C6.00217 15.0765 5.99954 15.0765 5.9969 15.0765H6.00217ZM7.50636 15.5726L6.63552 12.8971L7.53012 11.8602H10.4804L11.375 12.8971L10.5042 15.5726C9.52251 15.7784 8.48805 15.781 7.50373 15.5726H7.50636ZM14.3755 3.66755L13.4809 6.41953L11.9371 7.12929L9.6439 5.46174V3.57784L11.9503 1.90237C12.8713 2.31135 13.6999 2.91557 14.3781 3.66755H14.3755ZM6.06287 1.90237L8.3693 3.57784V5.46174L6.07606 7.12929L4.53229 6.41953L3.63769 3.66755C4.3159 2.91557 5.14452 2.31398 6.06551 1.90237H6.06287Z",fill:"#979DA2"},null,-1)])])):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createElementBlock("svg",b$e,[...o[1]||(o[1]=[t.createElementVNode("path",{d:"M17.182 5.9a.538.538 0 0 0-.13-.416L14.24 2.109a.558.558 0 0 0-.433-.203h-2.25c-.017 0-.034.012-.056.012a.557.557 0 0 0-.563.41 1.68 1.68 0 0 1-1.63 1.266 1.68 1.68 0 0 1-1.632-1.266.55.55 0 0 0-.563-.41c-.017 0-.033-.012-.056-.012h-2.25a.558.558 0 0 0-.433.203L1.561 5.484a.586.586 0 0 0-.129.416c.017.152.09.287.208.382l2.605 2.082v8.167c0 .31.253.563.562.563h9c.31 0 .563-.253.563-.563V8.364l2.604-2.082a.59.59 0 0 0 .208-.382zm-3.937 4.444H5.37V9.78h7.875v.563zM5.37 15.969v-4.5h7.875v4.5H5.37zm9-9.045v-.518a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v2.25H5.37v-2.25a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v.518L2.793 5.765l2.278-2.734h1.66A2.802 2.802 0 0 0 9.307 4.72a2.803 2.803 0 0 0 2.576-1.688h1.66l2.278 2.734-1.451 1.159z",fill:"#98A2B3"},null,-1)])])):t.createCommentVNode("",!0),n.value?(t.openBlock(),t.createElementBlock("svg",x$e,[...o[2]||(o[2]=[t.createElementVNode("path",{d:"M15.426 3.353a2.384 2.384 0 0 0-2.381 2.381 2.384 2.384 0 0 0 2.381 2.382 2.384 2.384 0 0 0 2.381-2.382 2.384 2.384 0 0 0-2.381-2.38zm0 3.766a1.386 1.386 0 0 1-1.385-1.385c0-.763.622-1.384 1.385-1.384s1.385.621 1.385 1.384c0 .764-.622 1.385-1.385 1.385zM1.424 6.558a.497.497 0 0 0 .704 0l1.295-1.296L4.72 6.558a.497.497 0 0 0 .704 0 .498.498 0 0 0 0-.705L4.128 4.558l1.295-1.295a.498.498 0 0 0-.705-.705L3.423 3.853 2.128 2.558a.499.499 0 0 0-.704.705l1.295 1.295-1.295 1.295a.498.498 0 0 0 0 .705zM13.013 12.443a.498.498 0 0 0-.705 0l-1.295 1.295-1.295-1.295a.499.499 0 0 0-.704.704l1.295 1.295-1.295 1.295a.499.499 0 0 0 .704.705l1.295-1.295 1.295 1.295a.497.497 0 0 0 .705 0 .498.498 0 0 0 0-.705l-1.295-1.295 1.295-1.295a.498.498 0 0 0 0-.704zM12.052 5.455l-2.01-1.747a.498.498 0 0 0-.654.753l1.066.926c-3.145.411-5.008 2.055-6.043 3.444a9.569 9.569 0 0 0-1.501 3.012 2.384 2.384 0 0 0-2.103 2.364 2.384 2.384 0 0 0 2.381 2.381 2.384 2.384 0 0 0 2.381-2.381 2.385 2.385 0 0 0-1.647-2.265 8.674 8.674 0 0 1 1.312-2.547C6.53 7.674 8.33 6.66 10.594 6.372l-.992 1.142a.498.498 0 0 0 .752.654l1.747-2.01a.498.498 0 0 0-.05-.703zm-7.48 8.752c0 .763-.62 1.384-1.384 1.384a1.386 1.386 0 0 1-1.384-1.384c0-.764.62-1.385 1.384-1.385.763 0 1.385.622 1.385 1.385z",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":".3"},null,-1)])])):t.createCommentVNode("",!0),T.value?(t.openBlock(),t.createElementBlock("svg",_$e,[...o[3]||(o[3]=[t.createElementVNode("rect",{x:".707",y:".9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:".9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:".707",y:"8.9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:"8.9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1)])])):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("svg",w$e,[...o[4]||(o[4]=[t.createStaticVNode('<g clip-path="url(#gpdeo9cu3a)" fill="#98A2B3" data-v-2df3c6a9><path d="M9.307.5C4.505.5.598 4.407.598 9.209c0 2 .69 3.938 1.946 5.486l-.754 3.159a.524.524 0 0 0 .727.599l3.038-1.384a8.743 8.743 0 0 0 3.752.848c4.802 0 8.709-3.907 8.709-8.708C18.016 4.407 14.109.5 9.307.5zm0 16.368a7.574 7.574 0 0 1-3.502-.845.525.525 0 0 0-.457-.011l-2.289 1.042.566-2.372a.524.524 0 0 0-.113-.465A7.657 7.657 0 0 1 1.647 9.21c0-4.224 3.436-7.66 7.66-7.66s7.66 3.436 7.66 7.66c0 4.223-3.436 7.66-7.66 7.66z" data-v-2df3c6a9></path><path d="M9.68 5.199c-1.094-.115-2.459.397-3.041 1.797a.524.524 0 0 0 .968.403c.375-.902 1.255-1.231 1.964-1.157.721.075 1.232.542 1.365 1.25.13.693-.136 1.097-1.097 1.662-1.042.613-1.372.874-1.372 2.27a.524.524 0 0 0 1.049 0c0-.479.033-.715.118-.843.094-.14.33-.283.737-.523.666-.392 1.905-1.12 1.596-2.76-.221-1.171-1.098-1.975-2.288-2.1zM9.145 12.673a.608.608 0 0 0-.506.17c-.13.13-.19.31-.17.505a.525.525 0 0 0 .939.263.523.523 0 0 0-.263-.938z" data-v-2df3c6a9></path></g><defs data-v-2df3c6a9><clipPath id="gpdeo9cu3a" data-v-2df3c6a9><path fill="#fff" transform="translate(.307 .5)" d="M0 0h18v18H0z" data-v-2df3c6a9></path></clipPath></defs>',2)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",T$e,t.toDisplayString(e.text),1),e.showBadge?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.showBadgeOnFilterFull?(t.openBlock(),t.createElementBlock("div",S$e,[t.createElementVNode("div",{class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.filtersTotal>0&&e.filtersTotal!=parseInt(e.infoValue)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)):e.filtersTotal>0?(t.openBlock(),t.createElementBlock("div",k$e)):t.createCommentVNode("",!0)],64))],64)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["button__arrow",{"rotated-180":e.isActive}])},[(t.openBlock(),t.createElementBlock("svg",L$e,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,C$e)]))],2)],4))}},N$e=t2(O$e,[["__scopeId","data-v-2df3c6a9"]]),E$e={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const a=e,v=r,$=t.ref(null);t.watch(()=>a.modelValue,()=>{h()},{immediate:!0});function h(){$.value&&($.value.checked=a.modelValue)}function u(i){v("update:modelValue",i.target.checked)}return t.onMounted(()=>{h()}),(i,p)=>(t.openBlock(),t.createElementBlock("input",{ref_key:"switchCustom",ref:$,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:u},null,544))}},lA=t2(E$e,[["__scopeId","data-v-e3a6ae4e"]]),z$e={class:"corners"},M$e={class:"corners-type"},V$e={class:"selected-item"},P$e={class:"available-item"},A$e={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R$e={class:"advanced-filters-menu"},U$e={class:"toggle-group"},F$e={class:"toggle-group"},I$e={key:0,class:"time-control"},q$e={class:"stepper-container"},j$e={class:"stepper"},W$e={class:"stepper-value"},D$e={class:"time-control"},K$e={class:"stepper-container"},B$e={class:"stepper"},X$e={class:"stepper-value"},G$e={class:"time-control"},Z$e={class:"stepper-container"},J$e={class:"stepper"},H$e={class:"stepper-value"},Y$e={class:"corners__how-many-games"},Q$e={class:"selected-item"},$$e={class:"available-item"},eet={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tet={__name:"FilterCorners",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:r}){var a;const v=Array.from({length:10}).map((P,V)=>({id:V+1,name:`${V+1} ${V===0?"corner":"corners"}`,value:V+1})),$=e,h=r,u=t.ref([...v]),i=t.ref(u.value[0]),p=t.ref(c()),l=t.ref({backgroundColor:"#2e3b46",width:"96.2%",borderColor:"rgba(255, 255, 255, 0.20)",infoBorderColor:"rgba(255, 255, 255, 0.20)",height:"40px",padding:"0 4px",textFontFamily:"'Poppins-Regular'",showIcon:!1}),n=t.ref({label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),k=t.ref(!1),T=t.ref($.defaultFilters?$.defaultFilters.isAgainstMode:!1),x=t.ref($.defaultFilters?null:(a=n.value)==null?void 0:a.options[0]),d=t.computed(()=>({...sA}));t.watch(()=>$.viewConfig,P=>{P.filters&&(n.value||s())},{immediate:!0});const o=t.computed(()=>({isAgainstMode:T.value,selectedTeam:x.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...p.value}}));t.watch(()=>o.value,P=>{console.log("before emit change",P),console.log("props.viewConfig",$.viewConfig),h("change",{filters:{...P,advancedFilters:{...P.advancedFilters,areConnectionsVisible:!P.advancedFilters.areConnectionsVisible,arePathsVisible:!P.advancedFilters.arePathsVisible}},view:$.viewConfig})},{deep:!0,immediate:!0});function c(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function s(){if($.viewConfig&&$.viewConfig.filters){const P=$.viewConfig.filters.find(V=>V.key==="teamRadios");if(P){n.value={options:P.options};return}}n.value={label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function f(){console.log("setDefaultValues called with props.defaultFilters:",$.defaultFilters),$.defaultFilters&&(x.value=n.value.options.find(P=>P.value===($.defaultFilters.isHomeTeam?1:2))||n.value.options[0],p.value={...$.defaultFilters.advancedFilters,areConnectionsVisible:!$.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!$.defaultFilters.advancedFilters.arePathsVisible})}function g(P){x.value=P}function S(P){i.value=P}function L(P,V){const I=p.value[V]+P;if(!(I<-5||I>10)){if(["secondsBefore","secondsAfter"].includes(V)){if(V==="secondsBefore"){if(p.value.secondsAfter<I)return}else if(p.value.secondsBefore>I)return}p.value[V]=I}}function E(){k.value=!1}return t.onBeforeUnmount(()=>{}),t.onMounted(()=>{setTimeout(()=>{f()},500)}),(P,V)=>(t.openBlock(),t.createElementBlock("div",z$e,[t.withDirectives(t.createElementVNode("div",M$e,[t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":!T.value}])}," A favor ",2),t.createVNode(lA,{modelValue:T.value,"onUpdate:modelValue":V[0]||(V[0]=I=>T.value=I)},null,8,["modelValue"]),t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":T.value}])}," En contra ",2)],512),[[t.vShow,!e.isPostMatch]]),t.createVNode(t.unref($k),t.mergeProps(d.value,{items:n.value.options,"model-value":x.value,"onUpdate:modelValue":g}),{default:t.withCtx(()=>[t.createElementVNode("div",V$e,[V[10]||(V[10]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(x.value?x.value.label:n.value.label),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",P$e,[t.createElementVNode("div",null,t.toDisplayString(I.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",A$e,[...V[11]||(V[11]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,x.value&&x.value.label===I.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(e$e),{modelValue:k.value,"onUpdate:modelValue":V[9]||(V[9]=I=>k.value=I),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:t.withCtx(()=>[t.createVNode(N$e,t.mergeProps(l.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":k.value,"show-icon":!0,"icon-type":t.unref(Kb).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:t.withCtx(()=>[t.createElementVNode("div",R$e,[V[22]||(V[22]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),t.createElementVNode("div",U$e,[V[12]||(V[12]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(lA,{modelValue:p.value.areConnectionsVisible,"onUpdate:modelValue":V[1]||(V[1]=I=>p.value.areConnectionsVisible=I)},null,8,["modelValue"]),V[13]||(V[13]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),V[23]||(V[23]=t.createElementVNode("hr",{class:"separator"},null,-1)),V[24]||(V[24]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),t.createElementVNode("div",F$e,[V[14]||(V[14]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(lA,{modelValue:p.value.arePathsVisible,"onUpdate:modelValue":V[2]||(V[2]=I=>p.value.arePathsVisible=I)},null,8,["modelValue"]),V[15]||(V[15]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),p.value.arePathsVisible?(t.openBlock(),t.createElementBlock("div",I$e,[V[17]||(V[17]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" / "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",q$e,[t.createElementVNode("div",j$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[3]||(V[3]=I=>L(-1,"secondsBeforeAndAfter"))},"−"),t.createElementVNode("span",W$e,t.toDisplayString(p.value.secondsBeforeAndAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[4]||(V[4]=I=>L(1,"secondsBeforeAndAfter"))},"+")]),V[16]||(V[16]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",D$e,[V[19]||(V[19]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",K$e,[t.createElementVNode("div",B$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[5]||(V[5]=I=>L(-1,"secondsBefore"))},"−"),t.createElementVNode("span",X$e,t.toDisplayString(p.value.secondsBefore),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[6]||(V[6]=I=>L(1,"secondsBefore"))},"+")]),V[18]||(V[18]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),t.createElementVNode("div",G$e,[V[21]||(V[21]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",Z$e,[t.createElementVNode("div",J$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[7]||(V[7]=I=>L(-1,"secondsAfter"))},"−"),t.createElementVNode("span",H$e,t.toDisplayString(p.value.secondsAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[8]||(V[8]=I=>L(1,"secondsAfter"))},"+")]),V[20]||(V[20]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),V[25]||(V[25]=t.createElementVNode("hr",{class:"separator"},null,-1)),t.createElementVNode("button",{class:"btn-ready",onClick:E},"Listo")])]),_:1},8,["modelValue"]),t.withDirectives(t.createElementVNode("div",Y$e,[t.createVNode(t.unref($k),t.mergeProps(d.value,{items:u.value,"model-value":i.value,"onUpdate:modelValue":S}),{default:t.withCtx(()=>[t.createElementVNode("div",Q$e,[V[26]||(V[26]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(i.value?i.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",$$e,[t.createElementVNode("div",null,t.toDisplayString(I.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",eet,[...V[27]||(V[27]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,i.value&&i.value.name===I.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.defaultFilters]])]))}},ret=t2(tet,[["__scopeId","data-v-fea60946"]]),aet={class:"resultados-filter"},net={class:"filter-checkboxes"},iet=["checked","disabled","onChange"],oet={class:"checkbox-label"},set={class:"filter-actions"},cet={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=[{value:"iba-ganando",label:"Iba ganando"},{value:"iba-perdiendo",label:"Iba perdiendo"},{value:"iba-empatado",label:"Iba empatado"}],h=t.ref([]);t.watch(()=>a.selectedValues,k=>{var T;if(console.log("[ResultadosFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:k,filterValue:k==null?void 0:k[a.filterIndex],optionValue:(T=k==null?void 0:k[a.filterIndex])==null?void 0:T[a.optionIndex],isArray:Array.isArray(k),filterValueType:typeof(k==null?void 0:k[a.filterIndex])}),!k||!Array.isArray(k)){h.value.length===0&&(console.log("[ResultadosFilter] No hay valores en props, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"]);return}const x=k[a.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x))if(x[a.optionIndex]!==void 0){const d=Array.isArray(x[a.optionIndex])?x[a.optionIndex]:[];console.log("[ResultadosFilter] Valores encontrados para sincronizar:",d,"localSelectedValues actual:",h.value);const o=JSON.stringify(h.value.sort()),c=JSON.stringify(d.sort());o!==c?(console.log("[ResultadosFilter] Actualizando localSelectedValues con:",d),h.value=d.length>0?[...d]:[]):console.log("[ResultadosFilter] Los valores ya están sincronizados, no se actualiza");return}else console.log("[ResultadosFilter] filterValue existe pero no tiene optionIndex",a.optionIndex,"filterValue keys:",Object.keys(x));else console.log("[ResultadosFilter] filterValue no es un objeto válido:",x);h.value.length===0&&(console.log("[ResultadosFilter] No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])},{immediate:!0,deep:!0}),t.onMounted(()=>{var k,T,x;console.log("[ResultadosFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(k=a.selectedValues)==null?void 0:k[a.filterIndex],optionValue:(x=(T=a.selectedValues)==null?void 0:T[a.filterIndex])==null?void 0:x[a.optionIndex]}),t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const d=a.selectedValues[a.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[a.optionIndex]!==void 0){const o=Array.isArray(d[a.optionIndex])?d[a.optionIndex]:[];if(console.log("[ResultadosFilter] onMounted - Valores encontrados:",o),o.length>0){console.log("[ResultadosFilter] onMounted - Actualizando localSelectedValues con:",o),h.value=[...o];return}}}h.value.length===0&&(console.log("[ResultadosFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])})});const u=k=>h.value.includes(k),i=k=>h.value.length===1&&h.value.includes(k),p=(k,T)=>{let x=[...h.value];if(T)x.includes(k)||x.push(k);else{if(x.length===1)return;x=x.filter(d=>d!==k)}x.length===0&&(x=[$[0].value]),h.value=x,v("update-selection",{optionIndex:a.optionIndex,values:x})},l=()=>{const k=$.map(T=>T.value);h.value=[...k],v("update-selection",{optionIndex:a.optionIndex,values:[...k]})},n=()=>{v("done")};return(k,T)=>(t.openBlock(),t.createElementBlock("div",aet,[t.createElementVNode("div",net,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,x=>t.createElementVNode("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:u(x.value),disabled:i(x.value),onChange:t.withModifiers(d=>p(x.value,d.target.checked),["stop"])},null,40,iet),t.createElementVNode("span",oet,t.toDisplayString(x.label),1)])),64))]),t.createElementVNode("div",set,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(l,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(n,["stop"])}," Listo ")])]))}},SN=t2(cet,[["__scopeId","data-v-6b648e3f"]]),uet={class:"detalles-filter"},det={class:"filter-header"},pet={class:"checkbox-todos"},het=["checked"],fet={class:"time-section"},met={class:"time-buttons"},yet=["onClick"],get={class:"time-section"},vet={class:"time-buttons"},bet=["onClick"],xet={class:"filter-actions"},_et={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=[{value:"0-15",label:"0-15"},{value:"16-30",label:"16-30"},{value:"31-45",label:"31-45"}],h=[{value:"46-60",label:"46-60"},{value:"61-75",label:"61-75"},{value:"76-90",label:"76-90"}],u=[...$,...h].map(d=>d.value),i=t.ref([]);t.watch(()=>a.selectedValues,d=>{var o;if(console.log("[DetallesFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:d,filterValue:d==null?void 0:d[a.filterIndex],optionValue:(o=d==null?void 0:d[a.filterIndex])==null?void 0:o[a.optionIndex]}),!d||!Array.isArray(d))return;const c=d[a.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[a.optionIndex]!==void 0){const s=Array.isArray(c[a.optionIndex])?c[a.optionIndex]:[];if(console.log("[DetallesFilter] Valores encontrados para sincronizar:",s),s.length>0){const f=JSON.stringify(i.value.sort()),g=JSON.stringify(s.sort());f!==g&&(console.log("[DetallesFilter] Actualizando localSelectedValues con:",s),i.value=[...s])}}},{immediate:!0,deep:!0});const p=t.computed(()=>[...$,...h].map(d=>d.value).every(d=>i.value.includes(d)));t.onMounted(()=>{var d,o,c;console.log("[DetallesFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(d=a.selectedValues)==null?void 0:d[a.filterIndex],optionValue:(c=(o=a.selectedValues)==null?void 0:o[a.filterIndex])==null?void 0:c[a.optionIndex]}),t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const s=a.selectedValues[a.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)&&s[a.optionIndex]!==void 0){const f=Array.isArray(s[a.optionIndex])?s[a.optionIndex]:[];if(console.log("[DetallesFilter] onMounted - Valores encontrados:",f),f.length>0){console.log("[DetallesFilter] onMounted - Actualizando localSelectedValues con:",f),i.value=[...f];return}}}i.value.length===0&&(console.log("[DetallesFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),i.value=[...u])})});const l=d=>i.value.includes(d),n=d=>{const o=d.target.checked;let c=[];o?c=[...$,...h].map(s=>s.value):c=[u[0]],i.value=c,v("update-selection",{optionIndex:a.optionIndex,values:c})},k=d=>{let o=[...i.value];if(o.includes(d))if(o.length>1)o=o.filter(c=>c!==d);else return;else o.includes(d)||o.push(d);o.length===0&&(o=[u[0]]),i.value=o,v("update-selection",{optionIndex:a.optionIndex,values:o})},T=()=>{const d=[u[0]];i.value=d,v("update-selection",{optionIndex:a.optionIndex,values:d})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",uet,[t.createElementVNode("div",det,[o[1]||(o[1]=t.createElementVNode("span",{class:"filter-title"},"En: (Elige el lapso de tiempo)",-1)),t.createElementVNode("label",pet,[t.createElementVNode("input",{type:"checkbox",checked:p.value,onChange:t.withModifiers(n,["stop"])},null,40,het),o[0]||(o[0]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1))])]),t.createElementVNode("div",fet,[o[2]||(o[2]=t.createElementVNode("div",{class:"time-label"},"1er tiempo",-1)),t.createElementVNode("div",met,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,c=>t.createElementVNode("button",{key:c.value,class:t.normalizeClass(["time-button",{active:l(c.value)}]),onClick:t.withModifiers(s=>k(c.value),["stop"])},t.toDisplayString(c.label),11,yet)),64))])]),t.createElementVNode("div",get,[o[3]||(o[3]=t.createElementVNode("div",{class:"time-label"},"2do tiempo",-1)),t.createElementVNode("div",vet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(h,c=>t.createElementVNode("button",{key:c.value,class:t.normalizeClass(["time-button",{active:l(c.value)}]),onClick:t.withModifiers(s=>k(c.value),["stop"])},t.toDisplayString(c.label),11,bet)),64))])]),t.createElementVNode("div",xet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},cA=t2(_et,[["__scopeId","data-v-7bea3520"]]),wet={class:"como-fue-cobrado-filter"},Tet={class:"cobro-grid"},ket=["onClick"],Let={class:"cobro-image-container"},Cet=["src","alt"],Oet={class:"cobro-footer"},Net={class:"cobro-label"},Eet={class:"filter-actions"},zet={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=[{value:"comba-afuera",label:"Comba hacia afuera",image:"https://golstatsimages.blob.core.windows.net/content/comba-afuera-izquierda.png",count:10},{value:"comba-adentro",label:"Comba hacia adentro",image:"https://golstatsimages.blob.core.windows.net/content/comba-adentro-izquierda.png",count:2},{value:"raz-area",label:"Raz de área",image:"https://golstatsimages.blob.core.windows.net/content/raz-area-izquierda.png",count:0},{value:"en-corto",label:"En corto",image:"https://golstatsimages.blob.core.windows.net/content/en-corto-izquierda.png",count:1}],h=t.ref([]);t.watch(()=>a.selectedValues,n=>{var k;if(console.log("[ComoFueCobradoFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:n,filterValue:n==null?void 0:n[a.filterIndex],optionValue:(k=n==null?void 0:n[a.filterIndex])==null?void 0:k[a.optionIndex]}),!n||!Array.isArray(n)){h.value.length===0&&(h.value=[...$.map(x=>x.value)]);return}const T=n[a.filterIndex];if(T&&typeof T=="object"&&!Array.isArray(T)&&T[a.optionIndex]!==void 0){const x=Array.isArray(T[a.optionIndex])?T[a.optionIndex]:[];console.log("[ComoFueCobradoFilter] Valores encontrados para sincronizar:",x);const d=JSON.stringify(h.value.sort()),o=JSON.stringify(x.sort());d!==o&&(h.value=x.length>0?[...x]:[]);return}h.value.length===0&&(h.value=[...$.map(x=>x.value)])},{immediate:!0,deep:!0});const u=n=>h.value.includes(n),i=n=>{let k=[...h.value];k.includes(n)?k=k.filter(T=>T!==n):k.push(n),k.length===0&&(k=[...$.map(T=>T.value)]),h.value=k,v("update-selection",{optionIndex:a.optionIndex,values:k})};t.onMounted(()=>{var n,k,T;console.log("[ComoFueCobradoFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(n=a.selectedValues)==null?void 0:n[a.filterIndex],optionValue:(T=(k=a.selectedValues)==null?void 0:k[a.filterIndex])==null?void 0:T[a.optionIndex]}),t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const x=a.selectedValues[a.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x)&&x[a.optionIndex]!==void 0){const d=Array.isArray(x[a.optionIndex])?x[a.optionIndex]:[];if(console.log("[ComoFueCobradoFilter] onMounted - Valores encontrados:",d),d.length>0){console.log("[ComoFueCobradoFilter] onMounted - Actualizando localSelectedValues con:",d),h.value=[...d];return}}}h.value.length===0&&(console.log("[ComoFueCobradoFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["izquierda",...$.map(x=>x.value)])})});const p=()=>{const n=[...$.map(k=>k.value)];h.value=n,v("update-selection",{optionIndex:a.optionIndex,values:n})},l=()=>{v("done")};return(n,k)=>(t.openBlock(),t.createElementBlock("div",wet,[t.createElementVNode("div",Tet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,T=>t.createElementVNode("div",{key:T.value,class:t.normalizeClass(["cobro-item",{active:u(T.value)}]),onClick:t.withModifiers(x=>i(T.value),["stop"])},[t.createElementVNode("div",Let,[t.createElementVNode("img",{src:T.image,alt:T.label,class:"cobro-image"},null,8,Cet)]),t.createElementVNode("div",Oet,[t.createElementVNode("span",Net,t.toDisplayString(T.label),1)])],10,ket)),64))]),t.createElementVNode("div",Eet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(p,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},kN=t2(zet,[["__scopeId","data-v-fb6f9ab9"]]),Met={class:"zona-filter"},Vet={class:"template-zone"},Pet={class:"controls-zone-container"},Aet={class:"controls-zone-container-title-checkcon"},Ret={class:"controls-zone-container-title-checkcon-check"},Uet={class:"gsc-field-img-container"},Fet=["fill"],Iet=["fill"],qet=["fill"],jet=["fill"],Wet=["fill"],Det=["fill"],Ket=["fill"],Bet=["fill"],Xet=["fill"],Get=["fill"],Zet=["fill"],Jet=["fill"],Het=["fill"],Yet=["fill"],Qet=["fill"],$et=["fill"],ett=["fill"],ttt=["fill"],rtt=["fill"],att=["fill"],ntt=["fill"],itt=["fill"],ott=["fill"],stt=["fill"],ltt=["fill"],ctt=["fill"],utt=["fill"],dtt=["fill"],ptt=["fill"],htt=["fill"],ftt=["fill"],mtt=["fill"],ytt=["fill"],gtt=["fill"],vtt=["fill"],btt=["id"],xtt=["mask"],_tt={class:"filter-actions"},wtt={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=Array.from({length:35},(x,d)=>d+1),h=t.ref(!0),u=t.ref([]),i=t.computed(()=>u.value),p=t.computed(()=>new Date().getTime());t.watch(()=>a.selectedValues,x=>{var d;if(console.log("[ZonaFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:x,filterValue:x==null?void 0:x[a.filterIndex],optionValue:(d=x==null?void 0:x[a.filterIndex])==null?void 0:d[a.optionIndex]}),!x||!Array.isArray(x)){u.value.length===0&&(console.log("[ZonaFilter] No hay valores en props, usando valores por defecto"),u.value=[...$],h.value=!0);return}const o=x[a.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)){if(o[a.optionIndex]!==void 0){const c=Array.isArray(o[a.optionIndex])?o[a.optionIndex]:[];console.log("[ZonaFilter] Valores encontrados para sincronizar:",c);const s=JSON.stringify(u.value.sort((g,S)=>g-S)),f=JSON.stringify(c.sort((g,S)=>g-S));s!==f&&(console.log("[ZonaFilter] Actualizando zonesLocal con:",c),u.value=c.length>0?[...c]:[],h.value=c.length===35);return}}else if(Array.isArray(o)&&o.length>0){console.log("[ZonaFilter] filterValue es array directo:",o);const c=JSON.stringify(u.value.sort((f,g)=>f-g)),s=JSON.stringify(o.sort((f,g)=>f-g));c!==s&&(console.log("[ZonaFilter] Actualizando zonesLocal con array directo:",o),u.value=[...o],h.value=o.length===35);return}u.value.length===0&&(console.log("[ZonaFilter] No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)},{immediate:!0,deep:!0}),t.watch(u,x=>{h.value=x.length===35,v("update-selection",{optionIndex:a.optionIndex,values:x})},{deep:!0});function l(x){console.log("value clickAllCheckbox: ",x),x?(u.value=[...$],h.value=!0):(u.value=[1],h.value=!1)}function n(x){u.value.includes(x)?u.value=u.value.filter(d=>d!==x):u.value.push(x),h.value=u.value.length===35}const k=()=>{u.value=[...$],h.value=!0},T=()=>{v("done")};return t.onMounted(()=>{var x,d,o;if(console.log("[ZonaFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(x=a.selectedValues)==null?void 0:x[a.filterIndex],optionValue:(o=(d=a.selectedValues)==null?void 0:d[a.filterIndex])==null?void 0:o[a.optionIndex]}),a.selectedValues&&Array.isArray(a.selectedValues)){const c=a.selectedValues[a.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[a.optionIndex]!==void 0){const s=Array.isArray(c[a.optionIndex])?c[a.optionIndex]:[];if(console.log("[ZonaFilter] onMounted - Valores encontrados:",s),s.length>0){console.log("[ZonaFilter] onMounted - Actualizando zonesLocal con:",s),u.value=[...s],h.value=s.length===35;return}}}u.value.length===0&&(console.log("[ZonaFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",Met,[t.createElementVNode("div",Vet,[t.createElementVNode("div",Pet,[d[36]||(d[36]=t.createElementVNode("div",{class:"controls-zone-container-title"}," ¿A dónde fue el balón?: ",-1)),d[37]||(d[37]=t.createElementVNode("div",{class:"separator-line"},null,-1)),t.createElementVNode("div",Aet,[d[35]||(d[35]=t.createElementVNode("div",{class:"controls-zone-container-title-checkcon-label"}," Todas las zonas ",-1)),t.createElementVNode("div",Ret,[t.createVNode(t.unref(iA),{label:"",fontFamily:"Poppins-Regular",labelFontSize:"11px","label-color":"#FFF","model-value":h.value,"onUpdate:modelValue":l},null,8,["model-value"])])])]),t.createElementVNode("div",Uet,[(t.openBlock(),t.createElementBlock("svg",{key:`field-${u.value.length}`,width:"100%",height:"177",viewBox:"0 0 380 177",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{onClick:d[0]||(d[0]=o=>n(1)),class:"sector-field",x:"0.347042",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:i.value.includes(1)?"#FFFF0030":"#2e3b46"},null,8,Fet),t.createElementVNode("rect",{onClick:d[1]||(d[1]=o=>n(9)),class:"sector-field",x:"288.347",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(9)?"#FFFF0030":"#2e3b46"},null,8,Iet),t.createElementVNode("rect",{onClick:d[2]||(d[2]=o=>n(17)),class:"sector-field",x:"0.347042",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(17)?"#FFFF0030":"#2e3b46"},null,8,qet),t.createElementVNode("rect",{onClick:d[3]||(d[3]=o=>n(25)),class:"sector-field",x:"288.347",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(25)?"#FFFF0030":"#2e3b46"},null,8,jet),t.createElementVNode("rect",{onClick:d[4]||(d[4]=o=>n(26)),class:"sector-field",x:"0.347042",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(26)?"#FFFF0030":"#2e3b46"},null,8,Wet),t.createElementVNode("rect",{onClick:d[5]||(d[5]=o=>n(27)),class:"sector-field",x:"91.347",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(27)?"#FFFF0030":"#2e3b46"},null,8,Det),t.createElementVNode("rect",{onClick:d[6]||(d[6]=o=>n(28)),class:"sector-field",x:"157.015",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(28)?"#FFFF0030":"#2e3b46"},null,8,Ket),t.createElementVNode("rect",{onClick:d[7]||(d[7]=o=>n(29)),class:"sector-field",x:"222.679",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(29)?"#FFFF0030":"#2e3b46"},null,8,Bet),t.createElementVNode("rect",{onClick:d[8]||(d[8]=o=>n(30)),class:"sector-field",x:"288.347",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(30)?"#FFFF0030":"#2e3b46"},null,8,Xet),t.createElementVNode("rect",{onClick:d[9]||(d[9]=o=>n(31)),class:"sector-field",x:"0.347042",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(31)?"#FFFF0030":"#2e3b46"},null,8,Get),t.createElementVNode("rect",{onClick:d[10]||(d[10]=o=>n(32)),class:"sector-field",x:"91.347",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(32)?"#FFFF0030":"#2e3b46"},null,8,Zet),t.createElementVNode("rect",{onClick:d[11]||(d[11]=o=>n(33)),class:"sector-field",x:"157.015",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(33)?"#FFFF0030":"#2e3b46"},null,8,Jet),t.createElementVNode("rect",{onClick:d[12]||(d[12]=o=>n(34)),class:"sector-field",x:"222.679",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(34)?"#FFFF0030":"#2e3b46"},null,8,Het),t.createElementVNode("rect",{onClick:d[13]||(d[13]=o=>n(35)),class:"sector-field",x:"288.347",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(35)?"#FFFF0030":"#2e3b46"},null,8,Yet),t.createElementVNode("rect",{onClick:d[14]||(d[14]=o=>n(2)),class:"sector-field",x:"91.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(2)?"#FFFF0030":"#2e3b46"},null,8,Qet),t.createElementVNode("rect",{onClick:d[15]||(d[15]=o=>n(3)),class:"sector-field",x:"114.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(3)?"#FFFF0030":"#2e3b46"},null,8,$et),t.createElementVNode("rect",{onClick:d[16]||(d[16]=o=>n(4)),class:"sector-field",x:"137.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(4)?"#FFFF0030":"#2e3b46"},null,8,ett),t.createElementVNode("rect",{onClick:d[17]||(d[17]=o=>n(5)),class:"sector-field",x:"172.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(5)?"#FFFF0030":"#2e3b46"},null,8,ttt),t.createElementVNode("rect",{onClick:d[18]||(d[18]=o=>n(6)),class:"sector-field",x:"207.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(6)?"#FFFF0030":"#2e3b46"},null,8,rtt),t.createElementVNode("rect",{onClick:d[19]||(d[19]=o=>n(7)),class:"sector-field",x:"242.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(7)?"#FFFF0030":"#2e3b46"},null,8,att),t.createElementVNode("rect",{onClick:d[20]||(d[20]=o=>n(8)),class:"sector-field",x:"265.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(8)?"#FFFF0030":"#2e3b46"},null,8,ntt),t.createElementVNode("rect",{onClick:d[21]||(d[21]=o=>n(10)),class:"sector-field",x:"91.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(10)?"#FFFF0030":"#2e3b46"},null,8,itt),t.createElementVNode("rect",{onClick:d[22]||(d[22]=o=>n(11)),class:"sector-field",x:"114.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(11)?"#FFFF0030":"#2e3b46"},null,8,ott),t.createElementVNode("rect",{onClick:d[23]||(d[23]=o=>n(12)),class:"sector-field",x:"137.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(12)?"#FFFF0030":"#2e3b46"},null,8,stt),t.createElementVNode("rect",{onClick:d[24]||(d[24]=o=>n(13)),class:"sector-field",x:"172.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(13)?"#FFFF0030":"#2e3b46"},null,8,ltt),t.createElementVNode("rect",{onClick:d[25]||(d[25]=o=>n(14)),class:"sector-field",x:"207.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(14)?"#FFFF0030":"#2e3b46"},null,8,ctt),t.createElementVNode("rect",{onClick:d[26]||(d[26]=o=>n(15)),class:"sector-field",x:"242.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(15)?"#FFFF0030":"#2e3b46"},null,8,utt),t.createElementVNode("rect",{onClick:d[27]||(d[27]=o=>n(16)),class:"sector-field",x:"265.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(16)?"#FFFF0030":"#2e3b46"},null,8,dtt),t.createElementVNode("rect",{onClick:d[28]||(d[28]=o=>n(18)),class:"sector-field",x:"91.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(18)?"#FFFF0030":"#2e3b46"},null,8,ptt),t.createElementVNode("rect",{onClick:d[29]||(d[29]=o=>n(19)),class:"sector-field",x:"114.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(19)?"#FFFF0030":"#2e3b46"},null,8,htt),t.createElementVNode("rect",{onClick:d[30]||(d[30]=o=>n(20)),class:"sector-field",x:"137.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(20)?"#FFFF0030":"#2e3b46"},null,8,ftt),t.createElementVNode("rect",{onClick:d[31]||(d[31]=o=>n(21)),class:"sector-field",x:"172.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(21)?"#FFFF0030":"#2e3b46"},null,8,mtt),t.createElementVNode("rect",{onClick:d[32]||(d[32]=o=>n(22)),class:"sector-field",x:"207.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(22)?"#FFFF0030":"#2e3b46"},null,8,ytt),t.createElementVNode("rect",{onClick:d[33]||(d[33]=o=>n(23)),class:"sector-field",x:"242.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(23)?"#FFFF0030":"#2e3b46"},null,8,gtt),t.createElementVNode("rect",{onClick:d[34]||(d[34]=o=>n(24)),class:"sector-field",x:"265.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(24)?"#FFFF0030":"#2e3b46"},null,8,vtt),d[40]||(d[40]=t.createElementVNode("rect",{x:"91.6",y:"0.6",width:"196.8",height:"87.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),d[41]||(d[41]=t.createElementVNode("rect",{x:"137.6",y:"0.782404",width:"104.8",height:"28.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),t.createElementVNode("mask",{id:p.value,style:{"mask-type":"alpha"},maskUnits:"userSpaceOnUse",x:"91",y:"88",width:"198",height:"25"},[...d[38]||(d[38]=[t.createElementVNode("rect",{width:"197.746",height:"24.6043",transform:"matrix(1 0 0 -1 91 113)",fill:"#D9D9D9"},null,-1)])],8,btt),t.createElementVNode("g",{mask:`url(#${p.value})`},[...d[39]||(d[39]=[t.createElementVNode("circle",{cx:"185.329",cy:"56.5046",r:"52.6152",stroke:"#DFE3E2","stroke-width":"1.38817"},null,-1)])],8,xtt),d[42]||(d[42]=t.createElementVNode("circle",{cx:"190.278",cy:"66.2782",r:"2.27817",fill:"white"},null,-1)),d[43]||(d[43]=t.createElementVNode("rect",{x:"0.7",y:"0.7",width:"378.6",height:"175.6",stroke:"#DFE3E2","stroke-width":"1.4"},null,-1))]))])]),t.createElementVNode("div",_tt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(k,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},uA=t2(wtt,[["__scopeId","data-v-203bc904"]]),Ttt={class:"que-sucedio-filter"},Stt={class:"filter-header"},ktt={class:"checkbox-item todos-header"},Ltt=["checked"],Ctt={class:"filter-section"},Ott={class:"checkbox-item main-option"},Ntt=["checked"],Ett={class:"sub-options"},ztt={class:"checkbox-item sub-option"},Mtt=["checked"],Vtt={class:"checkbox-item sub-option"},Ptt=["checked"],Att={class:"filter-section"},Rtt={class:"checkbox-item main-option"},Utt=["checked"],Ftt={class:"sub-options"},Itt={class:"checkbox-item sub-option"},qtt=["checked"],jtt={class:"checkbox-item sub-option"},Wtt=["checked"],Dtt={class:"checkbox-item sub-option"},Ktt=["checked"],Btt={class:"filter-actions"},Xtt={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],h={"rematado-destino-porteria":["fue-gol","no-fue-gol"],"rematado-sin-destino-porteria":["ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"]},u=t.ref([]);t.watch(()=>a.selectedValues,d=>{if(!d||!Array.isArray(d))return;const o=d[a.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)&&o[a.optionIndex]!==void 0){const c=Array.isArray(o[a.optionIndex])?o[a.optionIndex]:[];if(c.length>0){const s=JSON.stringify(u.value.sort()),f=JSON.stringify(c.sort());s!==f&&(u.value=[...c])}}},{immediate:!0,deep:!0}),t.onMounted(()=>{t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const d=a.selectedValues[a.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[a.optionIndex]!==void 0){const o=Array.isArray(d[a.optionIndex])?d[a.optionIndex]:[];if(o.length>0){u.value=[...o];return}}}u.value.length===0&&(u.value=[...$])})});const i=t.computed(()=>$.every(d=>u.value.includes(d))),p=d=>u.value.includes(d),l=d=>{d.target.checked?u.value=[...$]:u.value=[],v("update-selection",{optionIndex:a.optionIndex,values:[...u.value]})},n=(d,o)=>{let c=[...u.value];const s=h[d]||[];o?(c.includes(d)||c.push(d),s.forEach(f=>{c.includes(f)||c.push(f)})):c=c.filter(f=>f!==d&&!s.includes(f)),u.value=c,v("update-selection",{optionIndex:a.optionIndex,values:c})},k=(d,o)=>{let c=[...u.value];const s=Object.keys(h).find(f=>h[f].includes(d));o?(c.includes(d)||c.push(d),s&&h[s].every(f=>c.includes(f))&&!c.includes(s)&&c.push(s)):(c=c.filter(f=>f!==d),s&&c.includes(s)&&(c=c.filter(f=>f!==s))),u.value=c,v("update-selection",{optionIndex:a.optionIndex,values:c})},T=()=>{u.value=[...$],v("update-selection",{optionIndex:a.optionIndex,values:[...$]})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",Ttt,[t.createElementVNode("div",Stt,[t.createElementVNode("label",ktt,[o[7]||(o[7]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1)),t.createElementVNode("input",{type:"checkbox",checked:i.value,onChange:t.withModifiers(l,["stop"])},null,40,Ltt)])]),o[15]||(o[15]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Ctt,[t.createElementVNode("label",Ott,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-destino-porteria"),onChange:o[0]||(o[0]=t.withModifiers(c=>n("rematado-destino-porteria",c.target.checked),["stop"]))},null,40,Ntt),o[8]||(o[8]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado con destino a portería",-1))]),t.createElementVNode("div",Ett,[t.createElementVNode("label",ztt,[t.createElementVNode("input",{type:"checkbox",checked:p("fue-gol"),onChange:o[1]||(o[1]=t.withModifiers(c=>k("fue-gol",c.target.checked),["stop"]))},null,40,Mtt),o[9]||(o[9]=t.createElementVNode("span",{class:"checkbox-label"},"Fue gol",-1))]),t.createElementVNode("label",Vtt,[t.createElementVNode("input",{type:"checkbox",checked:p("no-fue-gol"),onChange:o[2]||(o[2]=t.withModifiers(c=>k("no-fue-gol",c.target.checked),["stop"]))},null,40,Ptt),o[10]||(o[10]=t.createElementVNode("span",{class:"checkbox-label"},"No fue gol",-1))])])]),o[16]||(o[16]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Att,[t.createElementVNode("label",Rtt,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-sin-destino-porteria"),onChange:o[3]||(o[3]=t.withModifiers(c=>n("rematado-sin-destino-porteria",c.target.checked),["stop"]))},null,40,Utt),o[11]||(o[11]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado sin destino a portería",-1))]),t.createElementVNode("div",Ftt,[t.createElementVNode("label",Itt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-portero-rival"),onChange:o[4]||(o[4]=t.withModifiers(c=>k("ganados-por-portero-rival",c.target.checked),["stop"]))},null,40,qtt),o[12]||(o[12]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por portero rival",-1))]),t.createElementVNode("label",jtt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-jugador-rival"),onChange:o[5]||(o[5]=t.withModifiers(c=>k("ganados-por-jugador-rival",c.target.checked),["stop"]))},null,40,Wtt),o[13]||(o[13]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por jugador rival",-1))]),t.createElementVNode("label",Dtt,[t.createElementVNode("input",{type:"checkbox",checked:p("sin-destino"),onChange:o[6]||(o[6]=t.withModifiers(c=>k("sin-destino",c.target.checked),["stop"]))},null,40,Ktt),o[14]||(o[14]=t.createElementVNode("span",{class:"checkbox-label"},"Sin destino",-1))])])]),t.createElementVNode("div",Btt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},u9=t2(Xtt,[["__scopeId","data-v-e3994cc8"]]),Gtt={class:"advanced-select-accordion"},Ztt=["onClick"],Jtt={class:"accordion-header-left"},Htt={class:"accordion-icon"},Ytt=["src","alt"],Qtt={class:"accordion-title"},$tt={class:"accordion-header-right"},ert={key:0,class:"accordion-badge"},trt={key:0,class:"accordion-content"},rrt={class:"accordion-footer"},art={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:r}){const a=e;t.watch(()=>a.selectedValues,x=>{console.log("Acorden inicla 55555555555v [AdvancedSelectAccordion] selectedValues recibidos:",{filterIndex:a.filterIndex,selectedValues:x,filterValue:x==null?void 0:x[a.filterIndex],filterValueType:typeof(x==null?void 0:x[a.filterIndex]),isArray:Array.isArray(x==null?void 0:x[a.filterIndex]),filterValueKeys:x!=null&&x[a.filterIndex]&&typeof(x==null?void 0:x[a.filterIndex])=="object"?Object.keys(x[a.filterIndex]):null})},{immediate:!0,deep:!0});const v=r,$=t.ref({}),h=x=>{$.value[x]?$.value[x]=!1:(Object.keys($.value).forEach(d=>{$.value[d]=!1}),$.value[x]=!0)},u=x=>{const d=a.filter.options[x];if(!d||!d.filters)return 0;const o=a.selectedValues[a.filterIndex];if(!o||!o[x])return 0;const c=o[x];return Array.isArray(c)?c.length:0},i=(x,d)=>x.icon?x.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${d+1}.png`,p=x=>x==="Qué sucedió?"||x==="Qué sucedió"?"¿Qué sucedió?":x,l=x=>{const d={resultados:SN,detalles:cA,"como-fue-cobrado":kN,"como fue cobrado":kN,zona:uA,"que-sucedio":u9,"qué sucedió":u9,"que sucedio":u9},o=typeof x.value=="string"?x.value:String(x.value||""),c=typeof x.label=="string"?x.label:String(x.label||""),s=o.toLowerCase().trim(),f=c.toLowerCase().trim();if(s&&d[s])return d[s];if(f&&d[f])return d[f];const g=f.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,S=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[S]||S);return g&&d[g]?d[g]:SN},n=x=>{v("update-selection",{filterIndex:a.filterIndex,optionIndex:x.optionIndex,values:x.values})},k=x=>{$.value[x]=!1},T=()=>{v("close")};return(x,d)=>(t.openBlock(),t.createElementBlock("div",Gtt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filter.options,(o,c)=>(t.openBlock(),t.createElementBlock("div",{key:o.value||c,class:"accordion-item"},[t.createElementVNode("div",{class:"accordion-header",onClick:t.withModifiers(s=>h(c),["stop"])},[t.createElementVNode("div",Jtt,[t.createElementVNode("span",Htt,[t.createElementVNode("img",{src:i(o,c),alt:o.label},null,8,Ytt)]),t.createElementVNode("span",Qtt,t.toDisplayString(p(o.label)),1)]),t.createElementVNode("div",$tt,[u(c)>0?(t.openBlock(),t.createElementBlock("span",ert,t.toDisplayString(u(c)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["accordion-chevron",{open:$.value[c]}])},[...d[0]||(d[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,Ztt),t.createVNode(t.Transition,{name:"accordion"},{default:t.withCtx(()=>[$.value[c]?(t.openBlock(),t.createElementBlock("div",trt,[l(o)===SN?(t.openBlock(),t.createBlock(SN,{key:0,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===cA?(t.openBlock(),t.createBlock(cA,{key:1,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===kN?(t.openBlock(),t.createBlock(kN,{key:2,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===uA?(t.openBlock(),t.createBlock(uA,{key:3,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===u9?(t.openBlock(),t.createBlock(u9,{key:4,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:2},1024)]))),128)),t.createElementVNode("div",rrt,[d[1]||(d[1]=t.createElementVNode("div",{class:"footer-separator"},null,-1)),t.createElementVNode("button",{class:"btn-done-footer",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},nrt=t2(art,[["__scopeId","data-v-92b4e8ad"]]),irt={class:"corners-zone-filters"},ort={key:0,class:"custom-radio-group"},srt={class:"radio-label"},lrt={class:"radio-options"},crt=["name","value","onUpdate:modelValue"],urt={key:0,class:"filter-separator"},drt={class:"filter-inline select-with-label"},prt=["data-filter-type","onClick"],hrt={class:"select-display"},frt={class:"select-label"},mrt={key:0,class:"dropdown-menu type-menu simple-select-menu"},yrt={class:"simple-select-scroll-area"},grt=["onClick"],vrt={class:"option-content"},brt={class:"option-title"},xrt={key:0,class:"option-checkmark"},_rt={class:"switch-group"},wrt={class:"switch-label"},Trt=["onClick"],Srt={key:0,class:"filter-separator"},krt={key:3,class:"filter-inline advanced-select-wrapper"},Lrt=["data-filter-type","onClick"],Crt={class:"select-display"},Ort={class:"select-label"},Nrt={__name:"CornersZoneFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:17},viewConfig:{type:Object,default:()=>({})},defaultFilters:{type:Object,default:()=>null}},emits:["filters-changed","filter-updated","change","remove-views"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref(null),l=t.ref([]);let n=!1,k=null;const T=(I,j)=>{if(Array.isArray(I)&&Array.isArray(j)){if(I.length!==j.length)return!1;for(let F=0;F<I.length;F++)if(I[F]!==j[F])return!1;return!0}return I===j},x=(I,j=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]){const F=v.filters[0],W=v.filters[1],U=F.options,z=W.options;U&&Array.isArray(U)&&z?I!=null?U.findIndex(X=>X.value===I)!==-1&&z[I]?(l.value=z[I],j&&!(()=>{const X=h.value[1];return X==null?!1:Array.isArray(X)?X.length>0:X!==""})()&&!n&&l.value.length>0&&(h.value[1]=l.value[0].value,t.nextTick(()=>{}))):(l.value=[],h.value[1]=null):(l.value=[],h.value[1]=null):l.value=[]}},d=()=>{var I,j,F;v.initialValues&&v.initialValues.length>0?v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]))?h.value=v.filters.map((z,X)=>{var N,Y,se,me;const ge=v.initialValues[X];if(ge!=null)return z.type==="switch"&&v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${X} (formato simple):`,ge),ge;if(z.type==="radio-button")return((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null;if(z.type==="advanced-select"){console.log("8888888888888888888888888888 LLEgo auqi mero inicio de davances filters: ",z.type,z.options);const be={};let xe=!1;return z.options&&Array.isArray(z.options)&&(console.log("999999999999999999999999 LLEgo auqi mero inicio de davances filters: options",z.options),z.options.forEach((Ae,je)=>{var _e,Ue,qe,Re,De,Qe,rt;Ae.value==="zona"||(_e=Ae.label)!=null&&_e.toLowerCase().includes("zona")?(be[je]=Array.from({length:35},(dt,ct)=>ct+1),xe=!0):Ae.value==="resultados"||(Ue=Ae.label)!=null&&Ue.toLowerCase().includes("resultados")?(be[je]=["iba-ganando","iba-perdiendo","iba-empatado"],xe=!0):Ae.value==="que-sucedio"||Ae.value==="que sucedio"||(qe=Ae.label)!=null&&qe.toLowerCase().includes("qué sucedió")||(Re=Ae.label)!=null&&Re.toLowerCase().includes("que sucedio")?(be[je]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],xe=!0):Ae.value==="detalles"||(De=Ae.label)!=null&&De.toLowerCase().includes("detalles")?(be[je]=["0-15","16-30","31-45","46-60","61-75","76-90"],xe=!0):(Ae.value==="como-fue-cobrado"||Ae.value==="como fue cobrado"||(Qe=Ae.label)!=null&&Qe.toLowerCase().includes("cómo fue cobrado")||(rt=Ae.label)!=null&&rt.toLowerCase().includes("como fue cobrado"))&&(be[je]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],xe=!0)})),xe?be:{}}return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (formato simple):`,!1),!1):z.type==="select-simple"&&((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null}):v.isEditMode?(console.log("[CornersZoneFilters] ========== MODO EDICIÓN =========="),console.log("[CornersZoneFilters] initialValues completo:",v.initialValues),console.log("[CornersZoneFilters] initialValues[3] (filtro avanzado):",(I=v.initialValues)==null?void 0:I[3]),console.log("[CornersZoneFilters] Tipo de initialValues[3]:",typeof((j=v.initialValues)==null?void 0:j[3])),console.log("[CornersZoneFilters] Es array initialValues[3]:",Array.isArray((F=v.initialValues)==null?void 0:F[3])),h.value=v.filters.map((z,X)=>{var N,Y,se,me,ge,be,xe,Ae,je,_e;const Ue=v.initialValues[X];if(X===3&&console.log(`[CornersZoneFilters] Procesando filtro en índice ${X} (FILTRO AVANZADO):`,{filterType:z.type,filterData:Ue,hasFilterData:!!Ue,filterDataKeys:Ue?Object.keys(Ue):null,selectedValue:Ue==null?void 0:Ue.selectedValue,selectedValueType:typeof(Ue==null?void 0:Ue.selectedValue),isDirectObject:Ue&&typeof Ue=="object"&&!Array.isArray(Ue)&&!Ue.selectedValue&&!Ue.selectedOption&&!Ue.isChecked}),!Ue)return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(qe=>qe.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (modo edición):`,!1),!1):z.type==="radio-button"?((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null:z.type==="select-simple"?((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null:z.type==="advanced-select"?{}:null;if(z.type==="advanced-select"){if(console.log(`[CornersZoneFilters] Modo edición - Filtro avanzado en índice ${X}:`,{filterIndex:X,filterType:z.type,filterData:Ue,selectedValue:Ue==null?void 0:Ue.selectedValue,selectedValueType:typeof(Ue==null?void 0:Ue.selectedValue),isArray:Array.isArray(Ue==null?void 0:Ue.selectedValue),isDirectObject:typeof Ue=="object"&&!Array.isArray(Ue)&&!Ue.selectedValue&&!Ue.selectedOption&&!Ue.isChecked}),Ue.selectedValue!==void 0&&Ue.selectedValue!==null){if(typeof Ue.selectedValue=="object"&&!Array.isArray(Ue.selectedValue)){const qe=Object.keys(Ue.selectedValue).some(Re=>{const De=Number(Re);return!isNaN(De)&&De>=0});return console.log(`[CornersZoneFilters] Filtro avanzado ${X} - hasCorrectStructure:`,qe,"selectedValue:",Ue.selectedValue),qe?(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - Retornando selectedValue directamente:`,Ue.selectedValue),Ue.selectedValue):(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - Retornando selectedValue sin estructura correcta:`,Ue.selectedValue),Ue.selectedValue)}else if(Array.isArray(Ue.selectedValue)){console.log(`[CornersZoneFilters] Filtro avanzado ${X} - selectedValue es array, convirtiendo:`,Ue.selectedValue);const qe={};return Ue.selectedValue.forEach((Re,De)=>{qe[De]=Re}),console.log(`[CornersZoneFilters] Filtro avanzado ${X} - Valor convertido:`,qe),qe}}return typeof Ue=="object"&&!Array.isArray(Ue)&&!Ue.selectedValue&&!Ue.selectedOption&&!Ue.isChecked&&Ue!==null&&Object.keys(Ue).some(qe=>{const Re=Number(qe);return!isNaN(Re)&&Re>=0})?(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - filterData es objeto directo guardado, retornando:`,Ue),Ue):(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - No hay valores guardados, retornando objeto vacío`),{})}if(z.type==="radio-button"&&Ue.selectedOption)return Ue.selectedOption.value;if(z.type==="radio-button"&&!Ue.selectedOption)return Ue.selectedValue!==void 0?Ue.selectedValue:((be=(ge=z.options)==null?void 0:ge[0])==null?void 0:be.value)||null;if(z.type==="select-simple"&&Ue.selectedValue!==void 0)return Array.isArray(Ue.selectedValue)?Ue.selectedValue[0]:Ue.selectedValue;if(z.type==="select"&&Ue.selectedOptions)return Ue.selectedOptions.map(qe=>qe.value);if(z.type==="check"&&Ue.isChecked!==void 0)return Ue.isChecked;if(z.type==="switch"&&(Ue.isChecked!==void 0||Ue.selectedValue!==void 0)){const qe=Ue.isChecked!==void 0?Ue.isChecked:Ue.selectedValue;return v.filters.findIndex(Re=>Re.type==="switch")===X&&console.log(`[Primer Switch] Valor en modo edición (índice ${X}):`,qe),qe}return Ue.selectedValue!==void 0?Ue.selectedValue:z.type==="select"?[]:z.type==="check"||z.type==="switch"?!1:z.type==="radio-button"?((Ae=(xe=z.options)==null?void 0:xe[0])==null?void 0:Ae.value)||null:z.type==="select-simple"?((_e=(je=z.options)==null?void 0:je[0])==null?void 0:_e.value)||null:z.type==="advanced-select"?{}:null}),console.log("[CornersZoneFilters] ========== FIN MODO EDICIÓN =========="),console.log("[CornersZoneFilters] selectedValues después de mapear:",h.value),console.log("[CornersZoneFilters] selectedValues[3] (filtro avanzado):",h.value[3]),console.log("[CornersZoneFilters] Tipo de selectedValues[3]:",typeof h.value[3]),console.log("[CornersZoneFilters] Es array selectedValues[3]:",Array.isArray(h.value[3])),h.value[3]&&typeof h.value[3]=="object"&&(console.log("[CornersZoneFilters] Keys de selectedValues[3]:",Object.keys(h.value[3])),console.log("[CornersZoneFilters] selectedValues[3][0]:",h.value[3][0]),console.log("[CornersZoneFilters] selectedValues[3][1]:",h.value[3][1])),console.log("[CornersZoneFilters] ==========================================")):h.value=v.filters.map((z,X)=>{var N,Y,se,me;const ge=v.initialValues[X];if(ge!=null)return z.type==="switch"&&v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${X} (modo agregar):`,ge),ge;if(z.type==="radio-button")return((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null;if(z.type==="advanced-select"){const be={};let xe=!1;return z.options&&Array.isArray(z.options)&&z.options.forEach((Ae,je)=>{var _e,Ue,qe,Re,De,Qe,rt;Ae.value==="zona"||(_e=Ae.label)!=null&&_e.toLowerCase().includes("zona")?(be[je]=Array.from({length:35},(dt,ct)=>ct+1),xe=!0):Ae.value==="resultados"||(Ue=Ae.label)!=null&&Ue.toLowerCase().includes("resultados")?(be[je]=["iba-ganando","iba-perdiendo","iba-empatado"],xe=!0):Ae.value==="que-sucedio"||Ae.value==="que sucedio"||(qe=Ae.label)!=null&&qe.toLowerCase().includes("qué sucedió")||(Re=Ae.label)!=null&&Re.toLowerCase().includes("que sucedio")?(be[je]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],xe=!0):Ae.value==="detalles"||(De=Ae.label)!=null&&De.toLowerCase().includes("detalles")?(be[je]=["0-15","16-30","31-45","46-60","61-75","76-90"],xe=!0):(Ae.value==="como-fue-cobrado"||Ae.value==="como fue cobrado"||(Qe=Ae.label)!=null&&Qe.toLowerCase().includes("cómo fue cobrado")||(rt=Ae.label)!=null&&rt.toLowerCase().includes("como fue cobrado"))&&(be[je]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],xe=!0)}),xe?be:{}}return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (modo agregar):`,!1),!1):z.type==="select-simple"&&((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null}):h.value=v.filters.map((z,X)=>{var N,Y,se,me;return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(ge=>ge.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (sin initialValues):`,!1),!1):z.type==="radio-button"?((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null:z.type==="select-simple"?((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null:z.type==="advanced-select"?{}:null});const W=h.value.some(z=>z!=null&&(Array.isArray(z)?z.length>0:typeof z=="object"&&!Array.isArray(z)?Object.keys(z).length>0:z!==!1&&z!=="")),U=v.filters.map((z,X)=>({index:X,type:z.type,label:z.label||z.label_1||z.label_2||`Filtro ${X}`,value:h.value[X]}));console.log("??????????????????????????????????? ---- ???????????????????????????????????"),console.log("Valores de filtros seteados:",U),console.log("selectedValues:",h.value),console.log("props.filters:",v.filters),console.log("??????????????????????????????????? ---- ???????????????????????????????????"),W&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};d(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!n){const I=!(()=>{const j=h.value[1];return j==null?!1:Array.isArray(j)?j.length>0:j!==""})();x(h.value[0],I),t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(!u||h.value.length!==u.length||h.value.some((j,F)=>!T(j,u[F])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})}else setTimeout(()=>{h.value.some(I=>I!=null&&(Array.isArray(I)?I.length>0:typeof I=="object"&&!Array.isArray(I)?Object.keys(I).length>0:I!==!1&&I!==""))&&(!u||h.value.length!==u.length||h.value.some((I,j)=>!T(I,u[j])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))},100)})},300),t.watch(()=>v.initialValues,I=>{if(!I||I.length===0)return;const j=I.length>0&&(typeof I[0]=="number"||typeof I[0]=="boolean"||I[0]===null||Array.isArray(I[0])),F=!T(h.value,I),W=I&&I.length>0&&!n&&F,U=v.isEditMode&&n;if(W&&!U)if(j){const z=v.filters.findIndex(X=>X.type==="switch");z!==-1&&I[z]!==void 0&&console.log(`[Primer Switch] Se setea valor desde watcher initialValues (formato simple) en índice ${z}:`,I[z]),h.value=[...I]}else v.isEditMode?h.value=v.filters.map((z,X)=>{const N=I[X];return N?z.type==="radio-button"&&N.selectedOption?N.selectedOption.value:z.type==="select-simple"&&N.selectedValue!==void 0?Array.isArray(N.selectedValue)?N.selectedValue[0]:N.selectedValue:z.type==="select"&&N.selectedOptions?N.selectedOptions.map(Y=>Y.value):z.type==="check"&&N.isChecked!==void 0?N.isChecked:z.type==="switch"&&N.isChecked!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde isChecked en índice ${X} (modo edición):`,N.isChecked),N.isChecked):z.type==="switch"&&N.selectedValue!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde selectedValue en índice ${X} (modo edición):`,N.selectedValue),N.selectedValue):z.type==="advanced-select"&&N.selectedValue!==void 0||N.selectedValue!==void 0?N.selectedValue:h.value[X]:h.value[X]}):h.value=[...I];else n?k&&k.length>0&&(h.value=[...k]):U&&k&&k.length>0&&(h.value=[...k])},{deep:!0}),t.watch(()=>v.isEditMode,(I,j)=>{j===!0&&I===!1&&(k=null)},{immediate:!0}),t.watch(h,I=>{if(I.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))){const j=[...I];if(u){for(;j.length<u.length;)j.push(void 0);for(let F=0;F<u.length;F++)u[F]!==void 0&&u[F]!==null&&(j[F]===void 0||j[F]===null)&&(j[F]=u[F])}if((()=>{if(!u||j.length!==u.length)return!0;for(let F=0;F<j.length;F++)if(!T(j[F],u[F]))return!0;return!1})()){u=[...j];const F=v.filters.map((W,U)=>({index:U,type:W.type,label:W.label||W.label_1||W.label_2||`Filtro ${U}`,value:j[U]}));console.log("Valores de filtros actualizados:",F),$("filters-changed",{componentId:v.componentId,filters:j,timestamp:new Date().toISOString()})}}},{deep:!0}),t.watch(()=>h.value[0],(I,j)=>{var F;if(I==null){const U=v.filters[0];if(U&&U.type==="radio-button"&&U.options&&U.options.length>0){const z=U.options[0].value;h.value[0]=z;return}}const W=(F=v.filters)==null?void 0:F[0];W&&W.type==="select-simple"&&(I!==j&&j!==void 0?x(I,!0):j===void 0&&I!==null&&I!==void 0&&x(I,!1))},{immediate:!0});const o=I=>{i.value===I?i.value=null:(i.value=I,p.value=null)},c=I=>{p.value===I?p.value=null:(p.value=I,i.value=null)},s=(I,j)=>{if(n=!0,setTimeout(()=>{n=!1},1e3),h.value[I]=j,(I===0||I===1)&&(k=[...h.value]),i.value=null,I===0){h.value[1]!==void 0&&(h.value[1]=null);const F=n;n=!1,x(j,!0),n=F,h.value[1]!==null&&h.value[1]!==void 0&&(k=[...h.value])}},f=()=>{n=!0,setTimeout(()=>{n=!1},400)},g=I=>{n=!0,setTimeout(()=>{n=!1},400);const j=h.value[I],F=!j;h.value[I]=F,v.filters.findIndex(W=>W.type==="switch")===I&&console.log(`[Primer Switch] Se setea valor en índice ${I} desde toggleSwitch:`,F,"(valor anterior:",j,")")},S=I=>{n=!0,setTimeout(()=>{n=!1},400),h.value[I.filterIndex]||(h.value[I.filterIndex]={}),h.value[I.filterIndex]={...h.value[I.filterIndex],[I.optionIndex]:I.values},t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})},L=()=>h.value,E=(I,j)=>{const F=h.value[j];if(F==null)return null;if(j===1&&l.value.length>0){const W=l.value.find(U=>U.value===F);return W?W.label:null}if(I.options&&Array.isArray(I.options)){const W=I.options.find(U=>U.value===F);return W?W.label:null}return null},P=(I,j)=>{const F=h.value[j];if(!F||typeof F!="object"||Array.isArray(F))return null;const W=Object.values(F).reduce((U,z)=>Array.isArray(z)&&z.length>0?U+z.length:U,0);return W>0?`${W} seleccionado${W>1?"s":""}`:null},V=I=>{const j=I.target,F=j.closest(".advanced-select-dropdown"),W=j.closest(".advanced-select-menu"),U=j.closest(".advanced-select-accordion"),z=j.closest(".advanced-select-content"),X=j.closest(".custom-select.dynamic-select"),N=j.closest(".simple-select-menu");!(F||W||U||z)&&!(X||N)&&(p.value=null,i.value=null)};return t.onMounted(()=>{document.addEventListener("click",V)}),t.onUnmounted(()=>{document.removeEventListener("click",V)}),r({getCurrentValues:L,initializeValues:d}),(I,j)=>(t.openBlock(),t.createElementBlock("div",irt,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(F,W)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:W},[F.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",ort,[t.createElementVNode("div",srt,t.toDisplayString(F.label),1),t.createElementVNode("div",lrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(F.options,U=>(t.openBlock(),t.createElementBlock("label",{key:U.value,class:t.normalizeClass(["radio-option-card",{active:h.value[W]===U.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+W,value:U.value,"onUpdate:modelValue":z=>h.value[W]=z,onChange:f},null,40,crt),[[t.vModelRadio,h.value[W]]]),t.createElementVNode("span",null,t.toDisplayString(U.label),1)],2))),128))])])):F.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[W==2?(t.openBlock(),t.createElementBlock("div",urt)):t.createCommentVNode("",!0),t.createElementVNode("div",drt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":F.type,onClick:t.withModifiers(U=>o(W),["stop"])},[t.createElementVNode("div",hrt,[j[3]||(j[3]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",frt,t.toDisplayString(E(F,W)||F.label_2||F.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===W}])},[...j[2]||(j[2]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===W?(t.openBlock(),t.createElementBlock("div",mrt,[t.createElementVNode("div",yrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(W===1?l.value:F.options,U=>(t.openBlock(),t.createElementBlock("div",{key:U.value,class:t.normalizeClass(["option-card simple-select-option",{active:T(h.value[W],U.value)}]),onClick:t.withModifiers(z=>s(W,U.value),["stop"])},[t.createElementVNode("div",vrt,[t.createElementVNode("div",brt,t.toDisplayString(U.label),1)]),T(h.value[W],U.value)?(t.openBlock(),t.createElementBlock("div",xrt,[...j[4]||(j[4]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,grt))),128))])])):t.createCommentVNode("",!0)],8,prt)])],64)):F.type==="switch"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",_rt,[t.createElementVNode("label",wrt,[F.label_1?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["switch-text switch-text-left",{"switch-text-selected":!h.value[W]}])},t.toDisplayString(F.label_1),3)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"switch",onClick:U=>g(W)},[t.createElementVNode("div",{class:t.normalizeClass(["switch-track",{"switch-on":h.value[W]}])},[t.createElementVNode("div",{class:t.normalizeClass(["switch-thumb",{on:h.value[W]}])},null,2)],2)],8,Trt),F.label_2?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["switch-text switch-text-right",{"switch-text-selected":h.value[W]}])},t.toDisplayString(F.label_2),3)):t.createCommentVNode("",!0)])]),W>=0?(t.openBlock(),t.createElementBlock("div",Srt)):t.createCommentVNode("",!0)],64)):F.type==="advanced-select"?(t.openBlock(),t.createElementBlock("div",krt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":F.type,onClick:t.withModifiers(U=>c(W),["stop"])},[t.createElementVNode("div",Crt,[j[6]||(j[6]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",Ort,t.toDisplayString(P(F,W)||F.label||"Seleccionar"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:p.value===W}])},[...j[5]||(j[5]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),p.value===W?(t.openBlock(),t.createElementBlock("div",{key:0,class:"dropdown-menu type-menu advanced-select-menu",onClick:j[1]||(j[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",{class:"advanced-select-content",onClick:j[0]||(j[0]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(nrt,{filter:F,"filter-index":W,"selected-values":h.value,onUpdateSelection:S,onClose:U=>c(W)},null,8,["filter","filter-index","selected-values","onClose"])])])):t.createCommentVNode("",!0)],8,Lrt)])):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},Ert=t2(Nrt,[["__scopeId","data-v-7c2a6c9f"]]),zrt={class:"floating-bar"},Mrt={class:"tab active"},Vrt={class:"select-display"},Prt={class:"select-icon"},Art=["src"],Rrt={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},Urt={key:0,class:"select-placeholder select-label"},Frt={key:1,class:"select-label"},Irt={key:0,class:"dropdown-menu field-menu"},qrt=["onClick"],jrt={class:"option-icon"},Wrt=["data-hover-src","src"],Drt={class:"option-content"},Krt={class:"option-title"},Brt={key:0,class:"option-description"},Xrt={class:"select-display"},Grt={class:"select-icon"},Zrt=["src"],Jrt=["src"],Hrt={class:"select-label"},Yrt={key:0,class:"dropdown-menu type-menu type-menu-grid"},Qrt={class:"option-grid"},$rt=["onClick"],eat={key:0,class:"option-grid-title"},tat={key:1,class:"option-grid-title"},rat={key:2,class:"option-grid-title"},aat={class:"option-grid-icon"},nat=["src"],iat={key:1,class:"filter-separator"},oat=["onClick"],sat={class:"select-display"},lat={key:0,class:"badge-categorias"},cat={key:0,class:"dropdown-menu type-menu multi-select-menu"},uat={class:"multi-select-scroll-area"},dat={class:"select-all-checkbox"},pat=["checked","indeterminate","onChange"],hat={class:"option-checkbox"},fat=["checked","onChange"],mat=["onClick"],yat={class:"option-title"},gat={class:"multi-select-footer"},vat={key:1,class:"custom-radio-group filter-inline"},bat={class:"radio-label"},xat={class:"radio-options"},_at=["onUpdate:modelValue","disabled","name","value","onChange"],wat={key:2,class:"check-group filter-inline"},Tat=["onUpdate:modelValue","checked"],Sat=["data-filter-type","onClick"],kat={class:"select-display"},Lat={key:0,class:"dropdown-menu type-menu simple-select-menu"},Cat={class:"simple-select-scroll-area"},Oat=["onMouseenter","onClick"],Nat={class:"option-content"},Eat={class:"option-title"},zat={key:0,class:"option-checkmark"},Mat={key:4,class:"filter-separator"},Vat=Object.assign({name:"FloatingFiltersBar"},{__name:"filters",props:{token:{type:String,required:!0},view:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!1},filters_edition_mode:{type:Array,default:()=>null}},emits:["filters-changed","close"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref(new Map),u=t.ref([]);let i=null,p=null,l=null;const n=t.ref(!1),k=t.ref(!1),T=t.ref(!1),x=t.ref(!1),d=t.ref(!1),o=t.ref(!1),c=t.computed(()=>u.value),s=t.ref(null),f=t.computed(()=>c.value[s.value]||null),g=t.computed(()=>{var St;const Yt=((St=f.value)==null?void 0:St.views)||[];return U(Yt)}),S=t.ref(null),L=t.computed(()=>g.value.find(St=>St.id===S.value)||null),E=t.ref([]),P=t.computed(()=>{var St,Yt;return n.value?((St=L.value)==null?void 0:St.filters_edition_mode)||[]:((Yt=L.value)==null?void 0:Yt.filters)||[]});t.watch(n,St=>{St||(k.value=!1)}),t.watch(L,St=>{var Yt,er;if(!St){E.value=[];return}const or=St.id===6&&v.isPostMatch,Or=St.id===14;if(!Array.isArray(P.value)&&!or&&!Or){E.value=[];return}x.value||(or||Or?E.value=[]:E.value=P.value.map((Pr,oa)=>{var Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja,on,Ha,qr,wr;if(Pr.type==="select"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na){if(Na.selectedOptions&&Array.isArray(Na.selectedOptions))return Na.selectedOptions.map(rn=>rn.value);if(Na.selectedValue&&Array.isArray(Na.selectedValue))return Na.selectedValue.length>0&&Na.selectedValue[0]&&typeof Na.selectedValue[0]=="object"?sr(Na.selectedValue):Na.selectedValue}}return St.id===4&&Pr.options&&Array.isArray(Pr.options)?Pr.options.map(Na=>Na.value):[]}else if(Pr.type==="radio-button"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.selectedOption){let rn=Na.selectedOption.value;if(St.id===15&&oa===0&&rn===3&&((qa=(Ia=p==null?void 0:p.view)==null?void 0:Ia.filterMultiple)==null?void 0:qa.isHomeTeam)!==void 0){const mn=p.view.filterMultiple.isHomeTeam;typeof mn=="boolean"?rn=mn?1:2:typeof mn=="number"&&(rn=mn===1?1:2)}return rn}}if(St.id===7&&n.value&&p!=null&&p.view){if(oa===0&&(bn=p.view.componentProps)!=null&&bn.analysisType)return p.view.componentProps.analysisType==="offensive"?1:2;if(oa===1&&((fn=p.view.filterMultiple)==null?void 0:fn.isHomeTeam)!==void 0)return p.view.filterMultiple.isHomeTeam?1:2}return((ea=(In=Pr.options)==null?void 0:In[0])==null?void 0:ea.value)??null}else if(Pr.type==="select-simple"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.selectedValue!==void 0){let rn;return St.id===2&&(fa=(Ur=p==null?void 0:p.view)==null?void 0:Ur.filterMultiple)!=null&&fa.categoryId?rn=p.view.filterMultiple.categoryId:St.id===1&&(Za=(Ma=p==null?void 0:p.view)==null?void 0:Ma.filterMultiple)!=null&&Za.category?rn=p.view.filterMultiple.category:St.id===6&&(Xr=(Ea=p==null?void 0:p.view)==null?void 0:Ea.filterMultiple)!=null&&Xr.gameNumber?rn=p.view.filterMultiple.gameNumber:rn=Array.isArray(Na.selectedValue)?Na.selectedValue[0]:Na.selectedValue,rn}}if(St.id===2&&n.value&&p!=null&&p.view){if(i&&p.view.id){const Na=i.getComponentDynamicFilters(p.view.id);if(Na&&Na[oa]!==void 0)return Na[oa]}if(p.view.filterMultiple){if(Pr.type==="select-simple"&&p.view.filterMultiple.categoryId){const Na=p.view.filterMultiple.categoryId;return(Pr.options||[]).find(rn=>rn.value==Na),Na}if(Pr.type==="radio-button"&&p.view.filterMultiple.teamType!==void 0){const Na=p.view.filterMultiple.teamType;return(Pr.options||[]).find(rn=>rn.value==Na),Na}}}if(St.id===1&&n.value&&(ca=p==null?void 0:p.view)!=null&&ca.filterMultiple&&p.view.filterMultiple.category){const Na=p.view.filterMultiple.category;return(Pr.options||[]).find(rn=>rn.value==Na),Na}if(St.id===9&&n.value&&(kr=p==null?void 0:p.view)!=null&&kr.filterMultiple&&Pr.type==="select-simple"&&p.view.filterMultiple.categoryIds){const Na=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds],rn=(Pr.options||[]).filter(mn=>Array.isArray(mn.value)?hr(mn.value,Na):Na.includes(mn.value));return rn.length>0?rn[0].value:Na}if(St.id===6&&n.value&&(ua=p==null?void 0:p.view)!=null&&ua.filterMultiple&&p.view.filterMultiple.gameNumber){const Na=p.view.filterMultiple.gameNumber;return(Pr.options||[]).find(rn=>rn.value==Na),Na}if(St.id===5&&n.value&&(Xa=p==null?void 0:p.view)!=null&&Xa.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Na=p.view.filterMultiple.isHomeTeam;let rn;if(typeof Na=="boolean"?rn=Na?1:2:typeof Na=="number"?rn=Na===1?1:2:rn=1,(Pr.options||[]).find(mn=>mn.value==rn),Pr.type==="radio-button"&&(Pr.label==="Equipo"||Pr.label==="Team"||Pr.label==="Equipo seleccionado"))return rn}if(St.id===15&&n.value&&(ja=p==null?void 0:p.view)!=null&&ja.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0&&Pr.type==="radio-button"&&oa===0){const Na=p.view.filterMultiple.isHomeTeam;let rn;if(typeof Na=="boolean"?rn=Na?1:2:typeof Na=="number"?rn=Na===1?1:2:rn=1,(Pr.options||[]).find(mn=>mn.value==rn))return rn}if(St.id===9&&n.value&&(on=p==null?void 0:p.view)!=null&&on.filterMultiple&&Pr.type==="radio-button"&&p.view.filterMultiple.isHomeTeam!==void 0){const Na=p.view.filterMultiple.isHomeTeam?1:2,rn=((Ha=Pr.options)==null?void 0:Ha.map(mn=>mn.value))||[];return rn.includes(Na)?Na:rn[0]||1}return((wr=(qr=Pr.options)==null?void 0:qr[0])==null?void 0:wr.value)??null}else if(Pr.type==="check"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.isChecked!==void 0)return Na.isChecked}if(St.id===8)return!0;if(St.id===3){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.isChecked!==void 0)return Na.isChecked}return!1}return!1}return null}),!((Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)!=null&&er.toLowerCase().includes("tops players"))&&(!n.value||or)&&t.nextTick(()=>{var Pr,oa;St.id===4&&n.value&&(Pr=p==null?void 0:p.view)!=null&&Pr.id&&i&&i.setDynamicFilters(E.value,p.view.id),St.id===3&&n.value&&(oa=p==null?void 0:p.view)!=null&&oa.id&&i&&i.setDynamicFilters(E.value,p.view.id),Ye()}))},{immediate:!0}),t.watch(()=>i,St=>{St&&St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))},{deep:!0}),t.watch(()=>i==null?void 0:i.dynamicFilters,St=>{if(St&&Array.isArray(St)){if(d.value)return;x.value=!0,E.value=[...St],t.nextTick(()=>{x.value=!1})}},{deep:!0}),t.watch(()=>L.value,St=>{if(n.value&&l&&St&&St.filters){if(x.value||o.value)return;if(St.id===3){if(d.value||o.value)return;const Yt=l.dynamicFilters.find(er=>er.filterType==="check");Yt&&Yt.isChecked!==void 0&&E.value&&E.value.length>0&&(d.value=!0,E.value[0]=Yt.isChecked,t.nextTick(()=>{E.value=[...E.value],d.value=!1}))}setTimeout(()=>{(!E.value||E.value.length===0)&&($t(),Zt(),Tt()),St.id===4&&Rt()},100)}},{deep:!0}),t.watch(()=>{var St;return(St=L.value)==null?void 0:St.id},St=>{if(n.value&&l&&St===4){if(x.value||o.value)return;setTimeout(()=>{Rt()},200)}}),t.watch(()=>E.value,St=>{if(n.value&&l&&St&&St.length>0){if(x.value||d.value||o.value)return;setTimeout(()=>{var Yt;Ut()&&($t(),Zt(),Tt(),((Yt=L.value)==null?void 0:Yt.id)===4&&Rt())},50)}},{deep:!0});function V(St,Yt){var er,or,Or,Pr,oa;const Ia=E.value[St];if((er=L.value)==null||er.id,(or=L.value)==null||or.id,Array.isArray(Ia)){if(((Or=L.value)==null?void 0:Or.id)===4&&St===0){const qa=Ia.some(bn=>{if(Yt.category_id&&Yt.event_type_id){if(bn.category_id&&bn.event_type_id)return bn.category_id===Yt.category_id&&bn.event_type_id===Yt.event_type_id;if(bn.event_type_id&&!bn.category_id)return bn.event_type_id===Yt.event_type_id;if(bn.category_id&&!bn.event_type_id)return bn.category_id===Yt.category_id}else{if(Yt.event_type_id)return bn.event_type_id===Yt.event_type_id;if(Yt.category_id)return bn.category_id===Yt.category_id}return JSON.stringify(bn)===JSON.stringify(Yt)});return(Pr=L.value)==null||Pr.id,qa}return Ia.includes(Yt)}else if(Ia!=null)return(oa=L.value)==null||oa.id,Ia===Yt;return!1}function I(St,Yt){var er,or,Or;const Pr=(or=(er=L.value)==null?void 0:er.filters)==null?void 0:or[St];if((Pr==null?void 0:Pr.type)==="select-simple"){rt(St,Yt);return}Array.isArray(E.value[St])||(E.value[St]=[]);const oa=E.value[St];let Ia=-1;((Or=L.value)==null?void 0:Or.id)===4&&St===0?Ia=oa.findIndex(qa=>Yt.category_id&&Yt.event_type_id?qa.category_id===Yt.category_id&&qa.event_type_id===Yt.event_type_id:Yt.event_type_id?qa.event_type_id===Yt.event_type_id:Yt.category_id?qa.category_id===Yt.category_id:!1):Ia=oa.indexOf(Yt),Ia>-1?oa.splice(Ia,1):oa.push(Yt),n.value&&Pt(),Ye()}function j(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length===Or.options.length}function F(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length>0&&or.length<Or.options.length}function W(){var St;return!(((St=L.value)==null?void 0:St.id)===6&&v.isPostMatch)}function U(St){return!St||!Array.isArray(St)?St:St.filter(Yt=>{const er=(Yt.name||Yt.title||"").toLowerCase();return v.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(or=>er.includes(or))})}function z(){var St,Yt;const er=((Yt=(St=f.value)==null?void 0:St.name)==null?void 0:Yt.toLowerCase())||"";return er.includes("cancha")||er.includes("volumétrica")||er.includes("volumetric")}function X(St,Yt){if(!n.value||!z())return!1;const er=String(St||"").toLowerCase(),or=String(Yt||"").toLowerCase();return er.includes("ambos")||or.includes("ambos")}function N(St){var Yt,er;const or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];if(!or||!or.options)return;const Or=or.options.map(Pr=>Pr.value);Array.isArray(E.value[St])||(E.value[St]=[]),j(St)?E.value[St]=[]:E.value[St]=[...Or],ge.value=St,Ye()}const Y=t.ref("ambos"),se=t.ref(!1),me=t.ref(!1),ge=t.ref(null),be=t.ref(null);function xe(St,Yt=!1){const er="https://golstatsimages.blob.core.windows.net/images-library/",or="https://golstatsimages.blob.core.windows.net/reports-images/",Or={cancha:"icn_cancha",grafico:"icn_grafico",gráfico:"icn_grafico",chart:"icn_grafico",volumetrica:"icn_cancha",volumétrica:"icn_cancha",volumetric:"icn_cancha",tabla:"icn_tabla",tablas:"icn_tabla",Tablas:"icn_tabla"},Pr=Object.keys(Or).find(oa=>St==null?void 0:St.toLowerCase().includes(oa.toLowerCase()));if(Pr){const oa=Or[Pr],Ia=Yt?"":"-def";return Pr.toLowerCase().includes("tabla")?`${or}${oa}${Ia}@2x.png`:`${er}${oa}${Ia}@2x.png`}return`${er}icn_default${Yt?"":"-def"}.png`}function Ae(){return f.value?f.value.name:"Tipo de vista"}function je(){return L.value?L.value.name||L.value.title:"Visualización"}function _e(){n.value||(se.value=!se.value,se.value&&(me.value=!1,t.nextTick(()=>{Jt()})))}function Ue(){n.value||f.value&&(me.value=!me.value,me.value&&(se.value=!1))}function qe(St){n.value||(s.value=St,se.value=!1,S.value=null,Ye())}function Re(St){var Yt,er;n.value||(S.value=St.id,me.value=!1,(Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)==null||er.toLowerCase().includes("tops players"))}function De(St){var Yt;ge.value=ge.value===St?null:St,((Yt=L.value)==null?void 0:Yt.id)===4&&n.value&&St===0&&setTimeout(()=>{E.value=[...E.value]},50)}function Qe(St){be.value=be.value===St?null:St}function rt(St,Yt){var er,or,Or,Pr,oa;if(((er=L.value)==null?void 0:er.id)===2){const Ia=P.value.findIndex(qa=>qa.type==="select-simple"&&qa.label==="Tipo de análisis");St===Ia?E.value[0]=Yt:E.value[St]=Yt}else if(((or=L.value)==null?void 0:or.id)===1)E.value[0]=Yt;else if(((Or=L.value)==null?void 0:Or.id)===6)E.value[0]=Yt;else if(((Pr=L.value)==null?void 0:Pr.id)===9)if(St===0){Array.isArray(Yt)?E.value[St]=Yt:E.value[St]=[Yt];const Ia=((oa=P.value[St])==null?void 0:oa.options)||[],qa=Array.isArray(Yt)?Yt:[Yt],bn=Ia.find(fn=>Array.isArray(fn.value)?hr(fn.value,qa):qa.includes(fn.value));bn?E.value[St]=bn.value:E.value[St]=qa}else E.value[St]=Yt;else E.value[St]=Yt;be.value=null,n.value&&Pt(),Ye()}function dt(St){St.target.closest(".custom-select")||(se.value=!1,me.value=!1,be.value=null)}const ct=[16,18];function Ye(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua;if(ct.includes((St=L.value)==null?void 0:St.id)||x.value)return;let Xa=[],ja=[];L.value&&Array.isArray(P.value)&&P.value.forEach((wr,Na)=>{if(wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2){const rn=E.value[Na]||[];Array.isArray(rn)&&rn.length>0&&(Xa=rn.map(mn=>{var $a;const Hn=($a=wr.options)==null?void 0:$a.find(Pn=>Pn.value===mn);return{value:mn,label:(Hn==null?void 0:Hn.label)||mn}}))}});const on=((Yt=L.value)==null?void 0:Yt.id)===4;if(L.value&&Array.isArray(L.value.filters)&&L.value.filters.some(wr=>wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2)&&Xa.length===0&&!on)return;if(on&&E.value&&E.value.length>0){const wr=E.value[0];Array.isArray(wr)&&wr.length>0}ja=((er=P.value)==null?void 0:er.map((wr,Na)=>{var rn,mn,$a,Hn;const Pn=E.value[Na];let Yn=wr.id||`filter_${Na}`;return((rn=L.value)==null?void 0:rn.id)===3&&n.value&&(mn=p==null?void 0:p.view)!=null&&mn.id&&(Yn=`filter_${Na}_component_${p.view.id}`),{filterId:Yn,filterType:wr.type,filterLabel:wr.label,filterIcon:wr.icon||null,selectedValue:Pn,selectedOptions:wr.type==="select"&&Array.isArray(Pn)&&Pn.length>0?Pn.map(An=>{var Wn;const Ci=(Wn=wr.options)==null?void 0:Wn.find(Pi=>Pi.value===An);return{value:An,label:(Ci==null?void 0:Ci.label)||An,icon:(Ci==null?void 0:Ci.icon)||null}}):null,selectedOption:wr.type==="radio-button"&&Pn!=null?{value:Pn,label:((Hn=($a=wr.options)==null?void 0:$a.find(An=>An.value===Pn))==null?void 0:Hn.label)||Pn}:null,isChecked:wr.type==="check"?Pn:null}}))||[];const Ha={mainSelector:{id:((or=f.value)==null?void 0:or.id)||null,name:((Or=f.value)==null?void 0:Or.name)||null,url:((Pr=f.value)==null?void 0:Pr.url)||null},viewSelector:{id:((oa=L.value)==null?void 0:oa.id)||null,name:((Ia=L.value)==null?void 0:Ia.name)||((qa=L.value)==null?void 0:qa.title)||null,url:((bn=L.value)==null?void 0:bn.url)||null},team:Y.value,dynamicFilters:ja,categoriasSeleccionadas:Xa,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((fn=P.value)==null?void 0:fn.length)||0,activeFilters:((In=P.value)==null?void 0:In.filter((wr,Na)=>{const rn=E.value[Na];return Array.isArray(rn)?rn.length>0:rn!=null&&rn!==!1}).length)||0}},qr={main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:Ha,filterAndViewsContainer:i,viewToEdit:p};if($("filters-changed",qr),n.value&&p){if(l=Ha,((ea=L.value)==null?void 0:ea.id)===2){const wr=l.dynamicFilters.findIndex(Na=>Na.filterType==="select-simple"&&Na.filterLabel==="Tipo de análisis");wr!==-1&&(fa=(Ur=p.view)==null?void 0:Ur.filterMultiple)!=null&&fa.categoryId&&(l.dynamicFilters[wr].selectedValue=p.view.filterMultiple.categoryId)}if(((Ma=L.value)==null?void 0:Ma.id)===1){const wr=l.dynamicFilters.findIndex(Na=>Na.filterType==="select-simple"&&Na.filterLabel==="Tipo de análisis");wr!==-1&&(Ea=(Za=p.view)==null?void 0:Za.filterMultiple)!=null&&Ea.category&&(l.dynamicFilters[wr].selectedValue=p.view.filterMultiple.category)}}if(((Xr=L.value)==null?void 0:Xr.id)===6&&n.value&&(ca=p==null?void 0:p.view)!=null&&ca.filterMultiple&&p.view.filterMultiple.gameNumber&&l){const wr=l.dynamicFilters.findIndex(Na=>Na.filterType==="select-simple"&&Na.filterLabel==="Número de juego");wr!==-1&&(ua=(kr=p.view)==null?void 0:kr.filterMultiple)!=null&&ua.gameNumber&&(l.dynamicFilters[wr].selectedValue=p.view.filterMultiple.gameNumber)}i&&!n.value?i.setDynamicFilters(E.value):i&&n.value}function st(){p=null,l=null,i=null,s.value=null,S.value=null,Y.value="ambos",E.value=[],se.value=!1,me.value=!1,ge.value=null,be.value=null,n.value=!1,k.value=!1,T.value=!1}function lt(St){if(St&&St.dynamicFilters){if(d.value)return;Array.isArray(St.dynamicFilters)&&St.dynamicFilters.length>0&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))}}function Ot(St){if(n.value=!0,St.mainSelector&&St.mainSelector.id){const Yt=u.value.findIndex(er=>er.id===St.mainSelector.id);Yt!==-1&&(s.value=Yt)}St.viewSelector&&St.viewSelector.id&&f.value&&f.value.views.findIndex(Yt=>Yt.id===St.viewSelector.id)!==-1&&(S.value=St.viewSelector.id),St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&t.nextTick(()=>{setTimeout(()=>{var Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja;if(L.value&&P.value){if(x.value)return;if(d.value=!0,St.dynamicFilters.forEach((on,Ha)=>{var qr,wr,Na,rn,mn,$a,Hn,Pn,Yn,An,Wn,Ci,Pi;if(Ha<P.value.length){const Po=P.value[Ha];if(((qr=L.value)==null?void 0:qr.id)===3&&n.value,Po.type==="check"){const So=on.isChecked;typeof So=="boolean"&&(E.value[Ha]=So)}else if(Po.type==="select"&&on.selectedOptions){const So=on.selectedOptions.map(Mo=>Mo.value);E.value[Ha]=So}else if(Po.type==="select"&&on.selectedValue&&Array.isArray(on.selectedValue))if(on.selectedValue.length>0&&on.selectedValue[0]&&typeof on.selectedValue[0]=="object"){const So=sr(on.selectedValue);E.value[Ha]=So}else E.value[Ha]=on.selectedValue;else if(Po.type==="radio-button"&&on.selectedOption)E.value[Ha]=on.selectedOption.value;else if(Po.type==="select-simple"&&on.selectedValue!==void 0){let So;((wr=L.value)==null?void 0:wr.id)===2&&(rn=(Na=p==null?void 0:p.view)==null?void 0:Na.filterMultiple)!=null&&rn.categoryId?So=p.view.filterMultiple.categoryId:((mn=L.value)==null?void 0:mn.id)===1&&(Hn=($a=p==null?void 0:p.view)==null?void 0:$a.filterMultiple)!=null&&Hn.category?So=p.view.filterMultiple.category:((Pn=L.value)==null?void 0:Pn.id)===6&&(An=(Yn=p==null?void 0:p.view)==null?void 0:Yn.filterMultiple)!=null&&An.gameNumber?So=p.view.filterMultiple.gameNumber:((Wn=L.value)==null?void 0:Wn.id)===9&&(Pi=(Ci=p==null?void 0:p.view)==null?void 0:Ci.filterMultiple)!=null&&Pi.categoryIds?So=p.view.filterMultiple.categoryIds:So=Array.isArray(on.selectedValue)?on.selectedValue[0]:on.selectedValue,E.value[Ha]=So}}}),((Yt=L.value)==null?void 0:Yt.id)===3&&n.value,((er=L.value)==null?void 0:er.id)===2&&n.value&&(or=p==null?void 0:p.view)!=null&&or.filterMultiple){if(p.view.filterMultiple.categoryId){const on=P.value.findIndex(Ha=>Ha.type==="select-simple"&&Ha.label==="Tipo de análisis");if(on!==-1){const Ha=p.view.filterMultiple.categoryId;if(E.value[0]=Ha,p.view.componentProps&&Ha){let qr=`Category ${Ha}`,wr=null;try{wr=A4(Ha),wr&&(qr=wr.name)}catch{const Na=P.value.findIndex(rn=>rn.type==="select-simple"&&rn.label==="Tipo de análisis");if(Na!==-1){const rn=(((Or=P.value[Na])==null?void 0:Or.options)||[]).find(mn=>mn.value==Ha);rn&&(qr=rn.label)}}p.view.componentProps.categoryView=[{id:Ha,name:qr}]}(((Pr=P.value[on])==null?void 0:Pr.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const on=P.value.findIndex(Ha=>Ha.type==="radio-button");if(on!==-1){const Ha=p.view.filterMultiple.teamType;E.value[on]=Ha,(((oa=P.value[on])==null?void 0:oa.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}}if(((Ia=L.value)==null?void 0:Ia.id)===9&&n.value&&(qa=p==null?void 0:p.view)!=null&&qa.filterMultiple){if(p.view.filterMultiple.categoryIds){const on=P.value.findIndex(Ha=>Ha.type==="select-simple");if(on!==-1){const Ha=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds];E.value[0]=Ha;const qr=(((bn=P.value[on])==null?void 0:bn.options)||[]).filter(Na=>Array.isArray(Na.value)?hr(Na.value,Ha):Ha.includes(Na.value));if(qr.length>0){const Na=qr[0].value;E.value[on]=Na}else E.value[on]=Ha;const wr=E.value[on];hr(wr,Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.isHomeTeam!==void 0){const on=P.value.findIndex(Ha=>Ha.type==="radio-button");if(on!==-1){const Ha=p.view.filterMultiple.isHomeTeam;let qr;typeof Ha=="boolean"?qr=Ha?1:2:typeof Ha=="number"?qr=Ha===1?1:2:qr=1,E.value[on]=qr,(((fn=P.value[on])==null?void 0:fn.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}if(((In=L.value)==null?void 0:In.id)===1&&n.value&&(ea=p==null?void 0:p.view)!=null&&ea.filterMultiple&&p.view.filterMultiple.category){const on=P.value.findIndex(Ha=>Ha.type==="select-simple"&&Ha.label==="Tipo de análisis");if(on!==-1){const Ha=p.view.filterMultiple.category;E.value[0]=Ha,p.view.componentProps&&Ha&&(p.view.componentProps.type=Ha),(((Ur=P.value[on])==null?void 0:Ur.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(((fa=L.value)==null?void 0:fa.id)===6&&n.value&&(Ma=p==null?void 0:p.view)!=null&&Ma.filterMultiple&&p.view.filterMultiple.gameNumber){const on=P.value.findIndex(Ha=>Ha.type==="select-simple"&&Ha.label==="Número de juego");if(on!==-1){const Ha=p.view.filterMultiple.gameNumber;E.value[0]=Ha,p.view.componentProps&&Ha&&(p.view.componentProps.gameNumber=Ha),(((Za=P.value[on])==null?void 0:Za.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(((Ea=L.value)==null?void 0:Ea.id)===7&&n.value&&p!=null&&p.view){if((Xr=p.view.componentProps)!=null&&Xr.analysisType&&P.value.length>0&&((ca=P.value[0])==null?void 0:ca.type)==="radio-button"){const on=p.view.componentProps.analysisType==="offensive"?1:2;E.value[0]=on}if(((kr=p.view.filterMultiple)==null?void 0:kr.isHomeTeam)!==void 0){const on=P.value.findIndex(Ha=>Ha.type==="radio-button"&&Ha.label==="Equipo");if(on!==-1){const Ha=p.view.filterMultiple.isHomeTeam?1:2;E.value[1]=Ha}else if(P.value.length>1&&((ua=P.value[1])==null?void 0:ua.type)==="radio-button"){const Ha=p.view.filterMultiple.isHomeTeam,qr=Ha?1:2;E.value[1]=qr,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Ha),(((Xa=P.value[1])==null?void 0:Xa.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}if(on!==-1&&p.view.componentProps){const Ha=p.view.filterMultiple.isHomeTeam,qr=Ha?1:2;p.view.componentProps.isHomeTeamForAnalysis=Ha,(((ja=P.value[on])==null?void 0:ja.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1})}},100)})}function Mt(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn;return{mainSelector:{id:((St=f.value)==null?void 0:St.id)||null,name:((Yt=f.value)==null?void 0:Yt.name)||null,url:((er=f.value)==null?void 0:er.url)||null},viewSelector:{id:((or=L.value)==null?void 0:or.id)||null,name:((Or=L.value)==null?void 0:Or.name)||((Pr=L.value)==null?void 0:Pr.title)||null,url:((oa=L.value)==null?void 0:oa.url)||null},team:Y.value,dynamicFilters:((Ia=P.value)==null?void 0:Ia.map((fn,In)=>{var ea,Ur;const fa=E.value[In];return{filterId:fn.id||`filter_${In}`,filterType:fn.type,filterLabel:fn.label,filterIcon:fn.icon||null,selectedValue:fa,selectedOptions:fn.type==="select"&&Array.isArray(fa)&&fa.length>0?fa.map(Ma=>{var Za;const Ea=(Za=fn.options)==null?void 0:Za.find(Xr=>Xr.value===Ma);return{value:Ma,label:(Ea==null?void 0:Ea.label)||Ma,icon:(Ea==null?void 0:Ea.icon)||null}}):null,selectedOption:fn.type==="radio-button"&&fa?{value:fa,label:((Ur=(ea=fn.options)==null?void 0:ea.find(Ma=>Ma.value===fa))==null?void 0:Ur.label)||fa}:null,isChecked:fn.type==="check"?fa:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((qa=P.value)==null?void 0:qa.length)||0,activeFilters:((bn=P.value)==null?void 0:bn.filter((fn,In)=>{const ea=E.value[In];return Array.isArray(ea)?ea.length>0:ea!=null&&ea!==!1}).length)||0}}}r({getCurrentFiltersJSON:Mt});function Et(){st(),$("close",i)}function qt(){k.value=!1,Et()}function Gt(){T.value&&(Sd.emit("filters-cancelled",i),T.value=!1),k.value=!1,Et()}t.onMounted(async()=>{document.addEventListener("click",dt),t.nextTick(()=>{Jt()});const St="https://fb78a14uud.execute-api.us-east-2.amazonaws.com/qa/views";try{const Yt=await(await fetch(St,{headers:{Authorization:`${v.token}`}})).json();u.value=Yt.data||[],h.value.clear(),u.value&&(h.value=u.value.reduce((er,or)=>(or.views&&Array.isArray(or.views)&&or.views.forEach(Or=>{Or.filters&&Array.isArray(Or.filters)&&er.set(Or.id,Or)}),er),new Map))}catch(Yt){console.error("Error al obtener datos:",Yt)}});function Jt(){document.querySelectorAll(".field-menu .option-card").forEach(St=>{const Yt=St.querySelector(".option-img");if(!Yt||!Yt.dataset.hoverSrc)return;const er=Yt.src,or=Yt.dataset.hoverSrc;St.addEventListener("mouseenter",()=>{Yt.src=or}),St.addEventListener("mouseleave",()=>{Yt.src=er})})}t.onUnmounted(()=>{document.removeEventListener("click",dt)}),Sd.on("set-filter-and-views-container",St=>{i=St,St&<(St)}),Sd.on("view-added",()=>{k.value=!0,T.value=!0}),Sd.on("component-added-to-container",St=>{(!n.value||i&&St.id===i.id)&<(St)}),Sd.on("edit-view",St=>{var Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja;console.log("on edit-view event received for view:",St),p=St,i=((Yt=St.view)==null?void 0:Yt.filterAndViewsContainer)||null,l=null;const on=[(or=(er=St.view)==null?void 0:er.coreView)==null?void 0:or.filtersJSON,(Or=St.view)==null?void 0:Or.filtersJSON,(Pr=St.coreView)==null?void 0:Pr.filtersJSON,St.filtersJSON,(Ia=(oa=St.view)==null?void 0:oa.componentProps)==null?void 0:Ia.filtersJSON];for(const Ha of on)if(Ha){l=Ha;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(qa=St.view)!=null&&qa.id){const Ha=i.getComponentDynamicFilters(St.view.id);if(Ha){let qr="Unknown";i.viewId===4?qr="Timeline":i.viewId===8?qr="FieldPosesion":i.viewId===3?qr="GSCMatchSummary":i.viewId===1?qr="GSCComparativeReports":i.viewId===2?qr="GscTopPlayer":i.viewId===13&&(qr="GSCTimelapseTable"),l&&(i.viewId===13?l={...l,dynamicFilters:Ha}:l={...l,dynamicFilters:Ha.map((wr,Na)=>Array.isArray(wr)?{selectedValue:wr,selectedOptions:wr.map(rn=>({value:rn,label:rn}))}:typeof wr=="boolean"?{isChecked:wr}:qr==="GSCComparativeReports"&&Na===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&Na===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&Na===1?{selectedOption:{value:wr,label:wr}}:{selectedOption:{value:wr,label:wr}})})}}if(i&&i.viewId===2&&(bn=St.view)!=null&&bn.filterMultiple){if(St.view.filterMultiple.categoryId&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Ha!==-1&&(l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:St.view.filterMultiple.categoryId,selectedOptions:[{value:St.view.filterMultiple.categoryId,label:`Category ${St.view.filterMultiple.categoryId}`}]})}if(St.view.filterMultiple.teamType!==void 0&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Ha!==-1){const qr=St.view.filterMultiple.teamType,wr=qr===1?"Mi equipo":qr===2?"Rival":qr===3?"Ambos":"Equipo";l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:qr,label:wr}}}}}if(i&&i.viewId===1&&(fn=St.view)!=null&&fn.filterMultiple&&St.view.filterMultiple.category&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Ha!==-1&&(l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:St.view.filterMultiple.category,selectedOptions:[{value:St.view.filterMultiple.category,label:St.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(In=St.view)!=null&&In.filterMultiple){if(St.view.filterMultiple.categoryIds&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select"&&qr.filterLabel==="Tipo de análisis");if(Ha!==-1){const qr=Array.isArray(St.view.filterMultiple.categoryIds)?St.view.filterMultiple.categoryIds:[St.view.filterMultiple.categoryIds];l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:qr,selectedOptions:qr.map(rn=>({value:rn,label:`Category ${rn}`}))};const wr=St.view.filterMultiple.categoryIds;hr(wr,qr);const Na=(((ea=P.value[Ha])==null?void 0:ea.options)||[]).filter(rn=>Array.isArray(rn.value)?hr(rn.value,qr):qr.includes(rn.value));if(Na.length>0){const rn=Na[0];l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:rn.value,selectedOptions:[rn]}}}}if(St.view.filterMultiple.isHomeTeam!==void 0&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Ha!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,Na;typeof qr=="boolean"?(wr=qr?1:2,Na=qr?"Mi equipo":"Rival"):typeof qr=="number"?(wr=qr===1?1:2,Na=qr===1?"Mi equipo":"Rival"):(wr=1,Na="Mi equipo"),l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}}}if(i&&i.viewId===6&&(Ur=St.view)!=null&&Ur.filterMultiple&&St.view.filterMultiple.gameNumber&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Número de juego");Ha!==-1&&(l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:St.view.filterMultiple.gameNumber,selectedOptions:[{value:St.view.filterMultiple.gameNumber,label:`Juego ${St.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&St.view&&l){if((fa=St.view.componentProps)!=null&&fa.analysisType){const Ha=l.dynamicFilters.findIndex((qr,wr)=>qr.filterType==="radio-button"&&wr===0);if(Ha!==-1){const qr=St.view.componentProps.analysisType,wr=qr==="offensive"?1:2,Na=qr==="offensive"?"A favor":"En contra";l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}}if(((Ma=St.view.filterMultiple)==null?void 0:Ma.isHomeTeam)!==void 0){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Ha!==-1){const qr=St.view.filterMultiple.isHomeTeam,wr=qr?1:2,Na=qr?"Equipo propio":"Equipo rival";l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}}}if(i&&i.viewId===10&&(Za=St.view)!=null&&Za.filterMultiple&&((Xr=(Ea=p==null?void 0:p.view)==null?void 0:Ea.coreView)==null?void 0:Xr.id)===10){const Ha=St.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:Ha})}if(i&&i.viewId===15&&(ca=St.view)!=null&&ca.id){const Ha=i.getComponentDynamicFilters(St.view.id);if(Ha&&l)l={...l,dynamicFilters:Ha.map((qr,wr)=>{var Na,rn;if(wr===0){let mn=qr;if(qr===3&&((rn=(Na=St.view)==null?void 0:Na.filterMultiple)==null?void 0:rn.isHomeTeam)!==void 0){const $a=St.view.filterMultiple.isHomeTeam;typeof $a=="boolean"?mn=$a?1:2:typeof $a=="number"&&(mn=$a===1?1:2)}return{selectedOption:{value:mn,label:mn===1?"Mi equipo":"Rival"}}}else if(wr===1)return{selectedValue:qr,selectedOptions:[{value:qr,label:`${qr} fortalezas`}]};return typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})};else if((kr=St.view)!=null&&kr.filterMultiple&&l&&St.view.filterMultiple.isHomeTeam!==void 0){const qr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Mi equipo");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let Na,rn;typeof wr=="boolean"?(Na=wr?1:2,rn=wr?"Local":"Visitante"):typeof wr=="number"?(Na=wr===1?1:2,rn=wr===1?"Local":"Visitante"):(Na=1,rn="Local"),l.dynamicFilters[qr]={...l.dynamicFilters[qr],selectedOption:{value:Na,label:rn}}}}}if(i&&i.viewId===17&&(ua=St.view)!=null&&ua.id){const Ha=i.getComponentDynamicFilters(St.view.id);if(Ha&&l)console.log("Edit filters opt 1",l),l={...l,dynamicFilters:Ha.map((qr,wr)=>{var Na,rn,mn,$a,Hn,Pn;const Yn=(Na=P.value)==null?void 0:Na[wr];if(Yn&&Yn.type==="radio-button"){let An=qr;if(qr===3&&((mn=(rn=St.view)==null?void 0:rn.filterMultiple)==null?void 0:mn.isHomeTeam)!==void 0){const Wn=St.view.filterMultiple.isHomeTeam;typeof Wn=="boolean"?An=Wn?1:2:typeof Wn=="number"&&(An=Wn===1?1:2)}return{selectedOption:{value:An,label:An===1?"Mi equipo":An===2?"Rival":"Ambos"}}}else if(wr===2){let An=qr;if((qr===3||qr!==1&&qr!==2&&($a=St.view)!=null&&$a.filterMultiple)&&((Pn=(Hn=St.view)==null?void 0:Hn.filterMultiple)==null?void 0:Pn.isHomeTeam)!==void 0){const Wn=St.view.filterMultiple.isHomeTeam;typeof Wn=="boolean"?An=Wn?1:2:typeof Wn=="number"&&(An=Wn===1?1:2)}return Yn&&Yn.type==="select-simple"?{selectedValue:An,selectedOptions:[{value:An,label:String(An)}]}:Yn&&Yn.type==="radio-button"?{selectedOption:{value:An,label:An===1?"Mi equipo":An===2?"Rival":"Ambos"}}:typeof An=="number"?{selectedValue:An}:{selectedOption:{value:An,label:String(An)}}}else{if(Yn&&Yn.type==="switch")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr};if(Yn&&Yn.type==="check")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr}}return Array.isArray(qr)?{selectedValue:qr,selectedOptions:qr.map(An=>({value:An,label:String(An)}))}:typeof qr=="boolean"?{selectedValue:qr}:typeof qr=="object"&&qr!==null?qr:typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})},console.log("Edit filters opt 1 finla --->",l);else if((Xa=St.view)!=null&&Xa.filterMultiple&&l&&(console.log("Edit filters opt 1 multiple"),St.view.filterMultiple.isHomeTeam!==void 0)){const qr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let Na,rn;typeof wr=="boolean"?(Na=wr?1:2,rn=wr?"Mi equipo":"Rival"):typeof wr=="number"?(Na=wr===1?1:2,rn=wr===1?"Mi equipo":"Rival"):(Na=1,rn="Mi equipo"),l.dynamicFilters[qr]={...l.dynamicFilters[qr],selectedOption:{value:Na,label:rn}}}}}if(i&&i.viewId===5&&(ja=St.view)!=null&&ja.filterMultiple&&St.view.filterMultiple.isHomeTeam!==void 0&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Ha!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,Na;typeof qr=="boolean"?(wr=qr?1:2,Na=qr?"Equipo propio":"Equipo rival"):typeof qr=="number"?(wr=qr===1?1:2,Na=qr===1?"Equipo propio":"Equipo rival"):(wr=1,Na="Equipo propio"),l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}else{const qr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let Na,rn;typeof wr=="boolean"?(Na=wr?1:2,rn=wr?"Equipo propio":"Equipo rival"):typeof wr=="number"?(Na=wr===1?1:2,rn=wr===1?"Equipo propio":"Equipo rival"):(Na=1,rn="Equipo propio"),l.dynamicFilters[qr]={...l.dynamicFilters[qr],selectedOption:{value:Na,label:rn}}}}}l&&Ot(l),k.value=!0});function Qt(){ge.value=null}function lr(St,Yt){var er;(er=L.value)==null||er.id}function hr(St,Yt){if(!Array.isArray(St)||!Array.isArray(Yt)||St.length!==Yt.length)return!1;const er=[...St].sort((Or,Pr)=>Or-Pr),or=[...Yt].sort((Or,Pr)=>Or-Pr);return JSON.stringify(er)===JSON.stringify(or)}function $t(){if(n.value&&l&&l.dynamicFilters){if(o.value||x.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&(er=P.value)!=null&&er[Yt]){const or=P.value[Yt];if(or.type==="check"&&St.isChecked!==void 0)E.value[Yt]=St.isChecked;else if(or.type==="select"&&St.selectedOptions){const Or=St.selectedOptions.map(Pr=>Pr.value);E.value[Yt]=Or}else or.type==="select"&&St.selectedValue&&Array.isArray(St.selectedValue)&&(E.value[Yt]=St.selectedValue)}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Rt(){var St;if(n.value&&l&&l.dynamicFilters&&((St=L.value)==null?void 0:St.id)===4){if(o.value||x.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((Yt,er)=>{var or,Or;if(Yt&&((Or=(or=P.value)==null?void 0:or[er])==null?void 0:Or.type)==="select"){if(Yt.selectedOptions){const Pr=Yt.selectedOptions.map(oa=>oa.value);E.value[er]=Pr}else if(Yt.selectedValue&&Array.isArray(Yt.selectedValue))if(Yt.selectedValue.length>0&&Yt.selectedValue[0]&&typeof Yt.selectedValue[0]=="object"){const Pr=sr(Yt.selectedValue);E.value[er]=Pr}else E.value[er]=Yt.selectedValue}}),setTimeout(()=>{var Yt;if(E.value=[...E.value],(Yt=p==null?void 0:p.view)!=null&&Yt.componentProps&&E.value&&E.value.length>0){const er=E.value[0];if(Array.isArray(er)&&er.length>0){const or=er.some(Ia=>Ia.event_type_id===1||typeof Ia=="string"&&Ia.includes("1")),Or=er.some(Ia=>Ia.category_id===8||typeof Ia=="string"&&Ia.includes("8")),Pr=er.some(Ia=>Ia.category_id===9||typeof Ia=="string"&&Ia.includes("9")),oa=er.some(Ia=>Ia.event_type_id===3||typeof Ia=="string"&&Ia.includes("3"));p.view.componentProps.selectedEvents=er,p.view.componentProps.goals=or,p.view.componentProps.yellowCards=Or,p.view.componentProps.redCards=Pr,p.view.componentProps.substitutions=oa,p.view.componentProps.key=er.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},200),t.nextTick(()=>{d.value=!1,o.value=!1})}}function sr(St){return!Array.isArray(St)||St.length===0?[]:St.map(Yt=>{if(Yt&&typeof Yt=="object"){if(Yt.event_type_id!==void 0||Yt.category_id!==void 0)return{event_type_id:Yt.event_type_id,category_id:Yt.category_id,...Yt.name&&{name:Yt.name},...Yt.label&&{label:Yt.label}};if(Yt.value&&typeof Yt.value=="object")return{event_type_id:Yt.value.event_type_id,category_id:Yt.value.category_id,...Yt.value.name&&{name:Yt.value.name},...Yt.value.label&&{label:Yt.value.label}};if(typeof Yt=="string"&&Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}}if(typeof Yt=="string")if(Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}else{const er=parseInt(Yt);if(!isNaN(er))return{event_type_id:er}}return Yt})}function Zt(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma;if(n.value&&l&&l.dynamicFilters&&P.value){if(o.value||x.value)return;if(o.value=!0,d.value=!0,l.dynamicFilters.forEach((Za,Ea)=>{var Xr,ca,kr,ua,Xa,ja,on,Ha,qr,wr,Na;if(Za&&((Xr=P.value[Ea])==null?void 0:Xr.type)==="select"){if(Za.selectedOptions){const rn=Za.selectedOptions.map(mn=>mn.value);E.value[Ea]=rn}else if(Za.selectedValue&&Array.isArray(Za.selectedValue))if(Za.selectedValue.length>0&&Za.selectedValue[0]&&typeof Za.selectedValue[0]=="object"){const rn=sr(Za.selectedValue);E.value[Ea]=rn}else E.value[Ea]=Za.selectedValue}else if(Za&&((ca=P.value[Ea])==null?void 0:ca.type)==="select-simple"&&Za.selectedValue!==void 0){let rn;((kr=L.value)==null?void 0:kr.id)===2&&(Xa=(ua=p==null?void 0:p.view)==null?void 0:ua.filterMultiple)!=null&&Xa.categoryId?rn=p.view.filterMultiple.categoryId:((ja=L.value)==null?void 0:ja.id)===1&&(Ha=(on=p==null?void 0:p.view)==null?void 0:on.filterMultiple)!=null&&Ha.category?rn=p.view.filterMultiple.category:((qr=L.value)==null?void 0:qr.id)===6&&(Na=(wr=p==null?void 0:p.view)==null?void 0:wr.filterMultiple)!=null&&Na.gameNumber?rn=p.view.filterMultiple.gameNumber:rn=Array.isArray(Za.selectedValue)?Za.selectedValue[0]:Za.selectedValue,E.value[Ea]=rn}}),((St=L.value)==null?void 0:St.id)===4&&setTimeout(()=>{var Za;if(E.value=[...E.value],(Za=p==null?void 0:p.view)!=null&&Za.componentProps&&E.value&&E.value.length>0){const Ea=E.value[0];if(Array.isArray(Ea)&&Ea.length>0){const Xr=Ea.some(Xa=>Xa.event_type_id===1||typeof Xa=="string"&&Xa.includes("1")),ca=Ea.some(Xa=>Xa.category_id===8||typeof Xa=="string"&&Xa.includes("8")),kr=Ea.some(Xa=>Xa.category_id===9||typeof Xa=="string"&&Xa.includes("9")),ua=Ea.some(Xa=>Xa.event_type_id===3||typeof Xa=="string"&&Xa.includes("3"));p.view.componentProps.selectedEvents=Ea,p.view.componentProps.goals=Xr,p.view.componentProps.yellowCards=ca,p.view.componentProps.redCards=kr,p.view.componentProps.substitutions=ua,p.view.componentProps.key=Ea.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},100),((Yt=L.value)==null?void 0:Yt.id)===2&&(er=p==null?void 0:p.view)!=null&&er.filterMultiple){if(p.view.filterMultiple.categoryId){const Za=P.value.findIndex(Ea=>Ea.type==="select-simple"&&Ea.label==="Tipo de análisis");if(Za!==-1){const Ea=p.view.filterMultiple.categoryId;if(E.value[0]=Ea,p.view.componentProps&&Ea){let Xr=`Category ${Ea}`,ca=null;try{ca=A4(Ea),ca&&(Xr=ca.name)}catch{const kr=P.value.findIndex(ua=>ua.type==="select-simple"&&ua.label==="Tipo de análisis");if(kr!==-1){const ua=(((or=P.value[kr])==null?void 0:or.options)||[]).find(Xa=>Xa.value==Ea);ua&&(Xr=ua.label)}}p.view.componentProps.categoryView=[{id:Ea,name:Xr}]}(((Or=P.value[Za])==null?void 0:Or.options)||[]).find(Xr=>Xr.value==Ea),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.teamType;E.value[Za]=Ea,(((Pr=P.value[Za])==null?void 0:Pr.options)||[]).find(Xr=>Xr.value==Ea),t.nextTick(()=>{E.value=[...E.value]})}}}if(((oa=L.value)==null?void 0:oa.id)===1&&(Ia=p==null?void 0:p.view)!=null&&Ia.filterMultiple&&p.view.filterMultiple.category&&P.value.findIndex(Za=>Za.type==="select-simple"&&Za.label==="Tipo de análisis")!==-1){const Za=p.view.filterMultiple.category;E.value[0]=Za,p.view.componentProps&&Za&&(p.view.componentProps.type=Za),t.nextTick(()=>{E.value=[...E.value]})}if(((qa=L.value)==null?void 0:qa.id)===6&&(bn=p==null?void 0:p.view)!=null&&bn.filterMultiple&&p.view.filterMultiple.gameNumber&&P.value.findIndex(Za=>Za.type==="select-simple"&&Za.label==="Número de juego")!==-1){const Za=p.view.filterMultiple.gameNumber;E.value[0]=Za,p.view.componentProps&&Za&&(p.view.componentProps.gameNumber=Za),t.nextTick(()=>{E.value=[...E.value]})}if(((fn=L.value)==null?void 0:fn.id)===5&&(In=p==null?void 0:p.view)!=null&&In.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0)if(P.value.findIndex(Za=>Za.type==="radio-button"&&Za.label==="Equipo")!==-1){const Za=p.view.filterMultiple.isHomeTeam;let Ea;typeof Za=="boolean"?Ea=Za?1:2:typeof Za=="number"?Ea=Za===1?1:2:Ea=1,E.value[0]=Ea,p.view.componentProps&&Za!==void 0&&(p.view.componentProps.isHomeTeamForAnalysis=Za===1),t.nextTick(()=>{E.value=[...E.value]})}else{const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.isHomeTeam;let Xr;typeof Ea=="boolean"?Xr=Ea?1:2:typeof Ea=="number"?Xr=Ea===1?1:2:Xr=1,E.value[Za]=Xr,p.view.componentProps&&Ea!==void 0&&(p.view.componentProps.preMatchType=Ea),t.nextTick(()=>{E.value=[...E.value]})}}if(((ea=L.value)==null?void 0:ea.id)===15&&(Ur=p==null?void 0:p.view)!=null&&Ur.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",Ea,"type:",typeof Ea);let Xr;typeof Ea=="boolean"?Xr=Ea?1:2:typeof Ea=="number"?Xr=Ea===1?1:2:Xr=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Xr,"teamFilterIndex:",Za),E.value[Za]=Xr,p.view.componentProps&&Ea!==void 0&&(p.view.componentProps.preMatchType=Xr),t.nextTick(()=>{E.value=[...E.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",E.value)})}else{const Ea=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Ea!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let ca;typeof Xr=="boolean"?ca=Xr?1:2:typeof Xr=="number"?ca=Xr===1?1:2:ca=1,E.value[Ea]=ca,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.preMatchType=ca),t.nextTick(()=>{E.value=[...E.value]})}}}if(((fa=L.value)==null?void 0:fa.id)===17&&(Ma=p==null?void 0:p.view)!=null&&Ma.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.isHomeTeam;let Xr;typeof Ea=="boolean"?Xr=Ea?1:2:typeof Ea=="number"?Xr=Ea===1?1:2:Xr=1,E.value[Za]=Xr,p.view.componentProps&&Ea!==void 0&&(p.view.componentProps.teamselected=Xr),t.nextTick(()=>{E.value=[...E.value]})}else{const Ea=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Ea!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let ca;typeof Xr=="boolean"?ca=Xr?1:2:typeof Xr=="number"?ca=Xr===1?1:2:ca=1,E.value[Ea]=ca,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.teamselected=ca),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1,o.value=!1})}}function Tt(){if(!o.value&&n.value&&l&&l.dynamicFilters&&P.value){if(x.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&((er=P.value[Yt])==null?void 0:er.type)==="radio-button"&&St.selectedOption&&St.selectedOption.value!==void 0){const or=St.selectedOption.value;E.value[Yt]=or}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Pt(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja,on,Ha,qr,wr,Na,rn,mn,$a,Hn,Pn,Yn;if(i&&n.value&&p){if(x.value)return;if(d.value=!0,((St=L.value)==null?void 0:St.id)===4){if(i.setDynamicFilters(E.value,(Yt=p.view)==null?void 0:Yt.id),i.updateDynamicFilters(E.value,(er=p.view)==null?void 0:er.id),p.view.componentProps&&E.value&&E.value.length>0){const An=E.value[0];if(Array.isArray(An)&&An.length>0){const Wn=An.some(So=>So.event_type_id===1||typeof So=="string"&&So.includes("1")),Ci=An.some(So=>So.category_id===8||typeof So=="string"&&So.includes("8")),Pi=An.some(So=>So.category_id===9||typeof So=="string"&&So.includes("9")),Po=An.some(So=>So.event_type_id===3||typeof So=="string"&&So.includes("3"));p.view.componentProps.selectedEvents=An,p.view.componentProps.goals=Wn,p.view.componentProps.yellowCards=Ci,p.view.componentProps.redCards=Pi,p.view.componentProps.substitutions=Po,p.view.componentProps.key=An.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}}else if(((or=L.value)==null?void 0:or.id)===8)i.setDynamicFilters(E.value,(Or=p.view)==null?void 0:Or.id),i.updateDynamicFilters(E.value,(Pr=p.view)==null?void 0:Pr.id);else if(((oa=L.value)==null?void 0:oa.id)===3)i.setDynamicFilters(E.value,(Ia=p.view)==null?void 0:Ia.id),i.updateDynamicFilters(E.value,(qa=p.view)==null?void 0:qa.id);else if(((bn=L.value)==null?void 0:bn.id)===13){const An=(fn=p.view)==null?void 0:fn.id;i.setDynamicFilters(E.value,An),i.updateDynamicFilters(E.value,An),p.view.componentProps&&(p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps}))}else if(((In=L.value)==null?void 0:In.id)===15){const An=(ea=p.view)==null?void 0:ea.id;if(i.setDynamicFilters(E.value,An),i.updateDynamicFilters(E.value,An),p.view.componentProps){const Wn=Array.isArray(E.value)&&E.value[3]!==void 0?E.value[3]:null;Wn!==null&&(p.view.componentProps.numitems=Wn),p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Ur=L.value)==null?void 0:Ur.id)===17){const An=(fa=p==null?void 0:p.view)==null?void 0:fa.id;i.setDynamicFilters(E.value,An),i.updateDynamicFilters(E.value,An);const Wn=(Ci,Pi)=>{if(!Ci)return;const Po=E.value[0];Po!==void 0&&(Ci.infavoragainstteam=!Po);const So=E.value[1];So!==void 0&&(Ci.lateralidad=So===32?"right":"left");const Mo=E.value[2];Mo!==void 0&&Pi&&(Mo===3||(Ci.teamselected=Mo===2?Pi.away_team:Pi.home_team)),Ci._updateKey=Date.now()};if(p&&p.view&&p.view.componentProps){const Ci=p.view.componentProps.game;Wn(p.view.componentProps,Ci),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Ma=L.value)==null?void 0:Ma.id)===2){i.setDynamicFilters(E.value,(Za=p.view)==null?void 0:Za.id),i.updateDynamicFilters(E.value,(Ea=p.view)==null?void 0:Ea.id);const An=E.value[0];if(An!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.categoryId,p.view.filterMultiple.categoryId=An,p.view.componentProps)){let Ci=`Category ${An}`,Pi=null;try{Pi=A4(An),Pi&&(Ci=Pi.name)}catch{const Po=P.value.findIndex(So=>So.type==="select-simple"&&So.label==="Tipo de análisis");if(Po!==-1){const So=(((Xr=P.value[Po])==null?void 0:Xr.options)||[]).find(Mo=>Mo.value==An);So&&(Ci=So.label)}}p.view.componentProps.categoryView=[{id:An,name:Ci}],Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple})}const Wn=E.value[1];Wn!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.teamType,p.view.filterMultiple.teamType=Wn,p.view.componentProps&&p.view.componentProps.game&&(Wn===1?p.view.componentProps.teamView=p.view.componentProps.game.homeTeam.team_id:Wn===2?p.view.componentProps.teamView=p.view.componentProps.game.awayTeam.team_id:p.view.componentProps.teamView=0),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((ca=L.value)==null?void 0:ca.id)===1){i.setDynamicFilters(E.value,(kr=p.view)==null?void 0:kr.id),i.updateDynamicFilters(E.value,(ua=p.view)==null?void 0:ua.id);const An=E.value[0];An!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.category,p.view.filterMultiple.category=An,p.view.componentProps&&(p.view.componentProps.type=An),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((Xa=L.value)==null?void 0:Xa.id)===6){i.setDynamicFilters(E.value,(ja=p.view)==null?void 0:ja.id),i.updateDynamicFilters(E.value,(on=p.view)==null?void 0:on.id);const An=E.value[0];An!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.gameNumber,p.view.filterMultiple.gameNumber=An,p.view.componentProps&&(p.view.componentProps.gameNumber=An,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Ha=L.value)==null?void 0:Ha.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})}))}else if(((qr=L.value)==null?void 0:qr.id)===7){i.setDynamicFilters(E.value,(wr=p.view)==null?void 0:wr.id),i.updateDynamicFilters(E.value,(Na=p.view)==null?void 0:Na.id);const An=E.value[0],Wn=E.value[1];if(An!==void 0&&p.view.componentProps){const Ci=An===1?"offensive":"defensive";p.view.componentProps.analysisType=Ci}if(Wn!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Ci=Wn===1;p.view.filterMultiple.isHomeTeam=Ci,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Ci,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(rn=L.value)==null?void 0:rn.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else if(((mn=L.value)==null?void 0:mn.id)===5){i.setDynamicFilters(E.value,($a=p.view)==null?void 0:$a.id),i.updateDynamicFilters(E.value,(Hn=p.view)==null?void 0:Hn.id);const An=E.value[0];if(An!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Wn=An===1?1:2;p.view.filterMultiple.isHomeTeam=Wn,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Wn===1,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Pn=L.value)==null?void 0:Pn.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else((Yn=L.value)==null?void 0:Yn.id)===9||(i.setDynamicFilters(E.value),i.updateDynamicFilters(E.value));t.nextTick(()=>{d.value=!1})}}function Ut(){var St,Yt;if(!l||!l.dynamicFilters||!P.value)return!1;for(let er=0;er<l.dynamicFilters.length;er++){const or=l.dynamicFilters[er],Or=P.value[er],Pr=E.value[er];if(!(!or||!Or)){if(Or.type==="check"){if(or.isChecked!==Pr)return!0}else if(Or.type==="radio-button"){if(((St=or.selectedOption)==null?void 0:St.value)!==Pr)return!0}else if(Or.type==="select"){const oa=((Yt=or.selectedOptions)==null?void 0:Yt.map(qa=>qa.value))||or.selectedValue||[],Ia=Array.isArray(Pr)?Pr:[];if(JSON.stringify(oa)!==JSON.stringify(Ia))return!0}}}return!1}function vr(St){var Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea;if(E.value=St.filters,i){const Xr=((Yt=p==null?void 0:p.view)==null?void 0:Yt.id)||null;i.setDynamicFilters(E.value,Xr),i.updateDynamicFilters(E.value,Xr)}if(n.value&&p&&(Sd.emit("activate-save-button"),Sd.emit("force-component-update",{itemId:((er=p==null?void 0:p.view)==null?void 0:er.id)||null,componentProps:p.view.componentProps}),Sd.emit("dynamic-filters-changed",{containerViewId:((or=p==null?void 0:p.view)==null?void 0:or.id)||null,viewId:((Or=p==null?void 0:p.view)==null?void 0:Or.id)||null,dynamicFilters:E.value}),Sd.emit("dynamic-filters-changed",{containerViewId:((Pr=p==null?void 0:p.view)==null?void 0:Pr.id)||null,viewId:((oa=p==null?void 0:p.view)==null?void 0:oa.id)||null,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})),!n.value&&i&&(((Ia=L.value)==null?void 0:Ia.id)===15||((qa=L.value)==null?void 0:qa.id)===17)&&i.getRequiresAddView(E.value,P.value)){i.setDynamicFilters(E.value),$("filters-changed",{main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:{mainSelector:{id:((bn=f.value)==null?void 0:bn.id)||null,name:((fn=f.value)==null?void 0:fn.name)||null,url:((In=f.value)==null?void 0:In.url)||null},viewSelector:{id:((ea=L.value)==null?void 0:ea.id)||null,name:((Ur=L.value)==null?void 0:Ur.name)||((fa=L.value)==null?void 0:fa.title)||null,url:((Ma=L.value)==null?void 0:Ma.url)||null},team:Y.value,dynamicFilters:E.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((Za=P.value)==null?void 0:Za.length)||0,activeFilters:((Ea=P.value)==null?void 0:Ea.filter((Xr,ca)=>{const kr=E.value[ca];return Array.isArray(kr)?kr.length>0:kr!=null&&kr!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:p}),Ye();return}Pt()}function ur(St){St.filterIndex!==void 0&&St.value!==void 0&&(E.value[St.filterIndex]=St.value,n.value&&Pt(),Ye())}function gr(){Gt()}function Tr(St){var Yt,er,or,Or,Pr,oa,Ia;console.log("newFilters in onChangeFiltersAltMode:",St);const qa={mainSelector:{id:((Yt=f.value)==null?void 0:Yt.id)||null,name:((er=f.value)==null?void 0:er.name)||null,url:((or=f.value)==null?void 0:or.url)||null},viewSelector:{id:((Or=L.value)==null?void 0:Or.id)||null,name:((Pr=L.value)==null?void 0:Pr.name)||((oa=L.value)==null?void 0:oa.title)||null,url:((Ia=L.value)==null?void 0:Ia.url)||null}};$("filters-changed",{filters:St.filters,view:St.view,viewToEdit:p,filterAndViewsContainer:i,filtersJSON:qa,isAltMode:!0})}function Rr(St){return JSON.parse(JSON.stringify(St))}return(St,Yt)=>(t.openBlock(),t.createElementBlock("div",zrt,[t.createElementVNode("button",Mrt,t.toDisplayString(n.value?"Editando visualización":"Nueva visualización"),1),t.createElementVNode("div",{class:t.normalizeClass([{disabled:n.value},"custom-select main-select"]),onClick:_e},[t.createElementVNode("div",Vrt,[t.createElementVNode("span",Prt,[f.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Art)):(t.openBlock(),t.createElementBlock("img",Rrt))]),f.value?(t.openBlock(),t.createElementBlock("span",Frt,t.toDisplayString(Ae()),1)):(t.openBlock(),t.createElementBlock("span",Urt,"Tipo de vista")),t.createElementVNode("span",{class:t.normalizeClass([{open:se.value},"arrow"])},[...Yt[5]||(Yt[5]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),se.value?(t.openBlock(),t.createElementBlock("div",Irt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(er,or)=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:s.value===or},"option-card"]),onClick:t.withModifiers(Or=>qe(or),["stop"])},[t.createElementVNode("div",jrt,[t.createElementVNode("img",{"data-hover-src":xe(er.name,!0),src:xe(er.name,!1),alt:"icono",class:"option-img-34"},null,8,Wrt)]),t.createElementVNode("div",Drt,[t.createElementVNode("div",Krt,t.toDisplayString(er.name),1),er.description?(t.openBlock(),t.createElementBlock("div",Brt,t.toDisplayString(er.description),1)):t.createCommentVNode("",!0)])],10,qrt))),128))])):t.createCommentVNode("",!0)],2),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{disabled:n.value},"custom-select second-select"]),onClick:Ue},[t.createElementVNode("div",Xrt,[t.createElementVNode("span",Grt,[L.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:L.value.url,alt:"icono",class:"option-img-graph2"},null,8,Zrt)):f.value?(t.openBlock(),t.createElementBlock("img",{key:1,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Jrt)):t.createCommentVNode("",!0)]),t.createElementVNode("span",Hrt,t.toDisplayString(je()),1),t.createElementVNode("span",{class:t.normalizeClass([{open:me.value},"arrow"])},[...Yt[6]||(Yt[6]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),me.value&&f.value?(t.openBlock(),t.createElementBlock("div",Yrt,[t.createElementVNode("div",Qrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,er=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:S.value===er.id},"option-card-grid"]),onClick:t.withModifiers(or=>Re(er),["stop"])},[er.id===17?(t.openBlock(),t.createElementBlock("div",eat,[...Yt[7]||(Yt[7]=[t.createElementVNode("div",null,"Tiros de esquina",-1),t.createElementVNode("div",null,"tendencia general",-1)])])):er.id===18?(t.openBlock(),t.createElementBlock("div",tat,[...Yt[8]||(Yt[8]=[t.createElementVNode("div",null,"Tactica fija",-1),t.createElementVNode("div",null,"jugadas especificas",-1)])])):(t.openBlock(),t.createElementBlock("div",rat,t.toDisplayString(er.name||er.title),1)),t.createElementVNode("div",aat,[t.createElementVNode("img",{src:er.url,alt:"icono",class:"option-img-grid"},null,8,nat)])],10,$rt))),128))])])):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),L.value?(t.openBlock(),t.createElementBlock("div",iat)):t.createCommentVNode("",!0),L.value&&L.value.id===13?(t.openBlock(),t.createBlock(IYe,{key:2,"component-id":13,filters:P.value,"initial-values":n.value?t.unref(l).dynamicFilters:E.value,"is-edit-mode":n.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===16?(t.openBlock(),t.createBlock(YQe,{key:3,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"is-edit-mode":!!t.unref(p),"is-post-match":e.isPostMatch,"view-config":Rr(h.value.get(16)),onChange:Tr,onRemoveViews:gr},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):L.value&&L.value.id===18?(t.openBlock(),t.createBlock(ret,{key:4,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"view-config":Rr(h.value.get(18)),"is-post-match":e.isPostMatch,onChange:Tr,onRemoveViews:gr},null,8,["default-filters","view-config","is-post-match"])):L.value&&L.value.id===15?(t.openBlock(),t.createBlock(aQe,{key:5,"component-id":15,filters:P.value,"initial-values":n.value?t.unref(l).dynamicFilters:E.value,"is-edit-mode":n.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===17?(t.openBlock(),t.createBlock(Ert,{key:6,"component-id":17,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,filters:P.value,"initial-values":n.value?t.unref(l).dynamicFilters:E.value,"is-edit-mode":n.value,"view-config":Rr(h.value.get(17)),onChange:Tr,onFiltersChanged:vr,onFilterUpdated:ur,onRemoveViews:gr},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):L.value&&P.value&&W()?(t.openBlock(),t.createElementBlock("div",{key:7,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":P.value.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P.value,(er,or)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:or},[er.type==="select"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>De(or),["stop"])},[t.createElementVNode("div",sat,[Yt[10]||(Yt[10]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[11]||(Yt[11]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(E.value[or])&&E.value[or].length>0?(t.openBlock(),t.createElementBlock("span",lat,t.toDisplayString(E.value[or].length),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass([{open:ge.value===or},"arrow"])},[...Yt[9]||(Yt[9]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),ge.value===or?(t.openBlock(),t.createElementBlock("div",cat,[t.createElementVNode("div",uat,[t.createElementVNode("div",{class:"multi-select-header",onClick:Yt[1]||(Yt[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("label",dat,[t.createElementVNode("input",{checked:j(or),indeterminate:F(or),type:"checkbox",onChange:t.withModifiers(Or=>N(or),["stop"]),onClick:Yt[0]||(Yt[0]=t.withModifiers(()=>{},["stop"]))},null,40,pat),Yt[12]||(Yt[12]=t.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:V(or,Or.value)},"option-card multi-select-option"]),onClick:Yt[2]||(Yt[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",hat,[t.createElementVNode("input",{checked:V(or,Or.value),type:"checkbox",onChange:t.withModifiers(Pr=>I(or,Or.value),["stop"])},null,40,fat)]),t.createElementVNode("div",{class:"option-content",onClick:Pr=>I(or,Or.value)},[t.createElementVNode("div",yat,t.toDisplayString(Or.label),1)],8,mat)],2))),128))]),t.createElementVNode("div",gat,[t.createElementVNode("button",{class:"btn-listo",onClick:Yt[3]||(Yt[3]=t.withModifiers(Or=>Qt(),["stop"]))},"Listo")])])):t.createCommentVNode("",!0)],8,oat)):er.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",vat,[t.createElementVNode("div",bat,t.toDisplayString(er.label),1),t.createElementVNode("div",xat,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("label",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"radio-option-card"])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pr=>E.value[or]=Pr,disabled:X(Or.value,Or.label),name:"dynamic-radio-"+or,value:Or.value,type:"radio",onChange:()=>{var Pr,oa,Ia;if(((Pr=L.value.value)==null?void 0:Pr.id)===9&&n.value.value&&(Ia=(oa=t.unref(p))==null?void 0:oa.view)!=null&&Ia.filterMultiple){const qa=E.value[or]===1;t.unref(p).view.filterMultiple.isHomeTeam=qa}n.value.value&&Pt(),Ye()}},null,40,_at),[[t.vModelRadio,E.value[or]]]),t.createElementVNode("span",null,t.toDisplayString(Or.label),1)],2))),128))])])):er.type==="check"?(t.openBlock(),t.createElementBlock("div",wat,[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Or=>E.value[or]=Or,checked:E.value[or],type:"checkbox",onChange:Yt[4]||(Yt[4]=()=>{n.value.value&&Pt(),Ye()})},null,40,Tat),[[t.vModelCheckbox,E.value[or]]]),t.createTextVNode(" "+t.toDisplayString(er.label),1)])])):er.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-filter-type":er.type,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>Qe(or),["stop"])},[t.createElementVNode("div",kat,[Yt[14]||(Yt[14]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[15]||(Yt[15]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),t.createElementVNode("span",{class:t.normalizeClass([{open:be.value===or},"arrow"])},[...Yt[13]||(Yt[13]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),be.value===or?(t.openBlock(),t.createElementBlock("div",Lat,[t.createElementVNode("div",Cat,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"option-card simple-select-option"]),onMouseenter:Pr=>lr(or,Or.value),onClick:t.withModifiers(Pr=>rt(or,Or.value),["stop"])},[t.createElementVNode("div",Nat,[t.createElementVNode("div",Eat,t.toDisplayString(Or.label),1)]),E.value[or]===Or.value?(t.openBlock(),t.createElementBlock("div",zat,[...Yt[16]||(Yt[16]=[t.createElementVNode("svg",{fill:"none",height:"16",viewBox:"0 0 16 16",width:"16"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])])):t.createCommentVNode("",!0)],42,Oat))),128))])])):t.createCommentVNode("",!0)],8,Sat)):t.createCommentVNode("",!0),or===1&&P.value.length>2?(t.openBlock(),t.createElementBlock("div",Mat)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0),n.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:8,class:"cancel-btn",onClick:Gt},"Cancelar")),k.value?(t.openBlock(),t.createElementBlock("button",{key:9,class:"ok-btn",onClick:qt},"OK")):t.createCommentVNode("",!0)]))}}),Pat=t2(Vat,[["__scopeId","data-v-9fa60fa7"]]),Aat={key:0,class:"modal-simple"},Rat={class:"modal-simple__content"},Uat={class:"modal-simple__content__header"},Fat={class:"modal-simple__content__body"},Iat={class:"modal-simple__content__footer"},qat={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,a)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.modelValue?(t.openBlock(),t.createElementBlock("div",Aat,[t.createElementVNode("div",Rat,[t.createElementVNode("div",Uat,[t.renderSlot(r.$slots,"header",{},void 0,!0)]),t.createElementVNode("div",Fat,[t.renderSlot(r.$slots,"body",{},void 0,!0)]),t.createElementVNode("div",Iat,[t.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):t.createCommentVNode("",!0)]))}},jat=t2(qat,[["__scopeId","data-v-1cc4f590"]]),Wat={class:"footer"},Dat={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:r}){const a=r;function v(h){a("update:modelValue",h)}function $(h){a("action",h),a("update:modelValue",!1)}return(h,u)=>(t.openBlock(),t.createBlock(jat,{"modle-value":e.value,"onUpdate:modelValue":v},{header:t.withCtx(()=>[...u[2]||(u[2]=[t.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:t.withCtx(()=>[...u[3]||(u[3]=[t.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:t.withCtx(()=>[t.createElementVNode("div",Wat,[t.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:u[0]||(u[0]=i=>$(!1))}," Seguir editando "),t.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:u[1]||(u[1]=i=>$(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},Kat=t2(Dat,[["__scopeId","data-v-ed9b5088"]]),Bat={key:0,class:"modal-simple"},Xat={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,a)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,null,{default:t.withCtx(()=>[e.modelValue?(t.openBlock(),t.createElementBlock("div",Bat,[...a[0]||(a[0]=[t.createElementVNode("div",{class:"modal-simple__content"},[t.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M29.3346 14.7823V16.0089C29.333 18.8842 28.402 21.6818 26.6804 23.9847C24.9589 26.2876 22.539 27.9722 19.7818 28.7875C17.0245 29.6027 14.0776 29.5048 11.3806 28.5084C8.68354 27.512 6.38084 25.6704 4.81592 23.2584C3.25099 20.8463 2.50769 17.993 2.69687 15.124C2.88605 12.255 3.99758 9.52404 5.86568 7.33836C7.73377 5.15269 10.2583 3.62944 13.0629 2.9958C15.8674 2.36215 18.8017 2.65205 21.428 3.82227",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),t.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):t.createCommentVNode("",!0)]),_:1})]))}},Gat=t2(Xat,[["__scopeId","data-v-2bc30783"]]),Zat={class:"template-maker__header"},Jat={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hat={class:"template-maker__content"},Yat={class:"template-maker__content__main"},Qat={id:"containerMain",class:"container-main"},$at={class:"template-maker__content__main__cover-selector"},ent=["id"],tnt={class:"page-indicator"},rnt={class:"page-indicator__index"},ant=["onClick"],nnt=["onClick"],int={key:0,class:"template-maker__content__main__footer"},ont={class:"template-maker__content__main__footer__paginator"},snt={class:"template-maker__content__main__footer__paginator__nav"},lnt={class:"template-maker__content__main__footer__paginator__numbers"},cnt=["onClick"],unt={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:r,emit:a}){const v=new Map,$=t.ref([{title:"Page 1",id:String(Date.now()),items:[{name:"Volumetrica",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:6,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}},{name:"Volumetrica",id:String(Date.now()),x:4,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]}]),h=t.ref(null),u=t.ref(0),i=t.ref(!1),p=t.ref(null),l=t.ref(null),n=t.ref(!0),k=t.ref(!1),T=t.ref(!1),x=t.ref(0),d=t.ref(!1),o=t.ref(null),c=t.ref(new Map),s=t.ref(null),f=t.ref(null),g=t.ref(!1),S=t.ref(!1),L=t.ref(!1),E=new Map,P=new Map,V=t.computed(()=>({"--overflow-y-template-maker":k.value?"scroll":"hidden","--height-container-main":k.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(k.value,"0")})),I=t.computed(()=>u.value+1);t.watch(()=>i.value,$t=>{const Rt=document.getElementById("app");$t?(u.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Rt&&(Rt.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Rt&&(Rt.style.overflow=""))});function j($t){return $t<10?`0${$t}`:$t}async function F({templateId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/templates/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(sr){console.error("Error fetching template by ID:",sr)}}async function W({reportId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/reports/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(sr){console.error("Error fetching report by ID:",sr)}}let U=0;function z($t){h.value=$t,U>0&&(g.value=!0),U++}function X($t){$t&&st(null,!0)}let N=null;function Y($t,Rt){let sr=$t.getBoundingClientRect(),Zt={height:$t.clientHeight,width:$t.clientWidth},Tt=Rt.getBoundingClientRect();if(!(Tt.top>=sr.top&&Tt.bottom<=sr.top+Zt.height)){const Pt=Tt.top-sr.top,Ut=Tt.bottom-sr.bottom;Math.abs(Pt)<Math.abs(Ut)?$t.scrollTop+=Pt:$t.scrollTop+=Ut}}function se($t,Rt){let sr=$t.getBoundingClientRect();const Zt=Rt.getBoundingClientRect().top-sr.top;$t.scrollTop+=Zt}function me($t,Rt=!1){const sr={title:`Page ${$.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(Gt(),$t!==void 0&&$t>=-1?$.value.splice($t+1,0,sr):$.value.push(sr),t.nextTick(()=>{const Zt=$.value.findIndex(Pt=>Pt.id===sr.id),Tt=document.getElementById(`page-${Zt+1}`);N||(N=document.getElementById("containerMain")),Tt&&N?Y(N,Tt):console.error("Page element or container main element not found")}),Rt)return sr;g.value=!0}function ge($t){if($t<0||$t>$.value.length)return;u.value=$t;const Rt=document.getElementById(`page-${$t}`);if(N||(N=document.getElementById("containerMain")),Rt&&N){const sr=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(sr),se(N,Rt),setTimeout(()=>{const Zt=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Zt)},300)}else console.error("Page element or container main element not found")}function be($t){s.value=$t,d.value=!0}function xe($t,Rt){const sr=Rt+1;$t&&u.value!==sr&&(u.value=sr)}function Ae($t){d.value=!0,Sd.emit("edit-view",{view:$t})}async function je({templateReportId:$t,userId:Rt,isTemplateMode:sr}){try{return sr?F({templateId:$t,userId:Rt}):W({reportId:$t,userId:Rt})}catch(Zt){throw new Error("Error fetching template or report by ID: "+Zt.message)}}function _e(){U=0,d.value=!1,u.value=0,s.value=null,f.value=null,c.value.clear(),N=null,p.value=null,l.value=null,h.value=null,x.value=0,$.value=[],T.value=!1,g.value=!1,S.value=!1,L.value=!1,E.forEach($t=>clearTimeout($t)),E.clear(),P.forEach($t=>clearTimeout($t)),P.clear(),Ue=[],v.clear()}let Ue=[];async function qe($t){if(_e(),n.value=$t.isTemplateMode,k.value=!!$t.isPDFMode,$t.isPDFMode?p.value=await W({reportId:$t.reportId,userId:$t.userId}):(p.value=$t.template,p.value=await je({templateReportId:$t.template.id,userId:$t.template.user_id,isTemplateMode:$t.isTemplateMode})),!p.value)return;p.value&&p.value.game&&(p.value.game=Ye(p.value.game)),l.value=JSON.parse(JSON.stringify(p.value)),T.value=p.value.template_type===2;const Rt=p.value.pages.find(sr=>sr.is_front_page);x.value=Rt?Rt.type:1,i.value=!0,$t.isTemplateMode||(Ue=await rt(p.value)),$.value=p.value.pages.reduce((sr,Zt,Tt)=>{if(!Zt.is_front_page){Zt.name||(Zt.name="");const Pt=Tt,Ut={originalPage:JSON.parse(JSON.stringify(Zt)),title:Zt.name,id:`p-${Date.now()-Tt*9}`,items:[],components:Zt.components};Zt.components&&Zt.components.length>0&&(Ut.items=Zt.components.reduce((vr,ur,gr)=>{const Tr=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ur.coreView.id,ur.dynamicFilters,T.value,n.value,ur.filtersJSON||null,dt.token,ur.filters),Rr={originalComponent:JSON.parse(JSON.stringify(ur)),title:ur.title,shortTitle:ur.shortTitle||ur.title,game:p.value.game,idAux:ur.id,id:`w-${Date.now()-gr*7}`,x:ur.column,y:ur.row,w:ur.colspan,h:ur.rowspan,maxWidth:ur.max_column,maxHeight:ur.max_row,minWidth:ur.min_column,minHeight:ur.min_row,noResize:!n.value,noMove:!n.value,coreView:ur.coreView||null,isTemplateMode:n.value,componentName:ur.componentName,componentProps:Qe({currentProps:ur.componentProps,coreView:ur.coreView,isTemplateMode:n.value,templateToEdit:p.value,filterMultiple:ur.filterMultiple||null,game:p.value.game||null,dynamicFilters:ur.dynamicFilters,page:Pt,componentId:gr})||{},filterMultiple:ur.filterMultiple,isHomeTeam:De({game:p.value.game,isTemplateMode:n.value,currentIsHomeTeam:ur.isHomeTeam||ur.componentProps.isHomeTeamForAnalysis}),filtersJSON:ur.filtersJSON||null,dynamicFilters:ur.dynamicFilters||[],filterAndViewsContainer:Tr};if(Rr.componentProps.isViewNull)return vr;const St=t.reactive({view:Rr});return Tr.addView(St,!0),c.value.set(Tr.getId(),Tr),vr.push(Rr),vr},[])),sr.push(Ut)}return sr},[]),console.log("Pages loaded into template maker:",$.value)}function Re({game:$t,isTemplateMode:Rt}){const sr=$t&&$t.homeTeam&&$t.awayTeam&&($t.homeTeam.team_id===dt.userTeamId||$t.awayTeam.team_id===dt.userTeamId);return{isUserTeamHome:sr&&$t.homeTeam.team_id===dt.userTeamId,requiresUserTeamAdjustment:sr&&!Rt}}function De({game:$t,isTemplateMode:Rt,currentIsHomeTeam:sr}){const{isUserTeamHome:Zt,requiresUserTeamAdjustment:Tt}=Re({game:$t,isTemplateMode:Rt});return Tt?sr?Zt:!Zt:sr}function Qe({currentProps:$t,coreView:Rt,templateToEdit:sr,isTemplateMode:Zt,filterMultiple:Tt,game:Pt,dynamicFilters:Ut,page:vr,componentId:ur}){var gr,Tr,Rr,St;if(!$t||!Rt)return $t||{};const{isUserTeamHome:Yt,requiresUserTeamAdjustment:er}=Re({game:Pt,isTemplateMode:Zt});let or={...$t};if(Rt.id===5&&(or.isGhostEffect=Zt,er)){const Or=or.preMatchType===1;or.preMatchType=Or?Yt?1:2:Yt?2:1}if(Rt.id===7&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===9&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===18){if(console.log("1818181818181818181818181818181818181818181818181818181818181818181818181818"),!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.teamIdForAnalysis=or.isHomeTeamForAnalysis?Pt.home_team:Pt.visiting_team;const Or=Ue.findIndex(oa=>((or.isAgainstMode?1:0)===oa.is_against||oa.is_against===or.isAgainstMode)&&or.teamIdForAnalysis===oa.team_id);console.log("templateToEdit",sr),console.log("propsAux",or),console.log("propsAux.isHomeTeamForAnalysis",or.isHomeTeamForAnalysis),console.log("specificPlaysCorners",[...Ue]),console.log("game",Pt),console.log("viewCornerIndex",Or);let Pr=null;Or!==-1&&(Pr={...Ue[Or]},Ue.splice(Or,1)),console.log("viewCorner",Pr),Pr?(or.specificPlaysCornersData=Pr,or.playIdForAnalysis=Pr.play_id,or.gameIdForAnalysis=Pr.game_id,or.seasonIdForAnalysis=Pr.season_id||Pt.season_id,or.isTemplateMode=Zt,or.isGameOnly=!0,or.isCornerInfoVisible=!0):(or.isNullCornerData=!0,or.isViewNull=!0,console.warn("No specific plays corner data available for this component"))}}if(Rt.id===16){if(!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.isPreMatch=!T.value,or.isTemplateMode=Zt,or.seasonId=sr.season_id,or.teamIdForAnalysis=or.isHomeTeamForAnalysis?sr.game.home_team:sr.game.visiting_team;const Or=or.isHomeTeamForAnalysis?sr.last_games.last_home_games:sr.last_games.last_visiting_games;T.value?or.gamesIdsForAnalysis=[sr.game.game_id]:or.howManyGames?or.gamesIdsForAnalysis=Or.slice(0,or.howManyGames).map(Pr=>Pr.game_id):(or.gamesIdsForAnalysis=[],or.gameDataUTC=sr.game.date_time_utc)}}if(Rt.id===10&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===1&&(or.gameId=Pt?Pt.id:"",or.homeLogo=Pt?Pt.homeTeam.logo:"",or.awayLogo=Pt?Pt.awayTeam.logo:"",or.seasonId=Pt?Pt.season_id:0,or.default=Zt),Rt.id===6&&(or.game=Pt||"",or.lastGames=sr.last_games,or.selectedOption=sr.template_type===2?"Postmatch":"Prematch"),Rt.id===13&&(or.isdefault=Zt,or.seasonid=Pt?Pt.seasonId:2010,or.datetimeutc=Pt?sr.template_type===1?Pt?Pt.date_time_utc:"":null:"",or.teamids=Pt?[Pt.home_team,Pt.visiting_team]:[1,2],or.categoryids=Ut?Ut[1]:[20,2],or.teamsshow=Pt?Ut?Ut[2]==1?[Pt.home_team]:Ut[2]==2?[Pt.visiting_team]:[Pt.home_team,Pt.visiting_team]:[1,2]:[1,2],or.analysistype=Ut?Ut[0]:[],or.gameid=sr.template_type===1?null:Pt?Pt.id:"",or.teams=Pt?[{id:Pt.home_team,name:Pt.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.home_team+".png"},{id:Pt.visiting_team,name:Pt.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.visiting_team+".png"}]:[]),Rt.id===15&&(or.view=1,or.token=dt.token,or.numitems=Ut?Ut[1]:3,or.isdefault=Zt,or.reportid=sr!=null&&sr.id?sr.id:0,or.userid=sr!=null&&sr.user_id?sr.user_id:0,or.page=vr+1,or.typegame=T.value?2:1,or.componentid=ur+1,or.data={season:Pt?Pt.seasonId:2010,type:2,game:Pt?Pt.id:0,team:Zt?2:Tt?Tt.isHomeTeam?Pt.home_team||2:Pt.visiting_team||2:2}),Rt.id===17){console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("LLEGO AQUI MERO ESTE COMPOENNETE ES: ---->>>> ",Pt),console.log("dynamicFiltersS: ---->>>> ",Ut),console.log("filters: =================================================================================="),console.log("lateralidad: ",Ut?Ut[1]==32?"right":"left":"right"),console.log("infavoragainstteam: ",Ut?Ut[0]:!0),console.log("teamselected: ",Tt?Tt.isHomeTeam?(Pt==null?void 0:Pt.home_team)||2:(Pt==null?void 0:Pt.visiting_team)||2:2),console.log("tournamentselected: ",sr!=null&&sr.tournament_id?{id:sr.tournament_id}:{id:1}),or.game=Pt?{id:Pt.id||Pt.game_id||Pt.gameId||null,home_team:Pt.home_team||null,away_team:Pt.visiting_team||null,season:Pt.seasonId||Pt.season_id||null,game_status:Pt.game_status||Pt.status||null,home_acronym:Pt.home_team_acronym||((gr=Pt.homeTeam)==null?void 0:gr.acronym)||null,away_acronym:Pt.visiting_team_acronym||((Tr=Pt.awayTeam)==null?void 0:Tr.acronym)||null,logo_home:((Rr=Pt.homeTeam)==null?void 0:Rr.logo)||null,logo_away:((St=Pt.awayTeam)==null?void 0:St.logo)||null}:null,or.infavoragainstteam=Ut?!Ut[0]:!0,or.forseason=!T.value,or.forteam=!1,or.tournamentselected=sr!=null&&sr.tournament_id?{id:sr.tournament_id}:{id:1},or.forgame=!!T.value,or.lateralidad=Ut&&Ut[1]==32?"right":"left",or.teamselected=Ut[2]==3?Tt?Tt.isHomeTeam?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:0:Ut[2]==2?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team;const Or=Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][4]!==void 0?Array.isArray(Ut[3][4])?Ut[3][4].filter(Pr=>Pr!=="rematado-destino-porteria").reduce((Pr,oa)=>(oa==="fue-gol"?Pr.push(583,585,587,589):oa==="no-fue-gol"?Pr.push(584,586,588,590):oa==="rematado-sin-destino-porteria"?Pr.push(125,131,139,145):oa==="sin-destino"?Pr.push(122,128,136,142):oa==="ganados-por-portero-rival"?Pr.push(123,129,137,143):oa==="ganados-por-jugador-rival"&&Pr.push(124,130,138,144),Pr),[]):[]:[];or.filters={isMoment:!0,final:[1,2,3],moment:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][0]!==void 0?Array.isArray(Ut[3][0])?Ut[3][0].map(Pr=>Pr==="iba-ganando"?1:Pr==="iba-empatado"?3:Pr==="iba-perdiendo"?2:Pr):[]:[],playingAs:[1,2],sections:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][1]!==void 0?Array.isArray(Ut[3][1])?Ut[3][1].map(Pr=>Pr==="0-15"?1:Pr==="16-30"?2:Pr==="31-45"?3:Pr==="46-60"?4:Pr==="61-75"?5:Pr==="76-90"?6:Pr):[]:[],games:T.value?[Pt==null?void 0:Pt.game_id]:[],players:[],cornertype:Ut&&Ut[1]!==void 0?Ut[1]:null,howWas:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][2]!==void 0?Array.isArray(Ut[3][2])?Ut[3][2].filter(Pr=>Pr!=="izquierda"&&Pr!=="derecha").map(Pr=>{const oa=Ut[1];return Pr==="comba-afuera"?oa==32?134:120:Pr==="comba-adentro"?oa==32?140:126:Pr==="raz-area"?oa==32?146:327:Pr==="en-corto"?oa==32?147:133:Pr}):[]:[],zona:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][3]!==void 0?Array.isArray(Ut[3][3])?Ut[3][3]:[]:[],whathappened:Or,isWhatHappenedFull:Array.isArray(Or)&&Or.length===24,isZoneFull:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][3]!==void 0&&Array.isArray(Ut[3][3])?Ut[3][3].length===35:!1},console.log("propsAux.filters: ",or.filters),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),or.showBallGo=!0,or.showHeatMap=!0,or.ballOnOff="OFF",or.showdefault=Zt}if(Rt.id===14&&(or.isReports=!0,or.isDefault=Zt,or.type=sr.tournament_type==1?1:0,or.typeView=1,or.tournament=sr.tournament_id,or.currentSeason=Pt?Pt.season_id:0,or.currentSeasonId=Pt?Pt.season_id:0,or.showVideos=!1,or.localTeam=Pt?Pt.home_team:0,or.awayTeam=Pt?Pt.visiting_team:0),Rt.id===3&&(or.defaultShields=Zt),Rt.id===2){let Or=!0,Pr=0,oa=0;Pt&&(Or=sr.main_team==Pt.home_team||sr.main_team==Pt.visiting_team,Pr=Or?sr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team,oa=Or?sr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team),or.gamed=Pt?Pt.id:"",or.game=Pt||"",or.season=Pt?Pt.season_id:0,or.teamView=Tt.teamType==3?0:Tt.teamType==1?Pr:oa,or.useDummyData=Zt}return Rt.id===8&&(or.teamSelected=Pt?{teamId:Pt.home_team}:1,or.isDefault=Zt),Rt.id===4&&(or.gameId=Pt?Pt.id:"",or.isDefault=Zt,or.homeTeam=Pt?Pt==null?void 0:Pt.home_team:"",or.awayTeam=Pt?Pt==null?void 0:Pt.visiting_team:""),or}async function rt($t){try{const Rt=await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$t.user_id}/reports/${$t.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:dt.token}})).json();return console.log("66666666666666666666666666666666666666"),Rt.data}catch(Rt){return console.error("Error fetching specific plays:",Rt),[]}}const dt=e,ct=a;t.watch(()=>dt.token,($t,Rt)=>{},{immediate:!0}),r({show:qe}),Sd.on("add-page-view",$t=>{v.set($t.view.id,$t.view);const Rt=$.value.find(sr=>sr.id===$t.pageId);Rt&&(Rt.items||(Rt.items=[]),Rt.items.push($t.view),t.nextTick(()=>{const sr=document.querySelector(`[gs-id="${$t.view.id}"]`);$t.grid.makeWidget(sr)}))}),Sd.on("add-page-and-view",$t=>{const Rt=$.value.findIndex(sr=>sr.id===$t.pageId);if(Rt>-1){const sr=me(Rt,!0);setTimeout(()=>{Sd.emit("add-view",{pageId:sr.id,view:$t.view,filterAndWidgetContainer:$t.filterAndWidgetContainer}),f.value&&(sr.stepBackPage=f.value),f.value=sr},500)}else console.error("Page not found for adding view:",$t.pageId)}),Sd.on("empty-page",$t=>{d.value&&s.value&&s.value.id===$t.id||(Jt($t),f.value&&f.value.id===$t.id&&(f.value.stepBackPage?f.value=f.value.stepBackPage:f.value=null))}),Sd.on("filters-cancelled",$t=>{$t&&$t.removeAllChildViews()}),Sd.on("activate-save-button",()=>{g.value=!0});function Ye($t){return{...$t,gameId:$t.game_id,id:$t.game_id,seasonId:$t.season_id,status:$t.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.home_team}.png`,team_id:$t.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.home_team}.png`,colloquial_name:$t.home_team_name,acronym:$t.home_team_acronym,team_name:$t.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.visiting_team}.png`,team_id:$t.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.visiting_team}.png`,colloquial_name:$t.visiting_team_name,acronym:$t.visiting_team_acronym,team_name:$t.visiting_team_name}}}function st($t,Rt=!1){Rt||!n.value?(i.value=!1,_e(),ct("close")):g.value?S.value=!0:(i.value=!1,_e(),ct("close"))}function lt(){o.value=null,d.value=!1}function Ot({page:$t,view:Rt,applyMinimumSize:sr=!1}){const Zt=$t.grid;if(!$t||!Rt||!Zt)return null;const Tt=sr?{w:Rt.min_column,h:Rt.min_row}:{w:Rt.colspan,h:Rt.rowspan},Pt=Zt.willItFit(0,0,Tt.w,Tt.h,!0);return Pt?{willFit:Pt,applyMinimumSize:sr}:sr?null:Ot({page:$t,view:Rt,applyMinimumSize:!0})}const Mt=new Set([9]);function Et($t){var Rt,sr,Zt,Tt,Pt,Ut,vr,ur,gr,Tr,Rr,St,Yt,er,or,Or,Pr,oa,Ia;if(console.log("onFiltersChanged called with filters:",$t),$t.dynamicFilters&&$t.dynamicFilters.length>0&&$t.viewToEdit&&$t.viewToEdit.view){const qa=$t.viewToEdit.view.id;$.value.forEach(bn=>{bn.items.forEach(fn=>{fn.id===qa&&fn.coreView&&fn.coreView.id===3&&(fn.componentProps.desplegable=$t.dynamicFilters[0]||!1,fn.componentProps.key=$t.dynamicFilters[0]||!1,t.nextTick(()=>{Sd.emit("force-component-update",{itemId:fn.id,componentProps:fn.componentProps})}))})})}if($t.viewToEdit){if(!$t.viewToEdit.view.filterAndViewsContainer){const qa=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[$t.viewToEdit],((Rt=$t.viewToEdit.view.coreView)==null?void 0:Rt.id)||$t.viewToEdit.view.id,$t.dynamicFilters||[],T.value,n.value,$t.filtersJSON,dt.token,$t.filters);$t.viewToEdit.view.filterAndViewsContainer=qa}$t.viewToEdit.view.filterAndViewsContainer.updateView({view:$t.viewToEdit,dynamicFilters:$t.dynamicFilters||[],filtersJSON:$t.filtersJSON||null,filters:$t.filters}),g.value=!0}else if($t.view){$t.view.id&&$t.filterAndViewsContainer&&$t.view.id!==$t.filterAndViewsContainer.viewId&&($t.filterAndViewsContainer.removeAllChildViews(),$t.filterAndViewsContainer.setViewId($t.view.id),$t.filterAndViewsContainer.setFiltersJSON($t.filtersJSON||null)),$t.view.id&&Mt.has($t.view.id)&&$t.dynamicFilters[0]&&$t.dynamicFilters[0].length===0&&$t.filterAndViewsContainer&&($t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(Zt=(sr=$t.viewToEdit)==null?void 0:sr.view)==null?void 0:Zt.id),g.value=!0);const qa=f.value||s.value,bn=Ot({page:qa,view:$t.view,applyMinimumSize:!1});$t.view.filtersJSON=$t.filtersJSON||null;const fn=$t.filterAndViewsContainer,In=$.value.findIndex(ea=>ea.id===qa.id);if(fn){console.log("1111");const ea=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);if(((Tt=$t.view)==null?void 0:Tt.id)===15){const Ur=(Pt=$t.filterAndViewsContainer)==null?void 0:Pt.getId();if(Ur&&E.has(Ur)){const fa=E.get(Ur);clearTimeout(fa),E.delete(Ur)}}if(((Ut=$t.view)==null?void 0:Ut.id)===17){const Ur=(vr=$t.filterAndViewsContainer)==null?void 0:vr.getId();if(Ur&&P.has(Ur)){const fa=P.get(Ur);clearTimeout(fa),P.delete(Ur)}}if(ea){if(fn.setFilters($t.filters),fn.setDynamicFilters($t.dynamicFilters),bn||In===$.value.length-1){Sd.emit("add-view",{pageId:qa.id,view:$t.view,filterAndWidgetContainer:fn,avoidWillFit:!1,applyMinimumSize:bn?bn.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(gr=(ur=$t.viewToEdit)==null?void 0:ur.view)==null?void 0:gr.id),g.value=!0;let Ur=null;if(((Tr=$t.view)==null?void 0:Tr.id)===15?(t.nextTick(()=>{var fa;const Ma=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);((fa=$t.dynamicFilters)==null?void 0:fa[0])===3&&Ma&&Et($t)}),Ur=setTimeout(()=>{var fa,Ma;const Za=(fa=$t.filterAndViewsContainer)==null?void 0:fa.getId();Za&&E.delete(Za),console.log("222222222222222222");const Ea=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters);((Ma=$t.dynamicFilters)==null?void 0:Ma[0])===3&&Ea&&Et($t)},200)):((Rr=$t.view)==null?void 0:Rr.id)===17?(t.nextTick(()=>{var fa,Ma;const Za=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters),Ea=(fa=$t.dynamicFilters)==null?void 0:fa[0],Xr=(Ma=$t.dynamicFilters)==null?void 0:Ma[2];(Ea===3||Xr===3)&&Za&&Et($t)}),Ur=setTimeout(()=>{var fa,Ma,Za;const Ea=(fa=$t.filterAndViewsContainer)==null?void 0:fa.getId();Ea&&P.delete(Ea);const Xr=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters),ca=(Ma=$t.dynamicFilters)==null?void 0:Ma[0],kr=(Za=$t.dynamicFilters)==null?void 0:Za[2];(ca===3||kr===3)&&Xr&&Et($t)},200)):(console.log("33333333333333"),Ur=setTimeout(()=>{$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters)&&Et($t)},1e3)),((St=$t.view)==null?void 0:St.id)===15&&Ur){const fa=(Yt=$t.filterAndViewsContainer)==null?void 0:Yt.getId();fa&&E.set(fa,Ur)}if(((er=$t.view)==null?void 0:er.id)===17&&Ur){const fa=(or=$t.filterAndViewsContainer)==null?void 0:or.getId();fa&&P.set(fa,Ur)}}}else $t.isAltMode?$t.viewToEdit||$t.filterAndViewsContainer.updateFilters($t.filters,(Pr=(Or=$t.viewToEdit)==null?void 0:Or.view)==null?void 0:Pr.id):$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(Ia=(oa=$t.viewToEdit)==null?void 0:oa.view)==null?void 0:Ia.id),g.value=!0}else if(bn||In===$.value.length-1){const ea=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],$t.view.id,$t.dynamicFilters,T.value,n.value,$t.filtersJSON,dt.token,$t.filters);Sd.emit("set-filter-and-views-container",ea),c.value.set(ea.getId(),ea);const Ur=$t.dynamicFilters&&($t.dynamicFilters[0]===3||$t.dynamicFilters[2]===3)&&($t.view.id===15||$t.view.id===17);$t.dynamicFilters&&(Array.isArray($t.dynamicFilters[0])||Ur)?($t.filterAndViewsContainer=ea,Et($t)):Sd.emit("add-view",{pageId:qa.id,view:$t.view,filterAndWidgetContainer:ea,avoidWillFit:!1,applyMinimumSize:bn?bn.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),g.value=!0}}}async function qt(){if(g.value)try{const $t=[{is_front_page:!0,template_type:h.value.isPostMatch?2:1,type:h.value.id},...$.value.map(sr=>({columns:sr.originalPage?sr.originalPage.columns:12,rows:sr.originalPage?sr.originalPage.rows:12,gap:sr.originalPage?sr.originalPage.gap:10,name:sr.title,width:sr.originalPage?sr.originalPage.width:968,height:sr.originalPage?sr.originalPage.height:702,components:sr.items.reduce((Zt,Tt)=>(Tt.isDeleted||Zt.push({min_column:Tt.minWidth,min_row:Tt.minHeight,max_column:Tt.maxWidth,max_row:Tt.maxHeight,column:Tt.x,row:Tt.y,colspan:Tt.w,rowspan:Tt.h,name:Tt.name,title:Tt.title,titleShort:Tt.titleShort||Tt.title,dynamicFilters:Tt.filterAndViewsContainer.getComponentDynamicFilters(Tt.id)||Tt.filterAndViewsContainer.getDynamicFilters()||[],coreView:Tt.coreView||null,componentName:Tt.componentName,componentProps:Tt.componentProps||{},isHomeTeam:Tt.isHomeTeam||Tt.componentProps.isHomeTeamForAnalysis,filterMultiple:Tt.filterMultiple}),Zt),[])}))];console.log("pagesAux to save:",$t);const Rt=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${p.value.user_id}/templates/${p.value.id}/pages`,{method:"PATCH",headers:{Authorization:dt.token},body:JSON.stringify({pages:$t})});L.value=!0,await Rt.json(),g.value=!1,setTimeout(()=>{L.value=!1},2e3)}catch($t){console.error("Error saving template:",$t)}}function Gt(){$.value.forEach($t=>{$t.offListeners&&$t.offListeners()})}function Jt($t){const Rt=$.value.findIndex(sr=>sr.id===$t.id);Rt>-1&&(Gt(),$.value=$.value.filter(sr=>sr.id!==$t.id),u.value>=Rt&&(u.value=Math.max(0,u.value-1)),g.value=!0)}function Qt(){g.value=!0}function lr($t){const Rt=$.value.find(sr=>sr.items.some(Zt=>Zt.id===$t.id));if(Rt){const sr=Rt.items.find(Zt=>Zt.id===$t.id);sr&&(sr.isDeleted=!0,g.value=!0)}}function hr($t){}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Kat,{modelValue:S.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=sr=>S.value=sr),onAction:X},null,8,["modelValue"]),t.createVNode(Gat,{"model-value":L.value},null,8,["model-value"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[i.value&&p.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-maker",style:t.normalizeStyle(V.value)},[t.withDirectives(t.createVNode(Pat,{token:e.token,view:o.value,"is-post-match":T.value,onClose:lt,onFiltersChanged:Et},null,8,["token","view","is-post-match"]),[[t.vShow,n.value&&d.value]]),t.createElementVNode("div",Zat,[t.createTextVNode(t.toDisplayString(p.value?p.value.name:"Nuevo template")+" ",1),t.createElementVNode("div",{class:"template-maker__header__close",onClick:st},[k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",Jat,[...Rt[6]||(Rt[6]=[t.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),t.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),t.createElementVNode("div",Hat,[Rt[13]||(Rt[13]=t.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),t.createElementVNode("div",Yat,[t.createElementVNode("div",Qat,[t.createElementVNode("div",$at,[t.withDirectives(t.createVNode(yQ,{"is-post-match":T.value,"initial-cover-id":x.value,onSelectCover:z},null,8,["is-post-match","initial-cover-id"]),[[t.vShow,n.value]])]),(t.openBlock(),t.createElementBlock("div",{class:"template-maker__content__main__pages",key:$.value.length},[h.value?(t.openBlock(),t.createBlock(wYe,{key:0,id:"page-0",game:p.value.game||null,"cover-id":h.value.id,"is-post-match":h.value.isPostMatch,onIntersectionChanged:Rt[1]||(Rt[1]=sr=>xe(sr,-1))},null,8,["game","cover-id","is-post-match"])):t.createCommentVNode("",!0),n.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":$.value.length===0?"30px":"0"})},[d.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Rt[2]||(Rt[2]=sr=>me(-1))},[...Rt[7]||(Rt[7]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(sr,Zt)=>(t.openBlock(),t.createElementBlock("div",{key:Zt,id:`page-${Zt+1}`,class:"template-maker__content__main__pages__page"},[t.createElementVNode("div",tnt,[t.createElementVNode("div",rnt,"Pag "+t.toDisplayString(j(Zt+2)),1)]),h.value?(t.openBlock(),t.createBlock(SHe,{key:0,page:sr,"is-template-mode":n.value,"is-post-match":h.value.isPostMatch,game:p.value.game||null,lastGames:p.value.lastGames||[],"is-filter-visible":d.value,onEditView:Ae,onIntersectionChanged:Tt=>xe(Tt,Zt),onChangeSort:hr,onDeletePage:Jt,onViewChanged:Qt,onDeleteView:lr},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):t.createCommentVNode("",!0),n.value&&!d.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":Zt+1===$.value.length?"30px":"0","margin-top":"10px"})},[t.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Tt=>me(Zt)},[...Rt[8]||(Rt[8]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,ant),t.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Tt=>be(sr)},[...Rt[9]||(Rt[9]=[t.createElementVNode("div",null,"+ Agregar gráfico",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,nnt)],4)):t.createCommentVNode("",!0)],8,ent))),128))]))]),k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",int,[t.createElementVNode("div",ont,[t.createElementVNode("div",snt,[t.createElementVNode("div",null,"Páginas "+t.toDisplayString(I.value),1),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value<=0}]),onClick:Rt[3]||(Rt[3]=sr=>u.value>0&&ge(u.value-1))},[...Rt[10]||(Rt[10]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.22444 5L5.29079 8.57741C5.56974 8.90285 5.56974 9.43049 5.29079 9.75592C5.01184 10.0814 4.55958 10.0814 4.28064 9.75592L0.709209 5.58926C0.430263 5.26382 0.430263 4.73618 0.709209 4.41074L4.28064 0.244078C4.55958 -0.0813593 5.01184 -0.0813592 5.29079 0.244078C5.56974 0.569515 5.56974 1.09715 5.29079 1.42259L2.22444 5Z",fill:"#92929D"})],-1)])],2),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value>=$.value.length}]),onClick:Rt[4]||(Rt[4]=sr=>u.value<$.value.length&&ge(u.value+1))},[...Rt[11]||(Rt[11]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.77556 5L0.70921 8.57741C0.430264 8.90285 0.430264 9.43049 0.70921 9.75592C0.988156 10.0814 1.44042 10.0814 1.71936 9.75592L5.29079 5.58926C5.56974 5.26382 5.56974 4.73618 5.29079 4.41074L1.71936 0.244078C1.44042 -0.0813593 0.988155 -0.0813592 0.709209 0.244078C0.430264 0.569515 0.430264 1.09715 0.70921 1.42259L3.77556 5Z",fill:"#92929D"})],-1)])],2)]),t.createElementVNode("div",lnt,[t.createElementVNode("div",{role:"button",class:t.normalizeClass({active:u.value===0}),onClick:Rt[5]||(Rt[5]=sr=>ge(0))},t.toDisplayString(j(1)),3),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(sr,Zt)=>(t.openBlock(),t.createElementBlock("div",{role:"button",key:Zt,class:t.normalizeClass({active:Zt+1===u.value}),onClick:Tt=>ge(Zt+1)},t.toDisplayString(j(Zt+2)),11,cnt))),128))])]),n.value?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:t.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!g.value}]),onClick:qt},[...Rt[12]||(Rt[12]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H10.6667L14 5.33333V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),t.createElementVNode("div",null,"Guardar",-1)])],2)):t.createCommentVNode("",!0)]))])])],4)):t.createCommentVNode("",!0)]))],64))}},dnt=t2(unt,[["__scopeId","data-v-332402ec"]]);function qZ(e,r){return function(){return e.apply(r,arguments)}}const{toString:pnt}=Object.prototype,{getPrototypeOf:dA}=Object,{iterator:LN,toStringTag:jZ}=Symbol,CN=(e=>r=>{const a=pnt.call(r);return e[a]||(e[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),Gw=e=>(e=e.toLowerCase(),r=>CN(r)===e),ON=e=>r=>typeof r===e,{isArray:e7}=Array,t7=ON("undefined");function d9(e){return e!==null&&!t7(e)&&e.constructor!==null&&!t7(e.constructor)&&Y_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const WZ=Gw("ArrayBuffer");function hnt(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&WZ(e.buffer),r}const fnt=ON("string"),Y_=ON("function"),DZ=ON("number"),p9=e=>e!==null&&typeof e=="object",mnt=e=>e===!0||e===!1,NN=e=>{if(CN(e)!=="object")return!1;const r=dA(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(jZ in e)&&!(LN in e)},ynt=e=>{if(!p9(e)||d9(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},gnt=Gw("Date"),vnt=Gw("File"),bnt=Gw("Blob"),xnt=Gw("FileList"),_nt=e=>p9(e)&&Y_(e.pipe),wnt=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Y_(e.append)&&((r=CN(e))==="formdata"||r==="object"&&Y_(e.toString)&&e.toString()==="[object FormData]"))},Tnt=Gw("URLSearchParams"),[Snt,knt,Lnt,Cnt]=["ReadableStream","Request","Response","Headers"].map(Gw),Ont=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function h9(e,r,{allOwnKeys:a=!1}={}){if(e===null||typeof e>"u")return;let v,$;if(typeof e!="object"&&(e=[e]),e7(e))for(v=0,$=e.length;v<$;v++)r.call(null,e[v],v,e);else{if(d9(e))return;const h=a?Object.getOwnPropertyNames(e):Object.keys(e),u=h.length;let i;for(v=0;v<u;v++)i=h[v],r.call(null,e[i],i,e)}}function KZ(e,r){if(d9(e))return null;r=r.toLowerCase();const a=Object.keys(e);let v=a.length,$;for(;v-- >0;)if($=a[v],r===$.toLowerCase())return $;return null}const OS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,BZ=e=>!t7(e)&&e!==OS;function pA(){const{caseless:e,skipUndefined:r}=BZ(this)&&this||{},a={},v=($,h)=>{const u=e&&KZ(a,h)||h;NN(a[u])&&NN($)?a[u]=pA(a[u],$):NN($)?a[u]=pA({},$):e7($)?a[u]=$.slice():(!r||!t7($))&&(a[u]=$)};for(let $=0,h=arguments.length;$<h;$++)arguments[$]&&h9(arguments[$],v);return a}const Nnt=(e,r,a,{allOwnKeys:v}={})=>(h9(r,($,h)=>{a&&Y_($)?e[h]=qZ($,a):e[h]=$},{allOwnKeys:v}),e),Ent=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),znt=(e,r,a,v)=>{e.prototype=Object.create(r.prototype,v),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),a&&Object.assign(e.prototype,a)},Mnt=(e,r,a,v)=>{let $,h,u;const i={};if(r=r||{},e==null)return r;do{for($=Object.getOwnPropertyNames(e),h=$.length;h-- >0;)u=$[h],(!v||v(u,e,r))&&!i[u]&&(r[u]=e[u],i[u]=!0);e=a!==!1&&dA(e)}while(e&&(!a||a(e,r))&&e!==Object.prototype);return r},Vnt=(e,r,a)=>{e=String(e),(a===void 0||a>e.length)&&(a=e.length),a-=r.length;const v=e.indexOf(r,a);return v!==-1&&v===a},Pnt=e=>{if(!e)return null;if(e7(e))return e;let r=e.length;if(!DZ(r))return null;const a=new Array(r);for(;r-- >0;)a[r]=e[r];return a},Ant=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&dA(Uint8Array)),Rnt=(e,r)=>{const v=(e&&e[LN]).call(e);let $;for(;($=v.next())&&!$.done;){const h=$.value;r.call(e,h[0],h[1])}},Unt=(e,r)=>{let a;const v=[];for(;(a=e.exec(r))!==null;)v.push(a);return v},Fnt=Gw("HTMLFormElement"),Int=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,v,$){return v.toUpperCase()+$}),XZ=(({hasOwnProperty:e})=>(r,a)=>e.call(r,a))(Object.prototype),qnt=Gw("RegExp"),GZ=(e,r)=>{const a=Object.getOwnPropertyDescriptors(e),v={};h9(a,($,h)=>{let u;(u=r($,h,e))!==!1&&(v[h]=u||$)}),Object.defineProperties(e,v)},jnt=e=>{GZ(e,(r,a)=>{if(Y_(e)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const v=e[a];if(Y_(v)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},Wnt=(e,r)=>{const a={},v=$=>{$.forEach(h=>{a[h]=!0})};return e7(e)?v(e):v(String(e).split(r)),a},Dnt=()=>{},Knt=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r;function Bnt(e){return!!(e&&Y_(e.append)&&e[jZ]==="FormData"&&e[LN])}const Xnt=e=>{const r=new Array(10),a=(v,$)=>{if(p9(v)){if(r.indexOf(v)>=0)return;if(d9(v))return v;if(!("toJSON"in v)){r[$]=v;const h=e7(v)?[]:{};return h9(v,(u,i)=>{const p=a(u,$+1);!t7(p)&&(h[i]=p)}),r[$]=void 0,h}}return v};return a(e,0)},Gnt=Gw("AsyncFunction"),Znt=e=>e&&(p9(e)||Y_(e))&&Y_(e.then)&&Y_(e.catch),ZZ=((e,r)=>e?setImmediate:r?((a,v)=>(OS.addEventListener("message",({source:$,data:h})=>{$===OS&&h===a&&v.length&&v.shift()()},!1),$=>{v.push($),OS.postMessage(a,"*")}))(`axios@${Math.random()}`,[]):a=>setTimeout(a))(typeof setImmediate=="function",Y_(OS.postMessage)),Jnt=typeof queueMicrotask<"u"?queueMicrotask.bind(OS):typeof process<"u"&&process.nextTick||ZZ,au={isArray:e7,isArrayBuffer:WZ,isBuffer:d9,isFormData:wnt,isArrayBufferView:hnt,isString:fnt,isNumber:DZ,isBoolean:mnt,isObject:p9,isPlainObject:NN,isEmptyObject:ynt,isReadableStream:Snt,isRequest:knt,isResponse:Lnt,isHeaders:Cnt,isUndefined:t7,isDate:gnt,isFile:vnt,isBlob:bnt,isRegExp:qnt,isFunction:Y_,isStream:_nt,isURLSearchParams:Tnt,isTypedArray:Ant,isFileList:xnt,forEach:h9,merge:pA,extend:Nnt,trim:Ont,stripBOM:Ent,inherits:znt,toFlatObject:Mnt,kindOf:CN,kindOfTest:Gw,endsWith:Vnt,toArray:Pnt,forEachEntry:Rnt,matchAll:Unt,isHTMLForm:Fnt,hasOwnProperty:XZ,hasOwnProp:XZ,reduceDescriptors:GZ,freezeMethods:jnt,toObjectSet:Wnt,toCamelCase:Int,noop:Dnt,toFiniteNumber:Knt,findKey:KZ,global:OS,isContextDefined:BZ,isSpecCompliantForm:Bnt,toJSONObject:Xnt,isAsyncFn:Gnt,isThenable:Znt,setImmediate:ZZ,asap:Jnt,isIterable:e=>e!=null&&Y_(e[LN])};function Rm(e,r,a,v,$){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),a&&(this.config=a),v&&(this.request=v),$&&(this.response=$,this.status=$.status?$.status:null)}au.inherits(Rm,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:au.toJSONObject(this.config),code:this.code,status:this.status}}});const JZ=Rm.prototype,HZ={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{HZ[e]={value:e}}),Object.defineProperties(Rm,HZ),Object.defineProperty(JZ,"isAxiosError",{value:!0}),Rm.from=(e,r,a,v,$,h)=>{const u=Object.create(JZ);au.toFlatObject(e,u,function(n){return n!==Error.prototype},l=>l!=="isAxiosError");const i=e&&e.message?e.message:"Error",p=r==null&&e?e.code:r;return Rm.call(u,i,p,a,v,$),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",h&&Object.assign(u,h),u};const Hnt=null;function hA(e){return au.isPlainObject(e)||au.isArray(e)}function YZ(e){return au.endsWith(e,"[]")?e.slice(0,-2):e}function QZ(e,r,a){return e?e.concat(r).map(function($,h){return $=YZ($),!a&&h?"["+$+"]":$}).join(a?".":""):r}function Ynt(e){return au.isArray(e)&&!e.some(hA)}const Qnt=au.toFlatObject(au,{},null,function(r){return/^is[A-Z]/.test(r)});function EN(e,r,a){if(!au.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,a=au.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,c){return!au.isUndefined(c[o])});const v=a.metaTokens,$=a.visitor||n,h=a.dots,u=a.indexes,p=(a.Blob||typeof Blob<"u"&&Blob)&&au.isSpecCompliantForm(r);if(!au.isFunction($))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(au.isDate(d))return d.toISOString();if(au.isBoolean(d))return d.toString();if(!p&&au.isBlob(d))throw new Rm("Blob is not supported. Use a Buffer instead.");return au.isArrayBuffer(d)||au.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function n(d,o,c){let s=d;if(d&&!c&&typeof d=="object"){if(au.endsWith(o,"{}"))o=v?o:o.slice(0,-2),d=JSON.stringify(d);else if(au.isArray(d)&&Ynt(d)||(au.isFileList(d)||au.endsWith(o,"[]"))&&(s=au.toArray(d)))return o=YZ(o),s.forEach(function(g,S){!(au.isUndefined(g)||g===null)&&r.append(u===!0?QZ([o],S,h):u===null?o:o+"[]",l(g))}),!1}return hA(d)?!0:(r.append(QZ(c,o,h),l(d)),!1)}const k=[],T=Object.assign(Qnt,{defaultVisitor:n,convertValue:l,isVisitable:hA});function x(d,o){if(!au.isUndefined(d)){if(k.indexOf(d)!==-1)throw Error("Circular reference detected in "+o.join("."));k.push(d),au.forEach(d,function(s,f){(!(au.isUndefined(s)||s===null)&&$.call(r,s,au.isString(f)?f.trim():f,o,T))===!0&&x(s,o?o.concat(f):[f])}),k.pop()}}if(!au.isObject(e))throw new TypeError("data must be an object");return x(e),r}function $Z(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(v){return r[v]})}function fA(e,r){this._pairs=[],e&&EN(e,this,r)}const eJ=fA.prototype;eJ.append=function(r,a){this._pairs.push([r,a])},eJ.toString=function(r){const a=r?function(v){return r.call(this,v,$Z)}:$Z;return this._pairs.map(function($){return a($[0])+"="+a($[1])},"").join("&")};function $nt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function tJ(e,r,a){if(!r)return e;const v=a&&a.encode||$nt;au.isFunction(a)&&(a={serialize:a});const $=a&&a.serialize;let h;if($?h=$(r,a):h=au.isURLSearchParams(r)?r.toString():new fA(r,a).toString(v),h){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+h}return e}class rJ{constructor(){this.handlers=[]}use(r,a,v){return this.handlers.push({fulfilled:r,rejected:a,synchronous:v?v.synchronous:!1,runWhen:v?v.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){au.forEach(this.handlers,function(v){v!==null&&r(v)})}}const aJ={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eit={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:fA,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},mA=typeof window<"u"&&typeof document<"u",yA=typeof navigator=="object"&&navigator||void 0,tit=mA&&(!yA||["ReactNative","NativeScript","NS"].indexOf(yA.product)<0),rit=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ait=mA&&window.location.href||"http://localhost",Dx={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mA,hasStandardBrowserEnv:tit,hasStandardBrowserWebWorkerEnv:rit,navigator:yA,origin:ait},Symbol.toStringTag,{value:"Module"})),...eit};function nit(e,r){return EN(e,new Dx.classes.URLSearchParams,{visitor:function(a,v,$,h){return Dx.isNode&&au.isBuffer(a)?(this.append(v,a.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)},...r})}function iit(e){return au.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function oit(e){const r={},a=Object.keys(e);let v;const $=a.length;let h;for(v=0;v<$;v++)h=a[v],r[h]=e[h];return r}function nJ(e){function r(a,v,$,h){let u=a[h++];if(u==="__proto__")return!0;const i=Number.isFinite(+u),p=h>=a.length;return u=!u&&au.isArray($)?$.length:u,p?(au.hasOwnProp($,u)?$[u]=[$[u],v]:$[u]=v,!i):((!$[u]||!au.isObject($[u]))&&($[u]=[]),r(a,v,$[u],h)&&au.isArray($[u])&&($[u]=oit($[u])),!i)}if(au.isFormData(e)&&au.isFunction(e.entries)){const a={};return au.forEachEntry(e,(v,$)=>{r(iit(v),$,a,0)}),a}return null}function sit(e,r,a){if(au.isString(e))try{return(r||JSON.parse)(e),au.trim(e)}catch(v){if(v.name!=="SyntaxError")throw v}return(a||JSON.stringify)(e)}const f9={transitional:aJ,adapter:["xhr","http","fetch"],transformRequest:[function(r,a){const v=a.getContentType()||"",$=v.indexOf("application/json")>-1,h=au.isObject(r);if(h&&au.isHTMLForm(r)&&(r=new FormData(r)),au.isFormData(r))return $?JSON.stringify(nJ(r)):r;if(au.isArrayBuffer(r)||au.isBuffer(r)||au.isStream(r)||au.isFile(r)||au.isBlob(r)||au.isReadableStream(r))return r;if(au.isArrayBufferView(r))return r.buffer;if(au.isURLSearchParams(r))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(h){if(v.indexOf("application/x-www-form-urlencoded")>-1)return nit(r,this.formSerializer).toString();if((i=au.isFileList(r))||v.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return EN(i?{"files[]":r}:r,p&&new p,this.formSerializer)}}return h||$?(a.setContentType("application/json",!1),sit(r)):r}],transformResponse:[function(r){const a=this.transitional||f9.transitional,v=a&&a.forcedJSONParsing,$=this.responseType==="json";if(au.isResponse(r)||au.isReadableStream(r))return r;if(r&&au.isString(r)&&(v&&!this.responseType||$)){const u=!(a&&a.silentJSONParsing)&&$;try{return JSON.parse(r,this.parseReviver)}catch(i){if(u)throw i.name==="SyntaxError"?Rm.from(i,Rm.ERR_BAD_RESPONSE,this,null,this.response):i}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dx.classes.FormData,Blob:Dx.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};au.forEach(["delete","get","head","post","put","patch"],e=>{f9.headers[e]={}});const lit=au.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),cit=e=>{const r={};let a,v,$;return e&&e.split(`
|
|
7993
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),v}static addGrid(r,a={}){if(!r)return null;let v=r;if(v.gridstack){const $=v.gridstack;return a&&($.opts={...$.opts,...a}),a.children!==void 0&&$.load(a.children),$}return(!r.classList.contains("grid-stack")||Rh.addRemoveCB)&&(Rh.addRemoveCB?v=Rh.addRemoveCB(r,a,!0,!0):v=ru.createDiv(["grid-stack",a.class],r)),Rh.init(a,v)}static registerEngine(r){Rh.engineClass=r}get placeholder(){if(!this._placeholder){this._placeholder=ru.createDiv([this.opts.placeholderClass,T3.itemClass,this.opts.itemClass]);const r=ru.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(r.textContent=this.opts.placeholderText)}return this._placeholder}constructor(r,a={}){var v;this.el=r,this.opts=a,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},r.gridstack=this,this.opts=a=a||{},r.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),a.row&&(a.minRow=a.maxRow=a.row,delete a.row);const $=ru.toNumber(r.getAttribute("gs-row"));a.column==="auto"&&delete a.column,a.alwaysShowResizeHandle!==void 0&&(a._alwaysShowResizeHandle=a.alwaysShowResizeHandle);const h=a.columnOpts;if(h){const n=h.breakpoints;!h.columnWidth&&!(n!=null&&n.length)?delete a.columnOpts:(h.columnMax=h.columnMax||12,(n==null?void 0:n.length)>1&&n.sort((k,T)=>(T.w||0)-(k.w||0)))}const u={...ru.cloneDeep(T3),column:ru.toNumber(r.getAttribute("gs-column"))||T3.column,minRow:$||ru.toNumber(r.getAttribute("gs-min-row"))||T3.minRow,maxRow:$||ru.toNumber(r.getAttribute("gs-max-row"))||T3.maxRow,staticGrid:ru.toBool(r.getAttribute("gs-static"))||T3.staticGrid,sizeToContent:ru.toBool(r.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(a.handleClass?"."+a.handleClass:a.handle?a.handle:"")||T3.draggable.handle},removableOptions:{accept:a.itemClass||T3.removableOptions.accept,decline:T3.removableOptions.decline}};r.getAttribute("gs-animate")&&(u.animate=ru.toBool(r.getAttribute("gs-animate"))),a=ru.defaults(a,u),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(a),a.rtl==="auto"&&(a.rtl=r.style.direction==="rtl"),a.rtl&&this.el.classList.add("grid-stack-rtl");const i=this.el.closest("."+T3.itemClass),p=i==null?void 0:i.gridstackNode;if(p&&(p.subGrid=this,this.parentGridNode=p,this.el.classList.add("grid-stack-nested"),p.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=a.cellHeight==="auto",this._isAutoCellHeight||a.cellHeight==="initial")this.cellHeight(void 0);else{typeof a.cellHeight=="number"&&a.cellHeightUnit&&a.cellHeightUnit!==T3.cellHeightUnit&&(a.cellHeight=a.cellHeight+a.cellHeightUnit,delete a.cellHeightUnit);const n=a.cellHeight;delete a.cellHeight,this.cellHeight(n)}a.alwaysShowResizeHandle==="mobile"&&(a.alwaysShowResizeHandle=Xw),this._setStaticClass();const l=a.engineClass||Rh.engineClass||P4;if(this.engine=new l({column:this.getColumn(),float:a.float,maxRow:a.maxRow,onChange:n=>{n.forEach(k=>{const T=k.el;T&&(k._removeDOM?(T&&T.remove(),delete k._removeDOM):this._writePosAttr(T,k))}),this._updateContainerHeight()}}),a.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(n=>this._prepareElement(n)),delete this.engine._loading,this.batchUpdate(!1)),a.children){const n=a.children;delete a.children,n.length&&this.load(n)}this.setAnimation(),a.subGridDynamic&&!Nf.pauseDrag&&(Nf.pauseDrag=!0),((v=a.draggable)==null?void 0:v.pause)!==void 0&&(Nf.pauseDrag=a.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(r=this.opts){this.el.classList.add("gs-"+r.column),typeof r.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/r.column}%`)}addWidget(r){if(!r)return;if(typeof r=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(r.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(r);let a,v=r;if(v.grid=this,v.el?a=v.el:Rh.addRemoveCB?a=Rh.addRemoveCB(this.el,r,!0,!1):a=this.createWidgetDivs(v),!a)return;if(v=a.gridstackNode,v&&a.parentElement===this.el&&this.engine.nodes.find(h=>h._id===v._id))return a;const $=this._readAttr(a);return ru.defaults(r,$),this.engine.prepareNode(r),this.el.appendChild(a),this.makeWidget(a,r),a}createWidgetDivs(r){const a=ru.createDiv(["grid-stack-item",this.opts.itemClass]),v=ru.createDiv(["grid-stack-item-content"],a);return ru.lazyLoad(r)?r.visibleObservable||(r.visibleObservable=new IntersectionObserver(([$])=>{var h,u;$.isIntersecting&&((h=r.visibleObservable)==null||h.disconnect(),delete r.visibleObservable,Rh.renderCB(v,r),(u=r.grid)==null||u.prepareDragDrop(r.el))}),window.setTimeout(()=>{var $;return($=r.visibleObservable)==null?void 0:$.observe(a)})):Rh.renderCB(v,r),a}makeSubGrid(r,a,v,$=!0){var h,u,i;let p=r.gridstackNode;if(p||(p=this.makeWidget(r).gridstackNode),(h=p.subGrid)!=null&&h.el)return p.subGrid;let l,n=this;for(;n&&!l;)l=(u=n.opts)==null?void 0:u.subGridOpts,n=(i=n.parentGridNode)==null?void 0:i.grid;a=ru.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...a||p.subGridOpts||{}}),p.subGridOpts=a;let k;a.column==="auto"&&(k=!0,a.column=Math.max(p.w||1,(v==null?void 0:v.w)||1),delete a.columnOpts);let T=p.el.querySelector(".grid-stack-item-content"),x,d;if($&&(this._removeDD(p.el),d={...p,x:0,y:0},ru.removeInternalForSave(d),delete d.subGridOpts,p.content&&(d.content=p.content,delete p.content),Rh.addRemoveCB?x=Rh.addRemoveCB(this.el,d,!0,!1):(x=ru.createDiv(["grid-stack-item"]),x.appendChild(T),T=ru.createDiv(["grid-stack-item-content"],p.el)),this.prepareDragDrop(p.el)),v){const c=k?a.column:p.w,s=p.h+v.h,f=p.el.style;f.transition="none",this.update(p.el,{w:c,h:s}),setTimeout(()=>f.transition=null)}const o=p.subGrid=Rh.addGrid(T,a);return v!=null&&v._moving&&(o._isTemp=!0),k&&(o._autoColumn=!0),$&&o.makeWidget(x,d),v&&(v._moving?window.setTimeout(()=>ru.simulateMouseEvent(v._event,"mouseenter",o.el),0):o.makeWidget(p.el,p)),this.resizeToContentCheck(!1,p),o}removeAsSubGrid(r){var a;const v=(a=this.parentGridNode)==null?void 0:a.grid;v&&(v.batchUpdate(),v.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach($=>{$.x+=this.parentGridNode.x,$.y+=this.parentGridNode.y,v.makeWidget($.el,$)}),v.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,r&&window.setTimeout(()=>ru.simulateMouseEvent(r._event,"mouseenter",v.el),0))}save(r=!0,a=!1,v=Rh.saveCB,$){const h=this.engine.save(r,v,$);if(h.forEach(u=>{var i;if(r&&u.el&&!u.subGrid&&!v){const p=u.el.querySelector(".grid-stack-item-content");u.content=p==null?void 0:p.innerHTML,u.content||delete u.content}else if(!r&&!v&&delete u.content,(i=u.subGrid)!=null&&i.el){const p=u.w||u.subGrid.getColumn(),l=u.subGrid.save(r,a,v,p);u.subGridOpts=a?l:{children:l},delete u.subGrid}delete u.el}),a){const u=ru.cloneDeep(this.opts);u.marginBottom===u.marginTop&&u.marginRight===u.marginLeft&&u.marginTop===u.marginRight&&(u.margin=u.marginTop,delete u.marginTop,delete u.marginRight,delete u.marginBottom,delete u.marginLeft),u.rtl===(this.el.style.direction==="rtl")&&(u.rtl="auto"),this._isAutoCellHeight&&(u.cellHeight="auto"),this._autoColumn&&(u.column="auto");const i=u._alwaysShowResizeHandle;return delete u._alwaysShowResizeHandle,i!==void 0?u.alwaysShowResizeHandle=i:delete u.alwaysShowResizeHandle,ru.removeInternalAndSame(u,T3),u.children=h,u}return h}load(r,a=Rh.addRemoveCB||!0){r=ru.cloneDeep(r);const v=this.getColumn();r.forEach(n=>{n.w=n.w||n.minW||1,n.h=n.h||n.minH||1}),r=ru.sort(r),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let $=0;r.forEach(n=>{$=Math.max($,(n.x||0)+n.w)}),$>this.engine.defaultColumn&&(this.engine.defaultColumn=$),$>v&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=r,this.engine.columnChanged($,v,this.responseLayout),r=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(r,$,!0));const h=Rh.addRemoveCB;typeof a=="function"&&(Rh.addRemoveCB=a);const u=[];this.batchUpdate();const i=!this.engine.nodes.length,p=i&&this.opts.animate;p&&this.setAnimation(!1),!i&&a&&[...this.engine.nodes].forEach(n=>{n.id&&(ru.find(r,n.id)||(Rh.addRemoveCB&&Rh.addRemoveCB(this.el,n,!1,!1),u.push(n),this.removeWidget(n.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(n=>ru.find(r,n.id)?(l.push(n),!1):!0),r.forEach(n=>{var k;const T=ru.find(l,n.id);if(T){if(ru.shouldSizeToContent(T)&&(n.h=T.h),this.engine.nodeBoundFix(n),(n.autoPosition||n.x===void 0||n.y===void 0)&&(n.w=n.w||T.w,n.h=n.h||T.h,this.engine.findEmptyPosition(n)),this.engine.nodes.push(T),ru.samePos(T,n)&&this.engine.nodes.length>1&&(this.moveNode(T,{...n,forceCollide:!0}),ru.copyPos(n,T)),this.update(T.el,n),(k=n.subGridOpts)!=null&&k.children){const x=T.el.querySelector(".grid-stack");x&&x.gridstack&&x.gridstack.load(n.subGridOpts.children)}}else a&&this.addWidget(n)}),delete this.engine._loading,this.engine.removedNodes=u,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,h?Rh.addRemoveCB=h:delete Rh.addRemoveCB,p&&this.setAnimation(!0,!0),this}batchUpdate(r=!0){return this.engine.batchUpdate(r),r||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(r=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!r||!this.opts.cellHeightUnit||this.opts.cellHeightUnit==="px"))return this.opts.cellHeight;if(this.opts.cellHeightUnit==="rem")return this.opts.cellHeight*parseFloat(getComputedStyle(document.documentElement).fontSize);if(this.opts.cellHeightUnit==="em")return this.opts.cellHeight*parseFloat(getComputedStyle(this.el).fontSize);if(this.opts.cellHeightUnit==="cm")return this.opts.cellHeight*(96/2.54);if(this.opts.cellHeightUnit==="mm")return this.opts.cellHeight*(96/2.54)/10;const a=this.el.querySelector("."+this.opts.itemClass);if(a){const $=ru.toNumber(a.getAttribute("gs-h"))||1;return Math.round(a.offsetHeight/$)}const v=parseInt(this.el.getAttribute("gs-current-row"));return v?Math.round(this.el.getBoundingClientRect().height/v):this.opts.cellHeight}cellHeight(r){if(r!==void 0&&this._isAutoCellHeight!==(r==="auto")&&(this._isAutoCellHeight=r==="auto",this._updateResizeEvent()),(r==="initial"||r==="auto")&&(r=void 0),r===void 0){const v=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;r=this.cellWidth()+v}const a=ru.parseHeight(r);return this.opts.cellHeightUnit===a.unit&&this.opts.cellHeight===a.h?this:(this.opts.cellHeightUnit=a.unit,this.opts.cellHeight=a.h,this.el.style.setProperty("--gs-cell-height",`${this.opts.cellHeight}${this.opts.cellHeightUnit}`),this._updateContainerHeight(),this.resizeToContentCheck(),this)}cellWidth(){return this._widthOrContainer()/this.getColumn()}_widthOrContainer(r=!1){var a;return r&&(a=this.opts.columnOpts)!=null&&a.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var r,a;const v=this.opts.columnOpts;if(!v||!v.columnWidth&&!((r=v.breakpoints)!=null&&r.length))return!1;const $=this.getColumn();let h=$;const u=this._widthOrContainer(!0);if(v.columnWidth)h=Math.min(Math.round(u/v.columnWidth)||1,v.columnMax);else{h=v.columnMax;let i=0;for(;i<v.breakpoints.length&&u<=v.breakpoints[i].w;)h=v.breakpoints[i++].c||$}if(h!==$){const i=(a=v.breakpoints)==null?void 0:a.find(p=>p.c===h);return this.column(h,(i==null?void 0:i.layout)||v.layout),!0}return!1}compact(r="compact",a=!0){return this.engine.compact(r,a),this._triggerChangeEvent(),this}column(r,a="moveScale"){if(!r||r<1||this.opts.column===r)return this;const v=this.getColumn();return this.opts.column=r,this.engine?(this.engine.column=r,this.el.classList.remove("gs-"+v),this._updateColumnVar(),this.engine.columnChanged(v,r,a),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=a,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(r=>r.matches("."+this.opts.itemClass)&&!r.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(r=!0){var a;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),r?this.el.parentNode.removeChild(this.el):(this.removeAll(r),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(a=this._placeholder)==null||delete a.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(r){return this.opts.float!==r&&(this.opts.float=this.engine.float=r,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(r,a=!1){const v=this.el.getBoundingClientRect();let $;a?$={top:v.top+document.documentElement.scrollTop,left:v.left}:$={top:this.el.offsetTop,left:this.el.offsetLeft};const h=r.left-$.left,u=r.top-$.top,i=v.width/this.getColumn(),p=v.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(h/i),y:Math.floor(u/p)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(r,a,v,$){return this.engine.isAreaEmpty(r,a,v,$)}makeWidget(r,a){const v=Rh.getElement(r);if(!v||v.gridstackNode)return v;v.parentElement||this.el.appendChild(v),this._prepareElement(v,!0,a);const $=v.gridstackNode;this._updateContainerHeight(),$.subGridOpts&&this.makeSubGrid(v,$.subGridOpts,void 0,!1);let h;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(h=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),h&&delete this._ignoreLayoutsNodeChange,v}on(r,a){return r.indexOf(" ")!==-1?(r.split(" ").forEach(v=>this.on(v,a)),this):(r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable"?(r==="enable"||r==="disable"?this._gsEventHandler[r]=v=>a(v):this._gsEventHandler[r]=v=>{v.detail&&a(v,v.detail)},this.el.addEventListener(r,this._gsEventHandler[r])):r==="drag"||r==="dragstart"||r==="dragstop"||r==="resizestart"||r==="resize"||r==="resizestop"||r==="dropped"||r==="resizecontent"?this._gsEventHandler[r]=a:console.error("GridStack.on("+r+") event not supported"),this)}off(r){return r.indexOf(" ")!==-1?(r.split(" ").forEach(a=>this.off(a)),this):((r==="change"||r==="added"||r==="removed"||r==="enable"||r==="disable")&&this._gsEventHandler[r]&&this.el.removeEventListener(r,this._gsEventHandler[r]),delete this._gsEventHandler[r],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(r=>this.off(r)),this}removeWidget(r,a=!0,v=!0){return r?(Rh.getElements(r).forEach($=>{if($.parentElement&&$.parentElement!==this.el)return;let h=$.gridstackNode;h||(h=this.engine.nodes.find(u=>$===u.el)),h&&(a&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,h,!1,!1),delete $.gridstackNode,this._removeDD($),this.engine.removeNode(h,a,v),a&&$.parentElement&&$.remove())}),v&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(r=!0,a=!0){return this.engine.nodes.forEach(v=>{r&&Rh.addRemoveCB&&Rh.addRemoveCB(this.el,v,!1,!1),delete v.el.gridstackNode,this.opts.staticGrid||this._removeDD(v.el)}),this.engine.removeAll(r,a),a&&this._triggerRemoveEvent(),this}setAnimation(r=this.opts.animate,a){return a?setTimeout(()=>{this.opts&&this.setAnimation(r)}):r?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=r,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(r,a=!0,v=!0){return!!this.opts.staticGrid===r?this:(r?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach($=>{this.prepareDragDrop($.el),$.subGrid&&v&&$.subGrid.setStatic(r,a,v)}),a&&this._setStaticClass(),this)}updateOptions(r){var a;const v=this.opts;return r===v?this:(r.acceptWidgets!==void 0&&(v.acceptWidgets=r.acceptWidgets,this._setupAcceptWidget()),r.animate!==void 0&&this.setAnimation(r.animate),r.cellHeight&&this.cellHeight(r.cellHeight),r.class!==void 0&&r.class!==v.class&&(v.class&&this.el.classList.remove(v.class),r.class&&this.el.classList.add(r.class)),r.columnOpts?(this.opts.columnOpts=r.columnOpts,this.checkDynamicColumn()):r.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof r.column=="number"&&this.column(r.column),r.margin!==void 0&&this.margin(r.margin),r.staticGrid!==void 0&&this.setStatic(r.staticGrid),r.disableDrag!==void 0&&!r.staticGrid&&this.enableMove(!r.disableDrag),r.disableResize!==void 0&&!r.staticGrid&&this.enableResize(!r.disableResize),r.float!==void 0&&this.float(r.float),r.row!==void 0?(v.minRow=v.maxRow=v.row=r.row,this._updateContainerHeight()):(r.minRow!==void 0&&(v.minRow=r.minRow,this._updateContainerHeight()),r.maxRow!==void 0&&(v.maxRow=r.maxRow)),(a=r.children)!=null&&a.length&&this.load(r.children),this)}update(r,a){return Rh.getElements(r).forEach(v=>{var $;const h=v==null?void 0:v.gridstackNode;if(!h)return;const u={...ru.copyPos({},h),...ru.cloneDeep(a)};this.engine.nodeBoundFix(u),delete u.autoPosition;const i=["x","y","w","h"];let p;if(i.some(k=>u[k]!==void 0&&u[k]!==h[k])&&(p={},i.forEach(k=>{p[k]=u[k]!==void 0?u[k]:h[k],delete u[k]})),!p&&(u.minW||u.minH||u.maxW||u.maxH)&&(p={}),u.content!==void 0){const k=v.querySelector(".grid-stack-item-content");k&&k.textContent!==u.content&&(h.content=u.content,Rh.renderCB(k,u),($=h.subGrid)!=null&&$.el&&(k.appendChild(h.subGrid.el),h.subGrid._updateContainerHeight())),delete u.content}let l=!1,n=!1;for(const k in u)k[0]!=="_"&&h[k]!==u[k]&&(h[k]=u[k],l=!0,n=n||!this.opts.staticGrid&&(k==="noResize"||k==="noMove"||k==="locked"));if(ru.sanitizeMinMax(h),p){const k=p.w!==void 0&&p.w!==h.w;this.moveNode(h,p),k&&h.subGrid?h.subGrid.onResize(this.hasAnimationCSS()?h.w:void 0):this.resizeToContentCheck(k,h),delete h._orig}(p||l)&&this._writeAttr(v,h),n&&this.prepareDragDrop(h.el),Rh.updateCB&&Rh.updateCB(h)}),this}moveNode(r,a){const v=r._updating;v||this.engine.cleanNodes().beginUpdate(r),this.engine.moveNode(r,a),this._updateContainerHeight(),v||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(r){var a,v;if(!r||(r.classList.remove("size-to-content-max"),!r.clientHeight))return;const $=r.gridstackNode;if(!$)return;const h=$.grid;if(!h||r.parentElement!==h.el)return;const u=h.getCellHeight(!0);if(!u)return;let i=$.h?$.h*u:r.clientHeight,p;if($.resizeToContentParent&&(p=r.querySelector($.resizeToContentParent)),p||(p=r.querySelector(Rh.resizeToContentParent)),!p)return;const l=r.clientHeight-p.clientHeight,n=$.h?$.h*u-l:p.clientHeight;let k;if($.subGrid){k=$.subGrid.getRow()*$.subGrid.getCellHeight(!0);const d=$.subGrid.el.getBoundingClientRect(),o=r.getBoundingClientRect();k+=d.top-o.top}else{if((v=(a=$.subGridOpts)==null?void 0:a.children)!=null&&v.length)return;{const d=p.firstElementChild;if(!d){console.error(`Error: GridStack.resizeToContent() widget id:${$.id} '${Rh.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}k=d.getBoundingClientRect().height||n}}if(n===k)return;i+=k-n;let T=Math.ceil(i/u);const x=Number.isInteger($.sizeToContent)?$.sizeToContent:0;x&&T>x&&(T=x,r.classList.add("size-to-content-max")),$.minH&&T<$.minH?T=$.minH:$.maxH&&T>$.maxH&&(T=$.maxH),T!==$.h&&(h._ignoreLayoutsNodeChange=!0,h.moveNode($,{h:T}),delete h._ignoreLayoutsNodeChange)}resizeToContentCBCheck(r){Rh.resizeToContentCB?Rh.resizeToContentCB(r):this.resizeToContent(r)}rotate(r,a){return Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;if(!ru.canBeRotated($))return;const h={w:$.h,h:$.w,minH:$.minW,minW:$.minH,maxH:$.maxW,maxW:$.maxH};if(a){const i=a.left>0?Math.floor(a.left/this.cellWidth()):0,p=a.top>0?Math.floor(a.top/this.opts.cellHeight):0;h.x=$.x+i-($.h-(p+1)),h.y=$.y+p-i}Object.keys(h).forEach(i=>{h[i]===void 0&&delete h[i]});const u=$._orig;this.update(v,h),$._orig=u}),this}margin(r){if(!(typeof r=="string"&&r.split(" ").length>1)){const a=ru.parseHeight(r);if(this.opts.marginUnit===a.unit&&this.opts.margin===a.h)return}return this.opts.margin=r,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(r){if(arguments.length>1){console.warn("gridstack.ts: `willItFit(x,y,w,h,autoPosition)` is deprecated. Use `willItFit({x, y,...})`. It will be removed soon");const a=arguments;let v=0,$={x:a[v++],y:a[v++],w:a[v++],h:a[v++],autoPosition:a[v++]};return this.willItFit($)}return this.engine.willItFit(r)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const r=this.engine.getDirtyNodes(!0);return r&&r.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(r),this._triggerEvent("change",r)),this.engine.saveInitial(),this}_triggerAddEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.addedNodes)!=null&&r.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(v=>{delete v._dirty});const a=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",a)}return this}_triggerRemoveEvent(){var r;if(this.engine.batchMode)return this;if((r=this.engine.removedNodes)!=null&&r.length){const a=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",a)}return this}_triggerEvent(r,a){const v=a?new CustomEvent(r,{bubbles:!1,detail:a}):new Event(r);let $=this;for(;$.parentGridNode;)$=$.parentGridNode.grid;return $.el.dispatchEvent(v),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const r=this.parentGridNode;let a=this.getRow()+this._extraDragRow;const v=this.opts.cellHeight,$=this.opts.cellHeightUnit;if(!v)return this;if(!r&&!this.opts.minRow){const h=ru.parseHeight(getComputedStyle(this.el).minHeight);if(h.h>0&&h.unit===$){const u=Math.floor(h.h/v);a<u&&(a=u)}}return this.el.setAttribute("gs-current-row",String(a)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),a&&(this.el.style[r?"minHeight":"height"]=a*v+$),r&&ru.shouldSizeToContent(r)&&r.grid.resizeToContentCBCheck(r.el),this}_prepareElement(r,a=!1,v){v=v||this._readAttr(r),r.gridstackNode=v,v.el=r,v.grid=this,v=this.engine.addNode(v,a),this._writeAttr(r,v),r.classList.add(T3.itemClass,this.opts.itemClass);const $=ru.shouldSizeToContent(v);return $?r.classList.add("size-to-content"):r.classList.remove("size-to-content"),$&&this.resizeToContentCheck(!1,v),ru.lazyLoad(v)||this.prepareDragDrop(v.el),this}_writePosAttr(r,a){return(!a._moving&&!a._resizing||this._placeholder===r)&&(r.style.top=a.y?a.y===1?"var(--gs-cell-height)":`calc(${a.y} * var(--gs-cell-height))`:null,r.style.left=a.x?a.x===1?"var(--gs-column-width)":`calc(${a.x} * var(--gs-column-width))`:null,r.style.width=a.w>1?`calc(${a.w} * var(--gs-column-width))`:null,r.style.height=a.h>1?`calc(${a.h} * var(--gs-cell-height))`:null),a.x>0?r.setAttribute("gs-x",String(a.x)):r.removeAttribute("gs-x"),a.y>0?r.setAttribute("gs-y",String(a.y)):r.removeAttribute("gs-y"),a.w>1?r.setAttribute("gs-w",String(a.w)):r.removeAttribute("gs-w"),a.h>1?r.setAttribute("gs-h",String(a.h)):r.removeAttribute("gs-h"),this}_writeAttr(r,a){if(!a)return this;this._writePosAttr(r,a);const v={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const $ in v)a[$]?r.setAttribute(v[$],String(a[$])):r.removeAttribute(v[$]);return this}_readAttr(r,a=!0){const v={};v.x=ru.toNumber(r.getAttribute("gs-x")),v.y=ru.toNumber(r.getAttribute("gs-y")),v.w=ru.toNumber(r.getAttribute("gs-w")),v.h=ru.toNumber(r.getAttribute("gs-h")),v.autoPosition=ru.toBool(r.getAttribute("gs-auto-position")),v.noResize=ru.toBool(r.getAttribute("gs-no-resize")),v.noMove=ru.toBool(r.getAttribute("gs-no-move")),v.locked=ru.toBool(r.getAttribute("gs-locked"));const $=r.getAttribute("gs-size-to-content");$&&($==="true"||$==="false"?v.sizeToContent=ru.toBool($):v.sizeToContent=parseInt($,10)),v.id=r.getAttribute("gs-id"),v.maxW=ru.toNumber(r.getAttribute("gs-max-w")),v.minW=ru.toNumber(r.getAttribute("gs-min-w")),v.maxH=ru.toNumber(r.getAttribute("gs-max-h")),v.minH=ru.toNumber(r.getAttribute("gs-min-h")),a&&(v.w===1&&r.removeAttribute("gs-w"),v.h===1&&r.removeAttribute("gs-h"),v.maxW&&r.removeAttribute("gs-max-w"),v.minW&&r.removeAttribute("gs-min-w"),v.maxH&&r.removeAttribute("gs-max-h"),v.minH&&r.removeAttribute("gs-min-h"));for(const h in v){if(!v.hasOwnProperty(h))return;!v[h]&&v[h]!==0&&h!=="sizeToContent"&&delete v[h]}return v}_setStaticClass(){const r=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...r),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...r),this.el.removeAttribute("gs-static")),this}onResize(r=(a=>(a=this.el)==null?void 0:a.clientWidth)()){if(!r||this.prevWidth===r)return;this.prevWidth=r,this.batchUpdate();let a=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),a=!0):a=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(v=>{v.subGrid&&v.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(a),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(r=!1,a=void 0){if(this.engine){if(r&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,a),this.animationDelay);if(a)ru.shouldSizeToContent(a)&&this.resizeToContentCBCheck(a.el);else if(this.engine.nodes.some(v=>ru.shouldSizeToContent(v))){const v=[...this.engine.nodes];this.batchUpdate(),v.forEach($=>{ru.shouldSizeToContent($)&&this.resizeToContentCBCheck($.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,a?[a]:this.engine.nodes)}}_updateResizeEvent(r=!1){const a=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(v=>v.sizeToContent));return!r&&a&&!this.resizeObserver?(this._sizeThrottle=ru.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(r||!a)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(r=".grid-stack-item"){return ru.getElement(r)}static getElements(r=".grid-stack-item"){return ru.getElements(r)}static getGridElement(r){return Rh.getElement(r)}static getGridElements(r){return ru.getElements(r)}_initMargin(){let r,a=0,v=[];typeof this.opts.margin=="string"&&(v=this.opts.margin.split(" ")),v.length===2?(this.opts.marginTop=this.opts.marginBottom=v[0],this.opts.marginLeft=this.opts.marginRight=v[1]):v.length===4?(this.opts.marginTop=v[0],this.opts.marginRight=v[1],this.opts.marginBottom=v[2],this.opts.marginLeft=v[3]):(r=ru.parseHeight(this.opts.margin),this.opts.marginUnit=r.unit,a=this.opts.margin=r.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(h=>{this.opts[h]===void 0?this.opts[h]=a:(r=ru.parseHeight(this.opts[h]),this.opts[h]=r.h,delete this.opts.margin)}),this.opts.marginUnit=r.unit,this.opts.marginTop===this.opts.marginBottom&&this.opts.marginLeft===this.opts.marginRight&&this.opts.marginTop===this.opts.marginRight&&(this.opts.margin=this.opts.marginTop);const $=this.el.style;return $.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),$.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return u_}static setupDragIn(r,a,v,$=document){(a==null?void 0:a.pause)!==void 0&&(Nf.pauseDrag=a.pause),a={appendTo:"body",helper:"clone",...a||{}},(typeof r=="string"?ru.getElements(r,$):r).forEach((h,u)=>{u_.isDraggable(h)||u_.dragIn(h,a),v!=null&&v[u]&&(h.gridstackNode=v[u])})}movable(r,a){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(a?delete $.noMove:$.noMove=!0,this.prepareDragDrop($.el))}),this)}resizable(r,a){return this.opts.staticGrid?this:(Rh.getElements(r).forEach(v=>{const $=v.gridstackNode;$&&(a?delete $.noResize:$.noResize=!0,this.prepareDragDrop($.el))}),this)}disable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!1,r),this.enableResize(!1,r),this._triggerEvent("disable"),this}enable(r=!0){if(!this.opts.staticGrid)return this.enableMove(!0,r),this.enableResize(!0,r),this._triggerEvent("enable"),this}enableMove(r,a=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&a&&v.subGrid.enableMove(r,a)}),this)}enableResize(r,a=!0){return this.opts.staticGrid?this:(r?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(v=>{this.prepareDragDrop(v.el),v.subGrid&&a&&v.subGrid.enableResize(r,a)}),this)}cancelDrag(){var r;const a=(r=this._placeholder)==null?void 0:r.gridstackNode;a&&(a._isExternal?(a._isAboutToRemove=!0,this.engine.removeNode(a)):a._isAboutToRemove&&Rh._itemRemoving(a.el,!1),this.engine.restoreInitial())}_removeDD(r){return u_.draggable(r,"destroy").resizable(r,"destroy"),r.gridstackNode&&delete r.gridstackNode._initDD,delete r.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return u_.droppable(this.el,"destroy"),this;let r,a;const v=($,h,u)=>{var i;u=u||h;const p=u.gridstackNode;if(!p)return;if(!((i=p.grid)!=null&&i.el)){u.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const x=u.getBoundingClientRect();u.style.left=x.x+(this.dragTransform.xScale-1)*($.clientX-x.x)/this.dragTransform.xScale+"px",u.style.top=x.y+(this.dragTransform.yScale-1)*($.clientY-x.y)/this.dragTransform.yScale+"px",u.style.transformOrigin="0px 0px"}let{top:l,left:n}=u.getBoundingClientRect();const k=this.el.getBoundingClientRect();n-=k.left,l-=k.top;const T={position:{top:l*this.dragTransform.xScale,left:n*this.dragTransform.yScale}};if(p._temporaryRemoved){if(p.x=Math.max(0,Math.round(n/a)),p.y=Math.max(0,Math.round(l/r)),delete p.autoPosition,this.engine.nodeBoundFix(p),!this.engine.willItFit(p)){if(p.autoPosition=!0,!this.engine.willItFit(p)){u_.off(h,"drag");return}p._willFitPos&&(ru.copyPos(p,p._willFitPos),delete p._willFitPos)}this._onStartMoving(u,$,T,p,a,r)}else this._dragOrResize(u,$,T,p,a,r)};return u_.droppable(this.el,{accept:$=>{const h=$.gridstackNode||this._readAttr($,!1);if((h==null?void 0:h.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let u=!0;if(typeof this.opts.acceptWidgets=="function")u=this.opts.acceptWidgets($);else{const i=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;u=$.matches(i)}if(u&&h&&this.opts.maxRow){const i={w:h.w,h:h.h,minW:h.minW,minH:h.minH};u=this.engine.willItFit(i)}return u}}).on(this.el,"dropover",($,h,u)=>{let i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((i==null?void 0:i.grid)===this&&!i._temporaryRemoved)return!1;if(i!=null&&i._sidebarOrig&&(i.w=i._sidebarOrig.w,i.h=i._sidebarOrig.h),i!=null&&i.grid&&i.grid!==this&&!i._temporaryRemoved&&i.grid._leave(h,u),u=u||h,a=this.cellWidth(),r=this.getCellHeight(!0),!i){const n=u.getAttribute("data-gs-widget")||u.getAttribute("gridstacknode");if(n){try{i=JSON.parse(n)}catch{console.error("Gridstack dropover: Bad JSON format: ",n)}u.removeAttribute("data-gs-widget"),u.removeAttribute("gridstacknode")}i||(i=this._readAttr(u)),i._sidebarOrig={w:i.w,h:i.h}}i.grid||(i.el||(i={...i}),i._isExternal=!0,u.gridstackNode=i);const p=i.w||Math.round(u.offsetWidth/a)||1,l=i.h||Math.round(u.offsetHeight/r)||1;return i.grid&&i.grid!==this?(h._gridstackNodeOrig||(h._gridstackNodeOrig=i),h.gridstackNode=i={...i,w:p,h:l,grid:this},delete i.x,delete i.y,this.engine.cleanupNode(i).nodeBoundFix(i),i._initDD=i._isExternal=i._temporaryRemoved=!0):(i.w=p,i.h=l,i._temporaryRemoved=!0),Rh._itemRemoving(i.el,!1),u_.on(h,"drag",v),v($,h,u),!1}).on(this.el,"dropout",($,h,u)=>{const i=(u==null?void 0:u.gridstackNode)||h.gridstackNode;return i&&(!i.grid||i.grid===this)&&(this._leave(h,u),this._isTemp&&this.removeAsSubGrid(i)),!1}).on(this.el,"drop",($,h,u)=>{var i,p,l;const n=(u==null?void 0:u.gridstackNode)||h.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._isExternal)return!1;const k=!!this.placeholder.parentElement,T=h!==u;this.placeholder.remove(),delete this.placeholder.gridstackNode,k&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const x=h._gridstackNodeOrig;if(delete h._gridstackNodeOrig,k&&x!=null&&x.grid&&x.grid!==this){const o=x.grid;o.engine.removeNodeFromLayoutCache(x),o.engine.removedNodes.push(x),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!n||(k&&(this.engine.cleanupNode(n),n.grid=this),(i=n.grid)==null||delete i._isTemp,u_.off(h,"drag"),u!==h?(u.remove(),h=u):h.remove(),this._removeDD(h),!k))return!1;const d=(l=(p=n.subGrid)==null?void 0:p.el)==null?void 0:l.gridstack;return ru.copyPos(n,this._readAttr(this.placeholder)),ru.removePositioningStyles(h),T&&(n.content||n.subGridOpts||Rh.addRemoveCB)?(delete n.el,h=this.addWidget(n)):(this._prepareElement(h,!0,n),this.el.appendChild(h),this.resizeToContentCheck(!1,n),d&&(d.parentGridNode=n),this._updateContainerHeight()),this.engine.addedNodes.push(n),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...$,type:"dropped"},x&&x.grid?x:void 0,n),!1}),this}static _itemRemoving(r,a){if(!r)return;const v=r?r.gridstackNode:void 0;!(v!=null&&v.grid)||r.classList.contains(v.grid.opts.removableOptions.decline)||(a?v._isAboutToRemove=!0:delete v._isAboutToRemove,a?r.classList.add("grid-stack-item-removing"):r.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const r=document.querySelector(this.opts.removable);return r?(!this.opts.staticGrid&&!u_.isDroppable(r)&&u_.droppable(r,this.opts.removableOptions).on(r,"dropover",(a,v)=>Rh._itemRemoving(v,!0)).on(r,"dropout",(a,v)=>Rh._itemRemoving(v,!1)),this):this}prepareDragDrop(r,a=!1){const v=r==null?void 0:r.gridstackNode;if(!v)return;const $=v.noMove||this.opts.disableDrag,h=v.noResize||this.opts.disableResize,u=this.opts.staticGrid||$&&h;if((a||u)&&(v._initDD&&(this._removeDD(r),delete v._initDD),u&&r.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!a))return this;if(!v._initDD){let i,p;const l=(T,x)=>{this.triggerEvent(T,T.target),i=this.cellWidth(),p=this.getCellHeight(!0),this._onStartMoving(r,T,x,v,i,p)},n=(T,x)=>{this._dragOrResize(r,T,x,v,i,p)},k=T=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete v._moving,delete v._resizing,delete v._event,delete v._lastTried;const x=v.w!==v._orig.w,d=T.target;if(!(!d.gridstackNode||d.gridstackNode.grid!==this)){if(v.el=d,v._isAboutToRemove){const o=r.gridstackNode.grid;o._gsEventHandler[T.type]&&o._gsEventHandler[T.type](T,d),o.engine.nodes.push(v),o.removeWidget(r,!0,!0)}else ru.removePositioningStyles(d),v._temporaryRemoved?(this._writePosAttr(d,v),this.engine.addNode(v)):this._writePosAttr(d,v),this.triggerEvent(T,d);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),T.type==="resizestop"&&(Number.isInteger(v.sizeToContent)&&(v.sizeToContent=v.h),this.resizeToContentCheck(x,v))}};u_.draggable(r,{start:l,stop:k,drag:n}).resizable(r,{start:l,stop:k,resize:n}),v._initDD=!0}return u_.draggable(r,$?"disable":"enable").resizable(r,h?"disable":"enable"),this}_onStartMoving(r,a,v,$,h,u){var i;if(this.engine.cleanNodes().beginUpdate($),this._writePosAttr(this.placeholder,$),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=$,(i=$.grid)!=null&&i.el)this.dragTransform=ru.getValuesFromTransformedElement(r);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const p=this.placeholder.closest(".grid-stack");this.dragTransform=ru.getValuesFromTransformedElement(p)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if($.el=this.placeholder,$._lastUiPosition=v.position,$._prevYPix=v.position.top,$._moving=a.type==="dragstart",$._resizing=a.type==="resizestart",delete $._lastTried,a.type==="dropover"&&$._temporaryRemoved&&(this.engine.addNode($),$._moving=!0),this.engine.cacheRects(h,u,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),a.type==="resizestart"){const p=this.getColumn()-$.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-$.y;u_.resizable(r,"option","minWidth",h*Math.min($.minW||1,p)).resizable(r,"option","minHeight",u*Math.min($.minH||1,l)).resizable(r,"option","maxWidth",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,p)).resizable(r,"option","maxWidthMoveLeft",h*Math.min($.maxW||Number.MAX_SAFE_INTEGER,$.x+$.w)).resizable(r,"option","maxHeight",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(r,"option","maxHeightMoveUp",u*Math.min($.maxH||Number.MAX_SAFE_INTEGER,$.y+$.h))}}_dragOrResize(r,a,v,$,h,u){const i={...$._orig};let p,l=this.opts.marginLeft,n=this.opts.marginRight,k=this.opts.marginTop,T=this.opts.marginBottom;const x=Math.round(u*.1),d=Math.round(h*.1);if(l=Math.min(l,d),n=Math.min(n,d),k=Math.min(k,x),T=Math.min(T,x),a.type==="drag"){if($._temporaryRemoved)return;const c=v.position.top-$._prevYPix;$._prevYPix=v.position.top,this.opts.draggable.scroll!==!1&&ru.updateScrollPosition(r,v.position,c);const s=v.position.left+(v.position.left>$._lastUiPosition.left?-n:l),f=v.position.top+(v.position.top>$._lastUiPosition.top?-T:k);i.x=Math.round(s/h),i.y=Math.round(f/u);const g=this._extraDragRow;if(this.engine.collide($,i)){const S=this.getRow();let L=Math.max(0,i.y+$.h-S);this.opts.maxRow&&S+L>this.opts.maxRow&&(L=Math.max(0,this.opts.maxRow-S)),this._extraDragRow=L}else this._extraDragRow=0;if(this._extraDragRow!==g&&this._updateContainerHeight(),$.x===i.x&&$.y===i.y)return}else if(a.type==="resize"){if(i.x<0||(ru.updateScrollResize(a,r,u),i.w=Math.round((v.size.width-l)/h),i.h=Math.round((v.size.height-k)/u),$.w===i.w&&$.h===i.h)||$._lastTried&&$._lastTried.w===i.w&&$._lastTried.h===i.h)return;const c=v.position.left+l,s=v.position.top+k;i.x=Math.round(c/h),i.y=Math.round(s/u),p=!0}$._event=a,$._lastTried=i;const o={x:v.position.left+l,y:v.position.top+k,w:(v.size?v.size.width:$.w*h)-l-n,h:(v.size?v.size.height:$.h*u)-k-T};if(this.engine.moveNodeCheck($,{...i,cellWidth:h,cellHeight:u,rect:o,resizing:p})){$._lastUiPosition=v.position,this.engine.cacheRects(h,u,k,n,T,l),delete $._skipDown,p&&$.subGrid&&$.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const c=a.target;$._sidebarOrig||this._writePosAttr(c,$),this.triggerEvent(a,c)}}triggerEvent(r,a){let v=this;for(;v.parentGridNode;)v=v.parentGridNode.grid;v._gsEventHandler[r.type]&&v._gsEventHandler[r.type](r,a)}_leave(r,a){a=a||r;const v=a.gridstackNode;if(!v||(a.style.transform=a.style.transformOrigin=null,u_.off(r,"drag"),v._temporaryRemoved))return;v._temporaryRemoved=!0,this.engine.removeNode(v),v.el=v._isExternal&&a?a:r;const $=v._sidebarOrig;v._isExternal&&this.engine.cleanupNode(v),v._sidebarOrig=$,this.opts.removable===!0&&Rh._itemRemoving(r,!0),r._gridstackNodeOrig?(r.gridstackNode=r._gridstackNodeOrig,delete r._gridstackNodeOrig):v._isExternal&&this.engine.restoreInitial()}commit(){return rHe(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}Rh.renderCB=(e,r)=>{e&&r!=null&&r.content&&(e.textContent=r.content)},Rh.resizeToContentParent=".grid-stack-item-content",Rh.Utils=ru,Rh.Engine=P4,Rh.GDRev="12.3.2";const oHe=[{id:1,name:"Goles",isSelected:!1},{id:2,name:"Pases acertados",isSelected:!1},{id:23,name:"Tiros de Esquina",isSelected:!1},{id:3,name:"Balones recuperados en disputa",isSelected:!1},{id:4,name:"Asistencias",isSelected:!1},{id:5,name:"Participaciones en gol",isSelected:!1},{id:6,name:"Tiros a gol",isSelected:!1},{id:7,name:"Tiros a gol que llegaron a la portería",isSelected:!1},{id:8,name:"Cabeceos en área rival",isSelected:!1},{id:9,name:"Cabeceos en área propia",isSelected:!1},{id:10,name:"Centros",isSelected:!1},{id:11,name:"Centros acertados",isSelected:!1},{id:12,name:"1vs1 exitosos ofensivos",isSelected:!1},{id:13,name:"1vs1 exitosos ofensivos que terminaron en gol",isSelected:!1},{id:14,name:"1vs1 defensivos exitoso",isSelected:!1},{id:15,name:"Rechaces",isSelected:!1},{id:16,name:"Balones ganados en área propia",isSelected:!1},{id:17,name:"Balones ganados en área rival",isSelected:!1},{id:18,name:"Faltas cometidas",isSelected:!1},{id:19,name:"Faltas recibidas",isSelected:!1},{id:20,name:"Tarjetas amarillas",isSelected:!1},{id:21,name:"Tarjetas rojas",isSelected:!1},{id:22,name:"Atajadas",isSelected:!1},{id:24,name:"Oportunidades de gol",isSelected:!1},{id:25,name:"Balones recuperados en cancha rival",isSelected:!1}],A4=e=>oHe.find(r=>r.id===e),R4=new Map([[9,{id:9,analysisTypes:new Map([["2-20",{analysisType:"successfulPasses",name:"Pases acertados",title:"Mapeo de pases acertados",titleShort:"Pases acertados"}],["3-21",{analysisType:"unsuccessfulPasses",name:"Pases no acertados",title:"Mapeo de pases no acertados",titleShort:"Pases no acertados"}],["222-223-224-225",{analysisType:"recoveredBalls",name:"Balones recuperados",title:"Mapeo de balones recuperados",titleShort:"Balones recuperados"}],["226-227-228-229",{analysisType:"lostBalls",name:"Balones perdidos",title:"Mapeo de balones perdidos",titleShort:"Balones perdidos"}]])}],[1,{general:"General",offensive:"Ofensivo",defensive:"Defensivo",possession:"Posesión",stoppedBall:"Balón parado",penalties:"Infracción"}]]);class Qk{constructor(r,a=[],v,$=null,h=!1,u=!1,i=null,p=null,l=null){Lw(this,"id",""),Lw(this,"childViews",[]),Lw(this,"viewId",0),Lw(this,"dynamicFilters",null),Lw(this,"componentSpecificFilters",new Map),Lw(this,"isPostMatch",!1),Lw(this,"isTemplateMode",!1),Lw(this,"filtresJSON",null),Lw(this,"token",null),Lw(this,"_isUpdating",!1),Lw(this,"filters",null),this.id=r,this.viewId=v,this.childViews=a,this.dynamicFilters=$,this.isPostMatch=h,this.isTemplateMode=u,this.filtresJSON=i,this.token=p,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(r=>{r.view.filterAndViewsContainer=new Qk(this.id,[r],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(r,a){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.event_type_id===a)}hasCategoryId(r,a){return!r||!Array.isArray(r)?!1:r.some(v=>v&&v.category_id===a)}getId(){return this.id}setViewId(r){this.viewId=r}setFiltersJSON(r){this.filtresJSON=r}setDynamicFilters(r,a=null){a?this.componentSpecificFilters.set(a,[...r]):this.dynamicFilters=r}setFilters(r){this.filters=r}getComponentDynamicFilters(r){return r&&this.componentSpecificFilters.has(r)?this.componentSpecificFilters.get(r):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(r=>r.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(r=>!r.view.isHomeTeam)}addSpecificPlays(r){if(r.view.componentProps&&this.filters){const a=this.filters.selectedTeam.value;if(console.log("teamSelected: ",a),a===3){console.log("this.getHomeTeamViews(): ",this.getHomeTeamViews()),console.log("this.getAwayTeamViews(): ",this.getAwayTeamViews());const v=this.getHomeTeamViews().length,$=this.getAwayTeamViews().length;v===0&&$>0&&this.getAwayTeamViews().forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=!0,h.view.isHomeTeam=!0,h.view.filterMultiple&&(h.view.filterMultiple.isHomeTeam=!0)}),v<this.filters.howManyCorners?this.childViews.length===0?(r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.howManyCorners=this.filters.howManyCorners,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):this.childViews.reduce((h,u,i,p)=>{let l={isAgainstMode:u.view.isAgainstMode,advancedFilters:u.view.componentProps.advancedFilters,isHomeTeamForAnalysis:u.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:u.view.isHomeTeam};return h&&(h.isHomeTeam&&!u.view.isHomeTeam?(u.view.componentProps.isAgainstMode=this.filters.isAgainstMode,u.view.componentProps.advancedFilters=this.filters.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=!0,u.view.isHomeTeam=!0,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}):!h.isHomeTeam&&!u.view.isHomeTeam&&(u.view.componentProps.isAgainstMode=h.isAgainstMode,u.view.componentProps.advancedFilters=h.advancedFilters,u.view.componentProps.isHomeTeamForAnalysis=h.isHomeTeamForAnalysis,u.view.isHomeTeam=h.isHomeTeam,u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam,selectedCategory:u.view.componentProps.categories[0],advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}),i===p.length-1&&(r.view.componentProps.advancedFilters=l.advancedFilters,r.view.componentProps.isAgainstMode=l.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=l.isHomeTeamForAnalysis,r.view.isHomeTeam=l.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})),l},null):(r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode})}else{const v=a===1;r.view.componentProps.isHomeTeamForAnalysis=v,r.view.isHomeTeam=v,r.view.componentProps.advancedFilters=this.filters.advancedFilters,r.view.componentProps.isAgainstMode=this.filters.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:this.filters.advancedFilters,howManyCorners:this.filters.howManyCorners,isAgainstMode:this.filters.isAgainstMode}}}console.log("++++++++++++++++++++++++++++++++++++++++++++++++++++++"),console.log("view: ",r)}addLastTouch(r){if(r.view.componentProps&&this.filters){let a=null;const v=this.filters.selectedCategories.map(h=>h.value),$=this.filters.selectedTeam.value;if($===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(p=>{p.view.componentProps.isHomeTeamForAnalysis=!0,p.view.isHomeTeam=!0,p.view.filterMultiple&&(p.view.filterMultiple.isHomeTeam=!0)});const h=this.getHomeTeamViews(),u=this.getAwayTeamViews();let i=!0;for(let p=0;p<v.length;p++){a=v[p];const l=h.find(k=>k.view.componentProps.categories[0].name===a.name),n=u.find(k=>k.view.componentProps.categories[0].name===a.name);if(!l||!n){i=!l;break}}i?this.childViews.length===0?(r.view.componentProps.categories=[a],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=a.name,r.view.titleShort=a.name,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:a,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((p,l,n,k)=>{let T={categories:l.view.componentProps.categories,analysisType:l.view.componentProps.analysisType,isAssistZoneVisible:this.filters.isAssistZoneVisible,howManyGames:this.filters.howManyGamesSelected.value,title:l.view.title,isHomeTeamForAnalysis:l.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:l.view.isHomeTeam};return p&&(p.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[a],l.view.componentProps.analysisType=this.filters.selectedGamePhase.name,l.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,l.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,l.view.componentProps.isHomeTeamForAnalysis=!0,l.view.title=a.name,r.view.titleShort=a.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:a,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!p.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=p.categories,l.view.componentProps.analysisType=p.analysisType,l.view.componentProps.isHomeTeamForAnalysis=p.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=p.isAssistZoneVisible,l.view.componentProps.howManyGames=p.howManyGames,l.view.title=p.title,l.view.titleShort=p.titleShort,l.view.isHomeTeam=p.isHomeTeam,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:l.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}),n===k.length-1&&(r.view.componentProps.categories=T.categories,r.view.componentProps.analysisType=T.analysisType,r.view.componentProps.isHomeTeamForAnalysis=T.isHomeTeamForAnalysis,r.view.componentProps.isAssistZoneVisible=T.isAssistZoneVisible,r.view.componentProps.howManyGames=T.howManyGames,r.view.title=T.title,r.view.titleShort=T.titleShort,r.view.isHomeTeam=T.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:r.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),T},null):(r.view.componentProps.categories=[a],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=a.name,r.view.titleShort=a.name,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:a,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const h=$===1,u=h?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=h,r.view.isHomeTeam=h;for(let i=0;i<v.length;i++){const p=v[i];if(!u.find(l=>l.view.componentProps.categories[0].name===p.name)){r.view.componentProps.categories=[p],r.view.componentProps.analysisType=this.filters.selectedGamePhase.name,r.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,r.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,r.view.title=p.name,r.view.titleShort=p.name,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:p,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(r,a=!1){var v,$,h,u,i,p,l,n,k,T;if(r.view.filterAndViewsContainer=this,Sd.emit("component-added-to-container",this),this.viewId===5&&r.view.componentProps&&!a&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===15&&r.view.componentProps&&!a&&(r.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,r.view.filterMultiple={isHomeTeam:r.view.componentProps.preMatchType===1}),this.viewId===17&&r.view.componentProps&&!a){this.dynamicFilters[0]!==void 0&&(r.view.componentProps.infavoragainstteam=!this.dynamicFilters[0]),this.dynamicFilters[1]!==void 0&&(r.view.componentProps.lateralidad=this.dynamicFilters[1]===32?"right":"left");const x=this.dynamicFilters[2]!==void 0?this.dynamicFilters[2]:this.dynamicFilters[0]||1,d=r.view.componentProps.game;if(x===3){const o=this.childViews.filter(c=>{var s;return((s=c.view.filterMultiple)==null?void 0:s.isHomeTeam)===!0}).length===0;d&&(r.view.componentProps.teamselected=o?d.home_team:d.away_team),r.view.filterMultiple={isHomeTeam:o}}else d&&(r.view.componentProps.teamselected=x===2?d.away_team:d.home_team),r.view.filterMultiple={isHomeTeam:x===1}}if(this.viewId===10&&r.view.componentProps&&!a&&(r.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,r.isHomeTeam=r.view.componentProps.isHomeTeamForAnalysis,r.view.filterMultiple={isHomeTeam:r.view.componentProps.isHomeTeamForAnalysis},r.view.filtersJSON=this.filtresJSON),this.viewId===7&&r.view.componentProps&&!a){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d[0]===1?"offensive":"defensive",c=d[1]===1;r.view.componentProps.analysisType=o,r.view.componentProps.isHomeTeamForAnalysis=c,r.isHomeTeam=c,r.view.filterMultiple={isHomeTeam:c},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===1&&r.view.componentProps&&!a){const x=this.dynamicFilters[0]||[];if(x&&x.length>0){let d;if(Array.isArray(x)){const c=this.childViews.map(f=>{var g;return(g=f.view.componentProps)==null?void 0:g.type}).filter(f=>f!==void 0),s=x.filter(f=>!c.includes(f));s.length>0?d=s[0]:d=x[0]}else d=x;const o=R4.get(this.viewId);r.view.componentProps.type=d,r.view.componentProps.default=!1,r.view.title=`Comparativa ${o[d]}`,r.view.filterMultiple={category:d}}}if(this.viewId===9&&r.view.componentProps&&!a){const x=this.dynamicFilters[0].map(s=>s.join("-"));let d="";const o=this.dynamicFilters[1],c=R4.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(L=>{L.view.componentProps.isHomeTeamForAnalysis=!0,L.view.isHomeTeam=!0,L.view.filterMultiple&&(L.view.filterMultiple.isHomeTeam=!0)});let s=null;const f=this.getHomeTeamViews(),g=this.getAwayTeamViews();let S=!0;for(let L=0;L<x.length;L++){d=x[L],s=c.analysisTypes.get(x[L]);const E=f.find(V=>V.view.componentProps.analysisType===s.analysisType),P=g.find(V=>V.view.componentProps.analysisType===s.analysisType);if(!E||!P){S=!E;break}}S?this.childViews.length===0?(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!0,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))}):this.childViews.reduce((L,E,P,V)=>{let I={analysisType:E.view.componentProps.analysisType,title:E.view.title,isHomeTeamForAnalysis:E.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:E.view.isHomeTeam};return L&&(L.isHomeTeam&&!E.view.isHomeTeam?(E.view.componentProps.analysisType=s.analysisType,E.view.componentProps.isHomeTeamForAnalysis=!0,E.view.title=s.title,r.view.titleShort=s.titleShort,E.view.isHomeTeam=!0,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}):!L.isHomeTeam&&!E.view.isHomeTeam&&(E.view.componentProps.analysisType=L.analysisType,E.view.componentProps.isHomeTeamForAnalysis=L.isHomeTeamForAnalysis,E.view.title=L.title,E.view.titleShort=L.titleShort,E.view.isHomeTeam=L.isHomeTeam,E.view.filterMultiple={isHomeTeam:E.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))}),P===V.length-1&&(r.view.componentProps.analysisType=I.analysisType,r.view.componentProps.isHomeTeamForAnalysis=I.isHomeTeamForAnalysis,r.view.title=I.title,r.view.titleShort=I.titleShort,r.view.isHomeTeam=I.isHomeTeam,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(j=>parseInt(j))})),I},null):(r.view.componentProps.analysisType=s.analysisType,r.view.componentProps.isHomeTeamForAnalysis=!1,r.view.title=s.title,r.view.titleShort=s.titleShort,r.view.isHomeTeam=!1,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,categoryIds:d.split("-").map(L=>parseInt(L))})}else{const s=o===1,f=s?this.getHomeTeamViews():this.getAwayTeamViews();r.view.componentProps.isHomeTeamForAnalysis=s,r.view.isHomeTeam=s;for(let g=0;g<x.length;g++){const S=c.analysisTypes.get(x[g]);if(!f.find(L=>L.view.componentProps.analysisType===S.analysisType)){r.view.componentProps.analysisType=S.analysisType,r.view.title=S.title,r.view.titleShort=S.titleShort,r.view.filterMultiple={categoryIds:x[g].split("-").map(L=>parseInt(L)),isHomeTeam:r.view.isHomeTeam};break}}}}if(this.viewId===2&&!a&&r.view.componentProps){const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id),r.view.componentProps.game&&(r.view.componentProps.gameid=r.view.componentProps.game.id,r.view.componentProps.season=r.view.componentProps.game.season_id,r.view.componentProps.teamView=d[1]===2?r.view.componentProps.game.awayTeam.team_id:d[1]===1?r.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let c=null;if(Array.isArray(o)){if(o.length>0){const g=this.childViews.map(L=>{var E;const P=(E=L.view.componentProps)==null?void 0:E.categoryView;return P&&P.length>0?P[0].id:null}).filter(L=>L!==null),S=o.filter(L=>!g.includes(L));S.length>0&&(c=S[0])}}else{const g=o;g&&(this.childViews.find(S=>{var L;const E=(L=S.view.componentProps)==null?void 0:L.categoryView;return E&&E.length>0&&E[0].id===g})||(c=g))}let s=null;if(c)try{s=A4(c)}catch{}const f=d&&d.length>1?d[1]:1;r.view.filterMultiple={categoryId:c,teamType:f},r.view.componentProps.categoryView=s?[{id:c,name:s.name}]:c?[{id:c,name:`Category ${c}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&r.view.componentProps&&!a&&r.view.game&&(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),r.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,r.view.componentProps.game=(v=r.view)==null?void 0:v.game,r.view.componentProps.teamSelected={teamId:(h=($=r.view)==null?void 0:$.game)==null?void 0:h.home_team},r.view.componentProps.isDefault=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&r.view.componentProps&&!a&&(r.view.componentProps.isdefault=!0,r.view.componentProps.seasonid=2010,r.view.teamids=[1,2],r.view.componentProps.categoryids=[20,2],r.view.componentProps.teamsshow=[1,2],r.view.componentProps.analysistype=1,r.view.componentProps.gameid="",r.view.componentProps.teams=[],r.view.componentProps.game=""),this.viewId===15&&r.view.componentProps&&!a&&(r.view.componentProps.isdefault=!0,r.view.componentProps.view=1,r.view.numitems=3,r.view.typegame=1,r.view.componentProps.token=this.token,r.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===17&&r.view.componentProps&&!a&&(console.log("6666666666666666666666666666 ddddddddddddddd LLEGO AQUI MERO ESTE COMPOENNETE ES: ---->>>> ",r.view.componentProps),r.view.componentProps.forseason=!1,r.view.componentProps.forteam=!0,r.view.componentProps.tournamentselected={id:1},r.view.componentProps.forgame=!1,r.view.componentProps.filters={},r.view.componentProps.showBallGo=!0,r.view.componentProps.showHeatMap=!0,r.view.componentProps.ballOnOff=!1,r.view.componentProps.showdefault=!0),this.viewId===14&&r.view.componentProps&&!a&&(r.view.componentProps.isReports=!0,r.view.componentProps.isDefault=!0,r.view.componentProps.type=0,r.view.componentProps.typeView=1,r.view.componentProps.showVideos=!1,r.view.componentProps.currentSeason=2010,r.view.componentProps.localTeam=2,r.view.componentProps.awayTeam=1),this.viewId===6&&r.view.componentProps&&!a){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:[];if(o&&o.length>0){let c=0;for(const s of o)if(!this.childViews.find(f=>f.view.componentProps.gameNumber===s)){c=s;break}c&&(r.view.componentProps.gameNumber=c,r.view.filterMultiple={gameNumber:c})}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===3&&r.view.componentProps&&!a&&r.view.game){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const x=this.getComponentDynamicFilters(r.view.id),d=x||this.dynamicFilters;!x&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const o=d&&d.length>0?d[0]:!1;r.view.componentProps.desplegable=o,r.view.componentProps.key=o,r.view.componentProps.game=(u=r.view)==null?void 0:u.game,r.view.componentProps.defaultShields=!1,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:d})}if(this.viewId===4&&r.view.componentProps&&!a&&r.view.game){if(r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0),this.isPostMatch){r.view.componentProps.key=!1,r.view.componentProps.isDefault=!1,r.view.componentProps.token=this.token,r.view.componentProps.gameId=(p=(i=r.view)==null?void 0:i.game)==null?void 0:p.game_id,r.view.componentProps.homeTeam=(n=(l=r.view)==null?void 0:l.game)==null?void 0:n.home_team,r.view.componentProps.awayTeam=(T=(k=r.view)==null?void 0:k.game)==null?void 0:T.visiting_team;const o=this.getComponentDynamicFilters(r.view.id),c=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,r.view.id);const s=c&&c.length>0?c[0]:[],f=this.hasEventTypeId(s,1),g=this.hasCategoryId(s,8),S=this.hasCategoryId(s,9),L=this.hasEventTypeId(s,3);r.view.componentProps.goals=f,r.view.componentProps.yellowCards=g,r.view.componentProps.redCards=S,r.view.componentProps.substitutions=L}const x=this.getComponentDynamicFilters(r.view.id)||this.dynamicFilters,d=x&&x.length>0?x[0]:[];r.view.componentProps.selectedEvents=d,r.view.componentProps.key=d.length>0,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:x})}this.viewId===16&&this.addLastTouch(r),this.viewId===18&&this.addSpecificPlays(r),this.childViews.push(r),Sd.emit("view-added")}getHowManyViewsToAdd(r,a=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const v=r[0];return v===2||v===3?v:1}if(this.viewId===4)return r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0?1:0;if(this.viewId===9){const v=r[0],$=r[1];if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&a){const v=a.selectedCategories||[],$=a.selectedTeam.value;if($===1||$===2){const h=$===1?this.getHomeTeamViews():this.getAwayTeamViews();return v.length-h.length}else return v.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const v=r[0]||[],$=r[1]||1;if(!v||v.length===0)return 0;if(Array.isArray(v)){const h=this.childViews.map(u=>{var i;const p=(i=u.view.componentProps)==null?void 0:i.categoryView;return p&&p.length>0?p[0].id:null}).filter(u=>u!==null);return v.filter(u=>!h.includes(u)).length}else{const h=v;return this.childViews.find(u=>{var i,p;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,n=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return l&&l.length>0&&l[0].id===h&&n===$})?0:1}}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return 0;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length}else{const $=v;return this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})?0:1}}return 0}getRequiresAddView(r,a){if(console.log("getRequiresAddView - viewId:",this.viewId),console.log("filters:",a),this.viewId===5)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===17){const v=r[2]||1,$=r[2];return v===3||$===3?this.childViews.length<2:this.childViews.length===0}if(this.viewId===10)return r[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return r[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const v=r[0];return v?v.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const v=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;return this.childViews.length===0&&v}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(r);if(this.viewId===16&&a){const v=[a.selectedCategories,a.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(v,a.totalCategoriesSelected)}if(this.viewId===18&&a){console.log("getRequiresAddView - GSCShotMapAnalysis"),console.log("dynamicFilters:",r),console.log("filters:",a);const v=[a.howManyCorners,a.selectedTeam.value],$=this.getRequiresAddViewMultipleAndBothTeams(v,a.howManyCorners);return console.count("before aux18 return"),console.log("aux18:",$),$}if(this.viewId===1){const v=r[0]||[];if(!v||v.length===0)return!1;if(Array.isArray(v)){const $=this.childViews.map(h=>{var u;return(u=h.view.componentProps)==null?void 0:u.type}).filter(h=>h!==void 0);return v.filter(h=>!$.includes(h)).length>0}else{const $=v;return!this.childViews.find(h=>{var u;return((u=h.view.componentProps)==null?void 0:u.type)===$})}}if(this.viewId===2){const v=r[0]||[];if(Array.isArray(v)){if(v.length>0){const $=this.childViews.map(h=>{var u;const i=(u=h.view.componentProps)==null?void 0:u.categoryView;return i&&i.length>0?i[0].id:null}).filter(h=>h!==null);return v.filter(h=>!$.includes(h)).length>0}return!1}else{const $=v,h=r[1]||1;return $?!this.childViews.find(u=>{var i,p;const l=(i=u.view.componentProps)==null?void 0:i.categoryView,n=((p=u.view.filterMultiple)==null?void 0:p.teamType)||1;return l&&l.length>0&&l[0].id===$&&n===h}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(r,a=null){const v=this.childViews.filter(l=>l.view.isHomeTeam),$=this.childViews.filter(l=>!l.view.isHomeTeam),h=a||r[0].length,u=r[1],i=h*(u===1||u===2?1:2),p=u===3?v.length+$.length:v.length||$.length;return i>p}getRequiresLessViews(r){if(this.viewId===5)return r[0]!==3&&this.childViews.length>1;if(this.viewId===15)return r[0]!==3&&this.childViews.length>1;if(this.viewId===17)return r[0]!==3&&this.childViews.length>1;if(this.viewId===6){const a=r[0];return a===2||a===3}return this.viewId,!1}updateSummary({dynamicFilters:r}){const a=this.childViews[0],v=document.querySelector(`[gs-id="${a.view.id}"]`),$=a.grid;if(a&&v&&$){const h=r[0],u=`min_column${h?"_2":""}`,i=`min_row${h?"_2":""}`,p=`max_column${h?"_2":""}`,l=`max_row${h?"_2":""}`,n=`colspan${h?"_2":""}`,k=`rowspan${h?"_2":""}`,T=a.view.coreView[n],x=a.view.coreView[k],d=a.view.coreView[u],o=a.view.coreView[i],c=a.view.coreView[p],s=a.view.coreView[l];a.view.w=T,a.view.h=x,a.view.maxWidth=c,a.view.maxHeight=s,a.view.minWidth=d,a.view.minHeight=o,v.setAttribute("gs-w",T),v.setAttribute("gs-h",x),v.setAttribute("gs-max-w",c),v.setAttribute("gs-max-h",s),v.setAttribute("gs-min-w",d),v.setAttribute("gs-min-h",o),$.update(v,{h:x,w:T,"gs-max-h":s,"gs-max-w":c,"gs-min-h":o,"gs-min-w":d})}}updateFilters(r){this.filters=r,this.viewId===16?this.updateLastTouchFilters(r):this.viewId===18&&this.updateSpecificPlaysFilters(r)}updateDynamicFilters(r,a=null){var v,$;if(!this._isUpdating){this._isUpdating=!0,a?this.componentSpecificFilters.set(a,[...r]):this.dynamicFilters=r,Sd.emit("component-added-to-container",this);try{if(this.viewId===5){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType===1})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,l=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&l&&(i.removeWidget(l),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const n=this.childViews[0];n.view.componentProps&&(n.view.componentProps.preMatchType=h,n.view.filterMultiple={isHomeTeam:n.view.componentProps.preMatchType})}else this.childViews.forEach((u,i)=>{u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.preMatchType}})}if(this.viewId===15){const h=r[0]||1;if(a){const u=this.childViews.find(i=>i.view.id===a);u&&u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(h<3){if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const i=this.childViews.pop(),p=i.grid,l=i.page,n=document.querySelector(`[gs-id="${i.view.id}"]`);if(p&&n&&(p.removeWidget(n),l)){const k=l.items.findIndex(T=>T.id===i.view.id);k!==-1&&l.items.splice(k,1)}}const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.preMatchType=h,u.view.filterMultiple={isHomeTeam:h===1})}}else if(this.childViews.length===2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else if(this.childViews.length<2)this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})});else{for(;this.childViews.length>2;){const u=this.childViews.pop(),i=u.grid,p=u.page,l=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&l&&(i.removeWidget(l),p)){const n=p.items.findIndex(k=>k.id===u.view.id);n!==-1&&p.items.splice(n,1)}}this.childViews.forEach((u,i)=>{u.view.componentProps&&(u.view.componentProps.preMatchType=i+1,u.view.filterMultiple={isHomeTeam:i===0})})}}if(this.viewId===17){const h=r[0]||1,u=r[2],i=h===3||u===3;if(a){const p=this.childViews.find(l=>l.view.id===a);if(p&&p.view.componentProps&&(r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left"),r[2]!==void 0)){const l=r[2],n=p.view.componentProps.game;if(l===3){if(((v=p.view.filterMultiple)==null?void 0:v.isHomeTeam)!==void 0){const k=p.view.filterMultiple.isHomeTeam;n&&(p.view.componentProps.teamselected=(typeof k=="boolean"?k:k===1)?n.home_team:n.away_team)}}else n&&(p.view.componentProps.teamselected=l===2?n.away_team:n.home_team);p.view.filterMultiple={isHomeTeam:l===1||l===3&&(($=p.view.filterMultiple)==null?void 0:$.isHomeTeam)}}}else if(i)if(this.childViews.length===2)this.childViews.forEach((p,l)=>{p.view.componentProps&&(p.view.componentProps.teamselected=l+1,p.view.filterMultiple={isHomeTeam:l===0})});else if(this.childViews.length<2)this.childViews.forEach((p,l)=>{p.view.componentProps&&(p.view.componentProps.teamselected=l+1,p.view.filterMultiple={isHomeTeam:l===0})});else{for(;this.childViews.length>2;){const p=this.childViews.pop(),l=p.grid,n=p.page,k=document.querySelector(`[gs-id="${p.view.id}"]`);if(l&&k&&(l.removeWidget(k),n)){const T=n.items.findIndex(x=>x.id===p.view.id);T!==-1&&n.items.splice(T,1)}}this.childViews.forEach((p,l)=>{p.view.componentProps&&(p.view.componentProps.teamselected=l+1,p.view.filterMultiple={isHomeTeam:l===0})})}else if(this.childViews.length===1){const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const l=p.view.componentProps.game;if(r[2]!==void 0&&l){const n=r[2];p.view.componentProps.teamselected=n===2?l.away_team:l.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}else if(this.childViews.length>1){for(;this.childViews.length>1;){const l=this.childViews.pop(),n=l.grid,k=l.page,T=document.querySelector(`[gs-id="${l.view.id}"]`);if(n&&T&&(n.removeWidget(T),k)){const x=k.items.findIndex(d=>d.id===l.view.id);x!==-1&&k.items.splice(x,1)}}const p=this.childViews[0];if(p.view.componentProps){r[0]!==void 0&&(p.view.componentProps.infavoragainstteam=!r[0]),r[1]!==void 0&&(p.view.componentProps.lateralidad=r[1]===32?"right":"left");const l=p.view.componentProps.game;if(r[2]!==void 0&&l){const n=r[2];p.view.componentProps.teamselected=n===2?l.away_team:l.home_team}p.view.filterMultiple={isHomeTeam:h===1}}}}if(this.viewId===10){const h=r[0]||1;if(h<3)if(this.childViews.length===1){const u=this.childViews[0];u.view.componentProps&&(u.view.componentProps.isHomeTeamForAnalysis=h===1,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis})}else{const u=this.childViews.pop(),i=u.grid,p=u.page,l=document.querySelector(`[gs-id="${u.view.id}"]`);if(i&&l&&(i.removeWidget(l),p)){const k=p.items.findIndex(T=>T.id===u.view.id);k!==-1&&p.items.splice(k,1)}const n=this.childViews[0];n.view.componentProps&&(n.view.componentProps.isHomeTeamForAnalysis=h===1,n.view.filterMultiple={isHomeTeam:n.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.filterMultiple={isHomeTeam:u.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const h=r[1];if(h===3)this.childViews.forEach((u,i)=>{u.view.componentProps.isHomeTeamForAnalysis=i%2===0,u.view.isHomeTeam=i%2===0,u.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",u.view.filterMultiple={isHomeTeam:u.view.isHomeTeam}});else{const u=h===1;if(this.childViews.length>0){const i=this.childViews[0];i.view.componentProps.isHomeTeamForAnalysis=u,i.view.isHomeTeam=u,i.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",i.view.filterMultiple={isHomeTeam:u},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const h=r[0],u=r[1];if(u===3){if(this.childViews.length>h.length){const i=h.map(p=>{const l=p.join("-");return R4.get(this.viewId).analysisTypes.get(l).analysisType});this.childViews.reduce((p,l)=>(i.includes(l.view.componentProps.analysisType)||p.push(l.view.componentProps.analysisType),p),[]).forEach(p=>{const l=this.childViews.findIndex(n=>n.view.componentProps.analysisType===p);if(l!==-1){const n=this.childViews[l];this.removeChildView(n)}})}}else{const i=u===1,p=this.getHomeTeamViews(),l=this.getAwayTeamViews();if(i&&p.length===0)l.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=i,n.view.isHomeTeam=i,n.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(!i&&l.length===0)p.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=i,n.view.isHomeTeam=i,n.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}});else if(p.length===l.length)i||p.forEach(n=>{n.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}}),(i?l:p).forEach(n=>{this.removeChildView(n)});else{const n=i?this.getHomeTeamViews():this.getAwayTeamViews();if(n.length>h.length){const k=h.map(T=>{const x=T.join("-");return R4.get(this.viewId).analysisTypes.get(x).analysisType});n.forEach(T=>{k.includes(T.view.componentProps.analysisType)?T.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}:this.removeChildView(T)})}else n.forEach(k=>{k.view.filterMultiple={categoryIds:h[0],isHomeTeam:i}})}}}if(this.viewId===2){const h=r[0]||[];if(Array.isArray(h)){const u=this.childViews.map(i=>{var p,l;const n=(p=i.view.componentProps)==null?void 0:p.categoryView,k=((l=i.view.filterMultiple)==null?void 0:l.teamType)||1,T=n&&n.length>0?n[0].id:null;return T?{categoryId:T,teamType:k,viewId:i.view.id}:null}).filter(i=>i!==null);if(a){const i=this.childViews.find(p=>p.view.id===a);if(i){const p=r[1]||1,l=h[0];if(l){let n=null;try{n=A4(l)}catch{}i.view.filterMultiple={categoryId:l,teamType:p},i.view.componentProps.game&&(p===1?i.view.componentProps.teamView=i.view.componentProps.game.homeTeam.team_id:p===2?i.view.componentProps.teamView=i.view.componentProps.game.awayTeam.team_id:i.view.componentProps.teamView=0),i.view.componentProps.categoryView=n?[{id:l,name:n.name}]:[{id:l,name:`Category ${l}`}]}}}if(!a){const i=r[1]||1;this.childViews.forEach(p=>{var l;const n=(l=p.view.componentProps)==null?void 0:l.categoryView;if(n&&n.length>0){const k=n[0].id;h.includes(k)&&(p.view.filterMultiple={categoryId:k,teamType:i})}})}if(u.map(i=>i.categoryId).filter(i=>!h.includes(i)).forEach(i=>{this.childViews.filter(p=>{var l;const n=(l=p.view.componentProps)==null?void 0:l.categoryView;return n&&n.length>0&&n[0].id===i}).forEach(p=>{this.removeChildView(p),Sd.emit("component-removed",{viewId:p.view.id,categoryId:i})})}),a){const i=h[0];if(i){const p=this.childViews.find(l=>l.view.id===a);if(p){let l=null;try{l=A4(i)}catch{}const n=r[1]||1;p.view.filterMultiple={categoryId:i,teamType:n},p.view.componentProps.game&&(p.view.componentProps.teamView=n===2?p.view.componentProps.game.awayTeam.team_id:n===1?p.view.componentProps.game.homeTeam.team_id:0),p.view.componentProps.categoryView=l?[{id:i,name:l.name}]:[{id:i,name:`Category ${i}`}]}}}}else{const u=h;if(u&&a){const i=this.childViews.find(p=>p.view.id===a);if(i){let p=null;try{p=A4(u)}catch{}const l=r[1]||1;i.view.filterMultiple={categoryId:u,teamType:l},i.view.componentProps.game&&(i.view.componentProps.teamView=l===2?i.view.componentProps.game.awayTeam.team_id:l===1?i.view.componentProps.game.homeTeam.team_id:0),i.view.componentProps.categoryView=p?[{id:u,name:p.name}]:[{id:u,name:`Category ${u}`}]}}}}if(this.viewId===8){const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.areInactiveVisible=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}if(this.viewId===1){const h=r[0]||[];if(a){this.setDynamicFilters(r,a);const u=this.childViews.find(i=>i.view.id===a);u&&this.updateComparative(u,r)}else if(this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.type)||u.push(i.view.componentProps.type),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.type===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const l=this.childViews[p+1],n=this.childViews[p];l&&(n.view.componentProps.type=l.view.componentProps.type,n.view.title=l.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(h))this.childViews.length>0&&h.length>0&&this.childViews.forEach((u,i)=>{if(u.view.componentProps&&i<h.length){const p=h[i],l=R4.get(this.viewId);u.view.componentProps.type=p,u.view.componentProps.default=!1,u.view.title=`Comparativa ${l[p]}`,u.view.filterMultiple={category:p}}});else{const u=h;if(u&&this.childViews.length>0){const i=this.childViews[0];if(i.view.componentProps){const p=R4.get(this.viewId);i.view.componentProps.type=u,i.view.componentProps.default=!1,i.view.title=`Comparativa ${p[u]}`,i.view.filterMultiple={category:u}}}}}if(this.viewId===6){const h=r[0]||[];if(a){this.setDynamicFilters(r,a);const u=this.childViews.find(i=>i.view.id===a);u&&this.updateGSCLineupsReports(u,r)}else{if(Array.isArray(h))if(h.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((u,i)=>(h.includes(i.view.componentProps.gameNumber)||u.push(i.view.componentProps.gameNumber),u),[]).forEach(u=>{const i=this.childViews.findIndex(p=>p.view.componentProps.gameNumber===u);if(i!==-1){for(let p=i;p<this.childViews.length;p++){const l=this.childViews[p+1],n=this.childViews[p];l&&(n.view.componentProps.gameNumber=l.view.componentProps.gameNumber,n.view.filterMultiple={gameNumber:l.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}}if(this.viewId===3){if(a){this.setDynamicFilters(r,a);const h=this.childViews.find(u=>u.view.id===a);h&&this.updateMatchSummary(h,r)}else{const h=r[0]||!1;this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.desplegable=h,u.view.componentProps.key=h,Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}this.updateSummary({dynamicFilters:r})}if(this.viewId===13){const h=r[1]||[];if(a){this.setDynamicFilters(r,a);const u=this.childViews.find(i=>i.view.id===a);u&&(u.view.componentProps&&(u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now()),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))}else this.childViews.forEach(u=>{u.view.componentProps&&(u.view.componentProps._isReactive||(u.view.componentProps=t.reactive(u.view.componentProps),u.view.componentProps._isReactive=!0),u.view.componentProps.categoryids=h,u.view.componentProps.analysistype=r[0]||1,u.view.componentProps.teamsshow=r[2]==1?[1]:r[2]==2?[2]:[1,2],u.view.dynamicFilters=r,u.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:u.view.id,componentProps:u.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:u.view.id,dynamicFilters:r}))})}else if(this.viewId===15){const h=r[0]||1,u=r[3]!==void 0?r[3]:typeof r[1]=="number"?r[1]:null;if(a){this.setDynamicFilters(r,a);const i=this.childViews.find(p=>p.view.id===a);i&&i.view.componentProps&&(i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))}else this.childViews.forEach(i=>{i.view.componentProps&&(i.view.componentProps._isReactive||(i.view.componentProps=t.reactive(i.view.componentProps),i.view.componentProps._isReactive=!0),i.view.componentProps.analysistype=h,u!==null&&(i.view.componentProps.numitems=u),i.view.dynamicFilters=r,i.view._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:i.view.id,componentProps:i.view.componentProps,dynamicFilters:r}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:i.view.id,dynamicFilters:r}))})}if(this.viewId===4){const h=r&&r.length>0&&Array.isArray(r[0])&&r[0].length>0;if(a){const u=this.childViews.find(i=>i.view.id===a);u&&u.view.componentProps.selectedEvents}else if(!h&&this.childViews.length>0)this.childViews.forEach(u=>{this.removeChildView(u)});else if(h&&this.childViews.length===0){const u={pageId:null,view:{id:this.viewId,name:"Timeline",title:"Timeline",colspan:12,rowspan:6,max_column:12,max_row:12,min_column:6,min_row:4},filterAndWidgetContainer:this};Sd.emit("add-view",u)}else this.childViews.forEach(u=>{this.updateTimeline(u,r)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(r=>{this.removeChildView(r)})}removeChildView(r,a=!1){const v=this.childViews.findIndex($=>$.view.id===r.view.id);if(v!==-1){const $=this.childViews[v];this.childViews.splice(v,1),$.view.id&&this.componentSpecificFilters.delete($.view.id);const h=$.grid,u=$.page,i=document.querySelector(`[gs-id="${$.view.id}"]`);if(h&&i&&(h.removeWidget(i),u&&!a)){const p=u.items.findIndex(l=>l.id===$.view.id);p!==-1&&(u.items.splice(p,1),u.items.length===0&&Sd.emit("empty-page",u))}}}updateView({view:r,dynamicFilters:a,filtersJSON:v,filters:$}){this.setFiltersJSON(v),this.dynamicFilters=a;const h=this.childViews.find(u=>{var i;return((i=u.view)==null?void 0:i.id)===r.view.id});if(h){h.view.filtersJSON=v,h.view.coreView&&(h.view.coreView.filtersJSON=v);let u=a;if(this.viewId===4){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===8){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===3){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i),this.updateSummary({dynamicFilters:u})}else if(this.viewId===1){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===6){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===7){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}else if(this.viewId===9){const i=this.getComponentDynamicFilters(r.view.id);i&&(u=i)}this.viewId===5?this.updateVolumetricField(h,u):this.viewId===7?this.updateGoalData(h,u):this.viewId===9?this.updateFieldDataByZones(h,a):this.viewId===10?this.updateXg(h,u):this.viewId===3?this.updateMatchSummary(h,u):this.viewId===4?this.updateTimeline(h,u):this.viewId===8?this.updateFieldPosesion(h,u):this.viewId===1?this.updateComparative(h,u):this.viewId===2?this.updateGSCtops(h,u):this.viewId===6?this.updateGSCLineupsReports(h,u):this.viewId===16?this.updateLastTouchSingle(h,$):this.viewId===18&&this.updateSpecificPlaysFiltersSingle(h,$)}}updateComparative(r,a){if(r.view.componentProps){const v=a[0]||[];if(v&&v.length>0){let $;if(Array.isArray(v)){const u=this.childViews.findIndex(i=>i.view.id===r.view.id);u>=0&&u<v.length?$=v[u]:$=v[0]}else $=v;const h=R4.get(this.viewId);r.view.componentProps.type=$,r.view.componentProps.default=!1,r.view.title=`Comparativa ${h[$]}`,r.view.filterMultiple={category:$}}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a})}}updateVolumetricField(r,a){if(r.view.componentProps){const v=a[0]||1;r.view.isHomeTeam=v===1,r.view.componentProps.preMatchType=v,r.view.filterMultiple={isHomeTeam:v},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateGoalData(r,a){if(r.view.componentProps){const v=a[0]===1?"offensive":"defensive",$=a[1]===1;r.view.componentProps.analysisType=v,r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={isHomeTeam:$},Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldDataByZones(r,a){if(r.view.componentProps){const v=a[0],$=a[1]===1;if(r.view.componentProps.isHomeTeamForAnalysis=$,r.view.isHomeTeam=$,r.view.filterMultiple={categoryIds:v,isHomeTeam:$},v&&v.length){const h=v.join("-"),u=R4.get(this.viewId).analysisTypes.get(h);u&&(r.view.componentProps.analysisType=u.analysisType,r.view.title=u.title,r.view.titleShort=u.titleShort)}}}updateXg(r,a){const v=a[0]===1;r.view.componentProps&&(r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.filtersJSON=this.filtresJSON,r.view.filterMultiple={isHomeTeam:v})}updateMatchSummary(r,a){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=a&&a.length>0?a[0]:!1;r.view.componentProps.desplegable=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a})}}updateTimeline(r,a){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=this.getComponentDynamicFilters(r.view.id)||a,$=v&&v.length>0?v[0]:[];r.view.componentProps.selectedEvents=$,r.view.componentProps.key=$.length>0;const h=this.hasEventTypeId($,1),u=this.hasCategoryId($,8),i=this.hasCategoryId($,9),p=this.hasEventTypeId($,3);r.view.componentProps.goals=h,r.view.componentProps.yellowCards=u,r.view.componentProps.redCards=i,r.view.componentProps.substitutions=p,r.view.componentProps._updateKey=Date.now(),Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:v}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:v}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}updateFieldPosesion(r,a){if(r.view.componentProps){r.view.componentProps._isReactive||(r.view.componentProps=t.reactive(r.view.componentProps),r.view.componentProps._isReactive=!0);const v=a&&a.length>0?a[0]:!1;r.view.componentProps.areInactiveVisible=v,r.view.componentProps.key=v,Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a})}}updateGSCtops(r,a){if(r.view.componentProps){const v=a[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=a[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}else{const $=v;if($){let h=null;try{h=A4($)}catch(i){console.warn("Error getting category by ID:",i)}const u=a[1]||1;r.view.filterMultiple={categoryId:$,teamType:u},r.view.componentProps.game&&(u===1?r.view.componentProps.teamView=r.view.componentProps.game.homeTeam.team_id:u===2?r.view.componentProps.teamView=r.view.componentProps.game.awayTeam.team_id:r.view.componentProps.teamView=0),r.view.componentProps.categoryView=h?[{id:$,name:h.name}]:[{id:$,name:`Category ${$}`}]}}}}updateGSCLineupsReports(r,a){if(r.view.componentProps){const v=a[0]||[];if(Array.isArray(v)){if(v.length>0){const $=v[0];r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$}}else{const $=v;$&&(r.view.filterMultiple={gameNumber:$},r.view.componentProps.gameNumber=$)}Sd.emit("component-props-updated",{viewId:r.view.id,componentProps:r.view.componentProps,dynamicFilters:a}),Sd.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:r.view.id,dynamicFilters:a}),Sd.emit("force-component-update",{itemId:r.view.id,componentProps:r.view.componentProps})}}getCategoryIdFromAnalysisType(r,a){if(!r||!a)return null;for(const v of a){const $=v.join("-"),h=R4.get(this.viewId);if(h&&h.analysisTypes){const u=h.analysisTypes.get($);if(u&&u.analysisType===r)return v[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach($=>{$.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,$.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,$.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,$.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const r=this.filters.selectedCategories.map($=>$.value),a=r.map($=>$.name),v=this.filters.selectedTeam.value;if(v===3)this.childViews.length>r&&this.childViews.reduce(($,h)=>(a.includes(h.view.componentProps.categories[0].name)||$.push(h.view.componentProps.categories[0].name),$),[]).forEach($=>{const h=this.childViews.findIndex(u=>u.view.componentProps.categories[0].name===$);if(h!==-1){const u=this.childViews[h];this.removeChildView(u)}});else{const $=v===1,h=this.getHomeTeamViews(),u=this.getAwayTeamViews();if($&&h.length===0)u.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(!$&&u.length===0)h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$});else if(h.length===u.length)$||h.forEach(i=>{i.view.componentProps.isHomeTeamForAnalysis=$,i.view.isHomeTeam=$,i.view.filterMultiple.isHomeTeam=$}),($?u:h).forEach(i=>{this.removeChildView(i)});else{const i=$?this.getHomeTeamViews():this.getAwayTeamViews();if(i.length>r.length){const p=r.map(l=>l.name);i.forEach(l=>{p.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=$:this.removeChildView(l)})}else i.forEach(p=>{p.view.filterMultiple.isHomeTeam=$})}}}updateLastTouchSingle(r,a){if(r.view.componentProps){const v=a.selectedTeam.value===1,$=a.selectedCategory.value;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.categories=[$],r.view.componentProps.analysisType=a.selectedGamePhase.name,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.isAssistZoneVisible=a.isAssistZoneVisible,r.view.componentProps.howManyGames=a.howManyGamesSelected.value,r.view.title=$.name,r.view.titleShort=$.name,r.view.isHomeTeam=v,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,selectedCategory:$,selectedGamePhase:a.selectedGamePhase,howManyGamesSelected:a.howManyGamesSelected,isAssistZoneVisible:a.isAssistZoneVisible}}}updateSpecificPlaysFilters(){if(console.log("updateSpecificPlaysFilters called"),!this.filters){console.warn("No filters available in updateCornershFilters");return}this.childViews.forEach(a=>{a.view.componentProps.advancedFilters=this.filters.advancedFilters,a.view.componentProps.howManyCorners=this.filters.howManyCorners,a.view.componentProps.isAgainstMode=this.filters.isAgainstMode,a.view.filterMultiple.advancedFilters=this.filters.advancedFilters,a.view.filterMultiple.isAgainstMode=this.filters.isAgainstMode});const r=this.filters.selectedTeam.value;if(r===3){const a=this.getHomeTeamViews(),v=this.getAwayTeamViews();if(a.length+v.length>this.filters.howManyCorners*2){const $=[];a.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),v.forEach((h,u)=>{u>=this.filters.howManyCorners&&$.push(h)}),$.forEach(h=>{this.removeChildView(h)})}}else{const a=r===1,v=this.getHomeTeamViews(),$=this.getAwayTeamViews();if(a&&v.length===0)$.forEach(h=>{console.log("awayView before update:",h),h.view.componentProps.isHomeTeamForAnalysis=a,h.view.isHomeTeam=a,h.view.filterMultiple.isHomeTeam=a});else if(!a&&$.length===0)v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=a,h.view.isHomeTeam=a,h.view.filterMultiple.isHomeTeam=a});else if(v.length===$.length)a||v.forEach(h=>{h.view.componentProps.isHomeTeamForAnalysis=a,h.view.isHomeTeam=a,h.view.filterMultiple.isHomeTeam=a}),(a?$:v).forEach(h=>{this.removeChildView(h)});else{const h=a?this.getHomeTeamViews():this.getAwayTeamViews();h.length>this.filters.howManyCorners?h.forEach((u,i)=>{i>=this.filters.howManyCorners?this.removeChildView(u):u.view.filterMultiple.isHomeTeam=a}):h.forEach(u=>{u.view.filterMultiple.isHomeTeam=a})}}}updateSpecificPlaysFiltersSingle(r,a){if(console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),console.log("view:",r),console.log("filter:",a),console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"),a.selectedTeam&&r.view.componentProps){const v=a.selectedTeam.value===1;r.view.isHomeTeam=v,r.view.componentProps.isHomeTeamForAnalysis=v,r.view.componentProps.isHomeTeamForAnalysis=!0,r.view.componentProps.advancedFilters=a.advancedFilters,r.view.componentProps.isAgainstMode=a.isAgainstMode,r.view.filterMultiple={isHomeTeam:r.view.isHomeTeam,advancedFilters:a.advancedFilters,isAgainstMode:a.isAgainstMode}}}}const sHe={class:"template-page__header"},lHe={class:"template-page__header__name"},cHe=["value"],uHe={class:"template-page__header__details"},dHe={class:"template-page__header__details__teams"},pHe={class:"template-page__header__details__teams__team"},hHe={key:0,class:"template-page__header__details__teams__team__logo"},fHe=["src"],mHe={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yHe={class:"template-page__header__details__teams__team"},gHe={key:0,class:"template-page__header__details__teams__team__logo"},vHe=["src"],bHe={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xHe={class:"template-page__content"},_He=["id"],wHe=["gs-id","gs-x","gs-y","gs-w","gs-h","gs-max-w","gs-max-h","gs-min-w","gs-min-h","gs-no-resize","gs-no-move","gs-auto-position"],THe=t.defineComponent({__name:"TemplateReportPage",props:{token:{type:String,default:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MCwibmFtZSI6IlVzdWFyaW8gRnJlZSIsInVzZXJuYW1lIjoiZnJlZUBnb2xzdGF0cy5jb20iLCJlbWFpbCI6ImZyZWVAZ29sc3RhdHMuY29tIiwiaWF0IjoxNjA2NzU4Nzk1LCJleHAiOjE2MzgyOTQ3OTV9.kPNmP7yDtk38cAXrUyc7OHRh6J25VFqy-XUNzbK-4YE"},game:{type:Object,default:()=>null},lastGames:{type:Array,default:()=>null},id:{type:[String,Number],default:()=>String(Date.now())},page:{type:Object,default:()=>({title:"Page 1",items:[{name:"Tabla jugadores",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]})},isPostMatch:{type:Boolean,default:!1},isTemplateMode:{type:Boolean,default:!1},isFilterVisible:{type:Boolean,default:!1}},emits:["intersection-changed","delete-page","change-sort","edit-view","view-changed","component-props-updated","delete-view","dynamic-filters-changed"],setup(e,{emit:r}){var a,v,$,h,u,i,p;const l=t.ref(null);let n=null;const k=e,T=t.ref(!1),x=r,d=t.computed(()=>k.page.items.reduce((je,_e)=>(je.set(_e.id,_e),je),new Map)),o=t.computed(()=>{var je,_e,Ue,qe;return k.game&&k.game.homeTeam&&k.game.awayTeam?{homeTeam:{name:((je=k.game.homeTeam)==null?void 0:je.acronym)||"LOC",logo:((_e=k.game.homeTeam)==null?void 0:_e.logo)||null},awayTeam:{name:((Ue=k.game.awayTeam)==null?void 0:Ue.acronym)||"VIS",logo:((qe=k.game.awayTeam)==null?void 0:qe.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let c=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const je={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(qe=>{qe.forEach(Re=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{x("intersection-changed",Re.isIntersecting)},50)})},je);const _e=l.value;_e&&c.observe(_e);const Ue=document.querySelector(".container-main");Ue&&Ue.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}function I(je){k.page.title=je.target.value,x("view-changed")}const j={game_id:0,season_id:0,prematch:!1},F={gameId:90209,id:90209,seasonId:1909,regularSeasonId:1909,matchday_name:"Matchday 1",status:1,score:[1,3],game_status:1,dateTimeUTC:"2024-09-05T22:00:00Z",homeTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/2936.png",team_id:2936,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/2936.png",colloquial_name:"Guyana",acronym:"GUY",team_name:"Guyana"},awayTeam:{logo:"https://golstatsimages.blob.core.windows.net/teams-80/3279.png",team_id:3279,provisional_logo:"https://golstatsimages.blob.core.windows.net/teams-provisional/3279.png",colloquial_name:"Surinam",acronym:"SUR",team_name:"Surinam"},is_live:0,minutes:{home_goals_minutes:[],visiting_goals_minutes:[],home_yellow_cards_minutes:[],away_yellow_cards_minutes:[],home_red_cards_minutes:[],away_red_cards_minutes:[]}},W=new Map([[5,{component:jI,componentName:"GSCVolumetricField",props:{isGamePreMatch:!k.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:k.isTemplateMode,isTemplateMode:k.isTemplateMode,preMatchType:1}}],[2,{component:zj,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:k.game?k.game.id:F.gameId,game:k.game,season:k.game?(a=k==null?void 0:k.game)==null?void 0:a.season_id:F.seasonId,teamView:0,useDummyData:k.isTemplateMode}}],[8,{component:PW,componentName:"FieldPosesion",props:{widthSection:600,game:F,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:FK,componentName:"GSCLineupsReports",props:{selectedOption:k.isPostMatch?"Postmatch":"Prematch",game:j,gamehome:j,gameaway:j}}],[3,{component:UW,componentName:"GSCMatchSummary",props:{game:F,defaultShields:!0,desplegable:!1}}],[4,{component:_D,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:F.gameId,homeTeam:F.homeTeam.team_id,awayTeam:F.awayTeam.team_id,token:k.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:LB,componentName:"GSCGoalData",props:{game:k.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!k.isPostMatch,analysisType:1}}],[9,{component:IK,componentName:"GSCFieldDataByZones",props:{game:k.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!k.isPostMatch,negative:!0}}],[10,{component:nP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[13,{component:HF,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:k.game?(v=k==null?void 0:k.game)==null?void 0:v.season_id:0,teamsIds:[8,13],categoryIds:[20,2],analysisType:1,teamsshow:[1],gameId:90401,teams:[{id:8,name:"MAZ",logo:"https://golstatsimages.blob.core.windows.net/teams-80/8.png"},{id:13,name:"SNL",logo:"https://golstatsimages.blob.core.windows.net/teams-80/13.png"}]}}],[14,{component:lF,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:LX,componentName:"GSCStrengths",props:{token:k.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[17,{component:FG,componentName:"GSCCornersGeneralTrend",props:{game:k.game?{id:k.game.id||k.game.game_id||k.game.gameId||null,home_team:k.game.home_team||null,away_team:k.game.visiting_team||null,season:k.game.seasonId||k.game.season_id||null,game_status:k.game.game_status||k.game.status||null,home_acronym:k.game.home_team_acronym||(($=k.game.homeTeam)==null?void 0:$.acronym)||null,away_acronym:k.game.visiting_team_acronym||((h=k.game.awayTeam)==null?void 0:h.acronym)||null,logo_home:((u=k.game.homeTeam)==null?void 0:u.logo)||null,logo_away:((i=k.game.awayTeam)==null?void 0:i.logo)||null}:null,infavoragainstteam:!0,forseason:!1,forteam:!0,showdefault:!0,tournamentselected:{id:1},forgame:!1,lateralidad:"right",teamselected:2,filters:{},showBallGo:!0,showHeatMap:!0,ballOnOff:!1}}],[10,{component:nP,componentName:"GSCGameXg",props:{game:k.game,isHomeTeamForAnalysis:!0,isPostMatch:k.isPostMatch}}],[1,{component:TB,componentName:"GSCComparativeReports",props:{gameId:k.game?k.game.id:"",homeLogo:k.game?k.game.homeTeam.logo:"",awayLogo:k.game?k.game.awayTeam.logo:"",seasonId:k.game?(p=k==null?void 0:k.game)==null?void 0:p.season_id:0,typeGame:k.isPostMatch,type:"stoppedBall",default:k.isTemplateMode}}],[16,{component:VX,componentName:"GSCLastTouch",props:{categories:[{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}],gameIdsForAnalysis:[],isAssistZoneVisible:!1,seasonId:2010,analysisType:"offensive",teamIdForAnalysis:17,gameDataUTC:"2025-11-08T03:00:00Z",isHomeTeamForAnalysis:!0,isTemplateMode:k.isTemplateMode,isPreMatch:!k.isPostMatch}}],[18,{component:zZ,componentName:"GSCSpecificPlays",props:{isHomeTeamForAnalysis:!0,isTemplateMode:k.isTemplateMode,isPreMatch:!k.isPostMatch,seasonIdForAnalysis:1325,selectedCategory:31,teamIdForAnalysis:1,isAgainstMode:!1,game:{id:62323,home_team:1,away_team:14,season:1325,game_status:4,home_acronym:"CHI",away_acronym:"SAN",logo_home:"https://golstatsimages.blob.core.windows.net/teams-80/1.png",logo_away:"https://golstatsimages.blob.core.windows.net/teams-80/14.png"},advancedFilters:{areConnectionsVisible:!1,arePathsVisible:!1,secondsBefore:-1,secondsAfter:1,secondsBeforeAndAfter:0}}}]]);function U(je){var _e,Ue,qe;if(((_e=je==null?void 0:je.coreView)==null?void 0:_e.id)===17&&je.dynamicFilters&&je.dynamicFilters[2]!==void 0){const Re=je.dynamicFilters[2];if(Re===1)return!0;if(Re===2)return!1;if(Re===3&&((Ue=je.filterMultiple)==null?void 0:Ue.isHomeTeam)!==void 0)return typeof je.filterMultiple.isHomeTeam=="boolean"?je.filterMultiple.isHomeTeam:je.filterMultiple.isHomeTeam===1}return(qe=je.componentProps)!=null&&qe.preMatchType?je.componentProps.preMatchType===1:je.isHomeTeam}function z(je){if(je)if(typeof je=="string"){let _e=null;switch(je){case"GSCVolumetricField":_e=jI;break;case"GSCGoalData":_e=LB;break;case"GscTopPlayer":_e=zj;break;case"FieldPosesion":_e=PW;break;case"GSCLineupsReports":_e=FK;break;case"GSCMatchSummary":_e=UW;break;case"GSCTimelineReports":_e=_D;break;case"GSCFieldDataByZones":_e=IK;break;case"GSCGeneraltable":_e=lF;break;case"GSCTimelapseTable":_e=HF;break;case"GSCGameXg":_e=nP;break;case"GSCComparativeReports":_e=TB;break;case"GSCStrengths":_e=LX;break;case"GSCCornersGeneralTrend":_e=FG;break;case"GSCLastTouch":_e=VX;break;case"GSCSpecificPlays":_e=zZ;break;default:_e=null}return _e}else return je;return null}function X({pageId:je,view:_e,filterAndWidgetContainer:Ue,applyMinimumSize:qe=!1,dynamicFilters:Re=[],filters:De=null}){if(k.page.id===je&&n){let Qe=!1;_e.id===3&&(Qe=Re[0]);const rt=`min_column${Qe?"_2":""}`,dt=`min_row${Qe?"_2":""}`,ct=`colspan${Qe?"_2":""}`,Ye=`rowspan${Qe?"_2":""}`,st={w:qe?_e[rt]:_e[ct],h:qe?_e[dt]:_e[Ye]};if(n.willItFit(0,0,st.w,st.h,!0)){const lt=n.addWidget(st),Ot=Number(lt.getAttribute("gs-x")||0),Mt=Number(lt.getAttribute("gs-y")||0);n.removeWidget(lt);const Et=W.get(_e.id),qt=t.reactive({...JSON.parse(JSON.stringify(Et.props))||{},_isReactive:!0}),Gt=t.reactive({pageId:je,grid:n,page:k.page,view:{name:_e.name,title:_e.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:Ot,y:Mt,w:st.w,h:st.h,maxWidth:_e.max_column,maxHeight:_e.max_row,minWidth:_e.min_column,minHeight:_e.min_row,componentName:Et.componentName,componentProps:qt,pageId:je,coreView:_e}});Ue.addView(Gt),Sd.emit("add-page-view",Gt)}else Sd.emit("add-page-and-view",{pageId:je,view:_e,filterAndWidgetContainer:Ue})}}function N(je){if(n){const _e=document.querySelector(`[gs-id="${je.id}"]`);_e&&(n.removeWidget(_e),x("delete-view",je))}}function Y(je){if(!je.filterAndViewsContainer&&je.coreView){const _e=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[je],je.coreView.id,je.dynamicFilters||[],k.isPostMatch,k.isTemplateMode,je.filtersJSON,null,je.filters);je.filterAndViewsContainer=_e}x("edit-view",je)}function se(){x("delete-page",k.page)}function me(){Sd.emit("change-sort",k.page)}function ge(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.itemId||Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function be(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps),_e._updateKey=Date.now())}function xe(je){if(f)return;const _e=k.page.items.find(Ue=>Ue.id===je.viewId);_e&&(Object.assign(_e.componentProps,je.componentProps||{}),_e._updateKey=Date.now())}const Ae=function(){Sd.off("add-view",X),Sd.off("force-component-update",ge),Sd.off("component-props-updated",be),Sd.off("dynamic-filters-changed",xe);const je=document.querySelector(".container-main");je&&je.removeEventListener("scroll",P),s&&clearTimeout(s),g&&clearTimeout(g)};return Sd.on("add-view",X),Sd.on("force-component-update",ge),Sd.on("component-props-updated",be),Sd.on("dynamic-filters-changed",xe),t.onMounted(async()=>{await t.nextTick(),n=Rh.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${k.id}`),n.on("change",(je,_e)=>{const Ue=_e[0];if(Ue){const qe=d.value.get(Ue.id);qe&&(qe.x=Ue.x,qe.y=Ue.y,qe.w=Ue.w,qe.h=Ue.h,x("view-changed"))}}),V(),k.page.grid=n,k.page.offListeners=Ae}),t.onUnmounted(()=>{c&&c.disconnect(),Ae(),s&&clearTimeout(s),g&&clearTimeout(g),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E)}),(je,_e)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"templatePage",ref:l,class:"template-page"},[t.createElementVNode("div",sHe,[T.value?(t.openBlock(),t.createBlock(MZ,{key:0,"options-type":"page",onClick:_e[0]||(_e[0]=t.withModifiers(Ue=>T.value=!1,["self"])),onMouseleave:_e[1]||(_e[1]=Ue=>T.value=!1),onCloseTooltip:_e[2]||(_e[2]=Ue=>T.value=!1),onDeletePage:se,onChangeSort:me})):t.createCommentVNode("",!0),t.createElementVNode("div",lHe,[_e[4]||(_e[4]=t.createElementVNode("div",null,[t.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M11.2986 12.9994C7.62909 14.8341 4.11744 16.0178 1.35547 16.4518L9.18763 20.0029C9.34545 20.0818 9.60192 20.0818 9.74002 20.0029L17.8878 16.3137C18.0457 16.2348 18.164 16.0572 18.164 15.8797V8.75781C16.2898 10.2177 13.9422 11.6776 11.2986 12.9994Z",fill:"white"}),t.createElementVNode("path",{d:"M4.7152 8.89735C4.7152 8.89735 10.9494 3.76802 16.8482 1.20335C15.0529 0.946887 11.3637 0.43395 9.3711 0.453678C4.41928 0.493135 1.06546 1.34145 1.06546 1.34145C0.90763 1.3809 0.769531 1.55846 0.769531 1.71629V8.12795C3.01857 6.56942 5.34651 5.56329 5.34651 5.56329C5.34651 5.56329 2.72264 7.06263 0.769531 8.81844V9.41028V14.1648C3.09748 13.9675 6.62886 12.7641 10.3575 10.7321C13.6719 8.91707 16.4733 6.84562 18.17 5.05035V2.40677C14.3032 3.37346 4.7152 8.89735 4.7152 8.89735Z",fill:"white"})])],-1)),_e[5]||(_e[5]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:I},null,40,cHe)]),t.createElementVNode("div",uHe,[t.createElementVNode("div",dHe,[t.createElementVNode("div",pHe,[o.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",hHe,[t.createElementVNode("img",{src:o.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,fHe)])):(t.openBlock(),t.createElementBlock("svg",mHe,[..._e[6]||(_e[6]=[t.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])])),t.createElementVNode("span",null,t.toDisplayString(o.value.homeTeam.name),1)]),_e[8]||(_e[8]=t.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),t.createElementVNode("div",yHe,[t.createElementVNode("span",null,t.toDisplayString(o.value.awayTeam.name),1),o.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",gHe,[t.createElementVNode("img",{src:o.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,vHe)])):(t.openBlock(),t.createElementBlock("svg",bHe,[..._e[7]||(_e[7]=[t.createElementVNode("path",{opacity:"0.4",d:"M12.0153 0.261719C12.0153 0.261719 13.6664 1.94994 17.7355 2.06744C21.149 2.16638 22.3796 1.30063 22.3796 1.30063C22.3796 1.30063 25.4902 10.2488 20.3822 17.7005C17.6983 21.615 12.5533 24.1504 12.0091 24.2617C11.4711 24.1504 6.31984 21.615 3.636 17.7005C-1.4596 10.2488 1.65094 1.30063 1.65094 1.30063C1.65094 1.30063 2.88155 2.16638 6.2951 2.06744C10.3642 1.94994 12.0153 0.261719 12.0153 0.261719Z",fill:"#54728B"},null,-1)])]))])]),e.isTemplateMode&&!e.isFilterVisible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:_e[3]||(_e[3]=Ue=>T.value=!0)},[..._e[9]||(_e[9]=[t.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M3.56953 6.28672C3.56953 7.19972 2.83253 7.93672 1.91953 7.93672C1.00653 7.93672 0.269531 7.19972 0.269531 6.28672C0.269531 5.37372 1.00653 4.63672 1.91953 4.63672C2.83253 4.63672 3.56953 5.37372 3.56953 6.28672ZM8.51953 4.63672C7.60653 4.63672 6.86953 5.37372 6.86953 6.28672C6.86953 7.19972 7.60653 7.93672 8.51953 7.93672C9.43253 7.93672 10.1695 7.19972 10.1695 6.28672C10.1695 5.37372 9.43253 4.63672 8.51953 4.63672ZM15.1195 4.63672C14.2065 4.63672 13.4695 5.37372 13.4695 6.28672C13.4695 7.19972 14.2065 7.93672 15.1195 7.93672C16.0325 7.93672 16.7695 7.19972 16.7695 6.28672C16.7695 5.37372 16.0325 4.63672 15.1195 4.63672Z",fill:"white"})],-1)])])):t.createCommentVNode("",!0)])]),t.createElementVNode("div",xHe,[t.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.page.items,Ue=>{var qe;return t.openBlock(),t.createElementBlock("div",{class:"grid-stack-item",key:Ue.key,"gs-id":Ue.id,"gs-x":Ue.x,"gs-y":Ue.y,"gs-w":Ue.w,"gs-h":Ue.h,"gs-max-w":Ue.maxWidth,"gs-max-h":Ue.maxHeight,"gs-min-w":Ue.minWidth,"gs-min-h":Ue.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!k.isTemplateMode,"gs-auto-position":Ue.x===0&&Ue.y===0},[t.createElementVNode("div",{class:t.normalizeClass(["grid-stack-item-content",{"is-selected":Ue.isSelected}])},[t.createVNode(YJe,{view:Ue,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":U(Ue),"is-filter-visible":e.isFilterVisible,"view-id":((qe=Ue==null?void 0:Ue.coreView)==null?void 0:qe.id)||0,onEdit:Re=>Y(Ue),onDelete:Re=>N(Ue)},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(z(Ue.componentName)),t.mergeProps({ref_for:!0},Ue.componentProps,{key:`${Ue.id}-${Ue._updateKey||0}`}),null,16))]),_:2},1032,["view","is-template-mode","is-post-match","game","lastGames","is-home-team","is-filter-visible","view-id","onEdit","onDelete"])],2)],8,wHe)}),128))],8,_He)])],512))}}),SHe=t2(THe,[["__scopeId","data-v-b0bc39a0"]]),kHe={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},LHe={key:0,class:"cover__main-logo cover__main-logo__home"},CHe={key:0,class:"team-logo"},OHe=["src"],NHe={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},EHe=["fill"],zHe={key:1,class:"cover__main-logo cover__main-logo__away"},MHe={key:0,class:"team-logo"},VHe=["src"],PHe={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},AHe=["fill"],RHe={class:"cover__title-subtitle"},UHe={class:"cover__title-subtitle__title"},FHe={class:"cover__title-subtitle__subtitle"},IHe={key:2,class:"cover-type-one"},qHe={class:"team-info-one"},jHe={class:"team-data"},WHe={key:0,class:"team-logo"},DHe=["src"],KHe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},BHe=["fill","opacity"],XHe={class:"team-name"},GHe={key:0,class:"team-events"},ZHe={class:"score-one"},JHe={key:0},HHe={class:"team-info-one"},YHe={class:"team-data"},QHe={key:0,class:"team-logo"},$He=["src"],eYe={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tYe=["fill","opacity"],rYe={class:"team-name"},aYe={key:0,class:"team-events"},nYe={key:3,class:"cover-type-two"},iYe={class:"team-data"},oYe={class:"team-info"},sYe={key:0,class:"team-logo"},lYe=["src"],cYe={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},uYe=["fill","opacity"],dYe={key:2,class:"team-score-two"},pYe={key:0,class:"team-goals"},hYe={class:"team-data"},fYe={class:"team-info"},mYe={key:0,class:"team-score-two"},yYe={key:1,class:"team-logo"},gYe=["src"],vYe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},bYe=["fill","opacity"],xYe={key:0,class:"team-goals"},_Ye={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:r}){const a=e,v=r,$=t.ref(null),h=t.computed(()=>[1,2].includes(a.coverId)),u=t.computed(()=>[1,3].includes(a.coverId)),i=t.computed(()=>a.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:a.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),p=t.computed(()=>a.game&&a.game.score?a.game.score:["0","0"]),l=t.computed(()=>{var I,j,F,W,U,z,X,N;if(a.game&&a.game.homeTeam&&a.game.awayTeam){const Y={homeTeam:{name:((I=a.game.homeTeam)==null?void 0:I.acronym)||"LOC",logo:((j=a.game.homeTeam)==null?void 0:j.logo)||null},awayTeam:{name:((F=a.game.awayTeam)==null?void 0:F.acronym)||"VIS",logo:((W=a.game.awayTeam)==null?void 0:W.logo)||null}};return h.value?(Y.homeTeam.goalsMinutes=o(a.game.minutes.home_goals_minutes),Y.homeTeam.totalYellowCards=((U=a.game.minutes.home_yellow_cards_minutes)==null?void 0:U.length)||0,Y.homeTeam.totalRedCards=((z=a.game.minutes.home_red_cards_minutes)==null?void 0:z.length)||0,Y.awayTeam.goalsMinutes=o(a.game.minutes.visiting_goals_minutes),Y.awayTeam.totalYellowCards=((X=a.game.minutes.away_yellow_cards_minutes)==null?void 0:X.length)||0,Y.awayTeam.totalRedCards=((N=a.game.minutes.away_red_cards_minutes)==null?void 0:N.length)||0):(Y.homeTeam.goalsEvents=d(a.game.report_minutes.home_goals_minutes),Y.awayTeam.goalsEvents=d(a.game.report_minutes.visiting_goals_minutes)),Y}return{homeTeam:{name:"LOC",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]},awayTeam:{name:"VIS",logo:null,goalsMinutes:"00'",totalYellowCards:0,totalRedCards:0,goalsEvents:[{playerName:"Nombre",goalTime:"00'"}]}}}),n=t.computed(()=>({"--background-image":u.value?"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-01@2x.jpg)":"url(https://golstatsimages.blob.core.windows.net/report-maker/background-postmatch-template-02@2x.jpg)","--grid-template-columns-type-one":a.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":a.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":a.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":a.isPostMatch?"100%":"fit-content"})),k=t.computed(()=>a.isPostMatch?"Postmatch":"Prematch"),T=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],x=t.computed(()=>{if(a.game){let I=kHe[a.game.matchday_abbreviation];I||(I=a.game.matchday_abbreviation.replace("M","J"));const[j,F,W]=a.game.date.split("-");return`${I} - ${W} ${T[Number(F)-1]}, ${j}`}return"Jornada - Día 00 Mes"});function d(I){return!I||!Array.isArray(I)||I.length===0?"":I.map(j=>{const F=j.split(", ");let W=F[0].replace("'","");W=W.replace("+",""),W=W.replace("’","");const U=W.split(" "),{strings:z,numbers:X}=U.reduce((se,me)=>(isNaN(Number(me))?se.strings.push(me):se.numbers.push(me),se),{strings:[],numbers:[]}),N=z.join(" "),Y=X.length===1?`${X[0]}'`:`${X[0]}' ${X.slice(1).join(" + ")}'`;return{playerName:N,goalTime:F.length===1?Y:`${Y}, ${F.reduce((se,me,ge)=>ge===0?se:`${se}${me}${ge<F.length-1?", ":""}`,"")}`}})}function o(I){return!I||!Array.isArray(I)||I.length===0?"":I.reduce((j,F,W)=>{const U=F.split(" ");let z="";return U.length===3?z=U[2]:U.length===5&&(z=`${U[2]} ${U[3]} ${U[4]}`),z&&(j+=`${z}${W<I.length-1?", ":""}`),j},"")}let c=null,s=null,f=!1,g=null,S=!1;const L=()=>{S=!0},E=()=>{S=!1};function P(){S||(f=!0,g&&clearTimeout(g),g=setTimeout(()=>{f=!1},150))}function V(){const I={root:null,rootMargin:"0px",threshold:.7};c=new IntersectionObserver(W=>{W.forEach(U=>{if(f){s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",U.isIntersecting)},100);return}s&&clearTimeout(s),s=setTimeout(()=>{v("intersection-changed",U.isIntersecting)},50)})},I);const j=$.value;j&&c.observe(j);const F=document.querySelector(".container-main");F&&F.addEventListener("scroll",P,{passive:!0}),document.addEventListener("programmatic-scroll-start",L),document.addEventListener("programmatic-scroll-end",E)}return t.onMounted(()=>{V()}),t.onUnmounted(()=>{c&&c.disconnect();const I=document.querySelector(".container-main");I&&I.removeEventListener("scroll",P),document.removeEventListener("programmatic-scroll-start",L),document.removeEventListener("programmatic-scroll-end",E),s&&clearTimeout(s),g&&clearTimeout(g)}),(I,j)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"coverPage",ref:$,class:"cover",style:t.normalizeStyle(n.value)},[h.value?(t.openBlock(),t.createElementBlock("div",LHe,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",CHe,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,OHe)])):(t.openBlock(),t.createElementBlock("svg",NHe,[t.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:i.value.homeTeam},null,8,EHe)]))])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("div",zHe,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",MHe,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,VHe)])):(t.openBlock(),t.createElementBlock("svg",PHe,[t.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:i.value.awayTeam},null,8,AHe)]))])):t.createCommentVNode("",!0),t.createElementVNode("div",RHe,[t.createElementVNode("div",UHe,[j[0]||(j[0]=t.createElementVNode("div",null,"Análisis",-1)),t.createElementVNode("div",null,t.toDisplayString(k.value),1)]),t.createElementVNode("div",FHe,t.toDisplayString(x.value),1)]),h.value?(t.openBlock(),t.createElementBlock("div",IHe,[t.createElementVNode("div",qHe,[t.createElementVNode("div",jHe,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",WHe,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,DHe)])):(t.openBlock(),t.createElementBlock("svg",KHe,[t.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:i.value.homeTeam,opacity:i.value.opacity},null,8,BHe)])),t.createElementVNode("div",XHe,t.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",GHe,[j[1]||(j[1]=t.createStaticVNode('<svg class="ball" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),t.createElementVNode("div",null,t.toDisplayString(l.value.homeTeam.goalsMinutes),1),j[2]||(j[2]=t.createElementVNode("div",{class:"separator"},null,-1)),j[3]||(j[3]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.homeTeam.totalYellowCards),1),j[4]||(j[4]=t.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.homeTeam.totalRedCards),1)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",ZHe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",JHe,t.toDisplayString(p.value[0])+" : "+t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",HHe,[t.createElementVNode("div",YHe,[l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",QHe,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,$He)])):(t.openBlock(),t.createElementBlock("svg",eYe,[t.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:i.value.awayTeam,opacity:i.value.opacity},null,8,tYe)])),t.createElementVNode("div",rYe,t.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",aYe,[t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.totalYellowCards),1),j[5]||(j[5]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.totalRedCards),1),j[6]||(j[6]=t.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),j[7]||(j[7]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(l.value.awayTeam.goalsMinutes),1),j[8]||(j[8]=t.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))])):t.createCommentVNode("",!0)])])):(t.openBlock(),t.createElementBlock("div",nYe,[t.createElementVNode("div",iYe,[t.createElementVNode("div",oYe,[l.value.homeTeam.logo?(t.openBlock(),t.createElementBlock("div",sYe,[t.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,lYe)])):(t.openBlock(),t.createElementBlock("svg",cYe,[t.createElementVNode("path",{d:"M80.0068 0.953125C80.0068 0.953125 91.0143 12.208 118.141 12.9913C140.898 13.6509 149.102 7.87917 149.102 7.87917C149.102 7.87917 169.839 67.5339 135.786 117.212C117.894 143.308 83.5935 160.211 79.9656 160.953C76.3789 160.211 42.0372 143.308 24.1449 117.212C-9.8257 67.5339 10.9112 7.87917 10.9112 7.87917C10.9112 7.87917 19.1153 13.6509 41.8723 12.9913C68.9993 12.208 80.0068 0.953125 80.0068 0.953125Z",fill:i.value.homeTeam,opacity:i.value.opacity},null,8,uYe)])),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",dYe,t.toDisplayString(p.value[0]),1)):t.createCommentVNode("",!0)]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",pYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.homeTeam.goalsEvents,(F,W)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-${W}`,class:"goal"},[t.createElementVNode("div",null,t.toDisplayString(F.playerName),1),j[9]||(j[9]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(F.goalTime),1),j[10]||(j[10]=t.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1))]))),128))])):t.createCommentVNode("",!0)]),j[13]||(j[13]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",hYe,[t.createElementVNode("div",fYe,[e.isPostMatch?(t.openBlock(),t.createElementBlock("div",mYe,t.toDisplayString(p.value[1]),1)):t.createCommentVNode("",!0),l.value.awayTeam.logo?(t.openBlock(),t.createElementBlock("div",yYe,[t.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,gYe)])):(t.openBlock(),t.createElementBlock("svg",vYe,[t.createElementVNode("path",{d:"M80.8504 0.953125C80.8504 0.953125 92.9822 3.39499 119.261 10.1779C144.106 16.5733 152.827 19.1314 152.827 19.1314C152.827 19.1314 156.936 44.2089 145.657 90.5655C136.548 127.969 106.742 152.038 80.8504 160.953C54.9977 152.038 25.1527 128.007 16.0442 90.5655C4.8039 44.2477 8.91243 19.1314 8.91243 19.1314C8.91243 19.1314 17.6334 16.5733 42.4783 10.1779C68.7574 3.39499 80.8504 0.953125 80.8504 0.953125Z",fill:i.value.awayTeam,opacity:i.value.opacity},null,8,bYe)]))]),e.isPostMatch?(t.openBlock(),t.createElementBlock("div",xYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value.awayTeam.goalsEvents,(F,W)=>(t.openBlock(),t.createElementBlock("div",{key:`goal-a-${W}`,class:"goal"},[j[11]||(j[11]=t.createStaticVNode('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-6680cbcf><path fill-rule="evenodd" clip-rule="evenodd" d="M10.0268 2.83594C6.09038 2.83594 2.89844 6.01986 2.89844 9.94705C2.89844 13.8742 6.09038 17.0582 10.0268 17.0582C13.9632 17.0582 17.1551 13.8742 17.1551 9.94705C17.1551 6.01986 13.9632 2.83594 10.0268 2.83594V2.83594Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path fill-rule="evenodd" clip-rule="evenodd" d="M8.0826 12.9597L6.87109 9.2304L10.0401 6.92578L13.2097 9.2304L11.9995 12.9597H8.0826Z" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M12.7277 3.39453L10.0276 4.54375L7.32812 3.39453" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.65662 5.34766L4.91603 8.27341L2.98828 10.4871" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.01562 13.6523L6.87533 14.3093L8.38436 16.8279" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.7031 16.8213L13.2109 14.3015L16.0697 13.6445" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M17.1051 10.4865L15.1758 8.27156L15.4349 5.34766" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M10.0456 4.54688V6.92693" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M13.2109 9.32248L15.1681 8.27344" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M11.9961 12.9609L13.2064 14.3086" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M8.08198 12.9609L6.87109 14.3099" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path><path d="M4.91797 8.27344L6.87609 9.22818" stroke="white" stroke-width="1.36665" stroke-linecap="round" stroke-linejoin="round" data-v-6680cbcf></path></svg>',1)),t.createElementVNode("div",null,t.toDisplayString(F.goalTime),1),j[12]||(j[12]=t.createElementVNode("div",{class:"bullet"},null,-1)),t.createElementVNode("div",null,t.toDisplayString(F.playerName),1)]))),128))])):t.createCommentVNode("",!0)])]))],4))}},wYe=t2(_Ye,[["__scopeId","data-v-6680cbcf"]]),TYe={class:"table-category-filters"},SYe={key:0,class:"custom-radio-group filter-inline"},kYe={class:"radio-label"},LYe={class:"radio-options"},CYe=["name","value","onUpdate:modelValue","onClick"],OYe=["data-filter-type","onClick","onMousedown","onMouseup"],NYe={class:"select-display"},EYe={class:"select-label"},zYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},MYe={class:"simple-select-scroll-area"},VYe=["onClick"],PYe={class:"option-content"},AYe={class:"option-title"},RYe={key:0,class:"option-checkmark"},UYe={key:2,class:"filter-separator"},FYe={__name:"TableCategoryFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:13}},emits:["filters-changed","filter-updated"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref([]);let u=null;const i=(S,L)=>{if(!L)return!0;for(let E=0;E<S.length;E++)if(!p(S[E],L[E]))return!0;return!1},p=(S,L)=>{if(Array.isArray(S)&&Array.isArray(L)){if(S.length!==L.length)return!1;for(let E=0;E<S.length;E++)if(S[E]!==L[E])return!1;return!0}return S===L},l=t.ref(null),n=t.ref([]);let k=!1,T=null;const x=()=>{T=null},d=()=>{setTimeout(()=>{k=!1},1e3)},o=(S,L=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const E=v.filters[0].options,P=v.filters[1].options;S!=null?E.findIndex(V=>V.value===S)!==-1&&P[S]?(n.value=P[S],L&&!(()=>{const V=h.value[1];return V==null?!1:Array.isArray(V)?V.length>0:V!==""})()&&!k&&n.value.length>0&&(h.value[1]=n.value[0].value,t.nextTick(()=>{}))):(n.value=[],h.value[1]=null):(n.value=[],h.value[1]=null)}},c=()=>{v.initialValues&&v.initialValues.length>0?h.value=[...v.initialValues]:h.value=v.filters.map(S=>{var L,E,P,V;return S.type==="select"?[]:S.type==="check"?!1:S.type==="radio-button"?((E=(L=S.options)==null?void 0:L[0])==null?void 0:E.value)||null:S.type==="select-simple"&&((V=(P=S.options)==null?void 0:P[0])==null?void 0:V.value)||null}),v.componentId===13&&h.value.some(S=>S!=null&&(Array.isArray(S)?S.length>0:S!==!1&&S!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};c(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!k){const S=!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})();o(h.value[0],S)}})},300),t.watch(()=>v.initialValues,S=>{const L=!p(h.value,S),E=S&&S.length>0&&!k&&L,P=v.isEditMode&&k;E&&!P?h.value=[...S]:k?T&&T.length>0&&(h.value=[...T]):P&&T&&T.length>0&&(h.value=[...T])},{deep:!0}),t.watch(()=>v.isEditMode,(S,L)=>{L===!0&&S===!1&&x()},{immediate:!0}),t.watch(h,(S,L)=>{S.some(E=>E!=null&&(Array.isArray(E)?E.length>0:E!==!1&&E!==""))&&i(S,u)&&(u=[...S],$("filters-changed",{componentId:v.componentId,filters:S,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(S,L)=>{S!==L&&L!==void 0?o(S,!0):L===void 0&&S!==null&&S!==void 0&&o(S,!1)},{immediate:!0}),t.watch(()=>h.value,(S,L)=>{v.filters.map((E,P)=>E.type==="radio-button"?P:-1).filter(E=>E!==-1).forEach(E=>{})},{deep:!0}),t.watch(n,()=>{},{deep:!0});const s=S=>{l.value===S?l.value=null:l.value=S},f=(S,L)=>{if(k=!0,d(),h.value[S]=L,(S===0||S===1)&&(T=[...h.value]),l.value=null,S===0){h.value[1]!==void 0&&(h.value[1]=null);const E=k;k=!1,o(L,!0),k=E,h.value[1]!==null&&h.value[1]!==void 0&&(T=[...h.value])}},g=()=>{k=!0,setTimeout(()=>{k=!1},1e3)};return r({getCurrentValues:()=>h.value,initializeValues:c}),(S,L)=>(t.openBlock(),t.createElementBlock("div",TYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(E,P)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:P},[E.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",SYe,[t.createElementVNode("div",kYe,t.toDisplayString(E.label),1),t.createElementVNode("div",LYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.options,V=>(t.openBlock(),t.createElementBlock("label",{key:V.value,class:t.normalizeClass(["radio-option-card",{active:h.value[P]===V.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"table-radio-"+P,value:V.value,"onUpdate:modelValue":I=>h.value[P]=I,onChange:L[0]||(L[0]=()=>{g()}),onClick:I=>console.log("Click en radio button",P,V.value,"Valor actual:",h.value[P])},null,40,CYe),[[t.vModelRadio,h.value[P]]]),t.createElementVNode("span",null,t.toDisplayString(V.label),1)],2))),128))])])):E.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":E.type,onClick:t.withModifiers(V=>s(P),["stop"]),onMousedown:V=>console.log("Mouse down en selector",P),onMouseup:V=>console.log("Mouse up en selector",P)},[t.createElementVNode("div",NYe,[L[2]||(L[2]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",EYe,t.toDisplayString(E.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:l.value===P}])},[...L[1]||(L[1]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===P?(t.openBlock(),t.createElementBlock("div",zYe,[t.createElementVNode("div",MYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P===1?n.value:E.options,V=>(t.openBlock(),t.createElementBlock("div",{key:V.value,class:t.normalizeClass(["option-card simple-select-option",{active:p(h.value[P],V.value)}]),onClick:t.withModifiers(I=>f(P,V.value),["stop"])},[t.createElementVNode("div",PYe,[t.createElementVNode("div",AYe,t.toDisplayString(V.label),1)]),p(h.value[P],V.value)?(t.openBlock(),t.createElementBlock("div",RYe,[...L[3]||(L[3]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,VYe))),128))])])):t.createCommentVNode("",!0)],40,OYe)):t.createCommentVNode("",!0),P===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",UYe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},IYe=t2(FYe,[["__scopeId","data-v-9d00f072"]]),qYe={class:"strengths-filters"},jYe={key:0,class:"custom-radio-group filter-inline"},WYe={class:"radio-label"},DYe={class:"radio-options"},KYe=["name","value","onUpdate:modelValue"],BYe={class:"filter-inline select-with-label"},XYe=["data-filter-type","onClick"],GYe={class:"select-display"},ZYe={class:"select-label"},JYe={key:0,class:"dropdown-menu type-menu simple-select-menu"},HYe={class:"simple-select-scroll-area"},YYe=["onClick"],QYe={class:"option-content"},$Ye={class:"option-title"},eQe={key:0,class:"option-checkmark"},tQe={key:2,class:"filter-separator"},rQe={__name:"StrengthsFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:15}},emits:["filters-changed","filter-updated"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref([]);let l=!1,n=null;const k=(s,f)=>{if(Array.isArray(s)&&Array.isArray(f)){if(s.length!==f.length)return!1;for(let g=0;g<s.length;g++)if(s[g]!==f[g])return!1;return!0}return s===f},T=(s,f=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]&&v.filters[1].options){const g=v.filters[0].options,S=v.filters[1].options;s!=null?g.findIndex(L=>L.value===s)!==-1&&S[s]?(p.value=S[s],f&&!(()=>{const L=h.value[1];return L==null?!1:Array.isArray(L)?L.length>0:L!==""})()&&!l&&p.value.length>0&&(h.value[1]=p.value[0].value,t.nextTick(()=>{}))):(p.value=[],h.value[1]=null):(p.value=[],h.value[1]=null)}},x=()=>{if(v.initialValues&&v.initialValues.length>0){const f=v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",f),f?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",v.initialValues),h.value=[...v.initialValues]):v.isEditMode?h.value=v.filters.map((g,S)=>{var L,E,P,V,I,j,F,W,U,z;const X=v.initialValues[S];if(console.log(`StrengthsFilters initializeValues - filter[${S}]:`,g==null?void 0:g.type,"filterData:",X),!X)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${S}, usando valor por defecto`),g.type==="select"?[]:g.type==="check"?!1:g.type==="radio-button"?((E=(L=g.options)==null?void 0:L[0])==null?void 0:E.value)||null:g.type==="select-simple"&&((V=(P=g.options)==null?void 0:P[0])==null?void 0:V.value)||null;if(g.type==="radio-button"&&X.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",X.selectedOption,"index:",S);const N=X.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",N),N}else{if(g.type==="radio-button"&&!X.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",X,"index:",S),X.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",X.selectedValue),X.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((j=(I=g.options)==null?void 0:I[0])==null?void 0:j.value)||null);if(g.type==="select-simple"&&X.selectedValue!==void 0)return Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue;if(g.type==="select"&&X.selectedOptions)return X.selectedOptions.map(N=>N.value);if(g.type==="check"&&X.isChecked!==void 0)return X.isChecked}return X.selectedValue!==void 0?X.selectedValue:g.type==="select"?[]:g.type==="check"?!1:g.type==="radio-button"?((W=(F=g.options)==null?void 0:F[0])==null?void 0:W.value)||null:g.type==="select-simple"&&((z=(U=g.options)==null?void 0:U[0])==null?void 0:z.value)||null}):h.value=[...v.initialValues]}else h.value=v.filters.map(f=>{var g,S,L,E;return f.type==="select"?[]:f.type==="check"?!1:f.type==="radio-button"?((S=(g=f.options)==null?void 0:g[0])==null?void 0:S.value)||null:f.type==="select-simple"&&((E=(L=f.options)==null?void 0:L[0])==null?void 0:E.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",h.value);const s=h.value.some(f=>f!=null&&(Array.isArray(f)?f.length>0:f!==!1&&f!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",s),s&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};x(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!l){const s=!(()=>{const f=h.value[1];return f==null?!1:Array.isArray(f)?f.length>0:f!==""})();T(h.value[0],s)}})},300),t.watch(()=>v.initialValues,(s,f)=>{if(!s||s.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",s),console.log("StrengthsFilters watch initialValues - oldValues:",f),console.log("StrengthsFilters watch initialValues - props.isEditMode:",v.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const g=s.length>0&&(typeof s[0]=="number"||typeof s[0]=="boolean"||s[0]===null||Array.isArray(s[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",g);const S=!k(h.value,s),L=s&&s.length>0&&!l&&S,E=v.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",S,"shouldUpdate:",L,"isEditModeProtection:",E),L&&!E?g?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",s),h.value=[...s]):v.isEditMode?h.value=v.filters.map((P,V)=>{const I=s[V];if(!I)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",V),h.value[V];if(P.type==="radio-button"&&I.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",I.selectedOption,"index:",V);const j=I.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",j),j}else{if(P.type==="select-simple"&&I.selectedValue!==void 0)return Array.isArray(I.selectedValue)?I.selectedValue[0]:I.selectedValue;if(P.type==="select"&&I.selectedOptions)return I.selectedOptions.map(j=>j.value);if(P.type==="check"&&I.isChecked!==void 0)return I.isChecked}return I.selectedValue!==void 0?I.selectedValue:h.value[V]}):h.value=[...s]:l?n&&n.length>0&&(h.value=[...n]):E&&n&&n.length>0&&(h.value=[...n])},{deep:!0}),t.watch(()=>v.isEditMode,(s,f)=>{f===!0&&s===!1&&(n=null)},{immediate:!0}),t.watch(h,s=>{s.some(f=>f!=null&&(Array.isArray(f)?f.length>0:f!==!1&&f!==""))&&(()=>{if(!u)return!0;for(let f=0;f<s.length;f++)if(!k(s[f],u[f]))return!0;return!1})()&&(u=[...s],$("filters-changed",{componentId:v.componentId,filters:s,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),t.watch(()=>h.value[0],(s,f)=>{s!==f&&f!==void 0?T(s,!0):f===void 0&&s!==null&&s!==void 0&&T(s,!1)},{immediate:!0});const d=s=>{i.value===s?i.value=null:i.value=s},o=(s,f)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),h.value[s]=f,(s===0||s===1)&&(n=[...h.value]),i.value=null,s===0){h.value[1]!==void 0&&(h.value[1]=null);const g=l;l=!1,T(f,!0),l=g,h.value[1]!==null&&h.value[1]!==void 0&&(n=[...h.value])}},c=()=>{l=!0,setTimeout(()=>{l=!1},400)};return r({getCurrentValues:()=>h.value,initializeValues:x}),(s,f)=>(t.openBlock(),t.createElementBlock("div",qYe,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(g,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[g.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",jYe,[t.createElementVNode("div",WYe,t.toDisplayString(g.label),1),t.createElementVNode("div",DYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("label",{key:L.value,class:t.normalizeClass(["radio-option-card",{active:h.value[S]===L.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"strengths-radio-"+S,value:L.value,"onUpdate:modelValue":E=>h.value[S]=E,onChange:c},null,40,KYe),[[t.vModelRadio,h.value[S]]]),t.createElementVNode("span",null,t.toDisplayString(L.label),1)],2))),128))])])):g.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[f[4]||(f[4]=t.createElementVNode("div",{class:"filter-separator"},null,-1)),t.createElementVNode("div",BYe,[f[3]||(f[3]=t.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":g.type,onClick:t.withModifiers(L=>d(S),["stop"])},[t.createElementVNode("div",GYe,[f[1]||(f[1]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",ZYe,t.toDisplayString(g.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===S}])},[...f[0]||(f[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===S?(t.openBlock(),t.createElementBlock("div",JYe,[t.createElementVNode("div",HYe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.options,L=>(t.openBlock(),t.createElementBlock("div",{key:L.value,class:t.normalizeClass(["option-card simple-select-option",{active:k(h.value[S],L.value)}]),onClick:t.withModifiers(E=>o(S,L.value),["stop"])},[t.createElementVNode("div",QYe,[t.createElementVNode("div",$Ye,t.toDisplayString(L.label),1)]),k(h.value[S],L.value)?(t.openBlock(),t.createElementBlock("div",eQe,[...f[2]||(f[2]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,YYe))),128))])])):t.createCommentVNode("",!0)],8,XYe)])],64)):t.createCommentVNode("",!0),S===1&&e.filters.length>2?(t.openBlock(),t.createElementBlock("div",tQe)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},aQe=t2(rQe,[["__scopeId","data-v-4c3876bd"]]),nQe=(e,r)=>{const a=e.__vccOpts||e;for(const[v,$]of r)a[v]=$;return a},iQe={key:1},oQe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sQe=["fill"],lQe={key:0,class:"checkbox__teams"},cQe={class:"checkbox__teams__logo"},uQe=["src"],dQe={class:"checkbox__teams__logo"},pQe=["src"],hQe={__name:"GSC-Checkbox",props:{width:{type:String,default:"fit-content"},height:{type:String,default:"fit-content"},label:{type:String,default:""},labelWhiteSpace:{type:String,default:"normal"},labelColor:{type:String,default:"white"},fontFamily:{type:String,default:"sans-serif"},labelFontSize:{type:String,default:"12px"},modelValue:{type:Boolean,default:!1},justifyContent:{type:String,default:"flex-start"},alignItems:{type:String,default:"center"},boxBackgroundColor:{type:String,default:"#CBEE6B"},boxValueColor:{type:String,default:"#0d1d29"},boxValue:{type:[String,Number],default:""},boxPosition:{type:String,default:"left",validator(e){return["left","right","top","bottom"].includes(e)}},boxMarginTop:{type:String,default:"0.2em"},boxWidthAndHeight:{type:String,default:"16px"},boxBorderColor:{type:String,default:"#969da2"},boxBorderWidth:{type:String,default:"2px"},boxBorderRadius:{type:String,default:"4px"},boxValueFontSize:{type:String,default:"10px"},boxValueFontFamily:{type:String,default:"sans-serif"},avoidInteraction:{type:Boolean,default:!1},avoidToCheck:{type:Boolean,default:!1},isBoxOnly:{type:Boolean,default:!1},teamsIds:{type:Array,default:()=>null}},emits:["update:modelValue"],setup(e,{emit:r}){const a=e;t.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const v=t.ref(!1),$=t.computed(()=>{const l={color:a.boxValueColor,"font-family":a.fontFamily,height:a.boxWidthAndHeight,width:a.boxWidthAndHeight,minWidth:a.boxWidthAndHeight,"border-radius":a.boxBorderRadius,"margin-top":a.boxMarginTop};return v.value?(l["background-color"]=a.boxBackgroundColor,l.border=`solid ${a.boxBorderWidth} ${a.boxBackgroundColor}`):l.border=`solid ${a.boxBorderWidth} ${a.boxBorderColor}`,l}),h=t.computed(()=>({"font-family":a.boxValueFontFamily,"font-size":a.boxValueFontSize,color:a.boxValueColor,"line-height":1})),u=t.computed(()=>{const l={color:a.labelColor,"font-family":a.fontFamily,"font-size":a.labelFontSize,"white-space":a.labelWhiteSpace,"text-align":a.boxPosition==="top"||a.boxPosition==="bottom"?"center":a.boxPosition};return(a.boxPosition==="left"||a.boxPosition==="right")&&(l[`margin-${a.boxPosition}`]=a.isBoxOnly?"0":a.teamsIds?"8px":"10px"),l});t.watch(()=>a.modelValue,l=>{l!==v.value&&(v.value=l)},{immediate:!0});function i(){a.avoidInteraction||!v.value&&a.avoidToCheck||(v.value=!v.value,r("update:modelValue",v.value))}function p(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,n)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:i},[t.createElementVNode("div",{class:"checkbox__box",style:t.normalizeStyle($.value)},[v.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[a.boxValue?(t.openBlock(),t.createElementBlock("div",{key:0,class:"checkbox__box__value",style:t.normalizeStyle(h.value)},t.toDisplayString(e.boxValue),5)):(t.openBlock(),t.createElementBlock("div",iQe,[(t.openBlock(),t.createElementBlock("svg",oQe,[t.createElementVNode("path",{d:"M9.77994 1.70133L4.10994 7.37133C3.96994 7.51133 3.77994 7.59133 3.57994 7.59133C3.37994 7.59133 3.18994 7.51133 3.04994 7.37133L0.219941 4.54133C-0.0700586 4.25133 -0.0700586 3.77133 0.219941 3.48133C0.509941 3.19133 0.989941 3.19133 1.27994 3.48133L3.57994 5.78133L8.71994 0.641328C9.00994 0.351328 9.48994 0.351328 9.77994 0.641328C10.0699 0.931328 10.0699 1.40133 9.77994 1.70133Z",fill:e.boxValueColor},null,8,sQe)]))]))],64)):t.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(t.openBlock(),t.createElementBlock("div",lQe,[t.createElementVNode("div",cQe,[t.createElementVNode("img",{src:p(e.teamsIds[0]),alt:""},null,8,uQe)]),t.createElementVNode("div",dQe,[t.createElementVNode("img",{src:p(e.teamsIds[1]),alt:""},null,8,pQe)])])):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"checkbox__label",style:t.normalizeStyle(u.value)},t.toDisplayString(e.label),5)],2))}},iA=nQe(hQe,[["__scopeId","data-v-b6f124d8"]]),fQe=(e,r)=>{const a=e.__vccOpts||e;for(const[v,$]of r)a[v]=$;return a},oA={props:{type:{type:Number,default:0},value:{type:Boolean,default:!1},textValue:String,icon:String,iconPosition:{type:String,default:"left"},iconSize:String,fontColor:{type:String,default:"#FFFFFF"},textDecoration:String,fontSize:{type:String,default:"16px"},fontSizeStat:{type:String,default:"16px"},fontStyle:String,fontFamily:{type:String,default:"Poppins-Regular"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},borderRadius:{type:String,default:"0px"},borderType:{type:String,default:"solid"},borderWidth:{type:Number,default:0},borderWidthBtn:{type:String,default:"2px"},borderColor:String,backgroundColor:{type:String,default:"none"},activeBackgroundColor:{type:String,default:"#000000"},activeBorderWidth:{type:Number,default:2},activeBorderType:{type:String,default:"solid"},activeBorderColor:{type:String,default:"#cbee6b"},activeColorText:{type:String,default:"#FFFFFF"},cursorType:{type:String,default:"default"},typeOnOff:{type:Boolean,default:!1},textCategory:String,textStat:String,marginLeftStat:{type:String,default:"15%"}},watch:{value:{deep:!0,immediate:!0,handler(e){this.status=e}}},data(){return{status:!1}},computed:{customStyle(){return{height:this.height,width:this.width,backgroundColor:this.backgroundColor,borderRadius:this.borderRadius,border:`${this.borderType} ${this.borderWidth}px ${this.borderColor}`,color:this.fontColor,textDecoration:this.textDecoration,cursor:this.cursorType,fontSize:this.fontSize,fontStyle:this.fontStyle,fontFamily:`${this.fontFamily} !important`}},customActive(){return{backgroundColor:this.activeBackgroundColor,color:this.activeColorText,border:`${this.activeBorderType} ${this.activeBorderWidth}px ${this.activeBorderColor}`}}},methods:{btnClick(e){this.$emit("click",e),this.typeOnOff&&(this.status=!this.status,this.$emit("status",this.status))}}},FZ=()=>{t.useCssVars(e=>({"9d01acb4":e.height,"14e95081":e.borderWidthBtn,"38fec285":e.borderType,34353510:e.borderColor,"20d20dc6":e.borderRadius,17130967:e.width,"4ccb7d36":e.backgroundColor,"5d1e86a2":e.cursorType,ce65d4a2:e.fontSize,fe4ac47a:e.fontStyle,f98e44dc:e.fontFamily,"93b87770":e.marginLeftStat,c7f7beba:e.fontSizeStat}))},IZ=oA.setup;oA.setup=IZ?(e,r)=>(FZ(),IZ(e,r)):FZ;const mQe=e=>(t.pushScopeId("data-v-f3ee6b2b"),e=e(),t.popScopeId(),e),yQe=["src"],gQe={key:1,class:"text"},vQe=["src"],bQe={class:"stats"},xQe=mQe(()=>t.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),_Qe={class:"numstats"},wQe={class:"leyend"};function TQe(e,r,a,v,$,h){return t.openBlock(),t.createElementBlock("div",null,[a.type==0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["button",$.status&&a.typeOnOff&&"button-active"]),style:t.normalizeStyle([h.customStyle,$.status&&a.typeOnOff&&h.customActive]),onClick:r[0]||(r[0]=(...u)=>h.btnClick&&h.btnClick(...u))},[a.icon&&a.iconPosition.toLowerCase()==="left"?(t.openBlock(),t.createElementBlock("img",{key:0,class:"icon",style:t.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,yQe)):t.createCommentVNode("",!0),a.textValue?(t.openBlock(),t.createElementBlock("div",gQe,t.toDisplayString(a.textValue),1)):t.createCommentVNode("",!0),a.icon&&a.iconPosition.toLowerCase()==="right"?(t.openBlock(),t.createElementBlock("img",{key:2,class:"icon",style:t.normalizeStyle({width:a.iconSize}),src:a.icon},null,12,vQe)):t.createCommentVNode("",!0)],6)):t.createCommentVNode("",!0),a.type==1?(t.openBlock(),t.createElementBlock("div",{key:1,class:"button-target",onClick:r[1]||(r[1]=(...u)=>h.btnClick&&h.btnClick(...u))},[t.createElementVNode("div",bQe,[xQe,t.createElementVNode("div",_Qe,t.toDisplayString(a.textStat),1)]),t.createElementVNode("div",wQe,t.toDisplayString(a.textCategory),1)])):t.createCommentVNode("",!0)])}const SQe=fQe(oA,[["render",TQe],["__scopeId","data-v-f3ee6b2b"]]),kQe={class:"gsc-dropdown__main-container__item-selected"},LQe=["height","width"],CQe=["stroke"],OQe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},NQe=["fill"],EQe={class:"gsc-dropdown__items-container"},zQe=["onClick"],MQe={key:0,class:"gsc-dropdown__items-footer"},$k={__name:"GSC-Dropdown",props:{modelValue:{type:[Object,Number,String],default:()=>null},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},fontSize:{type:String,default:"14px"},borderRadius:{type:Number,default:5},arrowHeight:{type:Number,default:24},arrowWidth:{type:Number,default:24},borderType:{type:String,default:"solid",validator:function(e){return["solid","dotted","dashed"].includes(e)}},borderWidth:{type:Number,default:1},borderColor:{type:String,default:"black"},backgroundColor:{type:String,default:"grey"},color:{type:String,default:"black"},arrowColor:{type:String,default:"#CBEE6B"},items:{type:Array,default:()=>[]},defaultItemByIndex:{type:Number,default:0},defaultItemByProp:{type:Object,default:null,validator:e=>["propName","value"].every(r=>r in e)},listBackgroundColor:{type:String,default:"white"},hoverBackgroundColor:{type:String,default:"#f1f1f1"},listMarginTop:{type:String,default:"0"},listContainerPadding:{type:String,default:"0"},listItemPadding:{type:String,default:"10px 12px"},listItemMargin:{type:String,default:"0"},listHeight:{type:String,default:"fit-content"},listItemSelectedColor:{type:String,default:"white"},listItemSelectedBackgroundColor:{type:String,default:"#399cfd"},listItemColor:{type:String,default:"black"},listBorderRadius:{type:String,default:"0"},listBorderColor:{type:String,default:""},listBorderWidth:{type:Number,default:1},listItemBorderRadius:{type:String,default:"0"},listAlignment:{type:String,default:"left"},isListSameWidth:{type:Boolean,default:!1},isMultipleOption:{type:Boolean,default:!1},footerBorderColor:{type:String,default:"#626970"},footerBorderWidth:{type:Number,default:1},isFooterVisible:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},onlyFirstTime:{type:Boolean,default:!1},iconType:{type:Number,default:1,validator:function(e){return[1,2].includes(e)}}},emits:["input","click-ready","update:modelValue"],setup(e,{emit:r}){const a=e,v=t.ref({}),$=t.ref(null),h=t.ref(a.isMultipleOption?-1:0),u=t.ref(!1);t.watch(()=>a.items,(x,d)=>{if(!a.modelValue&&(!a.onlyFirstTime||!d||!d.length)&&x&&x.length){if(a.defaultItemByProp){const o=a.items.findIndex(c=>c[a.defaultItemByProp.propName]===a.defaultItemByProp.value);o!==-1?(h.value=o,v.value=x[o]):(h.value=0,v.value=x[0])}else v.value=x[a.defaultItemByIndex];r("input",v.value)}},{immediate:!0}),t.watch(()=>a.modelValue,x=>{if(x){const d=a.items.findIndex(o=>typeof x=="object"?JSON.stringify(o)===JSON.stringify(x):o===x);d!==-1&&(h.value=d,v.value=a.items[d],r("update:modelValue",v.value))}},{immediate:!0});const i=t.computed(()=>({height:a.height,width:a.width,backgroundColor:a.backgroundColor,borderRadius:`${a.borderRadius}px`,border:`${a.borderType} ${a.borderWidth}px ${a.borderColor}`,color:a.color,"--hover-background-color":a.hoverBackgroundColor,"--list-container-padding":a.listContainerPadding,"--list-item-padding":a.listItemPadding,"--list-item-margin":a.listItemMargin,"--list-background-color":a.listBackgroundColor,"--list-height":a.listHeight,"--list-item-border-radius":a.listItemBorderRadius,"--list-item-selected-color":a.listItemSelectedColor,"--list-item-selected-background-color":a.listItemSelectedBackgroundColor,"--list-item-color":a.listItemColor,"--list-border-radius":`${a.listBorderRadius}`,"--list-border-color":a.listBorderColor,"--list-width":a.isListSameWidth?a.width:"fit-content","--list-border-width":`${a.listBorderWidth}px`,"--list-margin-top":a.listMarginTop,"--list-left":a.listAlignment==="left"?"0":"auto","--list-right":a.listAlignment==="right"?"0":"auto","--footer-border":`${a.footerBorderWidth}px solid ${a.footerBorderColor}`,"--dropdown-opacity":a.isDisabled?"0.5":"1","--dropdown-cursor":a.isDisabled?"not-allowed":"pointer","--dropdown-font-size":a.fontSize?a.fontSize:"14px"})),p=t.computed(()=>({height:`${a.arrowHeight}px`,width:`${a.arrowWidth}px`}));function l(){a.isDisabled||(u.value=!u.value)}function n(x){$.value&&!$.value.contains(x.target)&&(u.value=!1)}function k(x,d){a.isMultipleOption?h.value=-1:(h.value=d,u.value=!1),v.value=x,r("input",v.value),r("update:modelValue",v.value)}function T(){u.value=!1,r("click-ready")}return t.onMounted(()=>{document.addEventListener("click",n)}),t.onBeforeMount(()=>{document.removeEventListener("click",n)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"dropDown",ref:$,class:"gsc-dropdown",style:t.normalizeStyle(i.value)},[t.createElementVNode("div",{class:"gsc-dropdown__main-container",style:t.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[t.createElementVNode("div",kQe,[t.renderSlot(x.$slots,"default",{selectedItem:v.value})]),t.createElementVNode("div",{class:t.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":u.value}]),style:t.normalizeStyle(p.value)},[e.iconType===1?(t.openBlock(),t.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M18.394 9.13501L13.1302 14.3988C12.5086 15.0204 11.4914 15.0204 10.8697 14.3988L5.60596 9.13501",stroke:e.arrowColor},null,8,CQe)],8,LQe)):(t.openBlock(),t.createElementBlock("svg",OQe,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,NQe)]))],6)],4),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",EQe,[t.createElementVNode("div",null,[t.createElementVNode("div",{class:"gsc-dropdown__items",style:t.normalizeStyle({"margin-top":`${a.borderWidth}px`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.items,(o,c)=>(t.openBlock(),t.createElementBlock("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["gsc-dropdown__items__item",{selected:c===h.value}]),key:c,onClick:s=>k(o,c)},[t.renderSlot(x.$slots,"availableItem",{item:o})],10,zQe)),[[t.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(t.openBlock(),t.createElementBlock("div",MQe,[t.createVNode(t.unref(SQe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:T})])):t.createCommentVNode("",!0)])],512),[[t.vShow,u.value]])]),_:3})],4))}},sA={borderType:"solid",listBackgroundColor:"#2E3B46",listBorderColor:"rgba(255, 255, 255, 0.2)",listBorderRadius:"5px",height:"38px",borderWidth:.8,borderColor:"rgba(255, 255, 255, 0.2)",backgroundColor:"#2E3B46",color:"white",listItemColor:"white",listItemSelectedBackgroundColor:"#2E3B46",arrowColor:"#fff",width:"100%",listHeight:"200px",isListSameWidth:!1,isFooterVisible:!1,hoverBackgroundColor:"#2E3B46",iconType:2},VQe=[{label:"Goles recibidos",value:{name:"Goles recibidos",color:"#336DFF",points:[1,2,3],categories:[40],invert:[57,326,56,60,59,55],negative:!1,translationKey:"chalkboard.defensive.team.goals_received",singleName:"Gol recibido"}},{label:"Tiros a gol recibidos",value:{name:"Tiros a gol recibidos",color:"#7ED321",points:[1,2,3],categories:["510_r"],invert:[510],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Tiros a gol recibidos (portería)",value:{name:"Tiros a gol recibidos (portería)",color:"#990BFF",points:[1,2,3],categories:["537_r","540_r","544_r","547_r"],invert:[537,540,544,547],negative:!1,translationKey:"chalkboard.defensive.team.shots_on_goal_received",singleName:"Tiro a gol recibido"}},{label:"Centros totales recibidos",value:{name:"Centros totales recibidos",color:"#FF9226",points:[1,2,3],categories:["13_r","25_r"],invert:[13,25],negative:!1,translationKey:"chalkboard.defensive.team.total_centers_received",singleName:"Centro recibido"}},{label:"Centros acertados por el rival",value:{name:"Centros acertados por el rival",color:"#28A3B2",points:[1,2,3],categories:["98_r","101_r","104_r","105_r","109_r","112_r","115_r","116_r"],invert:[98,101,104,105,109,112,115,116],negative:!1,translationKey:"chalkboard.defensive.team.successful_centers_by_opponent",singleName:"Centro acertado"}},{label:"Fuera de lugar provocados",value:{name:"Fuera de lugar provocados",color:"#00DD00",points:[1,2,3],categories:["33_r"],invert:[33],negative:!1,translationKey:"chalkboard.defensive.team.offsides_caused",singleName:"Fuera de lugar"}},{label:"Balones recuperados (en disputa)",value:{name:"Balones recuperados (en disputa)",color:"#FF3399",points:[1,2,3],categories:[483],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_in_challenge",singleName:"Balón recuperado",isDefaultSelected:!0}},{label:"Balones recuperados (sin disputa)",value:{name:"Balones recuperados (sin disputa)",color:"#B4005A",points:[1,2,3],categories:[484],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_recovered_without_challenge",singleName:"Balón recuperado"}},{label:"1 vs 1 exitosos defensivos",value:{name:"1 vs 1 exitosos defensivos",color:"#3A3838",points:[1],categories:[5],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.successful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"1 vs 1 no exitosos defensivos",value:{name:"1 vs 1 no exitosos defensivos",color:"#008B31",points:[1],categories:[209],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.unsuccessful_1_on_1",singleName:"1 vs 1 defensivo"}},{label:"Balones ganados en área propia",value:{name:"Balones ganados en área propia",color:"#305496",points:[1,2],categories:[23],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.balls_won_own_penalty_box",singleName:"Balón ganado"}},{label:"Juego aéreo resto del campo",value:{name:"Juego aéreo resto del campo",color:"#FF8A4C",points:[1,2,3],categories:[24],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.arial_game_rest_pitch",singleName:"Juego aéreo"}},{label:"Barridas",value:{name:"Barridas",color:"#700000",points:[1],categories:[518],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.slide_tackles",singleName:"Barrida"}},{label:"Rechaces",value:{name:"Rechaces",color:"#CC0000",points:[1,2,3],categories:[34],invert:[],negative:!1,translationKey:"chalkboard.defensive.team.clearances",singleName:"Rechace"}}],PQe=[{label:"Goles",value:{name:"Goles",color:"#336DFF",points:[1,2,3],categories:[12,55,"35_r","54_r"],invert:[35,54],negative:!1,translationKey:"chalkboard.offensive.team.goals",singleName:"Gol",isDefaultSelected:!0}},{label:"Tiros a gol",value:{name:"Tiros a gol",color:"#7ED321",points:[1,2,3],categories:[510],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal",singleName:"Tiro a gol",isDefaultSelected:!1}},{label:"Tiros a gol (portería)",value:{name:"Tiros a gol (portería)",color:"#990BFF",points:[1,2,3],categories:[537,540,544,547],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.shots_on_goal_2",singleName:"Tiro a gol (portería)",isDefaultSelected:!1}},{label:"Centros totales",value:{name:"Centros totales",color:"#FF9226",points:[1,2,3],categories:[13,25],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.center_crosses",singleName:"Centro",isDefaultSelected:!1}},{label:"Centros acertados",value:{name:"Centros acertados",color:"#28A3B2",points:[1,2,3],categories:[98,101,104,105,109,112,115,116],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_center_crosses",singleName:"Centro acertado",isDefaultSelected:!1}},{label:"Balones ganados en área rival",value:{name:"Balones ganados en área rival",color:"#FF0092",points:[1,2],categories:[11],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.balls_won_opponent_penalty_box",singleName:"Balón ganado",isDefaultSelected:!1}},{label:"1vs1 exitosos ofensivos",value:{name:"1vs1 exitosos ofensivos",color:"#3A3838",points:[1],categories:[4],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.successful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"1vs1 no exitosos ofensivos",value:{name:"1vs1 no exitosos ofensivos",color:"#008B31",points:[1],categories:[208],invert:[],negative:!1,translationKey:"chalkboard.offensive.team.unsuccessful_1_on_1_attacking",singleName:"1 vs 1 ofensivo",isDefaultSelected:!1}},{label:"Remates con cabeza",value:{name:"Remates con cabeza",color:"#B4005A",points:[1,2,3],categories:[330,331,333,334,423,424,343,344],invert:[],negative:!1,translationKey:"",singleName:"Remate con cabeza",isDefaultSelected:!1}},{label:"Balón perdido en disputa",value:{name:"Balón perdido en disputa",color:"#9C08B0",points:[1,2,3],categories:[494],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido en disputa",isDefaultSelected:!1}},{label:"Balón perdido sin disputa",value:{name:"Balón perdido sin disputa",color:"#700000",points:[1,2,3],categories:[495],invert:[],negative:!1,translationKey:"",singleName:"Balón perdido sin disputa",isDefaultSelected:!1}}],AQe={class:"last-touch"},RQe={class:"selected-item"},UQe={class:"available-item"},FQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},IQe={class:"selected-item"},qQe={class:"available-item"},jQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WQe={key:1},DQe={class:"selected-item"},KQe={class:"available-item"},BQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},XQe={class:"last-touch__how-many-games"},GQe={class:"selected-item"},ZQe={class:"available-item"},JQe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},HQe={__name:"FilterLastTouch",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:r}){const a=e,v=r,$=t.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),h=t.ref({id:0,name:"Fases de juego",value:null}),u=t.ref(!1),i=t.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),p=t.ref(a.defaultFilters?null:i.value[0]),l=t.ref(null),n=t.computed(()=>({...sA})),k=t.computed(()=>({...sA,isFooterVisible:!a.isEditMode,isMultipleOption:!a.isEditMode})),T=t.computed(()=>{const ge=[];return x.value.options.forEach(be=>{be.forEach(xe=>{ge.push(xe)})}),ge}),x=t.ref(null),d=t.ref(null),o=t.ref(null),c=t.ref(null);t.watch(()=>a.viewConfig,ge=>{ge.filters&&(x.value||s(),d.value||f(),o.value||g(),c.value||P())},{immediate:!0});function s(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="categories");ge&&ge.options&&(x.value={label:ge.label,options:Object.entries(ge.options).reduce((be,[xe,Ae])=>(be.set(Number(xe),Ae),be),new Map)})}x.value={label:"Tipo de jugada",options:new Map([[2,PQe],[3,VQe]])}}function f(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="gamePhases");if(ge){d.value={label:ge.label,options:ge.options};return}}d.value={label:"Fases de juego",options:$.value}}function g(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="teamRadios");if(ge){o.value={options:ge.options},U(null,ge.options[0]);return}}o.value={label:"Equipo",options:a.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},U(null,o.value.options[0])}const S=t.ref(a.defaultFilters?null:o.value.options[0]),L=t.ref(a.defaultFilters?null:d.value.options[0]),E=t.ref(a.defaultFilters?null:x.value.options.get(L.value.value)[0]);function P(){if(a.viewConfig&&a.viewConfig.filters){const ge=a.viewConfig.filters.find(be=>be.key==="assistZoneCheckbox");if(ge){c.value={label:ge.label},z(ge.value);return}}c.value={label:"Zona de asistencia"}}const V=t.computed(()=>{const ge={selectedGamePhase:L.value,selectedTeam:S.value,isAssistZoneVisible:u.value,howManyGamesSelected:p.value};return a.isEditMode?(ge.selectedCategory=E.value,ge.totalCategoriesSelected=1):(ge.selectedCategories=l.value,ge.totalCategoriesSelected=0,x.value.options.forEach(be=>{be.forEach(xe=>{xe.isSelected&&(ge.totalCategoriesSelected+=1)})})),ge}),I=t.computed(()=>L.value?x.value.options.get(L.value.value)||[]:[]);t.watch(()=>V.value,ge=>{j()&&(console.log("before emit change:",{areAllFiltersFilled:j(),filters:ge,view:a.viewConfig}),v("change",{areAllFiltersFilled:j(),filters:ge,view:a.viewConfig}))},{deep:!0});function j(){return L.value&&(a.isEditMode&&E.value||!a.isEditMode&&l.value&&l.value.length)&&S.value&&p.value}function F(ge){L.value=ge,N(null)}function W(ge){S.value=ge}function U(ge,be){console.log("onChangeRadio:",be.value)}function z(ge){u.value=ge}function X(ge){p.value=ge}function N(ge){E.value=ge}function Y(ge,be){be.isSelected=ge,l.value=T.value.filter(xe=>xe.isSelected)}function se(){a.defaultFilters&&(u.value=a.defaultFilters.isAssistZoneVisible,p.value=i.value.find(ge=>ge.value===a.defaultFilters.howManyGamesSelected.value)||i.value[0],L.value=d.value.options.find(ge=>ge.value===a.defaultFilters.selectedGamePhase.value)||d.value.options[0],S.value=o.value.options.find(ge=>ge.value===(a.defaultFilters.isHomeTeam?1:2))||o.value.options[0],E.value=x.value.options.get(L.value.value).find(ge=>ge.value.name===a.defaultFilters.selectedCategory.name)||x.value.options.get(L.value.value)[0])}function me(){I.value.forEach(ge=>{ge.isSelected=!1}),u.value=!1,p.value=i.value[0],L.value=null,S.value=null,E.value=null,l.value=null}return t.onBeforeUnmount(()=>{me()}),t.onMounted(()=>{setTimeout(()=>{se()},500)}),(ge,be)=>(t.openBlock(),t.createElementBlock("div",AQe,[t.createVNode(t.unref($k),t.mergeProps(n.value,{items:d.value.options,"model-value":L.value,"onUpdate:modelValue":F}),{default:t.withCtx(()=>[t.createElementVNode("div",RQe,[be[0]||(be[0]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(L.value?L.value.label:d.value.label||h.value.name),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",UQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",FQe,[...be[1]||(be[1]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,L.value&&L.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(k.value,{items:I.value,"model-value":E.value,"onUpdate:modelValue":N}),{default:t.withCtx(()=>[t.createElementVNode("div",IQe,[be[2]||(be[2]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(x.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",qQe,[e.isEditMode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",jQe,[...be[3]||(be[3]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,E.value&&E.value.label===xe.label]])])],64)):(t.openBlock(),t.createElementBlock("div",WQe,[t.createVNode(t.unref(iA),{"model-value":xe.isSelected,label:xe.label,"onUpdate:modelValue":Ae=>Y(Ae,xe)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),t.createVNode(t.unref($k),t.mergeProps(n.value,{items:o.value.options,"model-value":S.value,"onUpdate:modelValue":W}),{default:t.withCtx(()=>[t.createElementVNode("div",DQe,[be[4]||(be[4]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(S.value?S.value.label:o.value.label),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",KQe,[t.createElementVNode("div",null,t.toDisplayString(xe.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",BQe,[...be[5]||(be[5]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,S.value&&S.value.label===xe.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(iA),{"model-value":u.value,label:c.value.label,"onUpdate:modelValue":z},null,8,["model-value","label"]),t.withDirectives(t.createElementVNode("div",XQe,[t.createVNode(t.unref($k),t.mergeProps(n.value,{items:i.value,"model-value":p.value,"onUpdate:modelValue":X}),{default:t.withCtx(()=>[t.createElementVNode("div",GQe,[be[6]||(be[6]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(p.value?p.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:xe})=>[t.createElementVNode("div",ZQe,[t.createElementVNode("div",null,t.toDisplayString(xe.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",JQe,[...be[7]||(be[7]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,p.value&&p.value.name===xe.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.isPostMatch]])]))}},YQe=t2(HQe,[["__scopeId","data-v-b006bd89"]]),QQe=(e,r)=>{const a=e.__vccOpts||e;for(const[v,$]of r)a[v]=$;return a},$Qe={__name:"GSC-Menu",props:{menuMarginTop:{type:Number,default:0,validator(e){return!Number.isNaN(e)}},modelValue:{type:Boolean,default:!1},width:{type:String,default:"fit-content"},menuWidth:{type:String,default:"fit-content"},zIndexOpen:{type:Number,default:3},leftMenu:{type:String,default:"unset"}},emits:["update:modelValue"],setup(e,{emit:r}){const a=e;t.useCssVars(x=>({"398d9242":e.width,f164e302:p.value,"4bb88040":e.menuWidth}));const v=t.ref(null),$=t.ref(!1),h=t.ref(null),u=t.ref({}),i=t.computed(()=>{const x={top:"0px","--left-menu":a.leftMenu};if(v.value){const d=v.value.getBoundingClientRect();x.top=`${d.height+a.menuMarginTop}px`}return x}),p=t.computed(()=>$.value?a.zIndexOpen:1);t.watch(()=>a.modelValue,x=>{x!==$.value&&($.value=x)},{immediate:!0}),t.watch($,x=>{x||setTimeout(()=>{u.value["--translate-x"]="0px"},500)});function l(x){const d=window.innerWidth,o=x.boundingClientRect.x,c=x.boundingClientRect.x+x.boundingClientRect.width,s=o<=0?Math.abs(o)+4:c>=d?d-(c+10):0;u.value["--translate-x"]=`${s}px`}function n(){new IntersectionObserver(x=>{x[0].intersectionRatio>0&&l(x[0])}).observe(h.value)}function k(){$.value=!$.value,r("update:modelValue",$.value)}function T(){$.value=!1,r("update:modelValue",$.value)}return t.onMounted(()=>{t.nextTick(()=>{n()})}),(x,d)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[$.value?(t.openBlock(),t.createElementBlock("div",{key:0,id:"menu-overlay",onClick:T})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"menu-container",style:t.normalizeStyle(u.value)},[t.createElementVNode("div",{ref_key:"trigger",ref:v,class:"menu-container__trigger",onClick:k},[t.renderSlot(x.$slots,"trigger",{},void 0,!0)],512),t.createVNode(t.Transition,null,{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{ref_key:"menu",ref:h,class:"menu-container__menu",style:t.normalizeStyle(i.value)},[t.renderSlot(x.$slots,"menu",{},void 0,!0)],4),[[t.vShow,$.value]])]),_:3})],4)],64))}},e$e=QQe($Qe,[["__scopeId","data-v-18c0df61"]]),Kb={CORNERS_ADVANCED:"cornersAdvanced"},t$e={key:0,class:"button__icon"},r$e={key:0,width:"19",height:"17",viewBox:"0 0 19 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a$e=["stroke"],n$e=["stroke"],i$e=["stroke"],o$e={key:1,width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},s$e=["stroke"],l$e=["stroke"],c$e=["fill"],u$e={key:2,width:"17",height:"17",viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},d$e=["fill"],p$e={key:3,width:"21",height:"18",viewBox:"0 0 21 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},h$e=["stroke"],f$e=["stroke"],m$e=["stroke"],y$e=["stroke"],g$e=["stroke"],v$e={key:4,width:"18",height:"17",viewBox:"0 0 18 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b$e={key:5,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x$e={key:6,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},_$e={key:7,width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},w$e={key:8,width:"19",height:"19",viewBox:"0 0 19 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T$e={class:"button__text"},S$e={key:0,class:"info-container"},k$e={key:1,style:{width:"20px"}},L$e={width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},C$e=["fill"],O$e={__name:"ButtonFilter",props:{isActive:{type:Boolean,default:!1},showBadge:{type:Boolean,default:!0},showBadgeOnFilterFull:{type:Boolean,default:!0},text:{type:String,default:""},infoValue:{type:[String,Number],default:""},filtersTotal:{type:Number,default:0},textFontFamily:{type:String,default:"sans-serif"},textFontSize:{type:String,default:"14px"},fontColor:{type:String,default:"white"},infoBackgroundColor:{type:String,default:"#424D58"},infoFontColor:{type:String,default:"#CBEE6B"},infoFontFamily:{type:String,default:"sans-serif"},infoFontSize:{type:String,default:"10px"},infoBorderColor:{type:String,default:"#0D1D29"},infoBorderRadius:{type:String,default:"4px"},infoHeight:{type:String,default:"20px"},infoWidth:{type:String,default:"20px"},height:{type:String,default:"fit-content"},width:{type:String,default:"fit-content"},backgroundColor:{type:String,default:"#0D1D29"},borderRadius:{type:String,default:"8px"},borderColor:{type:String,default:"#172531"},borderColorActive:{type:String,default:"white"},borderWidth:{type:String,default:"1px"},padding:{type:String,default:"12px"},arrowColor:{type:String,default:"#92929D"},iconColor:{type:String,default:"#92929D"},iconType:{type:String,default:"productivity"},showIcon:{type:Boolean,default:!0}},setup(e){const r=e,a=t.computed(()=>({"--height":r.height,"--width":r.width,"--text-font-family":r.textFontFamily,"--text-font-size":r.textFontSize,"--background-color":r.backgroundColor,"--border-radius":r.borderRadius,"--border-color":r.isActive?r.borderColorActive:r.borderColor,"--border-width":r.borderWidth,"--padding":r.padding,"--font-color":r.fontColor})),v=t.computed(()=>({"--info-background-color":r.infoValue?r.infoBackgroundColor:"transparent","--info-border-color":r.infoValue?r.infoBorderColor:"transparent","--info-border-radius":r.infoBorderRadius,"--info-font-family":r.infoFontFamily,"--info-font-size":r.infoFontSize,"--info-font-color":r.infoFontColor,"--info-height":r.infoHeight,"--info-width":r.infoWidth})),$=t.computed(()=>[Kb.PLAYS_TYPES,Kb.GOLSTATS,Kb.TOURNAMENTS,Kb.PLAYS,Kb.RESULTS,Kb.RESULTS_BY_TIME].includes(r.iconType)),h=t.computed(()=>[Kb.FIELD,Kb.GAMES].includes(r.iconType)),u=t.computed(()=>[Kb.DETAILS,Kb.UNIVERSE].includes(r.iconType)),i=t.computed(()=>[Kb.PERSONAL_DATA].includes(r.iconType)),p=t.computed(()=>[Kb.PRODUCTIVITY].includes(r.iconType)),l=t.computed(()=>(console.log("props.iconType",r.iconType),[Kb.CORNERS_ADVANCED].includes(r.iconType))),n=t.computed(()=>[Kb.HOW_WAS_CORNER].includes(r.iconType)),k=t.computed(()=>[Kb.TAKEN_CORNERS].includes(r.iconType)),T=t.computed(()=>[Kb.ZONE].includes(r.iconType)),x=t.computed(()=>[Kb.WHAT_HAPPENED].includes(r.iconType));return(d,o)=>(t.openBlock(),t.createElementBlock("div",{class:"button",style:t.normalizeStyle(a.value)},[e.showIcon?(t.openBlock(),t.createElementBlock("div",t$e,[i.value?(t.openBlock(),t.createElementBlock("svg",r$e,[t.createElementVNode("path",{d:"M12.6665 16.0001V14.3334C12.6665 13.4494 12.3153 12.6015 11.6902 11.9764C11.0651 11.3513 10.2173 11.0001 9.33323 11.0001H4.33329C3.44925 11.0001 2.60141 11.3513 1.9763 11.9764C1.35119 12.6015 1 13.4494 1 14.3334V16.0001",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,a$e),t.createElementVNode("path",{d:"M6.83329 7.66658C8.67422 7.66658 10.1666 6.17422 10.1666 4.33329C10.1666 2.49237 8.67422 1 6.83329 1C4.99237 1 3.5 2.49237 3.5 4.33329C3.5 6.17422 4.99237 7.66658 6.83329 7.66658Z",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,n$e),t.createElementVNode("path",{d:"M15.164 5.16663V10.1666M17.664 7.66659H12.6641",stroke:e.iconColor,"stroke-opacity":"1","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"},null,8,i$e)])):t.createCommentVNode("",!0),$.value||l.value?(t.openBlock(),t.createElementBlock("svg",o$e,[t.createElementVNode("path",{d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,s$e),t.createElementVNode("path",{d:"M15.9996 16.8727L14.8359 15.7091",stroke:e.iconColor,"stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,l$e),t.createElementVNode("path",{d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:e.iconColor,stroke:"#353F47","stroke-width":"0.3"},null,8,c$e)])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createElementBlock("svg",u$e,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.5 0C13.1944 0 17 3.80558 17 8.5C17 13.1944 13.1944 17 8.5 17C3.80558 17 0 13.1944 0 8.5C0 3.80558 3.80558 0 8.5 0ZM8.49751 1.54553C4.65662 1.54553 1.54297 4.65919 1.54297 8.50008C1.54297 12.341 4.65662 15.4546 8.49751 15.4546C12.3384 15.4546 15.4521 12.341 15.4521 8.50008C15.4521 4.65919 12.3384 1.54553 8.49751 1.54553ZM8.49929 3.09082C8.92605 3.09082 9.27202 3.43678 9.27202 3.86355V8.12198L12.451 10.5945C12.7878 10.8565 12.8485 11.342 12.5865 11.6789C12.3245 12.0157 11.839 12.0764 11.5022 11.8144L8.02488 9.10986C7.83666 8.96347 7.72656 8.73837 7.72656 8.49991V3.86355C7.72656 3.43678 8.07252 3.09082 8.49929 3.09082Z",fill:e.iconColor},null,8,d$e)])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock("svg",p$e,[t.createElementVNode("rect",{x:"1.16772",y:"1.16699",width:"19",height:"15.6667",stroke:e.iconColor},null,8,h$e),t.createElementVNode("rect",{x:"16.1677",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,f$e),t.createElementVNode("rect",{x:"1.16772",y:"6.16699",width:"4",height:"5.66667",stroke:e.iconColor},null,8,m$e),t.createElementVNode("path",{d:"M10.6677 0.666992V16.5003",stroke:e.iconColor},null,8,y$e),t.createElementVNode("path",{d:"M13.5033 9.00032C13.5033 10.5651 12.2348 11.8337 10.67 11.8337C9.1052 11.8337 7.83667 10.5651 7.83667 9.00032C7.83667 7.43552 9.1052 6.16699 10.67 6.16699C12.2348 6.16699 13.5033 7.43552 13.5033 9.00032Z",stroke:e.iconColor},null,8,g$e)])):t.createCommentVNode("",!0),p.value?(t.openBlock(),t.createElementBlock("svg",v$e,[...o[0]||(o[0]=[t.createElementVNode("path",{d:"M1.85113 13.0897C1.9303 13.2137 2.01739 13.3404 2.10447 13.4617C2.30239 13.7361 2.51878 14 2.74837 14.2507C3.74589 15.3298 5.01785 16.1504 6.41385 16.5963C6.4719 16.6148 6.52996 16.6332 6.58802 16.6491C6.60385 16.6544 6.61704 16.657 6.63024 16.6623C6.70413 16.6834 6.77538 16.7045 6.84927 16.723C7.54859 16.9077 8.27429 17 9.00264 17C9.73098 17 10.4593 16.9077 11.1586 16.7256C11.3064 16.686 11.4542 16.6438 11.5967 16.5989C11.9187 16.496 12.2353 16.372 12.5414 16.2322C12.7895 16.1187 13.0296 15.9921 13.2645 15.8549C14.2963 15.2533 15.2041 14.438 15.9034 13.467C15.9668 13.3799 16.0301 13.2876 16.0908 13.1926C16.1119 13.1609 16.133 13.1293 16.1541 13.095C16.9432 11.8681 17.405 10.4486 17.4868 8.98945C17.4947 8.84169 17.5 8.69393 17.5 8.54618C17.5 8.53034 17.5 8.51715 17.5 8.50132C17.5 6.90765 17.0646 5.37995 16.2386 4.04222C16.1198 3.85224 15.9932 3.66491 15.8612 3.48021C15.8586 3.47493 15.8559 3.4723 15.8533 3.46702C15.8084 3.40633 15.7636 3.34565 15.7161 3.2876C15.6712 3.22955 15.6237 3.1715 15.5789 3.1161C14.6526 1.98417 13.4466 1.10818 12.0928 0.580475C11.9556 0.525066 11.8105 0.474934 11.668 0.42744C10.8103 0.145118 9.91307 0 9.00264 0C8.09221 0 7.19497 0.14248 6.33732 0.424802C6.19482 0.472295 6.04967 0.525066 5.91245 0.577836C4.55604 1.10554 3.35005 1.98417 2.42378 3.11346C2.37364 3.17678 2.32086 3.24011 2.27072 3.30607C2.2285 3.35884 2.18892 3.41161 2.14933 3.46702C2.14933 3.46702 2.14933 3.46966 2.14669 3.4723C2.14669 3.47493 2.14405 3.47757 2.14142 3.48021C1.43418 4.44591 0.94598 5.53034 0.69792 6.68074C0.660975 6.85224 0.626669 7.02639 0.600279 7.20053C0.571251 7.39578 0.547501 7.59103 0.531667 7.78892C0.521111 7.91293 0.513195 8.03694 0.507917 8.16095C0.502639 8.27441 0.5 8.38786 0.5 8.50132V8.61214C0.502639 8.73615 0.507917 8.8628 0.513195 8.98945C0.595002 10.4486 1.05681 11.8681 1.84586 13.0923L1.85113 13.0897ZM1.82738 7.64908C1.82738 7.63325 1.83002 7.62005 1.83266 7.60422C1.84322 7.52771 1.85377 7.45119 1.86433 7.37731C1.86433 7.36412 1.86697 7.35092 1.86961 7.33773C1.8828 7.25594 1.89863 7.1715 1.91447 7.08971C1.91711 7.07124 1.92238 7.05541 1.92502 7.03694C1.94086 6.95778 1.95933 6.87599 1.9778 6.79683V6.78628C1.99891 6.70449 2.02266 6.62269 2.04378 6.5409C2.04905 6.52243 2.05433 6.5066 2.05961 6.48813C2.08336 6.40897 2.10711 6.32718 2.1335 6.24802L2.14142 6.22164C2.16517 6.14776 2.19156 6.07652 2.21794 6.00264C2.22322 5.98681 2.23114 5.97098 2.23642 5.95515C2.26545 5.87863 2.29711 5.79947 2.32878 5.72559C2.33406 5.70976 2.34197 5.69657 2.34725 5.68338C2.37628 5.61478 2.40795 5.54617 2.43962 5.47757C2.44489 5.46702 2.45017 5.45383 2.45545 5.44063C2.48975 5.36676 2.5267 5.29024 2.56628 5.21636C2.5742 5.20053 2.58212 5.1847 2.59267 5.16887C2.63226 5.09499 2.6692 5.02375 2.71143 4.94987V4.94195H2.7167L3.2656 6.63061L1.82738 7.67546C1.82738 7.67546 1.82738 7.65699 1.83002 7.64908H1.82738ZM4.08367 7.6095L5.62745 8.31926L6.52204 11.0712L5.62481 12.1108H2.74309C2.23642 11.2348 1.92238 10.2612 1.81683 9.25594L4.08367 7.6095ZM7.58026 1.41161C7.65942 1.39578 7.74123 1.37995 7.8204 1.36675C7.84151 1.36412 7.86262 1.35884 7.88109 1.3562C7.96026 1.34301 8.03679 1.33245 8.11596 1.32454C8.13971 1.3219 8.16346 1.31926 8.18721 1.31662C8.24791 1.30871 8.30596 1.30343 8.36666 1.29815C8.39305 1.29815 8.42207 1.29288 8.44846 1.29024C8.52235 1.28496 8.59361 1.27968 8.6675 1.27705C8.69916 1.27705 8.73347 1.27441 8.76514 1.27177C8.82319 1.27177 8.88125 1.26913 8.94194 1.26913C8.98153 1.26913 9.01847 1.26913 9.05806 1.26913C9.11611 1.26913 9.17681 1.26913 9.23487 1.27177C9.26653 1.27177 9.30084 1.27177 9.33251 1.27705C9.4064 1.27968 9.48029 1.28496 9.55154 1.29024C9.58057 1.29024 9.60696 1.29551 9.63334 1.29815C9.69404 1.30343 9.75473 1.30871 9.81279 1.31662C9.83654 1.31926 9.86029 1.3219 9.88668 1.32454C9.96585 1.33509 10.045 1.34565 10.1215 1.3562L10.1849 1.36675C10.264 1.37995 10.3459 1.39314 10.425 1.41161C10.4277 1.41161 10.4303 1.41161 10.4356 1.41161H10.4382L9 2.45646L7.56178 1.41161H7.56442C7.56442 1.41161 7.5697 1.41161 7.57234 1.41161H7.58026ZM9.00528 6.56728L11.1138 8.10026L10.3089 10.5805H7.70165L6.89677 8.10026L9.00528 6.56728ZM15.3018 4.94459V4.94987C15.3466 5.02111 15.3862 5.09499 15.4232 5.16887L15.4469 5.21636C15.4839 5.29024 15.5208 5.36676 15.5577 5.44063C15.563 5.45119 15.5683 5.46438 15.5736 5.47493C15.6052 5.54354 15.6369 5.61214 15.6659 5.68338C15.6712 5.69657 15.6791 5.7124 15.6844 5.72559C15.7161 5.80211 15.7478 5.87863 15.7768 5.95778C15.7821 5.97361 15.79 5.98945 15.7953 6.00528C15.8216 6.07916 15.848 6.1504 15.8718 6.22428C15.8744 6.23219 15.8771 6.24011 15.8797 6.25066C15.9061 6.32982 15.9298 6.40897 15.9536 6.49077C15.9589 6.50923 15.9641 6.52771 15.9694 6.54618C15.9905 6.62797 16.0143 6.70976 16.0328 6.78892C16.0328 6.7942 16.0328 6.79683 16.0328 6.80211C16.0512 6.88127 16.0697 6.96042 16.0855 7.03958L16.0961 7.09235C16.1119 7.17414 16.1278 7.25594 16.141 7.33773C16.141 7.35092 16.1462 7.36412 16.1462 7.37731C16.1568 7.45119 16.1673 7.52771 16.1779 7.60422C16.1779 7.62005 16.1805 7.63325 16.1832 7.64908C16.1832 7.65699 16.1832 7.66755 16.1858 7.67546L14.7476 6.63061L15.2965 4.93931L15.3018 4.94459ZM13.9295 7.61214L16.1937 9.25858C16.0882 10.2639 15.7715 11.2401 15.2675 12.1135H12.3858L11.4912 11.0739L12.3858 8.3219L13.9295 7.61214ZM14.3306 13.3879C14.3306 13.3879 14.3254 13.3931 14.3227 13.3958C14.2673 13.4565 14.2093 13.5172 14.1512 13.5752C14.138 13.5884 14.1248 13.6016 14.1116 13.6148C14.0536 13.6728 13.9929 13.7309 13.9322 13.7889C13.9216 13.7995 13.9111 13.81 13.8979 13.8206C13.8424 13.8707 13.7844 13.9235 13.729 13.971C13.7184 13.9789 13.7079 13.9894 13.6973 14C13.634 14.0554 13.5706 14.1055 13.5047 14.1583C13.4888 14.1715 13.473 14.1821 13.4598 14.1953C13.3938 14.2454 13.3278 14.2955 13.2619 14.3456C13.2619 14.3456 13.2566 14.3483 13.2566 14.3509C13.188 14.4011 13.1194 14.4486 13.0481 14.496C13.0323 14.5066 13.0165 14.5172 12.998 14.5277C12.9294 14.5726 12.8581 14.6174 12.7895 14.6623C12.7763 14.6702 12.7658 14.6781 12.7526 14.6834C12.6892 14.723 12.6233 14.7599 12.5573 14.7968C12.5441 14.8048 12.5283 14.8127 12.5151 14.8206C12.4438 14.8602 12.3699 14.8997 12.296 14.9367C12.2802 14.9446 12.2617 14.9525 12.2459 14.9631C12.1746 15 12.1007 15.0343 12.0295 15.0686C12.0242 15.0686 12.0189 15.0739 12.0137 15.0765H12.0084L12.5573 13.3879H14.3306ZM6.00217 15.0765L5.98898 15.0712C5.91509 15.0369 5.8412 15 5.76731 14.9631C5.75147 14.9551 5.73564 14.9472 5.71981 14.9393C5.64592 14.9024 5.57203 14.8628 5.49814 14.8206C5.48494 14.8127 5.47175 14.8048 5.45855 14.7995C5.39258 14.7625 5.32661 14.723 5.26063 14.6834C5.25008 14.6781 5.23688 14.6702 5.22633 14.6623C5.15508 14.6201 5.08646 14.5726 5.01521 14.5277C4.99938 14.5172 4.98355 14.5066 4.96771 14.496C4.89646 14.4486 4.82785 14.4011 4.75924 14.3509H4.75396C4.68799 14.2982 4.61937 14.248 4.5534 14.1953C4.53757 14.1821 4.52437 14.1715 4.50854 14.1583C4.44256 14.1055 4.37923 14.0554 4.3159 14C4.30534 13.9894 4.29478 13.9815 4.28159 13.971C4.22353 13.9208 4.16812 13.8707 4.1127 13.8206C4.10214 13.81 4.08895 13.7995 4.07839 13.7889C4.0177 13.7335 3.957 13.6755 3.89894 13.6148C3.88575 13.6016 3.87256 13.5884 3.85936 13.5752C3.8013 13.5172 3.74589 13.4591 3.69047 13.3984C3.68783 13.3958 3.68519 13.3931 3.67991 13.3879H5.45328L6.00217 15.0765C6.00217 15.0765 5.99954 15.0765 5.9969 15.0765H6.00217ZM7.50636 15.5726L6.63552 12.8971L7.53012 11.8602H10.4804L11.375 12.8971L10.5042 15.5726C9.52251 15.7784 8.48805 15.781 7.50373 15.5726H7.50636ZM14.3755 3.66755L13.4809 6.41953L11.9371 7.12929L9.6439 5.46174V3.57784L11.9503 1.90237C12.8713 2.31135 13.6999 2.91557 14.3781 3.66755H14.3755ZM6.06287 1.90237L8.3693 3.57784V5.46174L6.07606 7.12929L4.53229 6.41953L3.63769 3.66755C4.3159 2.91557 5.14452 2.31398 6.06551 1.90237H6.06287Z",fill:"#979DA2"},null,-1)])])):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createElementBlock("svg",b$e,[...o[1]||(o[1]=[t.createElementVNode("path",{d:"M17.182 5.9a.538.538 0 0 0-.13-.416L14.24 2.109a.558.558 0 0 0-.433-.203h-2.25c-.017 0-.034.012-.056.012a.557.557 0 0 0-.563.41 1.68 1.68 0 0 1-1.63 1.266 1.68 1.68 0 0 1-1.632-1.266.55.55 0 0 0-.563-.41c-.017 0-.033-.012-.056-.012h-2.25a.558.558 0 0 0-.433.203L1.561 5.484a.586.586 0 0 0-.129.416c.017.152.09.287.208.382l2.605 2.082v8.167c0 .31.253.563.562.563h9c.31 0 .563-.253.563-.563V8.364l2.604-2.082a.59.59 0 0 0 .208-.382zm-3.937 4.444H5.37V9.78h7.875v.563zM5.37 15.969v-4.5h7.875v4.5H5.37zm9-9.045v-.518a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v2.25H5.37v-2.25a.564.564 0 0 0-.563-.562.564.564 0 0 0-.562.562v.518L2.793 5.765l2.278-2.734h1.66A2.802 2.802 0 0 0 9.307 4.72a2.803 2.803 0 0 0 2.576-1.688h1.66l2.278 2.734-1.451 1.159z",fill:"#98A2B3"},null,-1)])])):t.createCommentVNode("",!0),n.value?(t.openBlock(),t.createElementBlock("svg",x$e,[...o[2]||(o[2]=[t.createElementVNode("path",{d:"M15.426 3.353a2.384 2.384 0 0 0-2.381 2.381 2.384 2.384 0 0 0 2.381 2.382 2.384 2.384 0 0 0 2.381-2.382 2.384 2.384 0 0 0-2.381-2.38zm0 3.766a1.386 1.386 0 0 1-1.385-1.385c0-.763.622-1.384 1.385-1.384s1.385.621 1.385 1.384c0 .764-.622 1.385-1.385 1.385zM1.424 6.558a.497.497 0 0 0 .704 0l1.295-1.296L4.72 6.558a.497.497 0 0 0 .704 0 .498.498 0 0 0 0-.705L4.128 4.558l1.295-1.295a.498.498 0 0 0-.705-.705L3.423 3.853 2.128 2.558a.499.499 0 0 0-.704.705l1.295 1.295-1.295 1.295a.498.498 0 0 0 0 .705zM13.013 12.443a.498.498 0 0 0-.705 0l-1.295 1.295-1.295-1.295a.499.499 0 0 0-.704.704l1.295 1.295-1.295 1.295a.499.499 0 0 0 .704.705l1.295-1.295 1.295 1.295a.497.497 0 0 0 .705 0 .498.498 0 0 0 0-.705l-1.295-1.295 1.295-1.295a.498.498 0 0 0 0-.704zM12.052 5.455l-2.01-1.747a.498.498 0 0 0-.654.753l1.066.926c-3.145.411-5.008 2.055-6.043 3.444a9.569 9.569 0 0 0-1.501 3.012 2.384 2.384 0 0 0-2.103 2.364 2.384 2.384 0 0 0 2.381 2.381 2.384 2.384 0 0 0 2.381-2.381 2.385 2.385 0 0 0-1.647-2.265 8.674 8.674 0 0 1 1.312-2.547C6.53 7.674 8.33 6.66 10.594 6.372l-.992 1.142a.498.498 0 0 0 .752.654l1.747-2.01a.498.498 0 0 0-.05-.703zm-7.48 8.752c0 .763-.62 1.384-1.384 1.384a1.386 1.386 0 0 1-1.384-1.384c0-.764.62-1.385 1.384-1.385.763 0 1.385.622 1.385 1.385z",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":".3"},null,-1)])])):t.createCommentVNode("",!0),T.value?(t.openBlock(),t.createElementBlock("svg",_$e,[...o[3]||(o[3]=[t.createElementVNode("rect",{x:".707",y:".9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:".9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:".707",y:"8.9",width:"5.2",height:"5.2",rx:".8",fill:"#98A2B3",stroke:"#98A2B3","stroke-width":"1.2"},null,-1),t.createElementVNode("rect",{x:"8.707",y:"8.9",width:"5.2",height:"5.2",rx:".8",stroke:"#98A2B3","stroke-width":"1.2"},null,-1)])])):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("svg",w$e,[...o[4]||(o[4]=[t.createStaticVNode('<g clip-path="url(#gpdeo9cu3a)" fill="#98A2B3" data-v-2df3c6a9><path d="M9.307.5C4.505.5.598 4.407.598 9.209c0 2 .69 3.938 1.946 5.486l-.754 3.159a.524.524 0 0 0 .727.599l3.038-1.384a8.743 8.743 0 0 0 3.752.848c4.802 0 8.709-3.907 8.709-8.708C18.016 4.407 14.109.5 9.307.5zm0 16.368a7.574 7.574 0 0 1-3.502-.845.525.525 0 0 0-.457-.011l-2.289 1.042.566-2.372a.524.524 0 0 0-.113-.465A7.657 7.657 0 0 1 1.647 9.21c0-4.224 3.436-7.66 7.66-7.66s7.66 3.436 7.66 7.66c0 4.223-3.436 7.66-7.66 7.66z" data-v-2df3c6a9></path><path d="M9.68 5.199c-1.094-.115-2.459.397-3.041 1.797a.524.524 0 0 0 .968.403c.375-.902 1.255-1.231 1.964-1.157.721.075 1.232.542 1.365 1.25.13.693-.136 1.097-1.097 1.662-1.042.613-1.372.874-1.372 2.27a.524.524 0 0 0 1.049 0c0-.479.033-.715.118-.843.094-.14.33-.283.737-.523.666-.392 1.905-1.12 1.596-2.76-.221-1.171-1.098-1.975-2.288-2.1zM9.145 12.673a.608.608 0 0 0-.506.17c-.13.13-.19.31-.17.505a.525.525 0 0 0 .939.263.523.523 0 0 0-.263-.938z" data-v-2df3c6a9></path></g><defs data-v-2df3c6a9><clipPath id="gpdeo9cu3a" data-v-2df3c6a9><path fill="#fff" transform="translate(.307 .5)" d="M0 0h18v18H0z" data-v-2df3c6a9></path></clipPath></defs>',2)])])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",T$e,t.toDisplayString(e.text),1),e.showBadge?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.showBadgeOnFilterFull?(t.openBlock(),t.createElementBlock("div",S$e,[t.createElementVNode("div",{class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[e.filtersTotal>0&&e.filtersTotal!=parseInt(e.infoValue)?(t.openBlock(),t.createElementBlock("div",{key:0,class:"button__info",style:t.normalizeStyle(v.value)},[t.withDirectives(t.createElementVNode("span",null,t.toDisplayString(e.infoValue),513),[[t.vShow,e.infoValue]])],4)):e.filtersTotal>0?(t.openBlock(),t.createElementBlock("div",k$e)):t.createCommentVNode("",!0)],64))],64)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["button__arrow",{"rotated-180":e.isActive}])},[(t.openBlock(),t.createElementBlock("svg",L$e,[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M4 2.62045L6.86193 0.167368C7.12228 -0.0557892 7.54439 -0.0557892 7.80474 0.167368C8.06509 0.390524 8.06509 0.752333 7.80474 0.97549L4.4714 3.83263C4.21105 4.05579 3.78895 4.05579 3.5286 3.83263L0.195262 0.97549C-0.0650874 0.752333 -0.0650874 0.390524 0.195262 0.167368C0.455612 -0.0557892 0.877722 -0.0557892 1.13807 0.167368L4 2.62045Z",fill:e.arrowColor},null,8,C$e)]))],2)],4))}},N$e=t2(O$e,[["__scopeId","data-v-2df3c6a9"]]),E$e={__name:"SwitchCustom",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:r}){const a=e,v=r,$=t.ref(null);t.watch(()=>a.modelValue,()=>{h()},{immediate:!0});function h(){$.value&&($.value.checked=a.modelValue)}function u(i){v("update:modelValue",i.target.checked)}return t.onMounted(()=>{h()}),(i,p)=>(t.openBlock(),t.createElementBlock("input",{ref_key:"switchCustom",ref:$,id:"toggle",class:"toggle",type:"checkbox",role:"switch",name:"toggle",onInput:u},null,544))}},lA=t2(E$e,[["__scopeId","data-v-e3a6ae4e"]]),z$e={class:"corners"},M$e={class:"corners-type"},V$e={class:"selected-item"},P$e={class:"available-item"},A$e={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R$e={class:"advanced-filters-menu"},U$e={class:"toggle-group"},F$e={class:"toggle-group"},I$e={key:0,class:"time-control"},q$e={class:"stepper-container"},j$e={class:"stepper"},W$e={class:"stepper-value"},D$e={class:"time-control"},K$e={class:"stepper-container"},B$e={class:"stepper"},X$e={class:"stepper-value"},G$e={class:"time-control"},Z$e={class:"stepper-container"},J$e={class:"stepper"},H$e={class:"stepper-value"},Y$e={class:"corners__how-many-games"},Q$e={class:"selected-item"},$$e={class:"available-item"},eet={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tet={__name:"FilterCorners",props:{viewConfig:{type:Object,default:()=>({})},isEditMode:{type:Boolean,default:!1},defaultFilters:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!0}},emits:["change","remove-views"],setup(e,{emit:r}){var a;const v=Array.from({length:10}).map((P,V)=>({id:V+1,name:`${V+1} ${V===0?"corner":"corners"}`,value:V+1})),$=e,h=r,u=t.ref([...v]),i=t.ref(u.value[0]),p=t.ref(c()),l=t.ref({backgroundColor:"#2e3b46",width:"96.2%",borderColor:"rgba(255, 255, 255, 0.20)",infoBorderColor:"rgba(255, 255, 255, 0.20)",height:"40px",padding:"0 4px",textFontFamily:"'Poppins-Regular'",showIcon:!1}),n=t.ref({label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}),k=t.ref(!1),T=t.ref($.defaultFilters?$.defaultFilters.isAgainstMode:!1),x=t.ref($.defaultFilters?null:(a=n.value)==null?void 0:a.options[0]),d=t.computed(()=>({...sA}));t.watch(()=>$.viewConfig,P=>{P.filters&&(n.value||s())},{immediate:!0});const o=t.computed(()=>({isAgainstMode:T.value,selectedTeam:x.value,howManyCorners:i.value?i.value.value:null,advancedFilters:{...p.value}}));t.watch(()=>o.value,P=>{console.log("before emit change",P),console.log("props.viewConfig",$.viewConfig),h("change",{filters:{...P,advancedFilters:{...P.advancedFilters,areConnectionsVisible:!P.advancedFilters.areConnectionsVisible,arePathsVisible:!P.advancedFilters.arePathsVisible}},view:$.viewConfig})},{deep:!0,immediate:!0});function c(){return{areConnectionsVisible:!0,arePathsVisible:!0,secondsBefore:-1,secondsAfter:0,secondsBeforeAndAfter:0}}function s(){if($.viewConfig&&$.viewConfig.filters){const P=$.viewConfig.filters.find(V=>V.key==="teamRadios");if(P){n.value={options:P.options};return}}n.value={label:"Equipo",options:$.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]}}function f(){console.log("setDefaultValues called with props.defaultFilters:",$.defaultFilters),$.defaultFilters&&(x.value=n.value.options.find(P=>P.value===($.defaultFilters.isHomeTeam?1:2))||n.value.options[0],p.value={...$.defaultFilters.advancedFilters,areConnectionsVisible:!$.defaultFilters.advancedFilters.areConnectionsVisible,arePathsVisible:!$.defaultFilters.advancedFilters.arePathsVisible})}function g(P){x.value=P}function S(P){i.value=P}function L(P,V){const I=p.value[V]+P;if(!(I<-5||I>10)){if(["secondsBefore","secondsAfter"].includes(V)){if(V==="secondsBefore"){if(p.value.secondsAfter<I)return}else if(p.value.secondsBefore>I)return}p.value[V]=I}}function E(){k.value=!1}return t.onBeforeUnmount(()=>{}),t.onMounted(()=>{setTimeout(()=>{f()},500)}),(P,V)=>(t.openBlock(),t.createElementBlock("div",z$e,[t.withDirectives(t.createElementVNode("div",M$e,[t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":!T.value}])}," A favor ",2),t.createVNode(lA,{modelValue:T.value,"onUpdate:modelValue":V[0]||(V[0]=I=>T.value=I)},null,8,["modelValue"]),t.createElementVNode("div",{class:t.normalizeClass(["label",{"switch-selected":T.value}])}," En contra ",2)],512),[[t.vShow,!e.isPostMatch]]),t.createVNode(t.unref($k),t.mergeProps(d.value,{items:n.value.options,"model-value":x.value,"onUpdate:modelValue":g}),{default:t.withCtx(()=>[t.createElementVNode("div",V$e,[V[10]||(V[10]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(x.value?x.value.label:n.value.label),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",P$e,[t.createElementVNode("div",null,t.toDisplayString(I.label),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",A$e,[...V[11]||(V[11]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,x.value&&x.value.label===I.label]])])])]),_:1},16,["items","model-value"]),t.createVNode(t.unref(e$e),{modelValue:k.value,"onUpdate:modelValue":V[9]||(V[9]=I=>k.value=I),width:"250px","left-menu":"0","menu-margin-top":18},{trigger:t.withCtx(()=>[t.createVNode(N$e,t.mergeProps(l.value,{text:"Filtros avanzados","show-badge-on-filter-full":!1,"filters-total":0,"is-active":k.value,"show-icon":!0,"icon-type":t.unref(Kb).CORNERS_ADVANCED}),null,16,["is-active","icon-type"])]),menu:t.withCtx(()=>[t.createElementVNode("div",R$e,[V[22]||(V[22]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar Conexiones",-1)),t.createElementVNode("div",U$e,[V[12]||(V[12]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(lA,{modelValue:p.value.areConnectionsVisible,"onUpdate:modelValue":V[1]||(V[1]=I=>p.value.areConnectionsVisible=I)},null,8,["modelValue"]),V[13]||(V[13]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),V[23]||(V[23]=t.createElementVNode("hr",{class:"separator"},null,-1)),V[24]||(V[24]=t.createElementVNode("h2",{class:"menu-title"},"Mostrar recorridos",-1)),t.createElementVNode("div",F$e,[V[14]||(V[14]=t.createElementVNode("label",{class:"toggle-label"},"Sí",-1)),t.createVNode(lA,{modelValue:p.value.arePathsVisible,"onUpdate:modelValue":V[2]||(V[2]=I=>p.value.arePathsVisible=I)},null,8,["modelValue"]),V[15]||(V[15]=t.createElementVNode("label",{class:"toggle-label"},"No",-1))]),p.value.arePathsVisible?(t.openBlock(),t.createElementBlock("div",I$e,[V[17]||(V[17]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" / "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",q$e,[t.createElementVNode("div",j$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[3]||(V[3]=I=>L(-1,"secondsBeforeAndAfter"))},"−"),t.createElementVNode("span",W$e,t.toDisplayString(p.value.secondsBeforeAndAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[4]||(V[4]=I=>L(1,"secondsBeforeAndAfter"))},"+")]),V[16]||(V[16]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",D$e,[V[19]||(V[19]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"antes"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",K$e,[t.createElementVNode("div",B$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[5]||(V[5]=I=>L(-1,"secondsBefore"))},"−"),t.createElementVNode("span",X$e,t.toDisplayString(p.value.secondsBefore),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[6]||(V[6]=I=>L(1,"secondsBefore"))},"+")]),V[18]||(V[18]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])]),t.createElementVNode("div",G$e,[V[21]||(V[21]=t.createElementVNode("label",{class:"time-label"},[t.createTextVNode(" Segundos "),t.createElementVNode("span",{class:"highlight"},"después"),t.createTextVNode(" del cobro: ")],-1)),t.createElementVNode("div",Z$e,[t.createElementVNode("div",J$e,[t.createElementVNode("button",{class:"stepper-btn",onClick:V[7]||(V[7]=I=>L(-1,"secondsAfter"))},"−"),t.createElementVNode("span",H$e,t.toDisplayString(p.value.secondsAfter),1),t.createElementVNode("button",{class:"stepper-btn",onClick:V[8]||(V[8]=I=>L(1,"secondsAfter"))},"+")]),V[20]||(V[20]=t.createElementVNode("div",{class:"stepper-unit"},"seg",-1))])])],64)),V[25]||(V[25]=t.createElementVNode("hr",{class:"separator"},null,-1)),t.createElementVNode("button",{class:"btn-ready",onClick:E},"Listo")])]),_:1},8,["modelValue"]),t.withDirectives(t.createElementVNode("div",Y$e,[t.createVNode(t.unref($k),t.mergeProps(d.value,{items:u.value,"model-value":i.value,"onUpdate:modelValue":S}),{default:t.withCtx(()=>[t.createElementVNode("div",Q$e,[V[26]||(V[26]=t.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"data-v-1238b29e":"",d:"M11.3464 15.7091C13.2744 15.7091 14.8373 14.1462 14.8373 12.2182C14.8373 10.2902 13.2744 8.72729 11.3464 8.72729C9.4184 8.72729 7.85547 10.2902 7.85547 12.2182C7.85547 14.1462 9.4184 15.7091 11.3464 15.7091Z",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M15.9996 16.8727L14.8359 15.7091",stroke:"#92929D","stroke-width":"1.2","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{"data-v-1238b29e":"",d:"M1.74545 14.1136H5.57341C5.80365 14.6432 6.11192 15.1265 6.4797 15.5591H1.74545C0.85957 15.5591 0.15 14.8495 0.15 13.9636V1.74545C0.15 0.85957 0.85957 0.15 1.74545 0.15H13.9636C14.8495 0.15 15.5591 0.85957 15.5591 1.74545V8.27117C15.1619 7.74472 14.6701 7.28299 14.1136 6.90213V1.74545V1.59545H13.9636H1.74545H1.59545V1.74545V13.9636V14.1136H1.74545ZM3.64091 3.64091H12.0682V5.08636H3.64091V3.64091ZM3.64091 7.13182H7.39844C6.87199 7.52898 6.41026 8.02079 6.0294 8.57727H3.64091V7.13182ZM3.64091 10.6227H5.20065C5.12651 11.0081 5.08636 11.3945 5.08636 11.7818V12.0682H3.64091V10.6227Z",fill:"#92929D",stroke:"#353F47","stroke-width":"0.3"})],-1)),t.createElementVNode("div",null,t.toDisplayString(i.value?i.value.name:"Seleccione"),1)])]),availableItem:t.withCtx(({item:I})=>[t.createElementVNode("div",$$e,[t.createElementVNode("div",null,t.toDisplayString(I.name),1),t.createElementVNode("div",null,[t.withDirectives((t.openBlock(),t.createElementBlock("svg",eet,[...V[27]||(V[27]=[t.createElementVNode("path",{d:"M12.7171 1.60412L5.34242 8.72375C5.16033 8.89955 4.91321 9 4.65308 9C4.39295 9 4.14582 8.89955 3.96373 8.72375L0.282891 5.17021C-0.0942971 4.80607 -0.0942971 4.20335 0.282891 3.8392C0.66008 3.47506 1.28439 3.47506 1.66158 3.8392L4.65308 6.72724L11.3384 0.273108C11.7156 -0.0910359 12.3399 -0.0910359 12.7171 0.273108C13.0943 0.637252 13.0943 1.22741 12.7171 1.60412Z",fill:"#CBEE6B"},null,-1)])],512)),[[t.vShow,i.value&&i.value.name===I.name]])])])]),_:1},16,["items","model-value"])],512),[[t.vShow,!e.defaultFilters]])]))}},ret=t2(tet,[["__scopeId","data-v-fea60946"]]),aet={class:"resultados-filter"},net={class:"filter-checkboxes"},iet=["checked","disabled","onChange"],oet={class:"checkbox-label"},set={class:"filter-actions"},cet={__name:"ResultadosFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=[{value:"iba-ganando",label:"Iba ganando"},{value:"iba-perdiendo",label:"Iba perdiendo"},{value:"iba-empatado",label:"Iba empatado"}],h=t.ref([]);t.watch(()=>a.selectedValues,k=>{var T;if(console.log("[ResultadosFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:k,filterValue:k==null?void 0:k[a.filterIndex],optionValue:(T=k==null?void 0:k[a.filterIndex])==null?void 0:T[a.optionIndex],isArray:Array.isArray(k),filterValueType:typeof(k==null?void 0:k[a.filterIndex])}),!k||!Array.isArray(k)){h.value.length===0&&(console.log("[ResultadosFilter] No hay valores en props, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"]);return}const x=k[a.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x))if(x[a.optionIndex]!==void 0){const d=Array.isArray(x[a.optionIndex])?x[a.optionIndex]:[];console.log("[ResultadosFilter] Valores encontrados para sincronizar:",d,"localSelectedValues actual:",h.value);const o=JSON.stringify(h.value.sort()),c=JSON.stringify(d.sort());o!==c?(console.log("[ResultadosFilter] Actualizando localSelectedValues con:",d),h.value=d.length>0?[...d]:[]):console.log("[ResultadosFilter] Los valores ya están sincronizados, no se actualiza");return}else console.log("[ResultadosFilter] filterValue existe pero no tiene optionIndex",a.optionIndex,"filterValue keys:",Object.keys(x));else console.log("[ResultadosFilter] filterValue no es un objeto válido:",x);h.value.length===0&&(console.log("[ResultadosFilter] No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])},{immediate:!0,deep:!0}),t.onMounted(()=>{var k,T,x;console.log("[ResultadosFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(k=a.selectedValues)==null?void 0:k[a.filterIndex],optionValue:(x=(T=a.selectedValues)==null?void 0:T[a.filterIndex])==null?void 0:x[a.optionIndex]}),t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const d=a.selectedValues[a.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[a.optionIndex]!==void 0){const o=Array.isArray(d[a.optionIndex])?d[a.optionIndex]:[];if(console.log("[ResultadosFilter] onMounted - Valores encontrados:",o),o.length>0){console.log("[ResultadosFilter] onMounted - Actualizando localSelectedValues con:",o),h.value=[...o];return}}}h.value.length===0&&(console.log("[ResultadosFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["iba-ganando","iba-perdiendo","iba-empatado"])})});const u=k=>h.value.includes(k),i=k=>h.value.length===1&&h.value.includes(k),p=(k,T)=>{let x=[...h.value];if(T)x.includes(k)||x.push(k);else{if(x.length===1)return;x=x.filter(d=>d!==k)}x.length===0&&(x=[$[0].value]),h.value=x,v("update-selection",{optionIndex:a.optionIndex,values:x})},l=()=>{const k=$.map(T=>T.value);h.value=[...k],v("update-selection",{optionIndex:a.optionIndex,values:[...k]})},n=()=>{v("done")};return(k,T)=>(t.openBlock(),t.createElementBlock("div",aet,[t.createElementVNode("div",net,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,x=>t.createElementVNode("label",{key:x.value,class:"checkbox-item"},[t.createElementVNode("input",{type:"checkbox",checked:u(x.value),disabled:i(x.value),onChange:t.withModifiers(d=>p(x.value,d.target.checked),["stop"])},null,40,iet),t.createElementVNode("span",oet,t.toDisplayString(x.label),1)])),64))]),t.createElementVNode("div",set,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(l,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(n,["stop"])}," Listo ")])]))}},SN=t2(cet,[["__scopeId","data-v-6b648e3f"]]),uet={class:"detalles-filter"},det={class:"filter-header"},pet={class:"checkbox-todos"},het=["checked"],fet={class:"time-section"},met={class:"time-buttons"},yet=["onClick"],get={class:"time-section"},vet={class:"time-buttons"},bet=["onClick"],xet={class:"filter-actions"},_et={__name:"DetallesFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=[{value:"0-15",label:"0-15"},{value:"16-30",label:"16-30"},{value:"31-45",label:"31-45"}],h=[{value:"46-60",label:"46-60"},{value:"61-75",label:"61-75"},{value:"76-90",label:"76-90"}],u=[...$,...h].map(d=>d.value),i=t.ref([]);t.watch(()=>a.selectedValues,d=>{var o;if(console.log("[DetallesFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:d,filterValue:d==null?void 0:d[a.filterIndex],optionValue:(o=d==null?void 0:d[a.filterIndex])==null?void 0:o[a.optionIndex]}),!d||!Array.isArray(d))return;const c=d[a.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[a.optionIndex]!==void 0){const s=Array.isArray(c[a.optionIndex])?c[a.optionIndex]:[];if(console.log("[DetallesFilter] Valores encontrados para sincronizar:",s),s.length>0){const f=JSON.stringify(i.value.sort()),g=JSON.stringify(s.sort());f!==g&&(console.log("[DetallesFilter] Actualizando localSelectedValues con:",s),i.value=[...s])}}},{immediate:!0,deep:!0});const p=t.computed(()=>[...$,...h].map(d=>d.value).every(d=>i.value.includes(d)));t.onMounted(()=>{var d,o,c;console.log("[DetallesFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(d=a.selectedValues)==null?void 0:d[a.filterIndex],optionValue:(c=(o=a.selectedValues)==null?void 0:o[a.filterIndex])==null?void 0:c[a.optionIndex]}),t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const s=a.selectedValues[a.filterIndex];if(s&&typeof s=="object"&&!Array.isArray(s)&&s[a.optionIndex]!==void 0){const f=Array.isArray(s[a.optionIndex])?s[a.optionIndex]:[];if(console.log("[DetallesFilter] onMounted - Valores encontrados:",f),f.length>0){console.log("[DetallesFilter] onMounted - Actualizando localSelectedValues con:",f),i.value=[...f];return}}}i.value.length===0&&(console.log("[DetallesFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),i.value=[...u])})});const l=d=>i.value.includes(d),n=d=>{const o=d.target.checked;let c=[];o?c=[...$,...h].map(s=>s.value):c=[u[0]],i.value=c,v("update-selection",{optionIndex:a.optionIndex,values:c})},k=d=>{let o=[...i.value];if(o.includes(d))if(o.length>1)o=o.filter(c=>c!==d);else return;else o.includes(d)||o.push(d);o.length===0&&(o=[u[0]]),i.value=o,v("update-selection",{optionIndex:a.optionIndex,values:o})},T=()=>{const d=[u[0]];i.value=d,v("update-selection",{optionIndex:a.optionIndex,values:d})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",uet,[t.createElementVNode("div",det,[o[1]||(o[1]=t.createElementVNode("span",{class:"filter-title"},"En: (Elige el lapso de tiempo)",-1)),t.createElementVNode("label",pet,[t.createElementVNode("input",{type:"checkbox",checked:p.value,onChange:t.withModifiers(n,["stop"])},null,40,het),o[0]||(o[0]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1))])]),t.createElementVNode("div",fet,[o[2]||(o[2]=t.createElementVNode("div",{class:"time-label"},"1er tiempo",-1)),t.createElementVNode("div",met,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,c=>t.createElementVNode("button",{key:c.value,class:t.normalizeClass(["time-button",{active:l(c.value)}]),onClick:t.withModifiers(s=>k(c.value),["stop"])},t.toDisplayString(c.label),11,yet)),64))])]),t.createElementVNode("div",get,[o[3]||(o[3]=t.createElementVNode("div",{class:"time-label"},"2do tiempo",-1)),t.createElementVNode("div",vet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(h,c=>t.createElementVNode("button",{key:c.value,class:t.normalizeClass(["time-button",{active:l(c.value)}]),onClick:t.withModifiers(s=>k(c.value),["stop"])},t.toDisplayString(c.label),11,bet)),64))])]),t.createElementVNode("div",xet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},cA=t2(_et,[["__scopeId","data-v-7bea3520"]]),wet={class:"como-fue-cobrado-filter"},Tet={class:"cobro-grid"},ket=["onClick"],Let={class:"cobro-image-container"},Cet=["src","alt"],Oet={class:"cobro-footer"},Net={class:"cobro-label"},Eet={class:"filter-actions"},zet={__name:"ComoFueCobradoFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=[{value:"comba-afuera",label:"Comba hacia afuera",image:"https://golstatsimages.blob.core.windows.net/content/comba-afuera-izquierda.png",count:10},{value:"comba-adentro",label:"Comba hacia adentro",image:"https://golstatsimages.blob.core.windows.net/content/comba-adentro-izquierda.png",count:2},{value:"raz-area",label:"Raz de área",image:"https://golstatsimages.blob.core.windows.net/content/raz-area-izquierda.png",count:0},{value:"en-corto",label:"En corto",image:"https://golstatsimages.blob.core.windows.net/content/en-corto-izquierda.png",count:1}],h=t.ref([]);t.watch(()=>a.selectedValues,n=>{var k;if(console.log("[ComoFueCobradoFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:n,filterValue:n==null?void 0:n[a.filterIndex],optionValue:(k=n==null?void 0:n[a.filterIndex])==null?void 0:k[a.optionIndex]}),!n||!Array.isArray(n)){h.value.length===0&&(h.value=[...$.map(x=>x.value)]);return}const T=n[a.filterIndex];if(T&&typeof T=="object"&&!Array.isArray(T)&&T[a.optionIndex]!==void 0){const x=Array.isArray(T[a.optionIndex])?T[a.optionIndex]:[];console.log("[ComoFueCobradoFilter] Valores encontrados para sincronizar:",x);const d=JSON.stringify(h.value.sort()),o=JSON.stringify(x.sort());d!==o&&(h.value=x.length>0?[...x]:[]);return}h.value.length===0&&(h.value=[...$.map(x=>x.value)])},{immediate:!0,deep:!0});const u=n=>h.value.includes(n),i=n=>{let k=[...h.value];k.includes(n)?k=k.filter(T=>T!==n):k.push(n),k.length===0&&(k=[...$.map(T=>T.value)]),h.value=k,v("update-selection",{optionIndex:a.optionIndex,values:k})};t.onMounted(()=>{var n,k,T;console.log("[ComoFueCobradoFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(n=a.selectedValues)==null?void 0:n[a.filterIndex],optionValue:(T=(k=a.selectedValues)==null?void 0:k[a.filterIndex])==null?void 0:T[a.optionIndex]}),t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const x=a.selectedValues[a.filterIndex];if(x&&typeof x=="object"&&!Array.isArray(x)&&x[a.optionIndex]!==void 0){const d=Array.isArray(x[a.optionIndex])?x[a.optionIndex]:[];if(console.log("[ComoFueCobradoFilter] onMounted - Valores encontrados:",d),d.length>0){console.log("[ComoFueCobradoFilter] onMounted - Actualizando localSelectedValues con:",d),h.value=[...d];return}}}h.value.length===0&&(console.log("[ComoFueCobradoFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),h.value=["izquierda",...$.map(x=>x.value)])})});const p=()=>{const n=[...$.map(k=>k.value)];h.value=n,v("update-selection",{optionIndex:a.optionIndex,values:n})},l=()=>{v("done")};return(n,k)=>(t.openBlock(),t.createElementBlock("div",wet,[t.createElementVNode("div",Tet,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList($,T=>t.createElementVNode("div",{key:T.value,class:t.normalizeClass(["cobro-item",{active:u(T.value)}]),onClick:t.withModifiers(x=>i(T.value),["stop"])},[t.createElementVNode("div",Let,[t.createElementVNode("img",{src:T.image,alt:T.label,class:"cobro-image"},null,8,Cet)]),t.createElementVNode("div",Oet,[t.createElementVNode("span",Net,t.toDisplayString(T.label),1)])],10,ket)),64))]),t.createElementVNode("div",Eet,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(p,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(l,["stop"])}," Listo ")])]))}},kN=t2(zet,[["__scopeId","data-v-fb6f9ab9"]]),Met={class:"zona-filter"},Vet={class:"template-zone"},Pet={class:"controls-zone-container"},Aet={class:"controls-zone-container-title-checkcon"},Ret={class:"controls-zone-container-title-checkcon-check"},Uet={class:"gsc-field-img-container"},Fet=["fill"],Iet=["fill"],qet=["fill"],jet=["fill"],Wet=["fill"],Det=["fill"],Ket=["fill"],Bet=["fill"],Xet=["fill"],Get=["fill"],Zet=["fill"],Jet=["fill"],Het=["fill"],Yet=["fill"],Qet=["fill"],$et=["fill"],ett=["fill"],ttt=["fill"],rtt=["fill"],att=["fill"],ntt=["fill"],itt=["fill"],ott=["fill"],stt=["fill"],ltt=["fill"],ctt=["fill"],utt=["fill"],dtt=["fill"],ptt=["fill"],htt=["fill"],ftt=["fill"],mtt=["fill"],ytt=["fill"],gtt=["fill"],vtt=["fill"],btt=["id"],xtt=["mask"],_tt={class:"filter-actions"},wtt={__name:"ZonaFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=Array.from({length:35},(x,d)=>d+1),h=t.ref(!0),u=t.ref([]),i=t.computed(()=>u.value),p=t.computed(()=>new Date().getTime());t.watch(()=>a.selectedValues,x=>{var d;if(console.log("[ZonaFilter] Watcher - selectedValues recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:x,filterValue:x==null?void 0:x[a.filterIndex],optionValue:(d=x==null?void 0:x[a.filterIndex])==null?void 0:d[a.optionIndex]}),!x||!Array.isArray(x)){u.value.length===0&&(console.log("[ZonaFilter] No hay valores en props, usando valores por defecto"),u.value=[...$],h.value=!0);return}const o=x[a.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)){if(o[a.optionIndex]!==void 0){const c=Array.isArray(o[a.optionIndex])?o[a.optionIndex]:[];console.log("[ZonaFilter] Valores encontrados para sincronizar:",c);const s=JSON.stringify(u.value.sort((g,S)=>g-S)),f=JSON.stringify(c.sort((g,S)=>g-S));s!==f&&(console.log("[ZonaFilter] Actualizando zonesLocal con:",c),u.value=c.length>0?[...c]:[],h.value=c.length===35);return}}else if(Array.isArray(o)&&o.length>0){console.log("[ZonaFilter] filterValue es array directo:",o);const c=JSON.stringify(u.value.sort((f,g)=>f-g)),s=JSON.stringify(o.sort((f,g)=>f-g));c!==s&&(console.log("[ZonaFilter] Actualizando zonesLocal con array directo:",o),u.value=[...o],h.value=o.length===35);return}u.value.length===0&&(console.log("[ZonaFilter] No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)},{immediate:!0,deep:!0}),t.watch(u,x=>{h.value=x.length===35,v("update-selection",{optionIndex:a.optionIndex,values:x})},{deep:!0});function l(x){console.log("value clickAllCheckbox: ",x),x?(u.value=[...$],h.value=!0):(u.value=[1],h.value=!1)}function n(x){u.value.includes(x)?u.value=u.value.filter(d=>d!==x):u.value.push(x),h.value=u.value.length===35}const k=()=>{u.value=[...$],h.value=!0},T=()=>{v("done")};return t.onMounted(()=>{var x,d,o;if(console.log("[ZonaFilter] onMounted - Valores recibidos:",{filterIndex:a.filterIndex,optionIndex:a.optionIndex,selectedValues:a.selectedValues,filterValue:(x=a.selectedValues)==null?void 0:x[a.filterIndex],optionValue:(o=(d=a.selectedValues)==null?void 0:d[a.filterIndex])==null?void 0:o[a.optionIndex]}),a.selectedValues&&Array.isArray(a.selectedValues)){const c=a.selectedValues[a.filterIndex];if(c&&typeof c=="object"&&!Array.isArray(c)&&c[a.optionIndex]!==void 0){const s=Array.isArray(c[a.optionIndex])?c[a.optionIndex]:[];if(console.log("[ZonaFilter] onMounted - Valores encontrados:",s),s.length>0){console.log("[ZonaFilter] onMounted - Actualizando zonesLocal con:",s),u.value=[...s],h.value=s.length===35;return}}}u.value.length===0&&(console.log("[ZonaFilter] onMounted - No se encontraron valores guardados, usando valores por defecto"),u.value=[...$],h.value=!0)}),(x,d)=>(t.openBlock(),t.createElementBlock("div",Met,[t.createElementVNode("div",Vet,[t.createElementVNode("div",Pet,[d[36]||(d[36]=t.createElementVNode("div",{class:"controls-zone-container-title"}," ¿A dónde fue el balón?: ",-1)),d[37]||(d[37]=t.createElementVNode("div",{class:"separator-line"},null,-1)),t.createElementVNode("div",Aet,[d[35]||(d[35]=t.createElementVNode("div",{class:"controls-zone-container-title-checkcon-label"}," Todas las zonas ",-1)),t.createElementVNode("div",Ret,[t.createVNode(t.unref(iA),{label:"",fontFamily:"Poppins-Regular",labelFontSize:"11px","label-color":"#FFF","model-value":h.value,"onUpdate:modelValue":l},null,8,["model-value"])])])]),t.createElementVNode("div",Uet,[(t.openBlock(),t.createElementBlock("svg",{key:`field-${u.value.length}`,width:"100%",height:"177",viewBox:"0 0 380 177",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("rect",{onClick:d[0]||(d[0]=o=>n(1)),class:"sector-field",x:"0.347042",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:i.value.includes(1)?"#FFFF0030":"#2e3b46"},null,8,Fet),t.createElementVNode("rect",{onClick:d[1]||(d[1]=o=>n(9)),class:"sector-field",x:"288.347",y:"0.347042",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(9)?"#FFFF0030":"#2e3b46"},null,8,Iet),t.createElementVNode("rect",{onClick:d[2]||(d[2]=o=>n(17)),class:"sector-field",x:"0.347042",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(17)?"#FFFF0030":"#2e3b46"},null,8,qet),t.createElementVNode("rect",{onClick:d[3]||(d[3]=o=>n(25)),class:"sector-field",x:"288.347",y:"44.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(25)?"#FFFF0030":"#2e3b46"},null,8,jet),t.createElementVNode("rect",{onClick:d[4]||(d[4]=o=>n(26)),class:"sector-field",x:"0.347042",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(26)?"#FFFF0030":"#2e3b46"},null,8,Wet),t.createElementVNode("rect",{onClick:d[5]||(d[5]=o=>n(27)),class:"sector-field",x:"91.347",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(27)?"#FFFF0030":"#2e3b46"},null,8,Det),t.createElementVNode("rect",{onClick:d[6]||(d[6]=o=>n(28)),class:"sector-field",x:"157.015",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(28)?"#FFFF0030":"#2e3b46"},null,8,Ket),t.createElementVNode("rect",{onClick:d[7]||(d[7]=o=>n(29)),class:"sector-field",x:"222.679",y:"88.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(29)?"#FFFF0030":"#2e3b46"},null,8,Bet),t.createElementVNode("rect",{onClick:d[8]||(d[8]=o=>n(30)),class:"sector-field",x:"288.347",y:"88.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(30)?"#FFFF0030":"#2e3b46"},null,8,Xet),t.createElementVNode("rect",{onClick:d[9]||(d[9]=o=>n(31)),class:"sector-field",x:"0.347042",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(31)?"#FFFF0030":"#2e3b46"},null,8,Get),t.createElementVNode("rect",{onClick:d[10]||(d[10]=o=>n(32)),class:"sector-field",x:"91.347",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(32)?"#FFFF0030":"#2e3b46"},null,8,Zet),t.createElementVNode("rect",{onClick:d[11]||(d[11]=o=>n(33)),class:"sector-field",x:"157.015",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(33)?"#FFFF0030":"#2e3b46"},null,8,Jet),t.createElementVNode("rect",{onClick:d[12]||(d[12]=o=>n(34)),class:"sector-field",x:"222.679",y:"132.347",width:"65.9726",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(34)?"#FFFF0030":"#2e3b46"},null,8,Het),t.createElementVNode("rect",{onClick:d[13]||(d[13]=o=>n(35)),class:"sector-field",x:"288.347",y:"132.347",width:"91.3059",height:"44.3059",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(35)?"#FFFF0030":"#2e3b46"},null,8,Yet),t.createElementVNode("rect",{onClick:d[14]||(d[14]=o=>n(2)),class:"sector-field",x:"91.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(2)?"#FFFF0030":"#2e3b46"},null,8,Qet),t.createElementVNode("rect",{onClick:d[15]||(d[15]=o=>n(3)),class:"sector-field",x:"114.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(3)?"#FFFF0030":"#2e3b46"},null,8,$et),t.createElementVNode("rect",{onClick:d[16]||(d[16]=o=>n(4)),class:"sector-field",x:"137.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(4)?"#FFFF0030":"#2e3b46"},null,8,ett),t.createElementVNode("rect",{onClick:d[17]||(d[17]=o=>n(5)),class:"sector-field",x:"172.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(5)?"#FFFF0030":"#2e3b46"},null,8,ttt),t.createElementVNode("rect",{onClick:d[18]||(d[18]=o=>n(6)),class:"sector-field",x:"207.347",y:"0.347042",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(6)?"#FFFF0030":"#2e3b46"},null,8,rtt),t.createElementVNode("rect",{onClick:d[19]||(d[19]=o=>n(7)),class:"sector-field",x:"242.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(7)?"#FFFF0030":"#2e3b46"},null,8,att),t.createElementVNode("rect",{onClick:d[20]||(d[20]=o=>n(8)),class:"sector-field",x:"265.347",y:"0.347042",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(8)?"#FFFF0030":"#2e3b46"},null,8,ntt),t.createElementVNode("rect",{onClick:d[21]||(d[21]=o=>n(10)),class:"sector-field",x:"91.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(10)?"#FFFF0030":"#2e3b46"},null,8,itt),t.createElementVNode("rect",{onClick:d[22]||(d[22]=o=>n(11)),class:"sector-field",x:"114.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(11)?"#FFFF0030":"#2e3b46"},null,8,ott),t.createElementVNode("rect",{onClick:d[23]||(d[23]=o=>n(12)),class:"sector-field",x:"137.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(12)?"#FFFF0030":"#2e3b46"},null,8,stt),t.createElementVNode("rect",{onClick:d[24]||(d[24]=o=>n(13)),class:"sector-field",x:"172.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(13)?"#FFFF0030":"#2e3b46"},null,8,ltt),t.createElementVNode("rect",{onClick:d[25]||(d[25]=o=>n(14)),class:"sector-field",x:"207.347",y:"29.6804",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(14)?"#FFFF0030":"#2e3b46"},null,8,ctt),t.createElementVNode("rect",{onClick:d[26]||(d[26]=o=>n(15)),class:"sector-field",x:"242.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(15)?"#FFFF0030":"#2e3b46"},null,8,utt),t.createElementVNode("rect",{onClick:d[27]||(d[27]=o=>n(16)),class:"sector-field",x:"265.347",y:"29.6804",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(16)?"#FFFF0030":"#2e3b46"},null,8,dtt),t.createElementVNode("rect",{onClick:d[28]||(d[28]=o=>n(18)),class:"sector-field",x:"91.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(18)?"#FFFF0030":"#2e3b46"},null,8,ptt),t.createElementVNode("rect",{onClick:d[29]||(d[29]=o=>n(19)),class:"sector-field",x:"114.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(19)?"#FFFF0030":"#2e3b46"},null,8,htt),t.createElementVNode("rect",{onClick:d[30]||(d[30]=o=>n(20)),class:"sector-field",x:"137.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(20)?"#FFFF0030":"#2e3b46"},null,8,ftt),t.createElementVNode("rect",{onClick:d[31]||(d[31]=o=>n(21)),class:"sector-field",x:"172.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(21)?"#FFFF0030":"#2e3b46"},null,8,mtt),t.createElementVNode("rect",{onClick:d[32]||(d[32]=o=>n(22)),class:"sector-field",x:"207.347",y:"59.0137",width:"35.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(22)?"#FFFF0030":"#2e3b46"},null,8,ytt),t.createElementVNode("rect",{onClick:d[33]||(d[33]=o=>n(23)),class:"sector-field",x:"242.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(23)?"#FFFF0030":"#2e3b46"},null,8,gtt),t.createElementVNode("rect",{onClick:d[34]||(d[34]=o=>n(24)),class:"sector-field",x:"265.347",y:"59.0137",width:"23.3059",height:"29.6392",stroke:"#9ECF55","stroke-width":"0.694084","stroke-dasharray":"2 2",fill:u.value.includes(24)?"#FFFF0030":"#2e3b46"},null,8,vtt),d[40]||(d[40]=t.createElementVNode("rect",{x:"91.6",y:"0.6",width:"196.8",height:"87.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),d[41]||(d[41]=t.createElementVNode("rect",{x:"137.6",y:"0.782404",width:"104.8",height:"28.8",stroke:"#DFE3E2","stroke-width":"1.2"},null,-1)),t.createElementVNode("mask",{id:p.value,style:{"mask-type":"alpha"},maskUnits:"userSpaceOnUse",x:"91",y:"88",width:"198",height:"25"},[...d[38]||(d[38]=[t.createElementVNode("rect",{width:"197.746",height:"24.6043",transform:"matrix(1 0 0 -1 91 113)",fill:"#D9D9D9"},null,-1)])],8,btt),t.createElementVNode("g",{mask:`url(#${p.value})`},[...d[39]||(d[39]=[t.createElementVNode("circle",{cx:"185.329",cy:"56.5046",r:"52.6152",stroke:"#DFE3E2","stroke-width":"1.38817"},null,-1)])],8,xtt),d[42]||(d[42]=t.createElementVNode("circle",{cx:"190.278",cy:"66.2782",r:"2.27817",fill:"white"},null,-1)),d[43]||(d[43]=t.createElementVNode("rect",{x:"0.7",y:"0.7",width:"378.6",height:"175.6",stroke:"#DFE3E2","stroke-width":"1.4"},null,-1))]))])]),t.createElementVNode("div",_tt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(k,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},uA=t2(wtt,[["__scopeId","data-v-203bc904"]]),Ttt={class:"que-sucedio-filter"},Stt={class:"filter-header"},ktt={class:"checkbox-item todos-header"},Ltt=["checked"],Ctt={class:"filter-section"},Ott={class:"checkbox-item main-option"},Ntt=["checked"],Ett={class:"sub-options"},ztt={class:"checkbox-item sub-option"},Mtt=["checked"],Vtt={class:"checkbox-item sub-option"},Ptt=["checked"],Att={class:"filter-section"},Rtt={class:"checkbox-item main-option"},Utt=["checked"],Ftt={class:"sub-options"},Itt={class:"checkbox-item sub-option"},qtt=["checked"],jtt={class:"checkbox-item sub-option"},Wtt=["checked"],Dtt={class:"checkbox-item sub-option"},Ktt=["checked"],Btt={class:"filter-actions"},Xtt={__name:"QueSucedioFilter",props:{option:{type:Object,required:!0},filterIndex:{type:Number,required:!0},optionIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","done"],setup(e,{emit:r}){const a=e,v=r,$=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],h={"rematado-destino-porteria":["fue-gol","no-fue-gol"],"rematado-sin-destino-porteria":["ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"]},u=t.ref([]);t.watch(()=>a.selectedValues,d=>{if(!d||!Array.isArray(d))return;const o=d[a.filterIndex];if(o&&typeof o=="object"&&!Array.isArray(o)&&o[a.optionIndex]!==void 0){const c=Array.isArray(o[a.optionIndex])?o[a.optionIndex]:[];if(c.length>0){const s=JSON.stringify(u.value.sort()),f=JSON.stringify(c.sort());s!==f&&(u.value=[...c])}}},{immediate:!0,deep:!0}),t.onMounted(()=>{t.nextTick(()=>{if(a.selectedValues&&Array.isArray(a.selectedValues)){const d=a.selectedValues[a.filterIndex];if(d&&typeof d=="object"&&!Array.isArray(d)&&d[a.optionIndex]!==void 0){const o=Array.isArray(d[a.optionIndex])?d[a.optionIndex]:[];if(o.length>0){u.value=[...o];return}}}u.value.length===0&&(u.value=[...$])})});const i=t.computed(()=>$.every(d=>u.value.includes(d))),p=d=>u.value.includes(d),l=d=>{d.target.checked?u.value=[...$]:u.value=[],v("update-selection",{optionIndex:a.optionIndex,values:[...u.value]})},n=(d,o)=>{let c=[...u.value];const s=h[d]||[];o?(c.includes(d)||c.push(d),s.forEach(f=>{c.includes(f)||c.push(f)})):c=c.filter(f=>f!==d&&!s.includes(f)),u.value=c,v("update-selection",{optionIndex:a.optionIndex,values:c})},k=(d,o)=>{let c=[...u.value];const s=Object.keys(h).find(f=>h[f].includes(d));o?(c.includes(d)||c.push(d),s&&h[s].every(f=>c.includes(f))&&!c.includes(s)&&c.push(s)):(c=c.filter(f=>f!==d),s&&c.includes(s)&&(c=c.filter(f=>f!==s))),u.value=c,v("update-selection",{optionIndex:a.optionIndex,values:c})},T=()=>{u.value=[...$],v("update-selection",{optionIndex:a.optionIndex,values:[...$]})},x=()=>{v("done")};return(d,o)=>(t.openBlock(),t.createElementBlock("div",Ttt,[t.createElementVNode("div",Stt,[t.createElementVNode("label",ktt,[o[7]||(o[7]=t.createElementVNode("span",{class:"checkbox-label"},"Todos",-1)),t.createElementVNode("input",{type:"checkbox",checked:i.value,onChange:t.withModifiers(l,["stop"])},null,40,Ltt)])]),o[15]||(o[15]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Ctt,[t.createElementVNode("label",Ott,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-destino-porteria"),onChange:o[0]||(o[0]=t.withModifiers(c=>n("rematado-destino-porteria",c.target.checked),["stop"]))},null,40,Ntt),o[8]||(o[8]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado con destino a portería",-1))]),t.createElementVNode("div",Ett,[t.createElementVNode("label",ztt,[t.createElementVNode("input",{type:"checkbox",checked:p("fue-gol"),onChange:o[1]||(o[1]=t.withModifiers(c=>k("fue-gol",c.target.checked),["stop"]))},null,40,Mtt),o[9]||(o[9]=t.createElementVNode("span",{class:"checkbox-label"},"Fue gol",-1))]),t.createElementVNode("label",Vtt,[t.createElementVNode("input",{type:"checkbox",checked:p("no-fue-gol"),onChange:o[2]||(o[2]=t.withModifiers(c=>k("no-fue-gol",c.target.checked),["stop"]))},null,40,Ptt),o[10]||(o[10]=t.createElementVNode("span",{class:"checkbox-label"},"No fue gol",-1))])])]),o[16]||(o[16]=t.createElementVNode("div",{class:"separator"},null,-1)),t.createElementVNode("div",Att,[t.createElementVNode("label",Rtt,[t.createElementVNode("input",{type:"checkbox",checked:p("rematado-sin-destino-porteria"),onChange:o[3]||(o[3]=t.withModifiers(c=>n("rematado-sin-destino-porteria",c.target.checked),["stop"]))},null,40,Utt),o[11]||(o[11]=t.createElementVNode("span",{class:"checkbox-label"},"Rematado sin destino a portería",-1))]),t.createElementVNode("div",Ftt,[t.createElementVNode("label",Itt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-portero-rival"),onChange:o[4]||(o[4]=t.withModifiers(c=>k("ganados-por-portero-rival",c.target.checked),["stop"]))},null,40,qtt),o[12]||(o[12]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por portero rival",-1))]),t.createElementVNode("label",jtt,[t.createElementVNode("input",{type:"checkbox",checked:p("ganados-por-jugador-rival"),onChange:o[5]||(o[5]=t.withModifiers(c=>k("ganados-por-jugador-rival",c.target.checked),["stop"]))},null,40,Wtt),o[13]||(o[13]=t.createElementVNode("span",{class:"checkbox-label"},"Ganados por jugador rival",-1))]),t.createElementVNode("label",Dtt,[t.createElementVNode("input",{type:"checkbox",checked:p("sin-destino"),onChange:o[6]||(o[6]=t.withModifiers(c=>k("sin-destino",c.target.checked),["stop"]))},null,40,Ktt),o[14]||(o[14]=t.createElementVNode("span",{class:"checkbox-label"},"Sin destino",-1))])])]),t.createElementVNode("div",Btt,[t.createElementVNode("button",{class:"btn-remove-filters",onClick:t.withModifiers(T,["stop"])}," Quitar filtros "),t.createElementVNode("button",{class:"btn-done",onClick:t.withModifiers(x,["stop"])}," Listo ")])]))}},u9=t2(Xtt,[["__scopeId","data-v-e3994cc8"]]),Gtt={class:"advanced-select-accordion"},Ztt=["onClick"],Jtt={class:"accordion-header-left"},Htt={class:"accordion-icon"},Ytt=["src","alt"],Qtt={class:"accordion-title"},$tt={class:"accordion-header-right"},ert={key:0,class:"accordion-badge"},trt={key:0,class:"accordion-content"},rrt={class:"accordion-footer"},art={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:r}){const a=e;t.watch(()=>a.selectedValues,x=>{console.log("Acorden inicla 55555555555v [AdvancedSelectAccordion] selectedValues recibidos:",{filterIndex:a.filterIndex,selectedValues:x,filterValue:x==null?void 0:x[a.filterIndex],filterValueType:typeof(x==null?void 0:x[a.filterIndex]),isArray:Array.isArray(x==null?void 0:x[a.filterIndex]),filterValueKeys:x!=null&&x[a.filterIndex]&&typeof(x==null?void 0:x[a.filterIndex])=="object"?Object.keys(x[a.filterIndex]):null})},{immediate:!0,deep:!0});const v=r,$=t.ref({}),h=x=>{$.value[x]?$.value[x]=!1:(Object.keys($.value).forEach(d=>{$.value[d]=!1}),$.value[x]=!0)},u=x=>{const d=a.filter.options[x];if(!d||!d.filters)return 0;const o=a.selectedValues[a.filterIndex];if(!o||!o[x])return 0;const c=o[x];return Array.isArray(c)?c.length:0},i=(x,d)=>x.icon?x.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${d+1}.png`,p=x=>x==="Qué sucedió?"||x==="Qué sucedió"?"¿Qué sucedió?":x,l=x=>{const d={resultados:SN,detalles:cA,"como-fue-cobrado":kN,"como fue cobrado":kN,zona:uA,"que-sucedio":u9,"qué sucedió":u9,"que sucedio":u9},o=typeof x.value=="string"?x.value:String(x.value||""),c=typeof x.label=="string"?x.label:String(x.label||""),s=o.toLowerCase().trim(),f=c.toLowerCase().trim();if(s&&d[s])return d[s];if(f&&d[f])return d[f];const g=f.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,S=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[S]||S);return g&&d[g]?d[g]:SN},n=x=>{v("update-selection",{filterIndex:a.filterIndex,optionIndex:x.optionIndex,values:x.values})},k=x=>{$.value[x]=!1},T=()=>{v("close")};return(x,d)=>(t.openBlock(),t.createElementBlock("div",Gtt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filter.options,(o,c)=>(t.openBlock(),t.createElementBlock("div",{key:o.value||c,class:"accordion-item"},[t.createElementVNode("div",{class:"accordion-header",onClick:t.withModifiers(s=>h(c),["stop"])},[t.createElementVNode("div",Jtt,[t.createElementVNode("span",Htt,[t.createElementVNode("img",{src:i(o,c),alt:o.label},null,8,Ytt)]),t.createElementVNode("span",Qtt,t.toDisplayString(p(o.label)),1)]),t.createElementVNode("div",$tt,[u(c)>0?(t.openBlock(),t.createElementBlock("span",ert,t.toDisplayString(u(c)),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["accordion-chevron",{open:$.value[c]}])},[...d[0]||(d[0]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,Ztt),t.createVNode(t.Transition,{name:"accordion"},{default:t.withCtx(()=>[$.value[c]?(t.openBlock(),t.createElementBlock("div",trt,[l(o)===SN?(t.openBlock(),t.createBlock(SN,{key:0,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===cA?(t.openBlock(),t.createBlock(cA,{key:1,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===kN?(t.openBlock(),t.createBlock(kN,{key:2,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===uA?(t.openBlock(),t.createBlock(uA,{key:3,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):l(o)===u9?(t.openBlock(),t.createBlock(u9,{key:4,option:o,"filter-index":e.filterIndex,"option-index":c,"selected-values":e.selectedValues,onUpdateSelection:n,onDone:()=>k(c)},null,8,["option","filter-index","option-index","selected-values","onDone"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:2},1024)]))),128)),t.createElementVNode("div",rrt,[d[1]||(d[1]=t.createElementVNode("div",{class:"footer-separator"},null,-1)),t.createElementVNode("button",{class:"btn-done-footer",onClick:t.withModifiers(T,["stop"])}," Listo ")])]))}},nrt=t2(art,[["__scopeId","data-v-92b4e8ad"]]),irt={class:"corners-zone-filters"},ort={key:0,class:"custom-radio-group"},srt={class:"radio-label"},lrt={class:"radio-options"},crt=["name","value","onUpdate:modelValue"],urt={key:0,class:"filter-separator"},drt={class:"filter-inline select-with-label"},prt=["data-filter-type","onClick"],hrt={class:"select-display"},frt={class:"select-label"},mrt={key:0,class:"dropdown-menu type-menu simple-select-menu"},yrt={class:"simple-select-scroll-area"},grt=["onClick"],vrt={class:"option-content"},brt={class:"option-title"},xrt={key:0,class:"option-checkmark"},_rt={class:"switch-group"},wrt={class:"switch-label"},Trt=["onClick"],Srt={key:0,class:"filter-separator"},krt={key:3,class:"filter-inline advanced-select-wrapper"},Lrt=["data-filter-type","onClick"],Crt={class:"select-display"},Ort={class:"select-label"},Nrt={__name:"CornersZoneFilters",props:{filters:{type:Array,default:()=>[]},initialValues:{type:Array,default:()=>[]},isEditMode:{type:Boolean,default:!1},componentId:{type:Number,default:17},viewConfig:{type:Object,default:()=>({})},defaultFilters:{type:Object,default:()=>null}},emits:["filters-changed","filter-updated","change","remove-views"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref([]);let u=null;const i=t.ref(null),p=t.ref(null),l=t.ref([]);let n=!1,k=null;const T=(I,j)=>{if(Array.isArray(I)&&Array.isArray(j)){if(I.length!==j.length)return!1;for(let F=0;F<I.length;F++)if(I[F]!==j[F])return!1;return!0}return I===j},x=(I,j=!0)=>{if(v.filters&&v.filters[0]&&v.filters[1]){const F=v.filters[0],W=v.filters[1],U=F.options,z=W.options;U&&Array.isArray(U)&&z?I!=null?U.findIndex(X=>X.value===I)!==-1&&z[I]?(l.value=z[I],j&&!(()=>{const X=h.value[1];return X==null?!1:Array.isArray(X)?X.length>0:X!==""})()&&!n&&l.value.length>0&&(h.value[1]=l.value[0].value,t.nextTick(()=>{}))):(l.value=[],h.value[1]=null):(l.value=[],h.value[1]=null):l.value=[]}},d=()=>{var I,j,F;v.initialValues&&v.initialValues.length>0?v.initialValues.length>0&&(typeof v.initialValues[0]=="number"||typeof v.initialValues[0]=="boolean"||v.initialValues[0]===null||Array.isArray(v.initialValues[0]))?h.value=v.filters.map((z,X)=>{var N,Y,se,me;const ge=v.initialValues[X];if(ge!=null)return z.type==="switch"&&v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${X} (formato simple):`,ge),ge;if(z.type==="radio-button")return((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null;if(z.type==="advanced-select"){console.log("8888888888888888888888888888 LLEgo auqi mero inicio de davances filters: ",z.type,z.options);const be={};let xe=!1;return z.options&&Array.isArray(z.options)&&(console.log("999999999999999999999999 LLEgo auqi mero inicio de davances filters: options",z.options),z.options.forEach((Ae,je)=>{var _e,Ue,qe,Re,De,Qe,rt;Ae.value==="zona"||(_e=Ae.label)!=null&&_e.toLowerCase().includes("zona")?(be[je]=Array.from({length:35},(dt,ct)=>ct+1),xe=!0):Ae.value==="resultados"||(Ue=Ae.label)!=null&&Ue.toLowerCase().includes("resultados")?(be[je]=["iba-ganando","iba-perdiendo","iba-empatado"],xe=!0):Ae.value==="que-sucedio"||Ae.value==="que sucedio"||(qe=Ae.label)!=null&&qe.toLowerCase().includes("qué sucedió")||(Re=Ae.label)!=null&&Re.toLowerCase().includes("que sucedio")?(be[je]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],xe=!0):Ae.value==="detalles"||(De=Ae.label)!=null&&De.toLowerCase().includes("detalles")?(be[je]=["0-15","16-30","31-45","46-60","61-75","76-90"],xe=!0):(Ae.value==="como-fue-cobrado"||Ae.value==="como fue cobrado"||(Qe=Ae.label)!=null&&Qe.toLowerCase().includes("cómo fue cobrado")||(rt=Ae.label)!=null&&rt.toLowerCase().includes("como fue cobrado"))&&(be[je]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],xe=!0)})),xe?be:{}}return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (formato simple):`,!1),!1):z.type==="select-simple"&&((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null}):v.isEditMode?(console.log("[CornersZoneFilters] ========== MODO EDICIÓN =========="),console.log("[CornersZoneFilters] initialValues completo:",v.initialValues),console.log("[CornersZoneFilters] initialValues[3] (filtro avanzado):",(I=v.initialValues)==null?void 0:I[3]),console.log("[CornersZoneFilters] Tipo de initialValues[3]:",typeof((j=v.initialValues)==null?void 0:j[3])),console.log("[CornersZoneFilters] Es array initialValues[3]:",Array.isArray((F=v.initialValues)==null?void 0:F[3])),h.value=v.filters.map((z,X)=>{var N,Y,se,me,ge,be,xe,Ae,je,_e;const Ue=v.initialValues[X];if(X===3&&console.log(`[CornersZoneFilters] Procesando filtro en índice ${X} (FILTRO AVANZADO):`,{filterType:z.type,filterData:Ue,hasFilterData:!!Ue,filterDataKeys:Ue?Object.keys(Ue):null,selectedValue:Ue==null?void 0:Ue.selectedValue,selectedValueType:typeof(Ue==null?void 0:Ue.selectedValue),isDirectObject:Ue&&typeof Ue=="object"&&!Array.isArray(Ue)&&!Ue.selectedValue&&!Ue.selectedOption&&!Ue.isChecked}),!Ue)return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(qe=>qe.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (modo edición):`,!1),!1):z.type==="radio-button"?((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null:z.type==="select-simple"?((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null:z.type==="advanced-select"?{}:null;if(z.type==="advanced-select"){if(console.log(`[CornersZoneFilters] Modo edición - Filtro avanzado en índice ${X}:`,{filterIndex:X,filterType:z.type,filterData:Ue,selectedValue:Ue==null?void 0:Ue.selectedValue,selectedValueType:typeof(Ue==null?void 0:Ue.selectedValue),isArray:Array.isArray(Ue==null?void 0:Ue.selectedValue),isDirectObject:typeof Ue=="object"&&!Array.isArray(Ue)&&!Ue.selectedValue&&!Ue.selectedOption&&!Ue.isChecked}),Ue.selectedValue!==void 0&&Ue.selectedValue!==null){if(typeof Ue.selectedValue=="object"&&!Array.isArray(Ue.selectedValue)){const qe=Object.keys(Ue.selectedValue).some(Re=>{const De=Number(Re);return!isNaN(De)&&De>=0});return console.log(`[CornersZoneFilters] Filtro avanzado ${X} - hasCorrectStructure:`,qe,"selectedValue:",Ue.selectedValue),qe?(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - Retornando selectedValue directamente:`,Ue.selectedValue),Ue.selectedValue):(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - Retornando selectedValue sin estructura correcta:`,Ue.selectedValue),Ue.selectedValue)}else if(Array.isArray(Ue.selectedValue)){console.log(`[CornersZoneFilters] Filtro avanzado ${X} - selectedValue es array, convirtiendo:`,Ue.selectedValue);const qe={};return Ue.selectedValue.forEach((Re,De)=>{qe[De]=Re}),console.log(`[CornersZoneFilters] Filtro avanzado ${X} - Valor convertido:`,qe),qe}}return typeof Ue=="object"&&!Array.isArray(Ue)&&!Ue.selectedValue&&!Ue.selectedOption&&!Ue.isChecked&&Ue!==null&&Object.keys(Ue).some(qe=>{const Re=Number(qe);return!isNaN(Re)&&Re>=0})?(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - filterData es objeto directo guardado, retornando:`,Ue),Ue):(console.log(`[CornersZoneFilters] Filtro avanzado ${X} - No hay valores guardados, retornando objeto vacío`),{})}if(z.type==="radio-button"&&Ue.selectedOption)return Ue.selectedOption.value;if(z.type==="radio-button"&&!Ue.selectedOption)return Ue.selectedValue!==void 0?Ue.selectedValue:((be=(ge=z.options)==null?void 0:ge[0])==null?void 0:be.value)||null;if(z.type==="select-simple"&&Ue.selectedValue!==void 0)return Array.isArray(Ue.selectedValue)?Ue.selectedValue[0]:Ue.selectedValue;if(z.type==="select"&&Ue.selectedOptions)return Ue.selectedOptions.map(qe=>qe.value);if(z.type==="check"&&Ue.isChecked!==void 0)return Ue.isChecked;if(z.type==="switch"&&(Ue.isChecked!==void 0||Ue.selectedValue!==void 0)){const qe=Ue.isChecked!==void 0?Ue.isChecked:Ue.selectedValue;return v.filters.findIndex(Re=>Re.type==="switch")===X&&console.log(`[Primer Switch] Valor en modo edición (índice ${X}):`,qe),qe}return Ue.selectedValue!==void 0?Ue.selectedValue:z.type==="select"?[]:z.type==="check"||z.type==="switch"?!1:z.type==="radio-button"?((Ae=(xe=z.options)==null?void 0:xe[0])==null?void 0:Ae.value)||null:z.type==="select-simple"?((_e=(je=z.options)==null?void 0:je[0])==null?void 0:_e.value)||null:z.type==="advanced-select"?{}:null}),console.log("[CornersZoneFilters] ========== FIN MODO EDICIÓN =========="),console.log("[CornersZoneFilters] selectedValues después de mapear:",h.value),console.log("[CornersZoneFilters] selectedValues[3] (filtro avanzado):",h.value[3]),console.log("[CornersZoneFilters] Tipo de selectedValues[3]:",typeof h.value[3]),console.log("[CornersZoneFilters] Es array selectedValues[3]:",Array.isArray(h.value[3])),h.value[3]&&typeof h.value[3]=="object"&&(console.log("[CornersZoneFilters] Keys de selectedValues[3]:",Object.keys(h.value[3])),console.log("[CornersZoneFilters] selectedValues[3][0]:",h.value[3][0]),console.log("[CornersZoneFilters] selectedValues[3][1]:",h.value[3][1])),console.log("[CornersZoneFilters] ==========================================")):h.value=v.filters.map((z,X)=>{var N,Y,se,me;const ge=v.initialValues[X];if(ge!=null)return z.type==="switch"&&v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde initialValues en índice ${X} (modo agregar):`,ge),ge;if(z.type==="radio-button")return((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null;if(z.type==="advanced-select"){const be={};let xe=!1;return z.options&&Array.isArray(z.options)&&z.options.forEach((Ae,je)=>{var _e,Ue,qe,Re,De,Qe,rt;Ae.value==="zona"||(_e=Ae.label)!=null&&_e.toLowerCase().includes("zona")?(be[je]=Array.from({length:35},(dt,ct)=>ct+1),xe=!0):Ae.value==="resultados"||(Ue=Ae.label)!=null&&Ue.toLowerCase().includes("resultados")?(be[je]=["iba-ganando","iba-perdiendo","iba-empatado"],xe=!0):Ae.value==="que-sucedio"||Ae.value==="que sucedio"||(qe=Ae.label)!=null&&qe.toLowerCase().includes("qué sucedió")||(Re=Ae.label)!=null&&Re.toLowerCase().includes("que sucedio")?(be[je]=["rematado-destino-porteria","fue-gol","no-fue-gol","rematado-sin-destino-porteria","ganados-por-portero-rival","ganados-por-jugador-rival","sin-destino"],xe=!0):Ae.value==="detalles"||(De=Ae.label)!=null&&De.toLowerCase().includes("detalles")?(be[je]=["0-15","16-30","31-45","46-60","61-75","76-90"],xe=!0):(Ae.value==="como-fue-cobrado"||Ae.value==="como fue cobrado"||(Qe=Ae.label)!=null&&Qe.toLowerCase().includes("cómo fue cobrado")||(rt=Ae.label)!=null&&rt.toLowerCase().includes("como fue cobrado"))&&(be[je]=["izquierda","comba-afuera","comba-adentro","raz-area","en-corto"],xe=!0)}),xe?be:{}}return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(be=>be.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (modo agregar):`,!1),!1):z.type==="select-simple"&&((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null}):h.value=v.filters.map((z,X)=>{var N,Y,se,me;return z.type==="select"?[]:z.type==="check"?!1:z.type==="switch"?(v.filters.findIndex(ge=>ge.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor por defecto en índice ${X} (sin initialValues):`,!1),!1):z.type==="radio-button"?((Y=(N=z.options)==null?void 0:N[0])==null?void 0:Y.value)||null:z.type==="select-simple"?((me=(se=z.options)==null?void 0:se[0])==null?void 0:me.value)||null:z.type==="advanced-select"?{}:null});const W=h.value.some(z=>z!=null&&(Array.isArray(z)?z.length>0:typeof z=="object"&&!Array.isArray(z)?Object.keys(z).length>0:z!==!1&&z!=="")),U=v.filters.map((z,X)=>({index:X,type:z.type,label:z.label||z.label_1||z.label_2||`Filtro ${X}`,value:h.value[X]}));console.log("??????????????????????????????????? ---- ???????????????????????????????????"),console.log("Valores de filtros seteados:",U),console.log("selectedValues:",h.value),console.log("props.filters:",v.filters),console.log("??????????????????????????????????? ---- ???????????????????????????????????"),W&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))};d(),setTimeout(()=>{t.nextTick(()=>{if(h.value[0]!==null&&h.value[0]!==void 0&&!n){const I=!(()=>{const j=h.value[1];return j==null?!1:Array.isArray(j)?j.length>0:j!==""})();x(h.value[0],I),t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(!u||h.value.length!==u.length||h.value.some((j,F)=>!T(j,u[F])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})}else setTimeout(()=>{h.value.some(I=>I!=null&&(Array.isArray(I)?I.length>0:typeof I=="object"&&!Array.isArray(I)?Object.keys(I).length>0:I!==!1&&I!==""))&&(!u||h.value.length!==u.length||h.value.some((I,j)=>!T(I,u[j])))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))},100)})},300),t.watch(()=>v.initialValues,I=>{if(!I||I.length===0)return;const j=I.length>0&&(typeof I[0]=="number"||typeof I[0]=="boolean"||I[0]===null||Array.isArray(I[0])),F=!T(h.value,I),W=I&&I.length>0&&!n&&F,U=v.isEditMode&&n;if(W&&!U)if(j){const z=v.filters.findIndex(X=>X.type==="switch");z!==-1&&I[z]!==void 0&&console.log(`[Primer Switch] Se setea valor desde watcher initialValues (formato simple) en índice ${z}:`,I[z]),h.value=[...I]}else v.isEditMode?h.value=v.filters.map((z,X)=>{const N=I[X];return N?z.type==="radio-button"&&N.selectedOption?N.selectedOption.value:z.type==="select-simple"&&N.selectedValue!==void 0?Array.isArray(N.selectedValue)?N.selectedValue[0]:N.selectedValue:z.type==="select"&&N.selectedOptions?N.selectedOptions.map(Y=>Y.value):z.type==="check"&&N.isChecked!==void 0?N.isChecked:z.type==="switch"&&N.isChecked!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde isChecked en índice ${X} (modo edición):`,N.isChecked),N.isChecked):z.type==="switch"&&N.selectedValue!==void 0?(v.filters.findIndex(Y=>Y.type==="switch")===X&&console.log(`[Primer Switch] Se setea valor desde selectedValue en índice ${X} (modo edición):`,N.selectedValue),N.selectedValue):z.type==="advanced-select"&&N.selectedValue!==void 0||N.selectedValue!==void 0?N.selectedValue:h.value[X]:h.value[X]}):h.value=[...I];else n?k&&k.length>0&&(h.value=[...k]):U&&k&&k.length>0&&(h.value=[...k])},{deep:!0}),t.watch(()=>v.isEditMode,(I,j)=>{j===!0&&I===!1&&(k=null)},{immediate:!0}),t.watch(h,I=>{if(I.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))){const j=[...I];if(u){for(;j.length<u.length;)j.push(void 0);for(let F=0;F<u.length;F++)u[F]!==void 0&&u[F]!==null&&(j[F]===void 0||j[F]===null)&&(j[F]=u[F])}if((()=>{if(!u||j.length!==u.length)return!0;for(let F=0;F<j.length;F++)if(!T(j[F],u[F]))return!0;return!1})()){u=[...j];const F=v.filters.map((W,U)=>({index:U,type:W.type,label:W.label||W.label_1||W.label_2||`Filtro ${U}`,value:j[U]}));console.log("Valores de filtros actualizados:",F),$("filters-changed",{componentId:v.componentId,filters:j,timestamp:new Date().toISOString()})}}},{deep:!0}),t.watch(()=>h.value[0],(I,j)=>{var F;if(I==null){const U=v.filters[0];if(U&&U.type==="radio-button"&&U.options&&U.options.length>0){const z=U.options[0].value;h.value[0]=z;return}}const W=(F=v.filters)==null?void 0:F[0];W&&W.type==="select-simple"&&(I!==j&&j!==void 0?x(I,!0):j===void 0&&I!==null&&I!==void 0&&x(I,!1))},{immediate:!0});const o=I=>{i.value===I?i.value=null:(i.value=I,p.value=null)},c=I=>{p.value===I?p.value=null:(p.value=I,i.value=null)},s=(I,j)=>{if(n=!0,setTimeout(()=>{n=!1},1e3),h.value[I]=j,(I===0||I===1)&&(k=[...h.value]),i.value=null,I===0){h.value[1]!==void 0&&(h.value[1]=null);const F=n;n=!1,x(j,!0),n=F,h.value[1]!==null&&h.value[1]!==void 0&&(k=[...h.value])}},f=()=>{n=!0,setTimeout(()=>{n=!1},400)},g=I=>{n=!0,setTimeout(()=>{n=!1},400);const j=h.value[I],F=!j;h.value[I]=F,v.filters.findIndex(W=>W.type==="switch")===I&&console.log(`[Primer Switch] Se setea valor en índice ${I} desde toggleSwitch:`,F,"(valor anterior:",j,")")},S=I=>{n=!0,setTimeout(()=>{n=!1},400),h.value[I.filterIndex]||(h.value[I.filterIndex]={}),h.value[I.filterIndex]={...h.value[I.filterIndex],[I.optionIndex]:I.values},t.nextTick(()=>{h.value.some(j=>j!=null&&(Array.isArray(j)?j.length>0:typeof j=="object"&&!Array.isArray(j)?Object.keys(j).length>0:j!==!1&&j!==""))&&(u=[...h.value],$("filters-changed",{componentId:v.componentId,filters:h.value,timestamp:new Date().toISOString()}))})},L=()=>h.value,E=(I,j)=>{const F=h.value[j];if(F==null)return null;if(j===1&&l.value.length>0){const W=l.value.find(U=>U.value===F);return W?W.label:null}if(I.options&&Array.isArray(I.options)){const W=I.options.find(U=>U.value===F);return W?W.label:null}return null},P=(I,j)=>{const F=h.value[j];if(!F||typeof F!="object"||Array.isArray(F))return null;const W=Object.values(F).reduce((U,z)=>Array.isArray(z)&&z.length>0?U+z.length:U,0);return W>0?`${W} seleccionado${W>1?"s":""}`:null},V=I=>{const j=I.target,F=j.closest(".advanced-select-dropdown"),W=j.closest(".advanced-select-menu"),U=j.closest(".advanced-select-accordion"),z=j.closest(".advanced-select-content"),X=j.closest(".custom-select.dynamic-select"),N=j.closest(".simple-select-menu");!(F||W||U||z)&&!(X||N)&&(p.value=null,i.value=null)};return t.onMounted(()=>{document.addEventListener("click",V)}),t.onUnmounted(()=>{document.removeEventListener("click",V)}),r({getCurrentValues:L,initializeValues:d}),(I,j)=>(t.openBlock(),t.createElementBlock("div",irt,[e.filters&&e.filters.length>0?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filters,(F,W)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:W},[F.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",ort,[t.createElementVNode("div",srt,t.toDisplayString(F.label),1),t.createElementVNode("div",lrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(F.options,U=>(t.openBlock(),t.createElementBlock("label",{key:U.value,class:t.normalizeClass(["radio-option-card",{active:h.value[W]===U.value}])},[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+W,value:U.value,"onUpdate:modelValue":z=>h.value[W]=z,onChange:f},null,40,crt),[[t.vModelRadio,h.value[W]]]),t.createElementVNode("span",null,t.toDisplayString(U.label),1)],2))),128))])])):F.type==="select-simple"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[W==2?(t.openBlock(),t.createElementBlock("div",urt)):t.createCommentVNode("",!0),t.createElementVNode("div",drt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":F.type,onClick:t.withModifiers(U=>o(W),["stop"])},[t.createElementVNode("div",hrt,[j[3]||(j[3]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",frt,t.toDisplayString(E(F,W)||F.label_2||F.label||"Tipo de análisis"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:i.value===W}])},[...j[2]||(j[2]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),i.value===W?(t.openBlock(),t.createElementBlock("div",mrt,[t.createElementVNode("div",yrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(W===1?l.value:F.options,U=>(t.openBlock(),t.createElementBlock("div",{key:U.value,class:t.normalizeClass(["option-card simple-select-option",{active:T(h.value[W],U.value)}]),onClick:t.withModifiers(z=>s(W,U.value),["stop"])},[t.createElementVNode("div",vrt,[t.createElementVNode("div",brt,t.toDisplayString(U.label),1)]),T(h.value[W],U.value)?(t.openBlock(),t.createElementBlock("div",xrt,[...j[4]||(j[4]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):t.createCommentVNode("",!0)],10,grt))),128))])])):t.createCommentVNode("",!0)],8,prt)])],64)):F.type==="switch"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",_rt,[t.createElementVNode("label",wrt,[F.label_1?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["switch-text switch-text-left",{"switch-text-selected":!h.value[W]}])},t.toDisplayString(F.label_1),3)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:"switch",onClick:U=>g(W)},[t.createElementVNode("div",{class:t.normalizeClass(["switch-track",{"switch-on":h.value[W]}])},[t.createElementVNode("div",{class:t.normalizeClass(["switch-thumb",{on:h.value[W]}])},null,2)],2)],8,Trt),F.label_2?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["switch-text switch-text-right",{"switch-text-selected":h.value[W]}])},t.toDisplayString(F.label_2),3)):t.createCommentVNode("",!0)])]),W>=0?(t.openBlock(),t.createElementBlock("div",Srt)):t.createCommentVNode("",!0)],64)):F.type==="advanced-select"?(t.openBlock(),t.createElementBlock("div",krt,[t.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":F.type,onClick:t.withModifiers(U=>c(W),["stop"])},[t.createElementVNode("div",Crt,[j[6]||(j[6]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",alt:"icono categorías",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),t.createElementVNode("span",Ort,t.toDisplayString(P(F,W)||F.label||"Seleccionar"),1),t.createElementVNode("span",{class:t.normalizeClass(["arrow",{open:p.value===W}])},[...j[5]||(j[5]=[t.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),p.value===W?(t.openBlock(),t.createElementBlock("div",{key:0,class:"dropdown-menu type-menu advanced-select-menu",onClick:j[1]||(j[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",{class:"advanced-select-content",onClick:j[0]||(j[0]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(nrt,{filter:F,"filter-index":W,"selected-values":h.value,onUpdateSelection:S,onClose:U=>c(W)},null,8,["filter","filter-index","selected-values","onClose"])])])):t.createCommentVNode("",!0)],8,Lrt)])):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0)]))}},Ert=t2(Nrt,[["__scopeId","data-v-7c2a6c9f"]]),zrt={class:"floating-bar"},Mrt={class:"tab active"},Vrt={class:"select-display"},Prt={class:"select-icon"},Art=["src"],Rrt={key:1,alt:"icono",class:"option-img-default",src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png"},Urt={key:0,class:"select-placeholder select-label"},Frt={key:1,class:"select-label"},Irt={key:0,class:"dropdown-menu field-menu"},qrt=["onClick"],jrt={class:"option-icon"},Wrt=["data-hover-src","src"],Drt={class:"option-content"},Krt={class:"option-title"},Brt={key:0,class:"option-description"},Xrt={class:"select-display"},Grt={class:"select-icon"},Zrt=["src"],Jrt=["src"],Hrt={class:"select-label"},Yrt={key:0,class:"dropdown-menu type-menu type-menu-grid"},Qrt={class:"option-grid"},$rt=["onClick"],eat={key:0,class:"option-grid-title"},tat={key:1,class:"option-grid-title"},rat={key:2,class:"option-grid-title"},aat={class:"option-grid-icon"},nat=["src"],iat={key:1,class:"filter-separator"},oat=["onClick"],sat={class:"select-display"},lat={key:0,class:"badge-categorias"},cat={key:0,class:"dropdown-menu type-menu multi-select-menu"},uat={class:"multi-select-scroll-area"},dat={class:"select-all-checkbox"},pat=["checked","indeterminate","onChange"],hat={class:"option-checkbox"},fat=["checked","onChange"],mat=["onClick"],yat={class:"option-title"},gat={class:"multi-select-footer"},vat={key:1,class:"custom-radio-group filter-inline"},bat={class:"radio-label"},xat={class:"radio-options"},_at=["onUpdate:modelValue","disabled","name","value","onChange"],wat={key:2,class:"check-group filter-inline"},Tat=["onUpdate:modelValue","checked"],Sat=["data-filter-type","onClick"],kat={class:"select-display"},Lat={key:0,class:"dropdown-menu type-menu simple-select-menu"},Cat={class:"simple-select-scroll-area"},Oat=["onMouseenter","onClick"],Nat={class:"option-content"},Eat={class:"option-title"},zat={key:0,class:"option-checkmark"},Mat={key:4,class:"filter-separator"},Vat=Object.assign({name:"FloatingFiltersBar"},{__name:"filters",props:{token:{type:String,required:!0},view:{type:Object,default:()=>null},isPostMatch:{type:Boolean,default:!1},filters_edition_mode:{type:Array,default:()=>null}},emits:["filters-changed","close"],setup(e,{expose:r,emit:a}){const v=e,$=a,h=t.ref(new Map),u=t.ref([]);let i=null,p=null,l=null;const n=t.ref(!1),k=t.ref(!1),T=t.ref(!1),x=t.ref(!1),d=t.ref(!1),o=t.ref(!1),c=t.computed(()=>u.value),s=t.ref(null),f=t.computed(()=>c.value[s.value]||null),g=t.computed(()=>{var St;const Yt=((St=f.value)==null?void 0:St.views)||[];return U(Yt)}),S=t.ref(null),L=t.computed(()=>g.value.find(St=>St.id===S.value)||null),E=t.ref([]),P=t.computed(()=>{var St,Yt;return n.value?((St=L.value)==null?void 0:St.filters_edition_mode)||[]:((Yt=L.value)==null?void 0:Yt.filters)||[]});t.watch(n,St=>{St||(k.value=!1)}),t.watch(L,St=>{var Yt,er;if(!St){E.value=[];return}const or=St.id===6&&v.isPostMatch,Or=St.id===14;if(!Array.isArray(P.value)&&!or&&!Or){E.value=[];return}x.value||(or||Or?E.value=[]:E.value=P.value.map((Pr,oa)=>{var Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja,on,Ha,qr,wr;if(Pr.type==="select"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na){if(Na.selectedOptions&&Array.isArray(Na.selectedOptions))return Na.selectedOptions.map(rn=>rn.value);if(Na.selectedValue&&Array.isArray(Na.selectedValue))return Na.selectedValue.length>0&&Na.selectedValue[0]&&typeof Na.selectedValue[0]=="object"?sr(Na.selectedValue):Na.selectedValue}}return St.id===4&&Pr.options&&Array.isArray(Pr.options)?Pr.options.map(Na=>Na.value):[]}else if(Pr.type==="radio-button"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.selectedOption){let rn=Na.selectedOption.value;if(St.id===15&&oa===0&&rn===3&&((qa=(Ia=p==null?void 0:p.view)==null?void 0:Ia.filterMultiple)==null?void 0:qa.isHomeTeam)!==void 0){const mn=p.view.filterMultiple.isHomeTeam;typeof mn=="boolean"?rn=mn?1:2:typeof mn=="number"&&(rn=mn===1?1:2)}return rn}}if(St.id===7&&n.value&&p!=null&&p.view){if(oa===0&&(bn=p.view.componentProps)!=null&&bn.analysisType)return p.view.componentProps.analysisType==="offensive"?1:2;if(oa===1&&((fn=p.view.filterMultiple)==null?void 0:fn.isHomeTeam)!==void 0)return p.view.filterMultiple.isHomeTeam?1:2}return((ea=(In=Pr.options)==null?void 0:In[0])==null?void 0:ea.value)??null}else if(Pr.type==="select-simple"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.selectedValue!==void 0){let rn;return St.id===2&&(fa=(Ur=p==null?void 0:p.view)==null?void 0:Ur.filterMultiple)!=null&&fa.categoryId?rn=p.view.filterMultiple.categoryId:St.id===1&&(Za=(Ma=p==null?void 0:p.view)==null?void 0:Ma.filterMultiple)!=null&&Za.category?rn=p.view.filterMultiple.category:St.id===6&&(Xr=(Ea=p==null?void 0:p.view)==null?void 0:Ea.filterMultiple)!=null&&Xr.gameNumber?rn=p.view.filterMultiple.gameNumber:rn=Array.isArray(Na.selectedValue)?Na.selectedValue[0]:Na.selectedValue,rn}}if(St.id===2&&n.value&&p!=null&&p.view){if(i&&p.view.id){const Na=i.getComponentDynamicFilters(p.view.id);if(Na&&Na[oa]!==void 0)return Na[oa]}if(p.view.filterMultiple){if(Pr.type==="select-simple"&&p.view.filterMultiple.categoryId){const Na=p.view.filterMultiple.categoryId;return(Pr.options||[]).find(rn=>rn.value==Na),Na}if(Pr.type==="radio-button"&&p.view.filterMultiple.teamType!==void 0){const Na=p.view.filterMultiple.teamType;return(Pr.options||[]).find(rn=>rn.value==Na),Na}}}if(St.id===1&&n.value&&(ca=p==null?void 0:p.view)!=null&&ca.filterMultiple&&p.view.filterMultiple.category){const Na=p.view.filterMultiple.category;return(Pr.options||[]).find(rn=>rn.value==Na),Na}if(St.id===9&&n.value&&(kr=p==null?void 0:p.view)!=null&&kr.filterMultiple&&Pr.type==="select-simple"&&p.view.filterMultiple.categoryIds){const Na=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds],rn=(Pr.options||[]).filter(mn=>Array.isArray(mn.value)?hr(mn.value,Na):Na.includes(mn.value));return rn.length>0?rn[0].value:Na}if(St.id===6&&n.value&&(ua=p==null?void 0:p.view)!=null&&ua.filterMultiple&&p.view.filterMultiple.gameNumber){const Na=p.view.filterMultiple.gameNumber;return(Pr.options||[]).find(rn=>rn.value==Na),Na}if(St.id===5&&n.value&&(Xa=p==null?void 0:p.view)!=null&&Xa.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Na=p.view.filterMultiple.isHomeTeam;let rn;if(typeof Na=="boolean"?rn=Na?1:2:typeof Na=="number"?rn=Na===1?1:2:rn=1,(Pr.options||[]).find(mn=>mn.value==rn),Pr.type==="radio-button"&&(Pr.label==="Equipo"||Pr.label==="Team"||Pr.label==="Equipo seleccionado"))return rn}if(St.id===15&&n.value&&(ja=p==null?void 0:p.view)!=null&&ja.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0&&Pr.type==="radio-button"&&oa===0){const Na=p.view.filterMultiple.isHomeTeam;let rn;if(typeof Na=="boolean"?rn=Na?1:2:typeof Na=="number"?rn=Na===1?1:2:rn=1,(Pr.options||[]).find(mn=>mn.value==rn))return rn}if(St.id===9&&n.value&&(on=p==null?void 0:p.view)!=null&&on.filterMultiple&&Pr.type==="radio-button"&&p.view.filterMultiple.isHomeTeam!==void 0){const Na=p.view.filterMultiple.isHomeTeam?1:2,rn=((Ha=Pr.options)==null?void 0:Ha.map(mn=>mn.value))||[];return rn.includes(Na)?Na:rn[0]||1}return((wr=(qr=Pr.options)==null?void 0:qr[0])==null?void 0:wr.value)??null}else if(Pr.type==="check"){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.isChecked!==void 0)return Na.isChecked}if(St.id===8)return!0;if(St.id===3){if(n.value&&l&&l.dynamicFilters){const Na=l.dynamicFilters[oa];if(Na&&Na.isChecked!==void 0)return Na.isChecked}return!1}return!1}return null}),!((Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)!=null&&er.toLowerCase().includes("tops players"))&&(!n.value||or)&&t.nextTick(()=>{var Pr,oa;St.id===4&&n.value&&(Pr=p==null?void 0:p.view)!=null&&Pr.id&&i&&i.setDynamicFilters(E.value,p.view.id),St.id===3&&n.value&&(oa=p==null?void 0:p.view)!=null&&oa.id&&i&&i.setDynamicFilters(E.value,p.view.id),Ye()}))},{immediate:!0}),t.watch(()=>i,St=>{St&&St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))},{deep:!0}),t.watch(()=>i==null?void 0:i.dynamicFilters,St=>{if(St&&Array.isArray(St)){if(d.value)return;x.value=!0,E.value=[...St],t.nextTick(()=>{x.value=!1})}},{deep:!0}),t.watch(()=>L.value,St=>{if(n.value&&l&&St&&St.filters){if(x.value||o.value)return;if(St.id===3){if(d.value||o.value)return;const Yt=l.dynamicFilters.find(er=>er.filterType==="check");Yt&&Yt.isChecked!==void 0&&E.value&&E.value.length>0&&(d.value=!0,E.value[0]=Yt.isChecked,t.nextTick(()=>{E.value=[...E.value],d.value=!1}))}setTimeout(()=>{(!E.value||E.value.length===0)&&($t(),Zt(),Tt()),St.id===4&&Rt()},100)}},{deep:!0}),t.watch(()=>{var St;return(St=L.value)==null?void 0:St.id},St=>{if(n.value&&l&&St===4){if(x.value||o.value)return;setTimeout(()=>{Rt()},200)}}),t.watch(()=>E.value,St=>{if(n.value&&l&&St&&St.length>0){if(x.value||d.value||o.value)return;setTimeout(()=>{var Yt;Ut()&&($t(),Zt(),Tt(),((Yt=L.value)==null?void 0:Yt.id)===4&&Rt())},50)}},{deep:!0});function V(St,Yt){var er,or,Or,Pr,oa;const Ia=E.value[St];if((er=L.value)==null||er.id,(or=L.value)==null||or.id,Array.isArray(Ia)){if(((Or=L.value)==null?void 0:Or.id)===4&&St===0){const qa=Ia.some(bn=>{if(Yt.category_id&&Yt.event_type_id){if(bn.category_id&&bn.event_type_id)return bn.category_id===Yt.category_id&&bn.event_type_id===Yt.event_type_id;if(bn.event_type_id&&!bn.category_id)return bn.event_type_id===Yt.event_type_id;if(bn.category_id&&!bn.event_type_id)return bn.category_id===Yt.category_id}else{if(Yt.event_type_id)return bn.event_type_id===Yt.event_type_id;if(Yt.category_id)return bn.category_id===Yt.category_id}return JSON.stringify(bn)===JSON.stringify(Yt)});return(Pr=L.value)==null||Pr.id,qa}return Ia.includes(Yt)}else if(Ia!=null)return(oa=L.value)==null||oa.id,Ia===Yt;return!1}function I(St,Yt){var er,or,Or;const Pr=(or=(er=L.value)==null?void 0:er.filters)==null?void 0:or[St];if((Pr==null?void 0:Pr.type)==="select-simple"){rt(St,Yt);return}Array.isArray(E.value[St])||(E.value[St]=[]);const oa=E.value[St];let Ia=-1;((Or=L.value)==null?void 0:Or.id)===4&&St===0?Ia=oa.findIndex(qa=>Yt.category_id&&Yt.event_type_id?qa.category_id===Yt.category_id&&qa.event_type_id===Yt.event_type_id:Yt.event_type_id?qa.event_type_id===Yt.event_type_id:Yt.category_id?qa.category_id===Yt.category_id:!1):Ia=oa.indexOf(Yt),Ia>-1?oa.splice(Ia,1):oa.push(Yt),n.value&&Pt(),Ye()}function j(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length===Or.options.length}function F(St){var Yt,er;const or=E.value[St],Or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];return(Or==null?void 0:Or.type)==="select-simple"||!Or||!Or.options||!Array.isArray(or)?!1:or.length>0&&or.length<Or.options.length}function W(){var St;return!(((St=L.value)==null?void 0:St.id)===6&&v.isPostMatch)}function U(St){return!St||!Array.isArray(St)?St:St.filter(Yt=>{const er=(Yt.name||Yt.title||"").toLowerCase();return v.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(or=>er.includes(or))})}function z(){var St,Yt;const er=((Yt=(St=f.value)==null?void 0:St.name)==null?void 0:Yt.toLowerCase())||"";return er.includes("cancha")||er.includes("volumétrica")||er.includes("volumetric")}function X(St,Yt){if(!n.value||!z())return!1;const er=String(St||"").toLowerCase(),or=String(Yt||"").toLowerCase();return er.includes("ambos")||or.includes("ambos")}function N(St){var Yt,er;const or=(er=(Yt=L.value)==null?void 0:Yt.filters)==null?void 0:er[St];if(!or||!or.options)return;const Or=or.options.map(Pr=>Pr.value);Array.isArray(E.value[St])||(E.value[St]=[]),j(St)?E.value[St]=[]:E.value[St]=[...Or],ge.value=St,Ye()}const Y=t.ref("ambos"),se=t.ref(!1),me=t.ref(!1),ge=t.ref(null),be=t.ref(null);function xe(St,Yt=!1){const er="https://golstatsimages.blob.core.windows.net/images-library/",or="https://golstatsimages.blob.core.windows.net/reports-images/",Or={cancha:"icn_cancha",grafico:"icn_grafico",gráfico:"icn_grafico",chart:"icn_grafico",volumetrica:"icn_cancha",volumétrica:"icn_cancha",volumetric:"icn_cancha",tabla:"icn_tabla",tablas:"icn_tabla",Tablas:"icn_tabla"},Pr=Object.keys(Or).find(oa=>St==null?void 0:St.toLowerCase().includes(oa.toLowerCase()));if(Pr){const oa=Or[Pr],Ia=Yt?"":"-def";return Pr.toLowerCase().includes("tabla")?`${or}${oa}${Ia}@2x.png`:`${er}${oa}${Ia}@2x.png`}return`${er}icn_default${Yt?"":"-def"}.png`}function Ae(){return f.value?f.value.name:"Tipo de vista"}function je(){return L.value?L.value.name||L.value.title:"Visualización"}function _e(){n.value||(se.value=!se.value,se.value&&(me.value=!1,t.nextTick(()=>{Jt()})))}function Ue(){n.value||f.value&&(me.value=!me.value,me.value&&(se.value=!1))}function qe(St){n.value||(s.value=St,se.value=!1,S.value=null,Ye())}function Re(St){var Yt,er;n.value||(S.value=St.id,me.value=!1,(Yt=St.name)!=null&&Yt.toLowerCase().includes("tops players")||(er=St.title)==null||er.toLowerCase().includes("tops players"))}function De(St){var Yt;ge.value=ge.value===St?null:St,((Yt=L.value)==null?void 0:Yt.id)===4&&n.value&&St===0&&setTimeout(()=>{E.value=[...E.value]},50)}function Qe(St){be.value=be.value===St?null:St}function rt(St,Yt){var er,or,Or,Pr,oa;if(((er=L.value)==null?void 0:er.id)===2){const Ia=P.value.findIndex(qa=>qa.type==="select-simple"&&qa.label==="Tipo de análisis");St===Ia?E.value[0]=Yt:E.value[St]=Yt}else if(((or=L.value)==null?void 0:or.id)===1)E.value[0]=Yt;else if(((Or=L.value)==null?void 0:Or.id)===6)E.value[0]=Yt;else if(((Pr=L.value)==null?void 0:Pr.id)===9)if(St===0){Array.isArray(Yt)?E.value[St]=Yt:E.value[St]=[Yt];const Ia=((oa=P.value[St])==null?void 0:oa.options)||[],qa=Array.isArray(Yt)?Yt:[Yt],bn=Ia.find(fn=>Array.isArray(fn.value)?hr(fn.value,qa):qa.includes(fn.value));bn?E.value[St]=bn.value:E.value[St]=qa}else E.value[St]=Yt;else E.value[St]=Yt;be.value=null,n.value&&Pt(),Ye()}function dt(St){St.target.closest(".custom-select")||(se.value=!1,me.value=!1,be.value=null)}const ct=[16,18];function Ye(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua;if(ct.includes((St=L.value)==null?void 0:St.id)||x.value)return;let Xa=[],ja=[];L.value&&Array.isArray(P.value)&&P.value.forEach((wr,Na)=>{if(wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2){const rn=E.value[Na]||[];Array.isArray(rn)&&rn.length>0&&(Xa=rn.map(mn=>{var $a;const Hn=($a=wr.options)==null?void 0:$a.find(Pn=>Pn.value===mn);return{value:mn,label:(Hn==null?void 0:Hn.label)||mn}}))}});const on=((Yt=L.value)==null?void 0:Yt.id)===4;if(L.value&&Array.isArray(L.value.filters)&&L.value.filters.some(wr=>wr.type==="select"&&wr.label==="Tipo de análisis"&&wr.id===2)&&Xa.length===0&&!on)return;if(on&&E.value&&E.value.length>0){const wr=E.value[0];Array.isArray(wr)&&wr.length>0}ja=((er=P.value)==null?void 0:er.map((wr,Na)=>{var rn,mn,$a,Hn;const Pn=E.value[Na];let Yn=wr.id||`filter_${Na}`;return((rn=L.value)==null?void 0:rn.id)===3&&n.value&&(mn=p==null?void 0:p.view)!=null&&mn.id&&(Yn=`filter_${Na}_component_${p.view.id}`),{filterId:Yn,filterType:wr.type,filterLabel:wr.label,filterIcon:wr.icon||null,selectedValue:Pn,selectedOptions:wr.type==="select"&&Array.isArray(Pn)&&Pn.length>0?Pn.map(An=>{var Wn;const Ci=(Wn=wr.options)==null?void 0:Wn.find(Pi=>Pi.value===An);return{value:An,label:(Ci==null?void 0:Ci.label)||An,icon:(Ci==null?void 0:Ci.icon)||null}}):null,selectedOption:wr.type==="radio-button"&&Pn!=null?{value:Pn,label:((Hn=($a=wr.options)==null?void 0:$a.find(An=>An.value===Pn))==null?void 0:Hn.label)||Pn}:null,isChecked:wr.type==="check"?Pn:null}}))||[];const Ha={mainSelector:{id:((or=f.value)==null?void 0:or.id)||null,name:((Or=f.value)==null?void 0:Or.name)||null,url:((Pr=f.value)==null?void 0:Pr.url)||null},viewSelector:{id:((oa=L.value)==null?void 0:oa.id)||null,name:((Ia=L.value)==null?void 0:Ia.name)||((qa=L.value)==null?void 0:qa.title)||null,url:((bn=L.value)==null?void 0:bn.url)||null},team:Y.value,dynamicFilters:ja,categoriasSeleccionadas:Xa,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((fn=P.value)==null?void 0:fn.length)||0,activeFilters:((In=P.value)==null?void 0:In.filter((wr,Na)=>{const rn=E.value[Na];return Array.isArray(rn)?rn.length>0:rn!=null&&rn!==!1}).length)||0}},qr={main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:Ha,filterAndViewsContainer:i,viewToEdit:p};if($("filters-changed",qr),n.value&&p){if(l=Ha,((ea=L.value)==null?void 0:ea.id)===2){const wr=l.dynamicFilters.findIndex(Na=>Na.filterType==="select-simple"&&Na.filterLabel==="Tipo de análisis");wr!==-1&&(fa=(Ur=p.view)==null?void 0:Ur.filterMultiple)!=null&&fa.categoryId&&(l.dynamicFilters[wr].selectedValue=p.view.filterMultiple.categoryId)}if(((Ma=L.value)==null?void 0:Ma.id)===1){const wr=l.dynamicFilters.findIndex(Na=>Na.filterType==="select-simple"&&Na.filterLabel==="Tipo de análisis");wr!==-1&&(Ea=(Za=p.view)==null?void 0:Za.filterMultiple)!=null&&Ea.category&&(l.dynamicFilters[wr].selectedValue=p.view.filterMultiple.category)}}if(((Xr=L.value)==null?void 0:Xr.id)===6&&n.value&&(ca=p==null?void 0:p.view)!=null&&ca.filterMultiple&&p.view.filterMultiple.gameNumber&&l){const wr=l.dynamicFilters.findIndex(Na=>Na.filterType==="select-simple"&&Na.filterLabel==="Número de juego");wr!==-1&&(ua=(kr=p.view)==null?void 0:kr.filterMultiple)!=null&&ua.gameNumber&&(l.dynamicFilters[wr].selectedValue=p.view.filterMultiple.gameNumber)}i&&!n.value?i.setDynamicFilters(E.value):i&&n.value}function st(){p=null,l=null,i=null,s.value=null,S.value=null,Y.value="ambos",E.value=[],se.value=!1,me.value=!1,ge.value=null,be.value=null,n.value=!1,k.value=!1,T.value=!1}function lt(St){if(St&&St.dynamicFilters){if(d.value)return;Array.isArray(St.dynamicFilters)&&St.dynamicFilters.length>0&&(x.value=!0,E.value=[...St.dynamicFilters],t.nextTick(()=>{x.value=!1}))}}function Ot(St){if(n.value=!0,St.mainSelector&&St.mainSelector.id){const Yt=u.value.findIndex(er=>er.id===St.mainSelector.id);Yt!==-1&&(s.value=Yt)}St.viewSelector&&St.viewSelector.id&&f.value&&f.value.views.findIndex(Yt=>Yt.id===St.viewSelector.id)!==-1&&(S.value=St.viewSelector.id),St.dynamicFilters&&Array.isArray(St.dynamicFilters)&&t.nextTick(()=>{setTimeout(()=>{var Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja;if(L.value&&P.value){if(x.value)return;if(d.value=!0,St.dynamicFilters.forEach((on,Ha)=>{var qr,wr,Na,rn,mn,$a,Hn,Pn,Yn,An,Wn,Ci,Pi;if(Ha<P.value.length){const Po=P.value[Ha];if(((qr=L.value)==null?void 0:qr.id)===3&&n.value,Po.type==="check"){const So=on.isChecked;typeof So=="boolean"&&(E.value[Ha]=So)}else if(Po.type==="select"&&on.selectedOptions){const So=on.selectedOptions.map(Mo=>Mo.value);E.value[Ha]=So}else if(Po.type==="select"&&on.selectedValue&&Array.isArray(on.selectedValue))if(on.selectedValue.length>0&&on.selectedValue[0]&&typeof on.selectedValue[0]=="object"){const So=sr(on.selectedValue);E.value[Ha]=So}else E.value[Ha]=on.selectedValue;else if(Po.type==="radio-button"&&on.selectedOption)E.value[Ha]=on.selectedOption.value;else if(Po.type==="select-simple"&&on.selectedValue!==void 0){let So;((wr=L.value)==null?void 0:wr.id)===2&&(rn=(Na=p==null?void 0:p.view)==null?void 0:Na.filterMultiple)!=null&&rn.categoryId?So=p.view.filterMultiple.categoryId:((mn=L.value)==null?void 0:mn.id)===1&&(Hn=($a=p==null?void 0:p.view)==null?void 0:$a.filterMultiple)!=null&&Hn.category?So=p.view.filterMultiple.category:((Pn=L.value)==null?void 0:Pn.id)===6&&(An=(Yn=p==null?void 0:p.view)==null?void 0:Yn.filterMultiple)!=null&&An.gameNumber?So=p.view.filterMultiple.gameNumber:((Wn=L.value)==null?void 0:Wn.id)===9&&(Pi=(Ci=p==null?void 0:p.view)==null?void 0:Ci.filterMultiple)!=null&&Pi.categoryIds?So=p.view.filterMultiple.categoryIds:So=Array.isArray(on.selectedValue)?on.selectedValue[0]:on.selectedValue,E.value[Ha]=So}}}),((Yt=L.value)==null?void 0:Yt.id)===3&&n.value,((er=L.value)==null?void 0:er.id)===2&&n.value&&(or=p==null?void 0:p.view)!=null&&or.filterMultiple){if(p.view.filterMultiple.categoryId){const on=P.value.findIndex(Ha=>Ha.type==="select-simple"&&Ha.label==="Tipo de análisis");if(on!==-1){const Ha=p.view.filterMultiple.categoryId;if(E.value[0]=Ha,p.view.componentProps&&Ha){let qr=`Category ${Ha}`,wr=null;try{wr=A4(Ha),wr&&(qr=wr.name)}catch{const Na=P.value.findIndex(rn=>rn.type==="select-simple"&&rn.label==="Tipo de análisis");if(Na!==-1){const rn=(((Or=P.value[Na])==null?void 0:Or.options)||[]).find(mn=>mn.value==Ha);rn&&(qr=rn.label)}}p.view.componentProps.categoryView=[{id:Ha,name:qr}]}(((Pr=P.value[on])==null?void 0:Pr.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const on=P.value.findIndex(Ha=>Ha.type==="radio-button");if(on!==-1){const Ha=p.view.filterMultiple.teamType;E.value[on]=Ha,(((oa=P.value[on])==null?void 0:oa.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}}if(((Ia=L.value)==null?void 0:Ia.id)===9&&n.value&&(qa=p==null?void 0:p.view)!=null&&qa.filterMultiple){if(p.view.filterMultiple.categoryIds){const on=P.value.findIndex(Ha=>Ha.type==="select-simple");if(on!==-1){const Ha=Array.isArray(p.view.filterMultiple.categoryIds)?p.view.filterMultiple.categoryIds:[p.view.filterMultiple.categoryIds];E.value[0]=Ha;const qr=(((bn=P.value[on])==null?void 0:bn.options)||[]).filter(Na=>Array.isArray(Na.value)?hr(Na.value,Ha):Ha.includes(Na.value));if(qr.length>0){const Na=qr[0].value;E.value[on]=Na}else E.value[on]=Ha;const wr=E.value[on];hr(wr,Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.isHomeTeam!==void 0){const on=P.value.findIndex(Ha=>Ha.type==="radio-button");if(on!==-1){const Ha=p.view.filterMultiple.isHomeTeam;let qr;typeof Ha=="boolean"?qr=Ha?1:2:typeof Ha=="number"?qr=Ha===1?1:2:qr=1,E.value[on]=qr,(((fn=P.value[on])==null?void 0:fn.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}if(((In=L.value)==null?void 0:In.id)===1&&n.value&&(ea=p==null?void 0:p.view)!=null&&ea.filterMultiple&&p.view.filterMultiple.category){const on=P.value.findIndex(Ha=>Ha.type==="select-simple"&&Ha.label==="Tipo de análisis");if(on!==-1){const Ha=p.view.filterMultiple.category;E.value[0]=Ha,p.view.componentProps&&Ha&&(p.view.componentProps.type=Ha),(((Ur=P.value[on])==null?void 0:Ur.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(((fa=L.value)==null?void 0:fa.id)===6&&n.value&&(Ma=p==null?void 0:p.view)!=null&&Ma.filterMultiple&&p.view.filterMultiple.gameNumber){const on=P.value.findIndex(Ha=>Ha.type==="select-simple"&&Ha.label==="Número de juego");if(on!==-1){const Ha=p.view.filterMultiple.gameNumber;E.value[0]=Ha,p.view.componentProps&&Ha&&(p.view.componentProps.gameNumber=Ha),(((Za=P.value[on])==null?void 0:Za.options)||[]).find(qr=>qr.value==Ha),t.nextTick(()=>{E.value=[...E.value]})}}if(((Ea=L.value)==null?void 0:Ea.id)===7&&n.value&&p!=null&&p.view){if((Xr=p.view.componentProps)!=null&&Xr.analysisType&&P.value.length>0&&((ca=P.value[0])==null?void 0:ca.type)==="radio-button"){const on=p.view.componentProps.analysisType==="offensive"?1:2;E.value[0]=on}if(((kr=p.view.filterMultiple)==null?void 0:kr.isHomeTeam)!==void 0){const on=P.value.findIndex(Ha=>Ha.type==="radio-button"&&Ha.label==="Equipo");if(on!==-1){const Ha=p.view.filterMultiple.isHomeTeam?1:2;E.value[1]=Ha}else if(P.value.length>1&&((ua=P.value[1])==null?void 0:ua.type)==="radio-button"){const Ha=p.view.filterMultiple.isHomeTeam,qr=Ha?1:2;E.value[1]=qr,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Ha),(((Xa=P.value[1])==null?void 0:Xa.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}if(on!==-1&&p.view.componentProps){const Ha=p.view.filterMultiple.isHomeTeam,qr=Ha?1:2;p.view.componentProps.isHomeTeamForAnalysis=Ha,(((ja=P.value[on])==null?void 0:ja.options)||[]).find(wr=>wr.value==qr),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1})}},100)})}function Mt(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn;return{mainSelector:{id:((St=f.value)==null?void 0:St.id)||null,name:((Yt=f.value)==null?void 0:Yt.name)||null,url:((er=f.value)==null?void 0:er.url)||null},viewSelector:{id:((or=L.value)==null?void 0:or.id)||null,name:((Or=L.value)==null?void 0:Or.name)||((Pr=L.value)==null?void 0:Pr.title)||null,url:((oa=L.value)==null?void 0:oa.url)||null},team:Y.value,dynamicFilters:((Ia=P.value)==null?void 0:Ia.map((fn,In)=>{var ea,Ur;const fa=E.value[In];return{filterId:fn.id||`filter_${In}`,filterType:fn.type,filterLabel:fn.label,filterIcon:fn.icon||null,selectedValue:fa,selectedOptions:fn.type==="select"&&Array.isArray(fa)&&fa.length>0?fa.map(Ma=>{var Za;const Ea=(Za=fn.options)==null?void 0:Za.find(Xr=>Xr.value===Ma);return{value:Ma,label:(Ea==null?void 0:Ea.label)||Ma,icon:(Ea==null?void 0:Ea.icon)||null}}):null,selectedOption:fn.type==="radio-button"&&fa?{value:fa,label:((Ur=(ea=fn.options)==null?void 0:ea.find(Ma=>Ma.value===fa))==null?void 0:Ur.label)||fa}:null,isChecked:fn.type==="check"?fa:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((qa=P.value)==null?void 0:qa.length)||0,activeFilters:((bn=P.value)==null?void 0:bn.filter((fn,In)=>{const ea=E.value[In];return Array.isArray(ea)?ea.length>0:ea!=null&&ea!==!1}).length)||0}}}r({getCurrentFiltersJSON:Mt});function Et(){st(),$("close",i)}function qt(){k.value=!1,Et()}function Gt(){T.value&&(Sd.emit("filters-cancelled",i),T.value=!1),k.value=!1,Et()}t.onMounted(async()=>{document.addEventListener("click",dt),t.nextTick(()=>{Jt()});const St="https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views";try{const Yt=await(await fetch(St,{headers:{Authorization:`${v.token}`}})).json();u.value=Yt.data||[],h.value.clear(),u.value&&(h.value=u.value.reduce((er,or)=>(or.views&&Array.isArray(or.views)&&or.views.forEach(Or=>{Or.filters&&Array.isArray(Or.filters)&&er.set(Or.id,Or)}),er),new Map))}catch(Yt){console.error("Error al obtener datos:",Yt)}});function Jt(){document.querySelectorAll(".field-menu .option-card").forEach(St=>{const Yt=St.querySelector(".option-img");if(!Yt||!Yt.dataset.hoverSrc)return;const er=Yt.src,or=Yt.dataset.hoverSrc;St.addEventListener("mouseenter",()=>{Yt.src=or}),St.addEventListener("mouseleave",()=>{Yt.src=er})})}t.onUnmounted(()=>{document.removeEventListener("click",dt)}),Sd.on("set-filter-and-views-container",St=>{i=St,St&<(St)}),Sd.on("view-added",()=>{k.value=!0,T.value=!0}),Sd.on("component-added-to-container",St=>{(!n.value||i&&St.id===i.id)&<(St)}),Sd.on("edit-view",St=>{var Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja;console.log("on edit-view event received for view:",St),p=St,i=((Yt=St.view)==null?void 0:Yt.filterAndViewsContainer)||null,l=null;const on=[(or=(er=St.view)==null?void 0:er.coreView)==null?void 0:or.filtersJSON,(Or=St.view)==null?void 0:Or.filtersJSON,(Pr=St.coreView)==null?void 0:Pr.filtersJSON,St.filtersJSON,(Ia=(oa=St.view)==null?void 0:oa.componentProps)==null?void 0:Ia.filtersJSON];for(const Ha of on)if(Ha){l=Ha;break}if(i&&(i.viewId===4||i.viewId===8||i.viewId===3||i.viewId===1||i.viewId===2||i.viewId===13)&&(qa=St.view)!=null&&qa.id){const Ha=i.getComponentDynamicFilters(St.view.id);if(Ha){let qr="Unknown";i.viewId===4?qr="Timeline":i.viewId===8?qr="FieldPosesion":i.viewId===3?qr="GSCMatchSummary":i.viewId===1?qr="GSCComparativeReports":i.viewId===2?qr="GscTopPlayer":i.viewId===13&&(qr="GSCTimelapseTable"),l&&(i.viewId===13?l={...l,dynamicFilters:Ha}:l={...l,dynamicFilters:Ha.map((wr,Na)=>Array.isArray(wr)?{selectedValue:wr,selectedOptions:wr.map(rn=>({value:rn,label:rn}))}:typeof wr=="boolean"?{isChecked:wr}:qr==="GSCComparativeReports"&&Na===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&Na===0?{selectedValue:wr,selectedOptions:[{value:wr,label:wr}]}:qr==="GscTopPlayer"&&Na===1?{selectedOption:{value:wr,label:wr}}:{selectedOption:{value:wr,label:wr}})})}}if(i&&i.viewId===2&&(bn=St.view)!=null&&bn.filterMultiple){if(St.view.filterMultiple.categoryId&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Ha!==-1&&(l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:St.view.filterMultiple.categoryId,selectedOptions:[{value:St.view.filterMultiple.categoryId,label:`Category ${St.view.filterMultiple.categoryId}`}]})}if(St.view.filterMultiple.teamType!==void 0&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Ha!==-1){const qr=St.view.filterMultiple.teamType,wr=qr===1?"Mi equipo":qr===2?"Rival":qr===3?"Ambos":"Equipo";l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:qr,label:wr}}}}}if(i&&i.viewId===1&&(fn=St.view)!=null&&fn.filterMultiple&&St.view.filterMultiple.category&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Tipo de análisis");Ha!==-1&&(l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:St.view.filterMultiple.category,selectedOptions:[{value:St.view.filterMultiple.category,label:St.view.filterMultiple.category}]})}if(i&&i.viewId===9&&(In=St.view)!=null&&In.filterMultiple){if(St.view.filterMultiple.categoryIds&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select"&&qr.filterLabel==="Tipo de análisis");if(Ha!==-1){const qr=Array.isArray(St.view.filterMultiple.categoryIds)?St.view.filterMultiple.categoryIds:[St.view.filterMultiple.categoryIds];l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:qr,selectedOptions:qr.map(rn=>({value:rn,label:`Category ${rn}`}))};const wr=St.view.filterMultiple.categoryIds;hr(wr,qr);const Na=(((ea=P.value[Ha])==null?void 0:ea.options)||[]).filter(rn=>Array.isArray(rn.value)?hr(rn.value,qr):qr.includes(rn.value));if(Na.length>0){const rn=Na[0];l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:rn.value,selectedOptions:[rn]}}}}if(St.view.filterMultiple.isHomeTeam!==void 0&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button");if(Ha!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,Na;typeof qr=="boolean"?(wr=qr?1:2,Na=qr?"Mi equipo":"Rival"):typeof qr=="number"?(wr=qr===1?1:2,Na=qr===1?"Mi equipo":"Rival"):(wr=1,Na="Mi equipo"),l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}}}if(i&&i.viewId===6&&(Ur=St.view)!=null&&Ur.filterMultiple&&St.view.filterMultiple.gameNumber&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="select-simple"&&qr.filterLabel==="Número de juego");Ha!==-1&&(l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedValue:St.view.filterMultiple.gameNumber,selectedOptions:[{value:St.view.filterMultiple.gameNumber,label:`Juego ${St.view.filterMultiple.gameNumber}`}]})}if(i&&i.viewId===7&&St.view&&l){if((fa=St.view.componentProps)!=null&&fa.analysisType){const Ha=l.dynamicFilters.findIndex((qr,wr)=>qr.filterType==="radio-button"&&wr===0);if(Ha!==-1){const qr=St.view.componentProps.analysisType,wr=qr==="offensive"?1:2,Na=qr==="offensive"?"A favor":"En contra";l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}}if(((Ma=St.view.filterMultiple)==null?void 0:Ma.isHomeTeam)!==void 0){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Ha!==-1){const qr=St.view.filterMultiple.isHomeTeam,wr=qr?1:2,Na=qr?"Equipo propio":"Equipo rival";l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}}}if(i&&i.viewId===10&&(Za=St.view)!=null&&Za.filterMultiple&&((Xr=(Ea=p==null?void 0:p.view)==null?void 0:Ea.coreView)==null?void 0:Xr.id)===10){const Ha=St.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:Ha})}if(i&&i.viewId===15&&(ca=St.view)!=null&&ca.id){const Ha=i.getComponentDynamicFilters(St.view.id);if(Ha&&l)l={...l,dynamicFilters:Ha.map((qr,wr)=>{var Na,rn;if(wr===0){let mn=qr;if(qr===3&&((rn=(Na=St.view)==null?void 0:Na.filterMultiple)==null?void 0:rn.isHomeTeam)!==void 0){const $a=St.view.filterMultiple.isHomeTeam;typeof $a=="boolean"?mn=$a?1:2:typeof $a=="number"&&(mn=$a===1?1:2)}return{selectedOption:{value:mn,label:mn===1?"Mi equipo":"Rival"}}}else if(wr===1)return{selectedValue:qr,selectedOptions:[{value:qr,label:`${qr} fortalezas`}]};return typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})};else if((kr=St.view)!=null&&kr.filterMultiple&&l&&St.view.filterMultiple.isHomeTeam!==void 0){const qr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button"&&wr.filterLabel==="Mi equipo");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let Na,rn;typeof wr=="boolean"?(Na=wr?1:2,rn=wr?"Local":"Visitante"):typeof wr=="number"?(Na=wr===1?1:2,rn=wr===1?"Local":"Visitante"):(Na=1,rn="Local"),l.dynamicFilters[qr]={...l.dynamicFilters[qr],selectedOption:{value:Na,label:rn}}}}}if(i&&i.viewId===17&&(ua=St.view)!=null&&ua.id){const Ha=i.getComponentDynamicFilters(St.view.id);if(Ha&&l)console.log("Edit filters opt 1",l),l={...l,dynamicFilters:Ha.map((qr,wr)=>{var Na,rn,mn,$a,Hn,Pn;const Yn=(Na=P.value)==null?void 0:Na[wr];if(Yn&&Yn.type==="radio-button"){let An=qr;if(qr===3&&((mn=(rn=St.view)==null?void 0:rn.filterMultiple)==null?void 0:mn.isHomeTeam)!==void 0){const Wn=St.view.filterMultiple.isHomeTeam;typeof Wn=="boolean"?An=Wn?1:2:typeof Wn=="number"&&(An=Wn===1?1:2)}return{selectedOption:{value:An,label:An===1?"Mi equipo":An===2?"Rival":"Ambos"}}}else if(wr===2){let An=qr;if((qr===3||qr!==1&&qr!==2&&($a=St.view)!=null&&$a.filterMultiple)&&((Pn=(Hn=St.view)==null?void 0:Hn.filterMultiple)==null?void 0:Pn.isHomeTeam)!==void 0){const Wn=St.view.filterMultiple.isHomeTeam;typeof Wn=="boolean"?An=Wn?1:2:typeof Wn=="number"&&(An=Wn===1?1:2)}return Yn&&Yn.type==="select-simple"?{selectedValue:An,selectedOptions:[{value:An,label:String(An)}]}:Yn&&Yn.type==="radio-button"?{selectedOption:{value:An,label:An===1?"Mi equipo":An===2?"Rival":"Ambos"}}:typeof An=="number"?{selectedValue:An}:{selectedOption:{value:An,label:String(An)}}}else{if(Yn&&Yn.type==="switch")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr};if(Yn&&Yn.type==="check")return typeof qr=="boolean"?{selectedValue:qr}:{selectedValue:qr}}return Array.isArray(qr)?{selectedValue:qr,selectedOptions:qr.map(An=>({value:An,label:String(An)}))}:typeof qr=="boolean"?{selectedValue:qr}:typeof qr=="object"&&qr!==null?qr:typeof qr=="number"?{selectedValue:qr}:{selectedOption:{value:qr,label:String(qr)}}})},console.log("Edit filters opt 1 finla --->",l);else if((Xa=St.view)!=null&&Xa.filterMultiple&&l&&(console.log("Edit filters opt 1 multiple"),St.view.filterMultiple.isHomeTeam!==void 0)){const qr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let Na,rn;typeof wr=="boolean"?(Na=wr?1:2,rn=wr?"Mi equipo":"Rival"):typeof wr=="number"?(Na=wr===1?1:2,rn=wr===1?"Mi equipo":"Rival"):(Na=1,rn="Mi equipo"),l.dynamicFilters[qr]={...l.dynamicFilters[qr],selectedOption:{value:Na,label:rn}}}}}if(i&&i.viewId===5&&(ja=St.view)!=null&&ja.filterMultiple&&St.view.filterMultiple.isHomeTeam!==void 0&&l){const Ha=l.dynamicFilters.findIndex(qr=>qr.filterType==="radio-button"&&qr.filterLabel==="Equipo");if(Ha!==-1){const qr=St.view.filterMultiple.isHomeTeam;let wr,Na;typeof qr=="boolean"?(wr=qr?1:2,Na=qr?"Equipo propio":"Equipo rival"):typeof qr=="number"?(wr=qr===1?1:2,Na=qr===1?"Equipo propio":"Equipo rival"):(wr=1,Na="Equipo propio"),l.dynamicFilters[Ha]={...l.dynamicFilters[Ha],selectedOption:{value:wr,label:Na}}}else{const qr=l.dynamicFilters.findIndex(wr=>wr.filterType==="radio-button");if(qr!==-1){const wr=St.view.filterMultiple.isHomeTeam;let Na,rn;typeof wr=="boolean"?(Na=wr?1:2,rn=wr?"Equipo propio":"Equipo rival"):typeof wr=="number"?(Na=wr===1?1:2,rn=wr===1?"Equipo propio":"Equipo rival"):(Na=1,rn="Equipo propio"),l.dynamicFilters[qr]={...l.dynamicFilters[qr],selectedOption:{value:Na,label:rn}}}}}l&&Ot(l),k.value=!0});function Qt(){ge.value=null}function lr(St,Yt){var er;(er=L.value)==null||er.id}function hr(St,Yt){if(!Array.isArray(St)||!Array.isArray(Yt)||St.length!==Yt.length)return!1;const er=[...St].sort((Or,Pr)=>Or-Pr),or=[...Yt].sort((Or,Pr)=>Or-Pr);return JSON.stringify(er)===JSON.stringify(or)}function $t(){if(n.value&&l&&l.dynamicFilters){if(o.value||x.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&(er=P.value)!=null&&er[Yt]){const or=P.value[Yt];if(or.type==="check"&&St.isChecked!==void 0)E.value[Yt]=St.isChecked;else if(or.type==="select"&&St.selectedOptions){const Or=St.selectedOptions.map(Pr=>Pr.value);E.value[Yt]=Or}else or.type==="select"&&St.selectedValue&&Array.isArray(St.selectedValue)&&(E.value[Yt]=St.selectedValue)}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Rt(){var St;if(n.value&&l&&l.dynamicFilters&&((St=L.value)==null?void 0:St.id)===4){if(o.value||x.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((Yt,er)=>{var or,Or;if(Yt&&((Or=(or=P.value)==null?void 0:or[er])==null?void 0:Or.type)==="select"){if(Yt.selectedOptions){const Pr=Yt.selectedOptions.map(oa=>oa.value);E.value[er]=Pr}else if(Yt.selectedValue&&Array.isArray(Yt.selectedValue))if(Yt.selectedValue.length>0&&Yt.selectedValue[0]&&typeof Yt.selectedValue[0]=="object"){const Pr=sr(Yt.selectedValue);E.value[er]=Pr}else E.value[er]=Yt.selectedValue}}),setTimeout(()=>{var Yt;if(E.value=[...E.value],(Yt=p==null?void 0:p.view)!=null&&Yt.componentProps&&E.value&&E.value.length>0){const er=E.value[0];if(Array.isArray(er)&&er.length>0){const or=er.some(Ia=>Ia.event_type_id===1||typeof Ia=="string"&&Ia.includes("1")),Or=er.some(Ia=>Ia.category_id===8||typeof Ia=="string"&&Ia.includes("8")),Pr=er.some(Ia=>Ia.category_id===9||typeof Ia=="string"&&Ia.includes("9")),oa=er.some(Ia=>Ia.event_type_id===3||typeof Ia=="string"&&Ia.includes("3"));p.view.componentProps.selectedEvents=er,p.view.componentProps.goals=or,p.view.componentProps.yellowCards=Or,p.view.componentProps.redCards=Pr,p.view.componentProps.substitutions=oa,p.view.componentProps.key=er.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},200),t.nextTick(()=>{d.value=!1,o.value=!1})}}function sr(St){return!Array.isArray(St)||St.length===0?[]:St.map(Yt=>{if(Yt&&typeof Yt=="object"){if(Yt.event_type_id!==void 0||Yt.category_id!==void 0)return{event_type_id:Yt.event_type_id,category_id:Yt.category_id,...Yt.name&&{name:Yt.name},...Yt.label&&{label:Yt.label}};if(Yt.value&&typeof Yt.value=="object")return{event_type_id:Yt.value.event_type_id,category_id:Yt.value.category_id,...Yt.value.name&&{name:Yt.value.name},...Yt.value.label&&{label:Yt.value.label}};if(typeof Yt=="string"&&Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}}if(typeof Yt=="string")if(Yt.includes("-")){const[er,or]=Yt.split("-");return{category_id:parseInt(er),event_type_id:parseInt(or)}}else{const er=parseInt(Yt);if(!isNaN(er))return{event_type_id:er}}return Yt})}function Zt(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma;if(n.value&&l&&l.dynamicFilters&&P.value){if(o.value||x.value)return;if(o.value=!0,d.value=!0,l.dynamicFilters.forEach((Za,Ea)=>{var Xr,ca,kr,ua,Xa,ja,on,Ha,qr,wr,Na;if(Za&&((Xr=P.value[Ea])==null?void 0:Xr.type)==="select"){if(Za.selectedOptions){const rn=Za.selectedOptions.map(mn=>mn.value);E.value[Ea]=rn}else if(Za.selectedValue&&Array.isArray(Za.selectedValue))if(Za.selectedValue.length>0&&Za.selectedValue[0]&&typeof Za.selectedValue[0]=="object"){const rn=sr(Za.selectedValue);E.value[Ea]=rn}else E.value[Ea]=Za.selectedValue}else if(Za&&((ca=P.value[Ea])==null?void 0:ca.type)==="select-simple"&&Za.selectedValue!==void 0){let rn;((kr=L.value)==null?void 0:kr.id)===2&&(Xa=(ua=p==null?void 0:p.view)==null?void 0:ua.filterMultiple)!=null&&Xa.categoryId?rn=p.view.filterMultiple.categoryId:((ja=L.value)==null?void 0:ja.id)===1&&(Ha=(on=p==null?void 0:p.view)==null?void 0:on.filterMultiple)!=null&&Ha.category?rn=p.view.filterMultiple.category:((qr=L.value)==null?void 0:qr.id)===6&&(Na=(wr=p==null?void 0:p.view)==null?void 0:wr.filterMultiple)!=null&&Na.gameNumber?rn=p.view.filterMultiple.gameNumber:rn=Array.isArray(Za.selectedValue)?Za.selectedValue[0]:Za.selectedValue,E.value[Ea]=rn}}),((St=L.value)==null?void 0:St.id)===4&&setTimeout(()=>{var Za;if(E.value=[...E.value],(Za=p==null?void 0:p.view)!=null&&Za.componentProps&&E.value&&E.value.length>0){const Ea=E.value[0];if(Array.isArray(Ea)&&Ea.length>0){const Xr=Ea.some(Xa=>Xa.event_type_id===1||typeof Xa=="string"&&Xa.includes("1")),ca=Ea.some(Xa=>Xa.category_id===8||typeof Xa=="string"&&Xa.includes("8")),kr=Ea.some(Xa=>Xa.category_id===9||typeof Xa=="string"&&Xa.includes("9")),ua=Ea.some(Xa=>Xa.event_type_id===3||typeof Xa=="string"&&Xa.includes("3"));p.view.componentProps.selectedEvents=Ea,p.view.componentProps.goals=Xr,p.view.componentProps.yellowCards=ca,p.view.componentProps.redCards=kr,p.view.componentProps.substitutions=ua,p.view.componentProps.key=Ea.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}},100),((Yt=L.value)==null?void 0:Yt.id)===2&&(er=p==null?void 0:p.view)!=null&&er.filterMultiple){if(p.view.filterMultiple.categoryId){const Za=P.value.findIndex(Ea=>Ea.type==="select-simple"&&Ea.label==="Tipo de análisis");if(Za!==-1){const Ea=p.view.filterMultiple.categoryId;if(E.value[0]=Ea,p.view.componentProps&&Ea){let Xr=`Category ${Ea}`,ca=null;try{ca=A4(Ea),ca&&(Xr=ca.name)}catch{const kr=P.value.findIndex(ua=>ua.type==="select-simple"&&ua.label==="Tipo de análisis");if(kr!==-1){const ua=(((or=P.value[kr])==null?void 0:or.options)||[]).find(Xa=>Xa.value==Ea);ua&&(Xr=ua.label)}}p.view.componentProps.categoryView=[{id:Ea,name:Xr}]}(((Or=P.value[Za])==null?void 0:Or.options)||[]).find(Xr=>Xr.value==Ea),t.nextTick(()=>{E.value=[...E.value]})}}if(p.view.filterMultiple.teamType!==void 0){const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.teamType;E.value[Za]=Ea,(((Pr=P.value[Za])==null?void 0:Pr.options)||[]).find(Xr=>Xr.value==Ea),t.nextTick(()=>{E.value=[...E.value]})}}}if(((oa=L.value)==null?void 0:oa.id)===1&&(Ia=p==null?void 0:p.view)!=null&&Ia.filterMultiple&&p.view.filterMultiple.category&&P.value.findIndex(Za=>Za.type==="select-simple"&&Za.label==="Tipo de análisis")!==-1){const Za=p.view.filterMultiple.category;E.value[0]=Za,p.view.componentProps&&Za&&(p.view.componentProps.type=Za),t.nextTick(()=>{E.value=[...E.value]})}if(((qa=L.value)==null?void 0:qa.id)===6&&(bn=p==null?void 0:p.view)!=null&&bn.filterMultiple&&p.view.filterMultiple.gameNumber&&P.value.findIndex(Za=>Za.type==="select-simple"&&Za.label==="Número de juego")!==-1){const Za=p.view.filterMultiple.gameNumber;E.value[0]=Za,p.view.componentProps&&Za&&(p.view.componentProps.gameNumber=Za),t.nextTick(()=>{E.value=[...E.value]})}if(((fn=L.value)==null?void 0:fn.id)===5&&(In=p==null?void 0:p.view)!=null&&In.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0)if(P.value.findIndex(Za=>Za.type==="radio-button"&&Za.label==="Equipo")!==-1){const Za=p.view.filterMultiple.isHomeTeam;let Ea;typeof Za=="boolean"?Ea=Za?1:2:typeof Za=="number"?Ea=Za===1?1:2:Ea=1,E.value[0]=Ea,p.view.componentProps&&Za!==void 0&&(p.view.componentProps.isHomeTeamForAnalysis=Za===1),t.nextTick(()=>{E.value=[...E.value]})}else{const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.isHomeTeam;let Xr;typeof Ea=="boolean"?Xr=Ea?1:2:typeof Ea=="number"?Xr=Ea===1?1:2:Xr=1,E.value[Za]=Xr,p.view.componentProps&&Ea!==void 0&&(p.view.componentProps.preMatchType=Ea),t.nextTick(()=>{E.value=[...E.value]})}}if(((ea=L.value)==null?void 0:ea.id)===15&&(Ur=p==null?void 0:p.view)!=null&&Ur.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",Ea,"type:",typeof Ea);let Xr;typeof Ea=="boolean"?Xr=Ea?1:2:typeof Ea=="number"?Xr=Ea===1?1:2:Xr=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Xr,"teamFilterIndex:",Za),E.value[Za]=Xr,p.view.componentProps&&Ea!==void 0&&(p.view.componentProps.preMatchType=Xr),t.nextTick(()=>{E.value=[...E.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",E.value)})}else{const Ea=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Ea!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let ca;typeof Xr=="boolean"?ca=Xr?1:2:typeof Xr=="number"?ca=Xr===1?1:2:ca=1,E.value[Ea]=ca,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.preMatchType=ca),t.nextTick(()=>{E.value=[...E.value]})}}}if(((fa=L.value)==null?void 0:fa.id)===17&&(Ma=p==null?void 0:p.view)!=null&&Ma.filterMultiple&&p.view.filterMultiple.isHomeTeam!==void 0){const Za=P.value.findIndex(Ea=>Ea.type==="radio-button");if(Za!==-1){const Ea=p.view.filterMultiple.isHomeTeam;let Xr;typeof Ea=="boolean"?Xr=Ea?1:2:typeof Ea=="number"?Xr=Ea===1?1:2:Xr=1,E.value[Za]=Xr,p.view.componentProps&&Ea!==void 0&&(p.view.componentProps.teamselected=Xr),t.nextTick(()=>{E.value=[...E.value]})}else{const Ea=P.value.findIndex(Xr=>Xr.type==="radio-button");if(Ea!==-1){const Xr=p.view.filterMultiple.isHomeTeam;let ca;typeof Xr=="boolean"?ca=Xr?1:2:typeof Xr=="number"?ca=Xr===1?1:2:ca=1,E.value[Ea]=ca,p.view.componentProps&&Xr!==void 0&&(p.view.componentProps.teamselected=ca),t.nextTick(()=>{E.value=[...E.value]})}}}t.nextTick(()=>{d.value=!1,o.value=!1})}}function Tt(){if(!o.value&&n.value&&l&&l.dynamicFilters&&P.value){if(x.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((St,Yt)=>{var er;if(St&&((er=P.value[Yt])==null?void 0:er.type)==="radio-button"&&St.selectedOption&&St.selectedOption.value!==void 0){const or=St.selectedOption.value;E.value[Yt]=or}}),t.nextTick(()=>{d.value=!1,o.value=!1})}}function Pt(){var St,Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea,Xr,ca,kr,ua,Xa,ja,on,Ha,qr,wr,Na,rn,mn,$a,Hn,Pn,Yn;if(i&&n.value&&p){if(x.value)return;if(d.value=!0,((St=L.value)==null?void 0:St.id)===4){if(i.setDynamicFilters(E.value,(Yt=p.view)==null?void 0:Yt.id),i.updateDynamicFilters(E.value,(er=p.view)==null?void 0:er.id),p.view.componentProps&&E.value&&E.value.length>0){const An=E.value[0];if(Array.isArray(An)&&An.length>0){const Wn=An.some(So=>So.event_type_id===1||typeof So=="string"&&So.includes("1")),Ci=An.some(So=>So.category_id===8||typeof So=="string"&&So.includes("8")),Pi=An.some(So=>So.category_id===9||typeof So=="string"&&So.includes("9")),Po=An.some(So=>So.event_type_id===3||typeof So=="string"&&So.includes("3"));p.view.componentProps.selectedEvents=An,p.view.componentProps.goals=Wn,p.view.componentProps.yellowCards=Ci,p.view.componentProps.redCards=Pi,p.view.componentProps.substitutions=Po,p.view.componentProps.key=An.length>0,p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}}else if(((or=L.value)==null?void 0:or.id)===8)i.setDynamicFilters(E.value,(Or=p.view)==null?void 0:Or.id),i.updateDynamicFilters(E.value,(Pr=p.view)==null?void 0:Pr.id);else if(((oa=L.value)==null?void 0:oa.id)===3)i.setDynamicFilters(E.value,(Ia=p.view)==null?void 0:Ia.id),i.updateDynamicFilters(E.value,(qa=p.view)==null?void 0:qa.id);else if(((bn=L.value)==null?void 0:bn.id)===13){const An=(fn=p.view)==null?void 0:fn.id;i.setDynamicFilters(E.value,An),i.updateDynamicFilters(E.value,An),p.view.componentProps&&(p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps}))}else if(((In=L.value)==null?void 0:In.id)===15){const An=(ea=p.view)==null?void 0:ea.id;if(i.setDynamicFilters(E.value,An),i.updateDynamicFilters(E.value,An),p.view.componentProps){const Wn=Array.isArray(E.value)&&E.value[3]!==void 0?E.value[3]:null;Wn!==null&&(p.view.componentProps.numitems=Wn),p.view.componentProps._updateKey=Date.now(),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Ur=L.value)==null?void 0:Ur.id)===17){const An=(fa=p==null?void 0:p.view)==null?void 0:fa.id;i.setDynamicFilters(E.value,An),i.updateDynamicFilters(E.value,An);const Wn=(Ci,Pi)=>{if(!Ci)return;const Po=E.value[0];Po!==void 0&&(Ci.infavoragainstteam=!Po);const So=E.value[1];So!==void 0&&(Ci.lateralidad=So===32?"right":"left");const Mo=E.value[2];Mo!==void 0&&Pi&&(Mo===3||(Ci.teamselected=Mo===2?Pi.away_team:Pi.home_team)),Ci._updateKey=Date.now()};if(p&&p.view&&p.view.componentProps){const Ci=p.view.componentProps.game;Wn(p.view.componentProps,Ci),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps})}}else if(((Ma=L.value)==null?void 0:Ma.id)===2){i.setDynamicFilters(E.value,(Za=p.view)==null?void 0:Za.id),i.updateDynamicFilters(E.value,(Ea=p.view)==null?void 0:Ea.id);const An=E.value[0];if(An!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.categoryId,p.view.filterMultiple.categoryId=An,p.view.componentProps)){let Ci=`Category ${An}`,Pi=null;try{Pi=A4(An),Pi&&(Ci=Pi.name)}catch{const Po=P.value.findIndex(So=>So.type==="select-simple"&&So.label==="Tipo de análisis");if(Po!==-1){const So=(((Xr=P.value[Po])==null?void 0:Xr.options)||[]).find(Mo=>Mo.value==An);So&&(Ci=So.label)}}p.view.componentProps.categoryView=[{id:An,name:Ci}],Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple})}const Wn=E.value[1];Wn!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.teamType,p.view.filterMultiple.teamType=Wn,p.view.componentProps&&p.view.componentProps.game&&(Wn===1?p.view.componentProps.teamView=p.view.componentProps.game.homeTeam.team_id:Wn===2?p.view.componentProps.teamView=p.view.componentProps.game.awayTeam.team_id:p.view.componentProps.teamView=0),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((ca=L.value)==null?void 0:ca.id)===1){i.setDynamicFilters(E.value,(kr=p.view)==null?void 0:kr.id),i.updateDynamicFilters(E.value,(ua=p.view)==null?void 0:ua.id);const An=E.value[0];An!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.category,p.view.filterMultiple.category=An,p.view.componentProps&&(p.view.componentProps.type=An),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}))}else if(((Xa=L.value)==null?void 0:Xa.id)===6){i.setDynamicFilters(E.value,(ja=p.view)==null?void 0:ja.id),i.updateDynamicFilters(E.value,(on=p.view)==null?void 0:on.id);const An=E.value[0];An!==void 0&&(p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.gameNumber,p.view.filterMultiple.gameNumber=An,p.view.componentProps&&(p.view.componentProps.gameNumber=An,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Ha=L.value)==null?void 0:Ha.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})}))}else if(((qr=L.value)==null?void 0:qr.id)===7){i.setDynamicFilters(E.value,(wr=p.view)==null?void 0:wr.id),i.updateDynamicFilters(E.value,(Na=p.view)==null?void 0:Na.id);const An=E.value[0],Wn=E.value[1];if(An!==void 0&&p.view.componentProps){const Ci=An===1?"offensive":"defensive";p.view.componentProps.analysisType=Ci}if(Wn!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Ci=Wn===1;p.view.filterMultiple.isHomeTeam=Ci,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Ci,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(rn=L.value)==null?void 0:rn.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else if(((mn=L.value)==null?void 0:mn.id)===5){i.setDynamicFilters(E.value,($a=p.view)==null?void 0:$a.id),i.updateDynamicFilters(E.value,(Hn=p.view)==null?void 0:Hn.id);const An=E.value[0];if(An!==void 0){p.view.filterMultiple||(p.view.filterMultiple={}),p.view.filterMultiple.isHomeTeam;const Wn=An===1?1:2;p.view.filterMultiple.isHomeTeam=Wn,p.view.componentProps&&(p.view.componentProps.isHomeTeamForAnalysis=Wn===1,p.view._updateKey,p.view._updateKey=Date.now()),Sd.emit("force-component-update",{itemId:p.view.id,componentProps:p.view.componentProps,filterMultiple:p.view.filterMultiple}),Sd.emit("dynamic-filters-changed",{containerViewId:(Pn=L.value)==null?void 0:Pn.id,viewId:p.view.id,dynamicFilters:E.value}),Sd.emit("component-props-updated",{viewId:p.view.id,componentProps:p.view.componentProps,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})}}else((Yn=L.value)==null?void 0:Yn.id)===9||(i.setDynamicFilters(E.value),i.updateDynamicFilters(E.value));t.nextTick(()=>{d.value=!1})}}function Ut(){var St,Yt;if(!l||!l.dynamicFilters||!P.value)return!1;for(let er=0;er<l.dynamicFilters.length;er++){const or=l.dynamicFilters[er],Or=P.value[er],Pr=E.value[er];if(!(!or||!Or)){if(Or.type==="check"){if(or.isChecked!==Pr)return!0}else if(Or.type==="radio-button"){if(((St=or.selectedOption)==null?void 0:St.value)!==Pr)return!0}else if(Or.type==="select"){const oa=((Yt=or.selectedOptions)==null?void 0:Yt.map(qa=>qa.value))||or.selectedValue||[],Ia=Array.isArray(Pr)?Pr:[];if(JSON.stringify(oa)!==JSON.stringify(Ia))return!0}}}return!1}function vr(St){var Yt,er,or,Or,Pr,oa,Ia,qa,bn,fn,In,ea,Ur,fa,Ma,Za,Ea;if(E.value=St.filters,i){const Xr=((Yt=p==null?void 0:p.view)==null?void 0:Yt.id)||null;i.setDynamicFilters(E.value,Xr),i.updateDynamicFilters(E.value,Xr)}if(n.value&&p&&(Sd.emit("activate-save-button"),Sd.emit("force-component-update",{itemId:((er=p==null?void 0:p.view)==null?void 0:er.id)||null,componentProps:p.view.componentProps}),Sd.emit("dynamic-filters-changed",{containerViewId:((or=p==null?void 0:p.view)==null?void 0:or.id)||null,viewId:((Or=p==null?void 0:p.view)==null?void 0:Or.id)||null,dynamicFilters:E.value}),Sd.emit("dynamic-filters-changed",{containerViewId:((Pr=p==null?void 0:p.view)==null?void 0:Pr.id)||null,viewId:((oa=p==null?void 0:p.view)==null?void 0:oa.id)||null,dynamicFilters:E.value}),t.nextTick(()=>{p.view.componentProps&&(p.view.componentProps={...p.view.componentProps})})),!n.value&&i&&(((Ia=L.value)==null?void 0:Ia.id)===15||((qa=L.value)==null?void 0:qa.id)===17)&&i.getRequiresAddView(E.value,P.value)){i.setDynamicFilters(E.value),$("filters-changed",{main:f.value,view:L.value,team:Y.value,dynamicFilters:E.value,filtersJSON:{mainSelector:{id:((bn=f.value)==null?void 0:bn.id)||null,name:((fn=f.value)==null?void 0:fn.name)||null,url:((In=f.value)==null?void 0:In.url)||null},viewSelector:{id:((ea=L.value)==null?void 0:ea.id)||null,name:((Ur=L.value)==null?void 0:Ur.name)||((fa=L.value)==null?void 0:fa.title)||null,url:((Ma=L.value)==null?void 0:Ma.url)||null},team:Y.value,dynamicFilters:E.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!f.value,viewSelected:!!L.value,totalDynamicFilters:((Za=P.value)==null?void 0:Za.length)||0,activeFilters:((Ea=P.value)==null?void 0:Ea.filter((Xr,ca)=>{const kr=E.value[ca];return Array.isArray(kr)?kr.length>0:kr!=null&&kr!==!1}).length)||0}},filterAndViewsContainer:i,viewToEdit:p}),Ye();return}Pt()}function ur(St){St.filterIndex!==void 0&&St.value!==void 0&&(E.value[St.filterIndex]=St.value,n.value&&Pt(),Ye())}function gr(){Gt()}function Tr(St){var Yt,er,or,Or,Pr,oa,Ia;console.log("newFilters in onChangeFiltersAltMode:",St);const qa={mainSelector:{id:((Yt=f.value)==null?void 0:Yt.id)||null,name:((er=f.value)==null?void 0:er.name)||null,url:((or=f.value)==null?void 0:or.url)||null},viewSelector:{id:((Or=L.value)==null?void 0:Or.id)||null,name:((Pr=L.value)==null?void 0:Pr.name)||((oa=L.value)==null?void 0:oa.title)||null,url:((Ia=L.value)==null?void 0:Ia.url)||null}};$("filters-changed",{filters:St.filters,view:St.view,viewToEdit:p,filterAndViewsContainer:i,filtersJSON:qa,isAltMode:!0})}function Rr(St){return JSON.parse(JSON.stringify(St))}return(St,Yt)=>(t.openBlock(),t.createElementBlock("div",zrt,[t.createElementVNode("button",Mrt,t.toDisplayString(n.value?"Editando visualización":"Nueva visualización"),1),t.createElementVNode("div",{class:t.normalizeClass([{disabled:n.value},"custom-select main-select"]),onClick:_e},[t.createElementVNode("div",Vrt,[t.createElementVNode("span",Prt,[f.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Art)):(t.openBlock(),t.createElementBlock("img",Rrt))]),f.value?(t.openBlock(),t.createElementBlock("span",Frt,t.toDisplayString(Ae()),1)):(t.openBlock(),t.createElementBlock("span",Urt,"Tipo de vista")),t.createElementVNode("span",{class:t.normalizeClass([{open:se.value},"arrow"])},[...Yt[5]||(Yt[5]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),se.value?(t.openBlock(),t.createElementBlock("div",Irt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,(er,or)=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:s.value===or},"option-card"]),onClick:t.withModifiers(Or=>qe(or),["stop"])},[t.createElementVNode("div",jrt,[t.createElementVNode("img",{"data-hover-src":xe(er.name,!0),src:xe(er.name,!1),alt:"icono",class:"option-img-34"},null,8,Wrt)]),t.createElementVNode("div",Drt,[t.createElementVNode("div",Krt,t.toDisplayString(er.name),1),er.description?(t.openBlock(),t.createElementBlock("div",Brt,t.toDisplayString(er.description),1)):t.createCommentVNode("",!0)])],10,qrt))),128))])):t.createCommentVNode("",!0)],2),f.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass([{disabled:n.value},"custom-select second-select"]),onClick:Ue},[t.createElementVNode("div",Xrt,[t.createElementVNode("span",Grt,[L.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:L.value.url,alt:"icono",class:"option-img-graph2"},null,8,Zrt)):f.value?(t.openBlock(),t.createElementBlock("img",{key:1,src:xe(f.value.name,!1),alt:"icono",class:"option-img"},null,8,Jrt)):t.createCommentVNode("",!0)]),t.createElementVNode("span",Hrt,t.toDisplayString(je()),1),t.createElementVNode("span",{class:t.normalizeClass([{open:me.value},"arrow"])},[...Yt[6]||(Yt[6]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),me.value&&f.value?(t.openBlock(),t.createElementBlock("div",Yrt,[t.createElementVNode("div",Qrt,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,er=>(t.openBlock(),t.createElementBlock("div",{key:er.id,class:t.normalizeClass([{active:S.value===er.id},"option-card-grid"]),onClick:t.withModifiers(or=>Re(er),["stop"])},[er.id===17?(t.openBlock(),t.createElementBlock("div",eat,[...Yt[7]||(Yt[7]=[t.createElementVNode("div",null,"Tiros de esquina",-1),t.createElementVNode("div",null,"tendencia general",-1)])])):er.id===18?(t.openBlock(),t.createElementBlock("div",tat,[...Yt[8]||(Yt[8]=[t.createElementVNode("div",null,"Tactica fija",-1),t.createElementVNode("div",null,"jugadas especificas",-1)])])):(t.openBlock(),t.createElementBlock("div",rat,t.toDisplayString(er.name||er.title),1)),t.createElementVNode("div",aat,[t.createElementVNode("img",{src:er.url,alt:"icono",class:"option-img-grid"},null,8,nat)])],10,$rt))),128))])])):t.createCommentVNode("",!0)],2)):t.createCommentVNode("",!0),L.value?(t.openBlock(),t.createElementBlock("div",iat)):t.createCommentVNode("",!0),L.value&&L.value.id===13?(t.openBlock(),t.createBlock(IYe,{key:2,"component-id":13,filters:P.value,"initial-values":n.value?t.unref(l).dynamicFilters:E.value,"is-edit-mode":n.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===16?(t.openBlock(),t.createBlock(YQe,{key:3,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"is-edit-mode":!!t.unref(p),"is-post-match":e.isPostMatch,"view-config":Rr(h.value.get(16)),onChange:Tr,onRemoveViews:gr},null,8,["default-filters","is-edit-mode","is-post-match","view-config"])):L.value&&L.value.id===18?(t.openBlock(),t.createBlock(ret,{key:4,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,"view-config":Rr(h.value.get(18)),"is-post-match":e.isPostMatch,onChange:Tr,onRemoveViews:gr},null,8,["default-filters","view-config","is-post-match"])):L.value&&L.value.id===15?(t.openBlock(),t.createBlock(aQe,{key:5,"component-id":15,filters:P.value,"initial-values":n.value?t.unref(l).dynamicFilters:E.value,"is-edit-mode":n.value,onFiltersChanged:vr,onFilterUpdated:ur},null,8,["filters","initial-values","is-edit-mode"])):L.value&&L.value.id===17?(t.openBlock(),t.createBlock(Ert,{key:6,"component-id":17,"default-filters":t.unref(p)?t.unref(p).view.filterMultiple:null,filters:P.value,"initial-values":n.value?t.unref(l).dynamicFilters:E.value,"is-edit-mode":n.value,"view-config":Rr(h.value.get(17)),onChange:Tr,onFiltersChanged:vr,onFilterUpdated:ur,onRemoveViews:gr},null,8,["default-filters","filters","initial-values","is-edit-mode","view-config"])):L.value&&P.value&&W()?(t.openBlock(),t.createElementBlock("div",{key:7,class:t.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":P.value.length>=2}])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(P.value,(er,or)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:or},[er.type==="select"?(t.openBlock(),t.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>De(or),["stop"])},[t.createElementVNode("div",sat,[Yt[10]||(Yt[10]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[11]||(Yt[11]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(E.value[or])&&E.value[or].length>0?(t.openBlock(),t.createElementBlock("span",lat,t.toDisplayString(E.value[or].length),1)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass([{open:ge.value===or},"arrow"])},[...Yt[9]||(Yt[9]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),ge.value===or?(t.openBlock(),t.createElementBlock("div",cat,[t.createElementVNode("div",uat,[t.createElementVNode("div",{class:"multi-select-header",onClick:Yt[1]||(Yt[1]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("label",dat,[t.createElementVNode("input",{checked:j(or),indeterminate:F(or),type:"checkbox",onChange:t.withModifiers(Or=>N(or),["stop"]),onClick:Yt[0]||(Yt[0]=t.withModifiers(()=>{},["stop"]))},null,40,pat),Yt[12]||(Yt[12]=t.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:V(or,Or.value)},"option-card multi-select-option"]),onClick:Yt[2]||(Yt[2]=t.withModifiers(()=>{},["stop"]))},[t.createElementVNode("div",hat,[t.createElementVNode("input",{checked:V(or,Or.value),type:"checkbox",onChange:t.withModifiers(Pr=>I(or,Or.value),["stop"])},null,40,fat)]),t.createElementVNode("div",{class:"option-content",onClick:Pr=>I(or,Or.value)},[t.createElementVNode("div",yat,t.toDisplayString(Or.label),1)],8,mat)],2))),128))]),t.createElementVNode("div",gat,[t.createElementVNode("button",{class:"btn-listo",onClick:Yt[3]||(Yt[3]=t.withModifiers(Or=>Qt(),["stop"]))},"Listo")])])):t.createCommentVNode("",!0)],8,oat)):er.type==="radio-button"?(t.openBlock(),t.createElementBlock("div",vat,[t.createElementVNode("div",bat,t.toDisplayString(er.label),1),t.createElementVNode("div",xat,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("label",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"radio-option-card"])},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Pr=>E.value[or]=Pr,disabled:X(Or.value,Or.label),name:"dynamic-radio-"+or,value:Or.value,type:"radio",onChange:()=>{var Pr,oa,Ia;if(((Pr=L.value.value)==null?void 0:Pr.id)===9&&n.value.value&&(Ia=(oa=t.unref(p))==null?void 0:oa.view)!=null&&Ia.filterMultiple){const qa=E.value[or]===1;t.unref(p).view.filterMultiple.isHomeTeam=qa}n.value.value&&Pt(),Ye()}},null,40,_at),[[t.vModelRadio,E.value[or]]]),t.createElementVNode("span",null,t.toDisplayString(Or.label),1)],2))),128))])])):er.type==="check"?(t.openBlock(),t.createElementBlock("div",wat,[t.createElementVNode("label",null,[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":Or=>E.value[or]=Or,checked:E.value[or],type:"checkbox",onChange:Yt[4]||(Yt[4]=()=>{n.value.value&&Pt(),Ye()})},null,40,Tat),[[t.vModelCheckbox,E.value[or]]]),t.createTextVNode(" "+t.toDisplayString(er.label),1)])])):er.type==="select-simple"?(t.openBlock(),t.createElementBlock("div",{key:3,"data-filter-type":er.type,class:"custom-select dynamic-select filter-inline",onClick:t.withModifiers(Or=>Qe(or),["stop"])},[t.createElementVNode("div",kat,[Yt[14]||(Yt[14]=t.createElementVNode("span",{class:"select-icon select-analisis-icon"},[t.createElementVNode("img",{alt:"icono categorías",src:"https://golstatsimages.blob.core.windows.net/report-maker/iconocategorias.png",style:{width:"18px",height:"18px","object-fit":"contain"}})],-1)),Yt[15]||(Yt[15]=t.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),t.createElementVNode("span",{class:t.normalizeClass([{open:be.value===or},"arrow"])},[...Yt[13]||(Yt[13]=[t.createElementVNode("svg",{fill:"none",height:"14",viewBox:"0 0 16 14",width:"16"},[t.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])],2)]),be.value===or?(t.openBlock(),t.createElementBlock("div",Lat,[t.createElementVNode("div",Cat,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(er.options,Or=>(t.openBlock(),t.createElementBlock("div",{key:Or.value,class:t.normalizeClass([{active:E.value[or]===Or.value},"option-card simple-select-option"]),onMouseenter:Pr=>lr(or,Or.value),onClick:t.withModifiers(Pr=>rt(or,Or.value),["stop"])},[t.createElementVNode("div",Nat,[t.createElementVNode("div",Eat,t.toDisplayString(Or.label),1)]),E.value[or]===Or.value?(t.openBlock(),t.createElementBlock("div",zat,[...Yt[16]||(Yt[16]=[t.createElementVNode("svg",{fill:"none",height:"16",viewBox:"0 0 16 16",width:"16"},[t.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"})],-1)])])):t.createCommentVNode("",!0)],42,Oat))),128))])])):t.createCommentVNode("",!0)],8,Sat)):t.createCommentVNode("",!0),or===1&&P.value.length>2?(t.openBlock(),t.createElementBlock("div",Mat)):t.createCommentVNode("",!0)],64))),128))],2)):t.createCommentVNode("",!0),n.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("button",{key:8,class:"cancel-btn",onClick:Gt},"Cancelar")),k.value?(t.openBlock(),t.createElementBlock("button",{key:9,class:"ok-btn",onClick:qt},"OK")):t.createCommentVNode("",!0)]))}}),Pat=t2(Vat,[["__scopeId","data-v-5035e341"]]),Aat={key:0,class:"modal-simple"},Rat={class:"modal-simple__content"},Uat={class:"modal-simple__content__header"},Fat={class:"modal-simple__content__body"},Iat={class:"modal-simple__content__footer"},qat={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,a)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[e.modelValue?(t.openBlock(),t.createElementBlock("div",Aat,[t.createElementVNode("div",Rat,[t.createElementVNode("div",Uat,[t.renderSlot(r.$slots,"header",{},void 0,!0)]),t.createElementVNode("div",Fat,[t.renderSlot(r.$slots,"body",{},void 0,!0)]),t.createElementVNode("div",Iat,[t.renderSlot(r.$slots,"footer",{},void 0,!0)])])])):t.createCommentVNode("",!0)]))}},jat=t2(qat,[["__scopeId","data-v-1cc4f590"]]),Wat={class:"footer"},Dat={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:r}){const a=r;function v(h){a("update:modelValue",h)}function $(h){a("action",h),a("update:modelValue",!1)}return(h,u)=>(t.openBlock(),t.createBlock(jat,{"modle-value":e.value,"onUpdate:modelValue":v},{header:t.withCtx(()=>[...u[2]||(u[2]=[t.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:t.withCtx(()=>[...u[3]||(u[3]=[t.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:t.withCtx(()=>[t.createElementVNode("div",Wat,[t.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:u[0]||(u[0]=i=>$(!1))}," Seguir editando "),t.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:u[1]||(u[1]=i=>$(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},Kat=t2(Dat,[["__scopeId","data-v-ed9b5088"]]),Bat={key:0,class:"modal-simple"},Xat={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(r,a)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,null,{default:t.withCtx(()=>[e.modelValue?(t.openBlock(),t.createElementBlock("div",Bat,[...a[0]||(a[0]=[t.createElementVNode("div",{class:"modal-simple__content"},[t.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M29.3346 14.7823V16.0089C29.333 18.8842 28.402 21.6818 26.6804 23.9847C24.9589 26.2876 22.539 27.9722 19.7818 28.7875C17.0245 29.6027 14.0776 29.5048 11.3806 28.5084C8.68354 27.512 6.38084 25.6704 4.81592 23.2584C3.25099 20.8463 2.50769 17.993 2.69687 15.124C2.88605 12.255 3.99758 9.52404 5.86568 7.33836C7.73377 5.15269 10.2583 3.62944 13.0629 2.9958C15.8674 2.36215 18.8017 2.65205 21.428 3.82227",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),t.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):t.createCommentVNode("",!0)]),_:1})]))}},Gat=t2(Xat,[["__scopeId","data-v-2bc30783"]]),Zat={class:"template-maker__header"},Jat={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hat={class:"template-maker__content"},Yat={class:"template-maker__content__main"},Qat={id:"containerMain",class:"container-main"},$at={class:"template-maker__content__main__cover-selector"},ent=["id"],tnt={class:"page-indicator"},rnt={class:"page-indicator__index"},ant=["onClick"],nnt=["onClick"],int={key:0,class:"template-maker__content__main__footer"},ont={class:"template-maker__content__main__footer__paginator"},snt={class:"template-maker__content__main__footer__paginator__nav"},lnt={class:"template-maker__content__main__footer__paginator__numbers"},cnt=["onClick"],unt={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:r,emit:a}){const v=new Map,$=t.ref([{title:"Page 1",id:String(Date.now()),items:[{name:"Volumetrica",id:`w-${String(Date.now())}`,x:0,y:0,w:4,h:6,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}},{name:"Volumetrica",id:String(Date.now()),x:4,y:0,w:4,h:4,maxWidth:4,maxHeight:4,noResize:!1,noMove:!1,componentProps:{}}]}]),h=t.ref(null),u=t.ref(0),i=t.ref(!1),p=t.ref(null),l=t.ref(null),n=t.ref(!0),k=t.ref(!1),T=t.ref(!1),x=t.ref(0),d=t.ref(!1),o=t.ref(null),c=t.ref(new Map),s=t.ref(null),f=t.ref(null),g=t.ref(!1),S=t.ref(!1),L=t.ref(!1),E=new Map,P=new Map,V=t.computed(()=>({"--overflow-y-template-maker":k.value?"scroll":"hidden","--height-container-main":k.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(k.value,"0")})),I=t.computed(()=>u.value+1);t.watch(()=>i.value,$t=>{const Rt=document.getElementById("app");$t?(u.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Rt&&(Rt.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Rt&&(Rt.style.overflow=""))});function j($t){return $t<10?`0${$t}`:$t}async function F({templateId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/templates/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(sr){console.error("Error fetching template by ID:",sr)}}async function W({reportId:$t,userId:Rt}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Rt}/reports/${$t}`,{method:"GET",headers:{Authorization:dt.token}})).json()).data}catch(sr){console.error("Error fetching report by ID:",sr)}}let U=0;function z($t){h.value=$t,U>0&&(g.value=!0),U++}function X($t){$t&&st(null,!0)}let N=null;function Y($t,Rt){let sr=$t.getBoundingClientRect(),Zt={height:$t.clientHeight,width:$t.clientWidth},Tt=Rt.getBoundingClientRect();if(!(Tt.top>=sr.top&&Tt.bottom<=sr.top+Zt.height)){const Pt=Tt.top-sr.top,Ut=Tt.bottom-sr.bottom;Math.abs(Pt)<Math.abs(Ut)?$t.scrollTop+=Pt:$t.scrollTop+=Ut}}function se($t,Rt){let sr=$t.getBoundingClientRect();const Zt=Rt.getBoundingClientRect().top-sr.top;$t.scrollTop+=Zt}function me($t,Rt=!1){const sr={title:`Page ${$.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(Gt(),$t!==void 0&&$t>=-1?$.value.splice($t+1,0,sr):$.value.push(sr),t.nextTick(()=>{const Zt=$.value.findIndex(Pt=>Pt.id===sr.id),Tt=document.getElementById(`page-${Zt+1}`);N||(N=document.getElementById("containerMain")),Tt&&N?Y(N,Tt):console.error("Page element or container main element not found")}),Rt)return sr;g.value=!0}function ge($t){if($t<0||$t>$.value.length)return;u.value=$t;const Rt=document.getElementById(`page-${$t}`);if(N||(N=document.getElementById("containerMain")),Rt&&N){const sr=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(sr),se(N,Rt),setTimeout(()=>{const Zt=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Zt)},300)}else console.error("Page element or container main element not found")}function be($t){s.value=$t,d.value=!0}function xe($t,Rt){const sr=Rt+1;$t&&u.value!==sr&&(u.value=sr)}function Ae($t){d.value=!0,Sd.emit("edit-view",{view:$t})}async function je({templateReportId:$t,userId:Rt,isTemplateMode:sr}){try{return sr?F({templateId:$t,userId:Rt}):W({reportId:$t,userId:Rt})}catch(Zt){throw new Error("Error fetching template or report by ID: "+Zt.message)}}function _e(){U=0,d.value=!1,u.value=0,s.value=null,f.value=null,c.value.clear(),N=null,p.value=null,l.value=null,h.value=null,x.value=0,$.value=[],T.value=!1,g.value=!1,S.value=!1,L.value=!1,E.forEach($t=>clearTimeout($t)),E.clear(),P.forEach($t=>clearTimeout($t)),P.clear(),Ue=[],v.clear()}let Ue=[];async function qe($t){if(_e(),n.value=$t.isTemplateMode,k.value=!!$t.isPDFMode,$t.isPDFMode?p.value=await W({reportId:$t.reportId,userId:$t.userId}):(p.value=$t.template,p.value=await je({templateReportId:$t.template.id,userId:$t.template.user_id,isTemplateMode:$t.isTemplateMode})),!p.value)return;p.value&&p.value.game&&(p.value.game=Ye(p.value.game)),l.value=JSON.parse(JSON.stringify(p.value)),T.value=p.value.template_type===2;const Rt=p.value.pages.find(sr=>sr.is_front_page);x.value=Rt?Rt.type:1,i.value=!0,$t.isTemplateMode||(Ue=await rt(p.value)),$.value=p.value.pages.reduce((sr,Zt,Tt)=>{if(!Zt.is_front_page){Zt.name||(Zt.name="");const Pt=Tt,Ut={originalPage:JSON.parse(JSON.stringify(Zt)),title:Zt.name,id:`p-${Date.now()-Tt*9}`,items:[],components:Zt.components};Zt.components&&Zt.components.length>0&&(Ut.items=Zt.components.reduce((vr,ur,gr)=>{const Tr=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ur.coreView.id,ur.dynamicFilters,T.value,n.value,ur.filtersJSON||null,dt.token,ur.filters),Rr={originalComponent:JSON.parse(JSON.stringify(ur)),title:ur.title,shortTitle:ur.shortTitle||ur.title,game:p.value.game,idAux:ur.id,id:`w-${Date.now()-gr*7}`,x:ur.column,y:ur.row,w:ur.colspan,h:ur.rowspan,maxWidth:ur.max_column,maxHeight:ur.max_row,minWidth:ur.min_column,minHeight:ur.min_row,noResize:!n.value,noMove:!n.value,coreView:ur.coreView||null,isTemplateMode:n.value,componentName:ur.componentName,componentProps:Qe({currentProps:ur.componentProps,coreView:ur.coreView,isTemplateMode:n.value,templateToEdit:p.value,filterMultiple:ur.filterMultiple||null,game:p.value.game||null,dynamicFilters:ur.dynamicFilters,page:Pt,componentId:gr})||{},filterMultiple:ur.filterMultiple,isHomeTeam:De({game:p.value.game,isTemplateMode:n.value,currentIsHomeTeam:ur.isHomeTeam||ur.componentProps.isHomeTeamForAnalysis}),filtersJSON:ur.filtersJSON||null,dynamicFilters:ur.dynamicFilters||[],filterAndViewsContainer:Tr};if(Rr.componentProps.isViewNull)return vr;const St=t.reactive({view:Rr});return Tr.addView(St,!0),c.value.set(Tr.getId(),Tr),vr.push(Rr),vr},[])),sr.push(Ut)}return sr},[]),console.log("Pages loaded into template maker:",$.value)}function Re({game:$t,isTemplateMode:Rt}){const sr=$t&&$t.homeTeam&&$t.awayTeam&&($t.homeTeam.team_id===dt.userTeamId||$t.awayTeam.team_id===dt.userTeamId);return{isUserTeamHome:sr&&$t.homeTeam.team_id===dt.userTeamId,requiresUserTeamAdjustment:sr&&!Rt}}function De({game:$t,isTemplateMode:Rt,currentIsHomeTeam:sr}){const{isUserTeamHome:Zt,requiresUserTeamAdjustment:Tt}=Re({game:$t,isTemplateMode:Rt});return Tt?sr?Zt:!Zt:sr}function Qe({currentProps:$t,coreView:Rt,templateToEdit:sr,isTemplateMode:Zt,filterMultiple:Tt,game:Pt,dynamicFilters:Ut,page:vr,componentId:ur}){var gr,Tr,Rr,St;if(!$t||!Rt)return $t||{};const{isUserTeamHome:Yt,requiresUserTeamAdjustment:er}=Re({game:Pt,isTemplateMode:Zt});let or={...$t};if(Rt.id===5&&(or.isGhostEffect=Zt,er)){const Or=or.preMatchType===1;or.preMatchType=Or?Yt?1:2:Yt?2:1}if(Rt.id===7&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===9&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===18){if(console.log("1818181818181818181818181818181818181818181818181818181818181818181818181818"),!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.teamIdForAnalysis=or.isHomeTeamForAnalysis?Pt.home_team:Pt.visiting_team;const Or=Ue.findIndex(oa=>((or.isAgainstMode?1:0)===oa.is_against||oa.is_against===or.isAgainstMode)&&or.teamIdForAnalysis===oa.team_id);console.log("templateToEdit",sr),console.log("propsAux",or),console.log("propsAux.isHomeTeamForAnalysis",or.isHomeTeamForAnalysis),console.log("specificPlaysCorners",[...Ue]),console.log("game",Pt),console.log("viewCornerIndex",Or);let Pr=null;Or!==-1&&(Pr={...Ue[Or]},Ue.splice(Or,1)),console.log("viewCorner",Pr),Pr?(or.specificPlaysCornersData=Pr,or.playIdForAnalysis=Pr.play_id,or.gameIdForAnalysis=Pr.game_id,or.seasonIdForAnalysis=Pr.season_id||Pt.season_id,or.isTemplateMode=Zt,or.isGameOnly=!0,or.isCornerInfoVisible=!0):(or.isNullCornerData=!0,or.isViewNull=!0,console.warn("No specific plays corner data available for this component"))}}if(Rt.id===16){if(!Zt&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(!Zt){or.isPreMatch=!T.value,or.isTemplateMode=Zt,or.seasonId=sr.season_id,or.teamIdForAnalysis=or.isHomeTeamForAnalysis?sr.game.home_team:sr.game.visiting_team;const Or=or.isHomeTeamForAnalysis?sr.last_games.last_home_games:sr.last_games.last_visiting_games;T.value?or.gamesIdsForAnalysis=[sr.game.game_id]:or.howManyGames?or.gamesIdsForAnalysis=Or.slice(0,or.howManyGames).map(Pr=>Pr.game_id):(or.gamesIdsForAnalysis=[],or.gameDataUTC=sr.game.date_time_utc)}}if(Rt.id===10&&er){const Or=or.isHomeTeamForAnalysis;or.isHomeTeamForAnalysis=Or?Yt:!Yt}if(Rt.id===1&&(or.gameId=Pt?Pt.id:"",or.homeLogo=Pt?Pt.homeTeam.logo:"",or.awayLogo=Pt?Pt.awayTeam.logo:"",or.seasonId=Pt?Pt.season_id:0,or.default=Zt),Rt.id===6&&(or.game=Pt||"",or.lastGames=sr.last_games,or.selectedOption=sr.template_type===2?"Postmatch":"Prematch"),Rt.id===13&&(or.isdefault=Zt,or.seasonid=Pt?Pt.seasonId:2010,or.datetimeutc=Pt?sr.template_type===1?Pt?Pt.date_time_utc:"":null:"",or.teamids=Pt?[Pt.home_team,Pt.visiting_team]:[1,2],or.categoryids=Ut?Ut[1]:[20,2],or.teamsshow=Pt?Ut?Ut[2]==1?[Pt.home_team]:Ut[2]==2?[Pt.visiting_team]:[Pt.home_team,Pt.visiting_team]:[1,2]:[1,2],or.analysistype=Ut?Ut[0]:[],or.gameid=sr.template_type===1?null:Pt?Pt.id:"",or.teams=Pt?[{id:Pt.home_team,name:Pt.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.home_team+".png"},{id:Pt.visiting_team,name:Pt.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Pt.visiting_team+".png"}]:[]),Rt.id===15&&(or.view=1,or.token=dt.token,or.numitems=Ut?Ut[1]:3,or.isdefault=Zt,or.reportid=sr!=null&&sr.id?sr.id:0,or.userid=sr!=null&&sr.user_id?sr.user_id:0,or.page=vr+1,or.typegame=T.value?2:1,or.componentid=ur+1,or.data={season:Pt?Pt.seasonId:2010,type:2,game:Pt?Pt.id:0,team:Zt?2:Tt?Tt.isHomeTeam?Pt.home_team||2:Pt.visiting_team||2:2}),Rt.id===17){console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("LLEGO AQUI MERO ESTE COMPOENNETE ES: ---->>>> ",Pt),console.log("dynamicFiltersS: ---->>>> ",Ut),console.log("filters: =================================================================================="),console.log("lateralidad: ",Ut?Ut[1]==32?"right":"left":"right"),console.log("infavoragainstteam: ",Ut?Ut[0]:!0),console.log("teamselected: ",Tt?Tt.isHomeTeam?(Pt==null?void 0:Pt.home_team)||2:(Pt==null?void 0:Pt.visiting_team)||2:2),console.log("tournamentselected: ",sr!=null&&sr.tournament_id?{id:sr.tournament_id}:{id:1}),or.game=Pt?{id:Pt.id||Pt.game_id||Pt.gameId||null,home_team:Pt.home_team||null,away_team:Pt.visiting_team||null,season:Pt.seasonId||Pt.season_id||null,game_status:Pt.game_status||Pt.status||null,home_acronym:Pt.home_team_acronym||((gr=Pt.homeTeam)==null?void 0:gr.acronym)||null,away_acronym:Pt.visiting_team_acronym||((Tr=Pt.awayTeam)==null?void 0:Tr.acronym)||null,logo_home:((Rr=Pt.homeTeam)==null?void 0:Rr.logo)||null,logo_away:((St=Pt.awayTeam)==null?void 0:St.logo)||null}:null,or.infavoragainstteam=Ut?!Ut[0]:!0,or.forseason=!T.value,or.forteam=!1,or.tournamentselected=sr!=null&&sr.tournament_id?{id:sr.tournament_id}:{id:1},or.forgame=!!T.value,or.lateralidad=Ut&&Ut[1]==32?"right":"left",or.teamselected=Ut[2]==3?Tt?Tt.isHomeTeam?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:0:Ut[2]==2?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team;const Or=Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][4]!==void 0?Array.isArray(Ut[3][4])?Ut[3][4].filter(Pr=>Pr!=="rematado-destino-porteria").reduce((Pr,oa)=>(oa==="fue-gol"?Pr.push(583,585,587,589):oa==="no-fue-gol"?Pr.push(584,586,588,590):oa==="rematado-sin-destino-porteria"?Pr.push(125,131,139,145):oa==="sin-destino"?Pr.push(122,128,136,142):oa==="ganados-por-portero-rival"?Pr.push(123,129,137,143):oa==="ganados-por-jugador-rival"&&Pr.push(124,130,138,144),Pr),[]):[]:[];or.filters={isMoment:!0,final:[1,2,3],moment:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][0]!==void 0?Array.isArray(Ut[3][0])?Ut[3][0].map(Pr=>Pr==="iba-ganando"?1:Pr==="iba-empatado"?3:Pr==="iba-perdiendo"?2:Pr):[]:[],playingAs:[1,2],sections:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][1]!==void 0?Array.isArray(Ut[3][1])?Ut[3][1].map(Pr=>Pr==="0-15"?1:Pr==="16-30"?2:Pr==="31-45"?3:Pr==="46-60"?4:Pr==="61-75"?5:Pr==="76-90"?6:Pr):[]:[],games:T.value?[Pt==null?void 0:Pt.game_id]:[],players:[],cornertype:Ut&&Ut[1]!==void 0?Ut[1]:null,howWas:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][2]!==void 0?Array.isArray(Ut[3][2])?Ut[3][2].filter(Pr=>Pr!=="izquierda"&&Pr!=="derecha").map(Pr=>{const oa=Ut[1];return Pr==="comba-afuera"?oa==32?134:120:Pr==="comba-adentro"?oa==32?140:126:Pr==="raz-area"?oa==32?146:327:Pr==="en-corto"?oa==32?147:133:Pr}):[]:[],zona:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][3]!==void 0?Array.isArray(Ut[3][3])?Ut[3][3]:[]:[],whathappened:Or,isWhatHappenedFull:Array.isArray(Or)&&Or.length===24,isZoneFull:Ut&&Ut[3]&&typeof Ut[3]=="object"&&!Array.isArray(Ut[3])&&Ut[3][3]!==void 0&&Array.isArray(Ut[3][3])?Ut[3][3].length===35:!1},console.log("propsAux.filters: ",or.filters),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),console.log("---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> ---->>>> "),or.showBallGo=!0,or.showHeatMap=!0,or.ballOnOff="OFF",or.showdefault=Zt}if(Rt.id===14&&(or.isReports=!0,or.isDefault=Zt,or.type=sr.tournament_type==1?1:0,or.typeView=1,or.tournament=sr.tournament_id,or.currentSeason=Pt?Pt.season_id:0,or.currentSeasonId=Pt?Pt.season_id:0,or.showVideos=!1,or.localTeam=Pt?Pt.home_team:0,or.awayTeam=Pt?Pt.visiting_team:0),Rt.id===3&&(or.defaultShields=Zt),Rt.id===2){let Or=!0,Pr=0,oa=0;Pt&&(Or=sr.main_team==Pt.home_team||sr.main_team==Pt.visiting_team,Pr=Or?sr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team,oa=Or?sr.main_team==(Pt==null?void 0:Pt.home_team)?Pt==null?void 0:Pt.visiting_team:Pt==null?void 0:Pt.home_team:Pt==null?void 0:Pt.visiting_team),or.gamed=Pt?Pt.id:"",or.game=Pt||"",or.season=Pt?Pt.season_id:0,or.teamView=Tt.teamType==3?0:Tt.teamType==1?Pr:oa,or.useDummyData=Zt}return Rt.id===8&&(or.teamSelected=Pt?{teamId:Pt.home_team}:1,or.isDefault=Zt),Rt.id===4&&(or.gameId=Pt?Pt.id:"",or.isDefault=Zt,or.homeTeam=Pt?Pt==null?void 0:Pt.home_team:"",or.awayTeam=Pt?Pt==null?void 0:Pt.visiting_team:""),or}async function rt($t){try{const Rt=await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${$t.user_id}/reports/${$t.id}/specific-plays-corners`,{method:"GET",headers:{Authorization:dt.token}})).json();return console.log("66666666666666666666666666666666666666"),Rt.data}catch(Rt){return console.error("Error fetching specific plays:",Rt),[]}}const dt=e,ct=a;t.watch(()=>dt.token,($t,Rt)=>{},{immediate:!0}),r({show:qe}),Sd.on("add-page-view",$t=>{v.set($t.view.id,$t.view);const Rt=$.value.find(sr=>sr.id===$t.pageId);Rt&&(Rt.items||(Rt.items=[]),Rt.items.push($t.view),t.nextTick(()=>{const sr=document.querySelector(`[gs-id="${$t.view.id}"]`);$t.grid.makeWidget(sr)}))}),Sd.on("add-page-and-view",$t=>{const Rt=$.value.findIndex(sr=>sr.id===$t.pageId);if(Rt>-1){const sr=me(Rt,!0);setTimeout(()=>{Sd.emit("add-view",{pageId:sr.id,view:$t.view,filterAndWidgetContainer:$t.filterAndWidgetContainer}),f.value&&(sr.stepBackPage=f.value),f.value=sr},500)}else console.error("Page not found for adding view:",$t.pageId)}),Sd.on("empty-page",$t=>{d.value&&s.value&&s.value.id===$t.id||(Jt($t),f.value&&f.value.id===$t.id&&(f.value.stepBackPage?f.value=f.value.stepBackPage:f.value=null))}),Sd.on("filters-cancelled",$t=>{$t&&$t.removeAllChildViews()}),Sd.on("activate-save-button",()=>{g.value=!0});function Ye($t){return{...$t,gameId:$t.game_id,id:$t.game_id,seasonId:$t.season_id,status:$t.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.home_team}.png`,team_id:$t.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.home_team}.png`,colloquial_name:$t.home_team_name,acronym:$t.home_team_acronym,team_name:$t.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${$t.visiting_team}.png`,team_id:$t.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${$t.visiting_team}.png`,colloquial_name:$t.visiting_team_name,acronym:$t.visiting_team_acronym,team_name:$t.visiting_team_name}}}function st($t,Rt=!1){Rt||!n.value?(i.value=!1,_e(),ct("close")):g.value?S.value=!0:(i.value=!1,_e(),ct("close"))}function lt(){o.value=null,d.value=!1}function Ot({page:$t,view:Rt,applyMinimumSize:sr=!1}){const Zt=$t.grid;if(!$t||!Rt||!Zt)return null;const Tt=sr?{w:Rt.min_column,h:Rt.min_row}:{w:Rt.colspan,h:Rt.rowspan},Pt=Zt.willItFit(0,0,Tt.w,Tt.h,!0);return Pt?{willFit:Pt,applyMinimumSize:sr}:sr?null:Ot({page:$t,view:Rt,applyMinimumSize:!0})}const Mt=new Set([9]);function Et($t){var Rt,sr,Zt,Tt,Pt,Ut,vr,ur,gr,Tr,Rr,St,Yt,er,or,Or,Pr,oa,Ia;if(console.log("onFiltersChanged called with filters:",$t),$t.dynamicFilters&&$t.dynamicFilters.length>0&&$t.viewToEdit&&$t.viewToEdit.view){const qa=$t.viewToEdit.view.id;$.value.forEach(bn=>{bn.items.forEach(fn=>{fn.id===qa&&fn.coreView&&fn.coreView.id===3&&(fn.componentProps.desplegable=$t.dynamicFilters[0]||!1,fn.componentProps.key=$t.dynamicFilters[0]||!1,t.nextTick(()=>{Sd.emit("force-component-update",{itemId:fn.id,componentProps:fn.componentProps})}))})})}if($t.viewToEdit){if(!$t.viewToEdit.view.filterAndViewsContainer){const qa=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[$t.viewToEdit],((Rt=$t.viewToEdit.view.coreView)==null?void 0:Rt.id)||$t.viewToEdit.view.id,$t.dynamicFilters||[],T.value,n.value,$t.filtersJSON,dt.token,$t.filters);$t.viewToEdit.view.filterAndViewsContainer=qa}$t.viewToEdit.view.filterAndViewsContainer.updateView({view:$t.viewToEdit,dynamicFilters:$t.dynamicFilters||[],filtersJSON:$t.filtersJSON||null,filters:$t.filters}),g.value=!0}else if($t.view){$t.view.id&&$t.filterAndViewsContainer&&$t.view.id!==$t.filterAndViewsContainer.viewId&&($t.filterAndViewsContainer.removeAllChildViews(),$t.filterAndViewsContainer.setViewId($t.view.id),$t.filterAndViewsContainer.setFiltersJSON($t.filtersJSON||null)),$t.view.id&&Mt.has($t.view.id)&&$t.dynamicFilters[0]&&$t.dynamicFilters[0].length===0&&$t.filterAndViewsContainer&&($t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(Zt=(sr=$t.viewToEdit)==null?void 0:sr.view)==null?void 0:Zt.id),g.value=!0);const qa=f.value||s.value,bn=Ot({page:qa,view:$t.view,applyMinimumSize:!1});$t.view.filtersJSON=$t.filtersJSON||null;const fn=$t.filterAndViewsContainer,In=$.value.findIndex(ea=>ea.id===qa.id);if(fn){console.log("1111");const ea=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);if(((Tt=$t.view)==null?void 0:Tt.id)===15){const Ur=(Pt=$t.filterAndViewsContainer)==null?void 0:Pt.getId();if(Ur&&E.has(Ur)){const fa=E.get(Ur);clearTimeout(fa),E.delete(Ur)}}if(((Ut=$t.view)==null?void 0:Ut.id)===17){const Ur=(vr=$t.filterAndViewsContainer)==null?void 0:vr.getId();if(Ur&&P.has(Ur)){const fa=P.get(Ur);clearTimeout(fa),P.delete(Ur)}}if(ea){if(fn.setFilters($t.filters),fn.setDynamicFilters($t.dynamicFilters),bn||In===$.value.length-1){Sd.emit("add-view",{pageId:qa.id,view:$t.view,filterAndWidgetContainer:fn,avoidWillFit:!1,applyMinimumSize:bn?bn.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(gr=(ur=$t.viewToEdit)==null?void 0:ur.view)==null?void 0:gr.id),g.value=!0;let Ur=null;if(((Tr=$t.view)==null?void 0:Tr.id)===15?(t.nextTick(()=>{var fa;const Ma=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters);((fa=$t.dynamicFilters)==null?void 0:fa[0])===3&&Ma&&Et($t)}),Ur=setTimeout(()=>{var fa,Ma;const Za=(fa=$t.filterAndViewsContainer)==null?void 0:fa.getId();Za&&E.delete(Za),console.log("222222222222222222");const Ea=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters);((Ma=$t.dynamicFilters)==null?void 0:Ma[0])===3&&Ea&&Et($t)},200)):((Rr=$t.view)==null?void 0:Rr.id)===17?(t.nextTick(()=>{var fa,Ma;const Za=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters),Ea=(fa=$t.dynamicFilters)==null?void 0:fa[0],Xr=(Ma=$t.dynamicFilters)==null?void 0:Ma[2];(Ea===3||Xr===3)&&Za&&Et($t)}),Ur=setTimeout(()=>{var fa,Ma,Za;const Ea=(fa=$t.filterAndViewsContainer)==null?void 0:fa.getId();Ea&&P.delete(Ea);const Xr=$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters),ca=(Ma=$t.dynamicFilters)==null?void 0:Ma[0],kr=(Za=$t.dynamicFilters)==null?void 0:Za[2];(ca===3||kr===3)&&Xr&&Et($t)},200)):(console.log("33333333333333"),Ur=setTimeout(()=>{$t.filterAndViewsContainer.getRequiresAddView($t.dynamicFilters,$t.filters)&&Et($t)},1e3)),((St=$t.view)==null?void 0:St.id)===15&&Ur){const fa=(Yt=$t.filterAndViewsContainer)==null?void 0:Yt.getId();fa&&E.set(fa,Ur)}if(((er=$t.view)==null?void 0:er.id)===17&&Ur){const fa=(or=$t.filterAndViewsContainer)==null?void 0:or.getId();fa&&P.set(fa,Ur)}}}else $t.isAltMode?$t.viewToEdit||$t.filterAndViewsContainer.updateFilters($t.filters,(Pr=(Or=$t.viewToEdit)==null?void 0:Or.view)==null?void 0:Pr.id):$t.filterAndViewsContainer.updateDynamicFilters($t.dynamicFilters,(Ia=(oa=$t.viewToEdit)==null?void 0:oa.view)==null?void 0:Ia.id),g.value=!0}else if(bn||In===$.value.length-1){const ea=new Qk(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],$t.view.id,$t.dynamicFilters,T.value,n.value,$t.filtersJSON,dt.token,$t.filters);Sd.emit("set-filter-and-views-container",ea),c.value.set(ea.getId(),ea);const Ur=$t.dynamicFilters&&($t.dynamicFilters[0]===3||$t.dynamicFilters[2]===3)&&($t.view.id===15||$t.view.id===17);$t.dynamicFilters&&(Array.isArray($t.dynamicFilters[0])||Ur)?($t.filterAndViewsContainer=ea,Et($t)):Sd.emit("add-view",{pageId:qa.id,view:$t.view,filterAndWidgetContainer:ea,avoidWillFit:!1,applyMinimumSize:bn?bn.applyMinimumSize:!1,dynamicFilters:$t.dynamicFilters,filters:$t.filters}),g.value=!0}}}async function qt(){if(g.value)try{const $t=[{is_front_page:!0,template_type:h.value.isPostMatch?2:1,type:h.value.id},...$.value.map(sr=>({columns:sr.originalPage?sr.originalPage.columns:12,rows:sr.originalPage?sr.originalPage.rows:12,gap:sr.originalPage?sr.originalPage.gap:10,name:sr.title,width:sr.originalPage?sr.originalPage.width:968,height:sr.originalPage?sr.originalPage.height:702,components:sr.items.reduce((Zt,Tt)=>(Tt.isDeleted||Zt.push({min_column:Tt.minWidth,min_row:Tt.minHeight,max_column:Tt.maxWidth,max_row:Tt.maxHeight,column:Tt.x,row:Tt.y,colspan:Tt.w,rowspan:Tt.h,name:Tt.name,title:Tt.title,titleShort:Tt.titleShort||Tt.title,dynamicFilters:Tt.filterAndViewsContainer.getComponentDynamicFilters(Tt.id)||Tt.filterAndViewsContainer.getDynamicFilters()||[],coreView:Tt.coreView||null,componentName:Tt.componentName,componentProps:Tt.componentProps||{},isHomeTeam:Tt.isHomeTeam||Tt.componentProps.isHomeTeamForAnalysis,filterMultiple:Tt.filterMultiple}),Zt),[])}))];console.log("pagesAux to save:",$t);const Rt=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${p.value.user_id}/templates/${p.value.id}/pages`,{method:"PATCH",headers:{Authorization:dt.token},body:JSON.stringify({pages:$t})});L.value=!0,await Rt.json(),g.value=!1,setTimeout(()=>{L.value=!1},2e3)}catch($t){console.error("Error saving template:",$t)}}function Gt(){$.value.forEach($t=>{$t.offListeners&&$t.offListeners()})}function Jt($t){const Rt=$.value.findIndex(sr=>sr.id===$t.id);Rt>-1&&(Gt(),$.value=$.value.filter(sr=>sr.id!==$t.id),u.value>=Rt&&(u.value=Math.max(0,u.value-1)),g.value=!0)}function Qt(){g.value=!0}function lr($t){const Rt=$.value.find(sr=>sr.items.some(Zt=>Zt.id===$t.id));if(Rt){const sr=Rt.items.find(Zt=>Zt.id===$t.id);sr&&(sr.isDeleted=!0,g.value=!0)}}function hr($t){}return($t,Rt)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Kat,{modelValue:S.value,"onUpdate:modelValue":Rt[0]||(Rt[0]=sr=>S.value=sr),onAction:X},null,8,["modelValue"]),t.createVNode(Gat,{"model-value":L.value},null,8,["model-value"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[i.value&&p.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"template-maker",style:t.normalizeStyle(V.value)},[t.withDirectives(t.createVNode(Pat,{token:e.token,view:o.value,"is-post-match":T.value,onClose:lt,onFiltersChanged:Et},null,8,["token","view","is-post-match"]),[[t.vShow,n.value&&d.value]]),t.createElementVNode("div",Zat,[t.createTextVNode(t.toDisplayString(p.value?p.value.name:"Nuevo template")+" ",1),t.createElementVNode("div",{class:"template-maker__header__close",onClick:st},[k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",Jat,[...Rt[6]||(Rt[6]=[t.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),t.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),t.createElementVNode("div",Hat,[Rt[13]||(Rt[13]=t.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),t.createElementVNode("div",Yat,[t.createElementVNode("div",Qat,[t.createElementVNode("div",$at,[t.withDirectives(t.createVNode(yQ,{"is-post-match":T.value,"initial-cover-id":x.value,onSelectCover:z},null,8,["is-post-match","initial-cover-id"]),[[t.vShow,n.value]])]),(t.openBlock(),t.createElementBlock("div",{class:"template-maker__content__main__pages",key:$.value.length},[h.value?(t.openBlock(),t.createBlock(wYe,{key:0,id:"page-0",game:p.value.game||null,"cover-id":h.value.id,"is-post-match":h.value.isPostMatch,onIntersectionChanged:Rt[1]||(Rt[1]=sr=>xe(sr,-1))},null,8,["game","cover-id","is-post-match"])):t.createCommentVNode("",!0),n.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":$.value.length===0?"30px":"0"})},[d.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Rt[2]||(Rt[2]=sr=>me(-1))},[...Rt[7]||(Rt[7]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(sr,Zt)=>(t.openBlock(),t.createElementBlock("div",{key:Zt,id:`page-${Zt+1}`,class:"template-maker__content__main__pages__page"},[t.createElementVNode("div",tnt,[t.createElementVNode("div",rnt,"Pag "+t.toDisplayString(j(Zt+2)),1)]),h.value?(t.openBlock(),t.createBlock(SHe,{key:0,page:sr,"is-template-mode":n.value,"is-post-match":h.value.isPostMatch,game:p.value.game||null,lastGames:p.value.lastGames||[],"is-filter-visible":d.value,onEditView:Ae,onIntersectionChanged:Tt=>xe(Tt,Zt),onChangeSort:hr,onDeletePage:Jt,onViewChanged:Qt,onDeleteView:lr},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):t.createCommentVNode("",!0),n.value&&!d.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"new-items-buttons",style:t.normalizeStyle({"margin-bottom":Zt+1===$.value.length?"30px":"0","margin-top":"10px"})},[t.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:Tt=>me(Zt)},[...Rt[8]||(Rt[8]=[t.createElementVNode("div",null,"+ Nueva página",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M8.66797 1.33203H4.0013C3.64768 1.33203 3.30854 1.47251 3.05849 1.72256C2.80844 1.9726 2.66797 2.31174 2.66797 2.66536V13.332C2.66797 13.6857 2.80844 14.0248 3.05849 14.2748C3.30854 14.5249 3.64768 14.6654 4.0013 14.6654H12.0013C12.3549 14.6654 12.6941 14.5249 12.9441 14.2748C13.1942 14.0248 13.3346 13.6857 13.3346 13.332V5.9987L8.66797 1.33203Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,ant),t.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:Tt=>be(sr)},[...Rt[9]||(Rt[9]=[t.createElementVNode("div",null,"+ Agregar gráfico",-1),t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,nnt)],4)):t.createCommentVNode("",!0)],8,ent))),128))]))]),k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",int,[t.createElementVNode("div",ont,[t.createElementVNode("div",snt,[t.createElementVNode("div",null,"Páginas "+t.toDisplayString(I.value),1),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value<=0}]),onClick:Rt[3]||(Rt[3]=sr=>u.value>0&&ge(u.value-1))},[...Rt[10]||(Rt[10]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.22444 5L5.29079 8.57741C5.56974 8.90285 5.56974 9.43049 5.29079 9.75592C5.01184 10.0814 4.55958 10.0814 4.28064 9.75592L0.709209 5.58926C0.430263 5.26382 0.430263 4.73618 0.709209 4.41074L4.28064 0.244078C4.55958 -0.0813593 5.01184 -0.0813592 5.29079 0.244078C5.56974 0.569515 5.56974 1.09715 5.29079 1.42259L2.22444 5Z",fill:"#92929D"})],-1)])],2),t.createElementVNode("div",{class:t.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:u.value>=$.value.length}]),onClick:Rt[4]||(Rt[4]=sr=>u.value<$.value.length&&ge(u.value+1))},[...Rt[11]||(Rt[11]=[t.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.77556 5L0.70921 8.57741C0.430264 8.90285 0.430264 9.43049 0.70921 9.75592C0.988156 10.0814 1.44042 10.0814 1.71936 9.75592L5.29079 5.58926C5.56974 5.26382 5.56974 4.73618 5.29079 4.41074L1.71936 0.244078C1.44042 -0.0813593 0.988155 -0.0813592 0.709209 0.244078C0.430264 0.569515 0.430264 1.09715 0.70921 1.42259L3.77556 5Z",fill:"#92929D"})],-1)])],2)]),t.createElementVNode("div",lnt,[t.createElementVNode("div",{role:"button",class:t.normalizeClass({active:u.value===0}),onClick:Rt[5]||(Rt[5]=sr=>ge(0))},t.toDisplayString(j(1)),3),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(sr,Zt)=>(t.openBlock(),t.createElementBlock("div",{role:"button",key:Zt,class:t.normalizeClass({active:Zt+1===u.value}),onClick:Tt=>ge(Zt+1)},t.toDisplayString(j(Zt+2)),11,cnt))),128))])]),n.value?(t.openBlock(),t.createElementBlock("div",{key:0,role:"button",class:t.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!g.value}]),onClick:qt},[...Rt[12]||(Rt[12]=[t.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{d:"M12.6667 14H3.33333C2.97971 14 2.64057 13.8595 2.39052 13.6095C2.14048 13.3594 2 13.0203 2 12.6667V3.33333C2 2.97971 2.14048 2.64057 2.39052 2.39052C2.64057 2.14048 2.97971 2 3.33333 2H10.6667L14 5.33333V12.6667C14 13.0203 13.8595 13.3594 13.6095 13.6095C13.3594 13.8595 13.0203 14 12.6667 14Z",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),t.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),t.createElementVNode("div",null,"Guardar",-1)])],2)):t.createCommentVNode("",!0)]))])])],4)):t.createCommentVNode("",!0)]))],64))}},dnt=t2(unt,[["__scopeId","data-v-332402ec"]]);function qZ(e,r){return function(){return e.apply(r,arguments)}}const{toString:pnt}=Object.prototype,{getPrototypeOf:dA}=Object,{iterator:LN,toStringTag:jZ}=Symbol,CN=(e=>r=>{const a=pnt.call(r);return e[a]||(e[a]=a.slice(8,-1).toLowerCase())})(Object.create(null)),Gw=e=>(e=e.toLowerCase(),r=>CN(r)===e),ON=e=>r=>typeof r===e,{isArray:e7}=Array,t7=ON("undefined");function d9(e){return e!==null&&!t7(e)&&e.constructor!==null&&!t7(e.constructor)&&Y_(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const WZ=Gw("ArrayBuffer");function hnt(e){let r;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?r=ArrayBuffer.isView(e):r=e&&e.buffer&&WZ(e.buffer),r}const fnt=ON("string"),Y_=ON("function"),DZ=ON("number"),p9=e=>e!==null&&typeof e=="object",mnt=e=>e===!0||e===!1,NN=e=>{if(CN(e)!=="object")return!1;const r=dA(e);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(jZ in e)&&!(LN in e)},ynt=e=>{if(!p9(e)||d9(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},gnt=Gw("Date"),vnt=Gw("File"),bnt=Gw("Blob"),xnt=Gw("FileList"),_nt=e=>p9(e)&&Y_(e.pipe),wnt=e=>{let r;return e&&(typeof FormData=="function"&&e instanceof FormData||Y_(e.append)&&((r=CN(e))==="formdata"||r==="object"&&Y_(e.toString)&&e.toString()==="[object FormData]"))},Tnt=Gw("URLSearchParams"),[Snt,knt,Lnt,Cnt]=["ReadableStream","Request","Response","Headers"].map(Gw),Ont=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function h9(e,r,{allOwnKeys:a=!1}={}){if(e===null||typeof e>"u")return;let v,$;if(typeof e!="object"&&(e=[e]),e7(e))for(v=0,$=e.length;v<$;v++)r.call(null,e[v],v,e);else{if(d9(e))return;const h=a?Object.getOwnPropertyNames(e):Object.keys(e),u=h.length;let i;for(v=0;v<u;v++)i=h[v],r.call(null,e[i],i,e)}}function KZ(e,r){if(d9(e))return null;r=r.toLowerCase();const a=Object.keys(e);let v=a.length,$;for(;v-- >0;)if($=a[v],r===$.toLowerCase())return $;return null}const OS=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,BZ=e=>!t7(e)&&e!==OS;function pA(){const{caseless:e,skipUndefined:r}=BZ(this)&&this||{},a={},v=($,h)=>{const u=e&&KZ(a,h)||h;NN(a[u])&&NN($)?a[u]=pA(a[u],$):NN($)?a[u]=pA({},$):e7($)?a[u]=$.slice():(!r||!t7($))&&(a[u]=$)};for(let $=0,h=arguments.length;$<h;$++)arguments[$]&&h9(arguments[$],v);return a}const Nnt=(e,r,a,{allOwnKeys:v}={})=>(h9(r,($,h)=>{a&&Y_($)?e[h]=qZ($,a):e[h]=$},{allOwnKeys:v}),e),Ent=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),znt=(e,r,a,v)=>{e.prototype=Object.create(r.prototype,v),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:r.prototype}),a&&Object.assign(e.prototype,a)},Mnt=(e,r,a,v)=>{let $,h,u;const i={};if(r=r||{},e==null)return r;do{for($=Object.getOwnPropertyNames(e),h=$.length;h-- >0;)u=$[h],(!v||v(u,e,r))&&!i[u]&&(r[u]=e[u],i[u]=!0);e=a!==!1&&dA(e)}while(e&&(!a||a(e,r))&&e!==Object.prototype);return r},Vnt=(e,r,a)=>{e=String(e),(a===void 0||a>e.length)&&(a=e.length),a-=r.length;const v=e.indexOf(r,a);return v!==-1&&v===a},Pnt=e=>{if(!e)return null;if(e7(e))return e;let r=e.length;if(!DZ(r))return null;const a=new Array(r);for(;r-- >0;)a[r]=e[r];return a},Ant=(e=>r=>e&&r instanceof e)(typeof Uint8Array<"u"&&dA(Uint8Array)),Rnt=(e,r)=>{const v=(e&&e[LN]).call(e);let $;for(;($=v.next())&&!$.done;){const h=$.value;r.call(e,h[0],h[1])}},Unt=(e,r)=>{let a;const v=[];for(;(a=e.exec(r))!==null;)v.push(a);return v},Fnt=Gw("HTMLFormElement"),Int=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(a,v,$){return v.toUpperCase()+$}),XZ=(({hasOwnProperty:e})=>(r,a)=>e.call(r,a))(Object.prototype),qnt=Gw("RegExp"),GZ=(e,r)=>{const a=Object.getOwnPropertyDescriptors(e),v={};h9(a,($,h)=>{let u;(u=r($,h,e))!==!1&&(v[h]=u||$)}),Object.defineProperties(e,v)},jnt=e=>{GZ(e,(r,a)=>{if(Y_(e)&&["arguments","caller","callee"].indexOf(a)!==-1)return!1;const v=e[a];if(Y_(v)){if(r.enumerable=!1,"writable"in r){r.writable=!1;return}r.set||(r.set=()=>{throw Error("Can not rewrite read-only method '"+a+"'")})}})},Wnt=(e,r)=>{const a={},v=$=>{$.forEach(h=>{a[h]=!0})};return e7(e)?v(e):v(String(e).split(r)),a},Dnt=()=>{},Knt=(e,r)=>e!=null&&Number.isFinite(e=+e)?e:r;function Bnt(e){return!!(e&&Y_(e.append)&&e[jZ]==="FormData"&&e[LN])}const Xnt=e=>{const r=new Array(10),a=(v,$)=>{if(p9(v)){if(r.indexOf(v)>=0)return;if(d9(v))return v;if(!("toJSON"in v)){r[$]=v;const h=e7(v)?[]:{};return h9(v,(u,i)=>{const p=a(u,$+1);!t7(p)&&(h[i]=p)}),r[$]=void 0,h}}return v};return a(e,0)},Gnt=Gw("AsyncFunction"),Znt=e=>e&&(p9(e)||Y_(e))&&Y_(e.then)&&Y_(e.catch),ZZ=((e,r)=>e?setImmediate:r?((a,v)=>(OS.addEventListener("message",({source:$,data:h})=>{$===OS&&h===a&&v.length&&v.shift()()},!1),$=>{v.push($),OS.postMessage(a,"*")}))(`axios@${Math.random()}`,[]):a=>setTimeout(a))(typeof setImmediate=="function",Y_(OS.postMessage)),Jnt=typeof queueMicrotask<"u"?queueMicrotask.bind(OS):typeof process<"u"&&process.nextTick||ZZ,au={isArray:e7,isArrayBuffer:WZ,isBuffer:d9,isFormData:wnt,isArrayBufferView:hnt,isString:fnt,isNumber:DZ,isBoolean:mnt,isObject:p9,isPlainObject:NN,isEmptyObject:ynt,isReadableStream:Snt,isRequest:knt,isResponse:Lnt,isHeaders:Cnt,isUndefined:t7,isDate:gnt,isFile:vnt,isBlob:bnt,isRegExp:qnt,isFunction:Y_,isStream:_nt,isURLSearchParams:Tnt,isTypedArray:Ant,isFileList:xnt,forEach:h9,merge:pA,extend:Nnt,trim:Ont,stripBOM:Ent,inherits:znt,toFlatObject:Mnt,kindOf:CN,kindOfTest:Gw,endsWith:Vnt,toArray:Pnt,forEachEntry:Rnt,matchAll:Unt,isHTMLForm:Fnt,hasOwnProperty:XZ,hasOwnProp:XZ,reduceDescriptors:GZ,freezeMethods:jnt,toObjectSet:Wnt,toCamelCase:Int,noop:Dnt,toFiniteNumber:Knt,findKey:KZ,global:OS,isContextDefined:BZ,isSpecCompliantForm:Bnt,toJSONObject:Xnt,isAsyncFn:Gnt,isThenable:Znt,setImmediate:ZZ,asap:Jnt,isIterable:e=>e!=null&&Y_(e[LN])};function Rm(e,r,a,v,$){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",r&&(this.code=r),a&&(this.config=a),v&&(this.request=v),$&&(this.response=$,this.status=$.status?$.status:null)}au.inherits(Rm,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:au.toJSONObject(this.config),code:this.code,status:this.status}}});const JZ=Rm.prototype,HZ={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{HZ[e]={value:e}}),Object.defineProperties(Rm,HZ),Object.defineProperty(JZ,"isAxiosError",{value:!0}),Rm.from=(e,r,a,v,$,h)=>{const u=Object.create(JZ);au.toFlatObject(e,u,function(n){return n!==Error.prototype},l=>l!=="isAxiosError");const i=e&&e.message?e.message:"Error",p=r==null&&e?e.code:r;return Rm.call(u,i,p,a,v,$),e&&u.cause==null&&Object.defineProperty(u,"cause",{value:e,configurable:!0}),u.name=e&&e.name||"Error",h&&Object.assign(u,h),u};const Hnt=null;function hA(e){return au.isPlainObject(e)||au.isArray(e)}function YZ(e){return au.endsWith(e,"[]")?e.slice(0,-2):e}function QZ(e,r,a){return e?e.concat(r).map(function($,h){return $=YZ($),!a&&h?"["+$+"]":$}).join(a?".":""):r}function Ynt(e){return au.isArray(e)&&!e.some(hA)}const Qnt=au.toFlatObject(au,{},null,function(r){return/^is[A-Z]/.test(r)});function EN(e,r,a){if(!au.isObject(e))throw new TypeError("target must be an object");r=r||new FormData,a=au.toFlatObject(a,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,c){return!au.isUndefined(c[o])});const v=a.metaTokens,$=a.visitor||n,h=a.dots,u=a.indexes,p=(a.Blob||typeof Blob<"u"&&Blob)&&au.isSpecCompliantForm(r);if(!au.isFunction($))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if(au.isDate(d))return d.toISOString();if(au.isBoolean(d))return d.toString();if(!p&&au.isBlob(d))throw new Rm("Blob is not supported. Use a Buffer instead.");return au.isArrayBuffer(d)||au.isTypedArray(d)?p&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function n(d,o,c){let s=d;if(d&&!c&&typeof d=="object"){if(au.endsWith(o,"{}"))o=v?o:o.slice(0,-2),d=JSON.stringify(d);else if(au.isArray(d)&&Ynt(d)||(au.isFileList(d)||au.endsWith(o,"[]"))&&(s=au.toArray(d)))return o=YZ(o),s.forEach(function(g,S){!(au.isUndefined(g)||g===null)&&r.append(u===!0?QZ([o],S,h):u===null?o:o+"[]",l(g))}),!1}return hA(d)?!0:(r.append(QZ(c,o,h),l(d)),!1)}const k=[],T=Object.assign(Qnt,{defaultVisitor:n,convertValue:l,isVisitable:hA});function x(d,o){if(!au.isUndefined(d)){if(k.indexOf(d)!==-1)throw Error("Circular reference detected in "+o.join("."));k.push(d),au.forEach(d,function(s,f){(!(au.isUndefined(s)||s===null)&&$.call(r,s,au.isString(f)?f.trim():f,o,T))===!0&&x(s,o?o.concat(f):[f])}),k.pop()}}if(!au.isObject(e))throw new TypeError("data must be an object");return x(e),r}function $Z(e){const r={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(v){return r[v]})}function fA(e,r){this._pairs=[],e&&EN(e,this,r)}const eJ=fA.prototype;eJ.append=function(r,a){this._pairs.push([r,a])},eJ.toString=function(r){const a=r?function(v){return r.call(this,v,$Z)}:$Z;return this._pairs.map(function($){return a($[0])+"="+a($[1])},"").join("&")};function $nt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function tJ(e,r,a){if(!r)return e;const v=a&&a.encode||$nt;au.isFunction(a)&&(a={serialize:a});const $=a&&a.serialize;let h;if($?h=$(r,a):h=au.isURLSearchParams(r)?r.toString():new fA(r,a).toString(v),h){const u=e.indexOf("#");u!==-1&&(e=e.slice(0,u)),e+=(e.indexOf("?")===-1?"?":"&")+h}return e}class rJ{constructor(){this.handlers=[]}use(r,a,v){return this.handlers.push({fulfilled:r,rejected:a,synchronous:v?v.synchronous:!1,runWhen:v?v.runWhen:null}),this.handlers.length-1}eject(r){this.handlers[r]&&(this.handlers[r]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(r){au.forEach(this.handlers,function(v){v!==null&&r(v)})}}const aJ={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eit={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:fA,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},mA=typeof window<"u"&&typeof document<"u",yA=typeof navigator=="object"&&navigator||void 0,tit=mA&&(!yA||["ReactNative","NativeScript","NS"].indexOf(yA.product)<0),rit=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ait=mA&&window.location.href||"http://localhost",Dx={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mA,hasStandardBrowserEnv:tit,hasStandardBrowserWebWorkerEnv:rit,navigator:yA,origin:ait},Symbol.toStringTag,{value:"Module"})),...eit};function nit(e,r){return EN(e,new Dx.classes.URLSearchParams,{visitor:function(a,v,$,h){return Dx.isNode&&au.isBuffer(a)?(this.append(v,a.toString("base64")),!1):h.defaultVisitor.apply(this,arguments)},...r})}function iit(e){return au.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function oit(e){const r={},a=Object.keys(e);let v;const $=a.length;let h;for(v=0;v<$;v++)h=a[v],r[h]=e[h];return r}function nJ(e){function r(a,v,$,h){let u=a[h++];if(u==="__proto__")return!0;const i=Number.isFinite(+u),p=h>=a.length;return u=!u&&au.isArray($)?$.length:u,p?(au.hasOwnProp($,u)?$[u]=[$[u],v]:$[u]=v,!i):((!$[u]||!au.isObject($[u]))&&($[u]=[]),r(a,v,$[u],h)&&au.isArray($[u])&&($[u]=oit($[u])),!i)}if(au.isFormData(e)&&au.isFunction(e.entries)){const a={};return au.forEachEntry(e,(v,$)=>{r(iit(v),$,a,0)}),a}return null}function sit(e,r,a){if(au.isString(e))try{return(r||JSON.parse)(e),au.trim(e)}catch(v){if(v.name!=="SyntaxError")throw v}return(a||JSON.stringify)(e)}const f9={transitional:aJ,adapter:["xhr","http","fetch"],transformRequest:[function(r,a){const v=a.getContentType()||"",$=v.indexOf("application/json")>-1,h=au.isObject(r);if(h&&au.isHTMLForm(r)&&(r=new FormData(r)),au.isFormData(r))return $?JSON.stringify(nJ(r)):r;if(au.isArrayBuffer(r)||au.isBuffer(r)||au.isStream(r)||au.isFile(r)||au.isBlob(r)||au.isReadableStream(r))return r;if(au.isArrayBufferView(r))return r.buffer;if(au.isURLSearchParams(r))return a.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),r.toString();let i;if(h){if(v.indexOf("application/x-www-form-urlencoded")>-1)return nit(r,this.formSerializer).toString();if((i=au.isFileList(r))||v.indexOf("multipart/form-data")>-1){const p=this.env&&this.env.FormData;return EN(i?{"files[]":r}:r,p&&new p,this.formSerializer)}}return h||$?(a.setContentType("application/json",!1),sit(r)):r}],transformResponse:[function(r){const a=this.transitional||f9.transitional,v=a&&a.forcedJSONParsing,$=this.responseType==="json";if(au.isResponse(r)||au.isReadableStream(r))return r;if(r&&au.isString(r)&&(v&&!this.responseType||$)){const u=!(a&&a.silentJSONParsing)&&$;try{return JSON.parse(r,this.parseReviver)}catch(i){if(u)throw i.name==="SyntaxError"?Rm.from(i,Rm.ERR_BAD_RESPONSE,this,null,this.response):i}}return r}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dx.classes.FormData,Blob:Dx.classes.Blob},validateStatus:function(r){return r>=200&&r<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};au.forEach(["delete","get","head","post","put","patch"],e=>{f9.headers[e]={}});const lit=au.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),cit=e=>{const r={};let a,v,$;return e&&e.split(`
|
|
7994
7994
|
`).forEach(function(u){$=u.indexOf(":"),a=u.substring(0,$).trim().toLowerCase(),v=u.substring($+1).trim(),!(!a||r[a]&&lit[a])&&(a==="set-cookie"?r[a]?r[a].push(v):r[a]=[v]:r[a]=r[a]?r[a]+", "+v:v)}),r},iJ=Symbol("internals");function m9(e){return e&&String(e).trim().toLowerCase()}function zN(e){return e===!1||e==null?e:au.isArray(e)?e.map(zN):String(e)}function uit(e){const r=Object.create(null),a=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let v;for(;v=a.exec(e);)r[v[1]]=v[2];return r}const dit=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function gA(e,r,a,v,$){if(au.isFunction(v))return v.call(this,r,a);if($&&(r=a),!!au.isString(r)){if(au.isString(v))return r.indexOf(v)!==-1;if(au.isRegExp(v))return v.test(r)}}function pit(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(r,a,v)=>a.toUpperCase()+v)}function hit(e,r){const a=au.toCamelCase(" "+r);["get","set","has"].forEach(v=>{Object.defineProperty(e,v+a,{value:function($,h,u){return this[v].call(this,r,$,h,u)},configurable:!0})})}let Q_=class{constructor(r){r&&this.set(r)}set(r,a,v){const $=this;function h(i,p,l){const n=m9(p);if(!n)throw new Error("header name must be a non-empty string");const k=au.findKey($,n);(!k||$[k]===void 0||l===!0||l===void 0&&$[k]!==!1)&&($[k||p]=zN(i))}const u=(i,p)=>au.forEach(i,(l,n)=>h(l,n,p));if(au.isPlainObject(r)||r instanceof this.constructor)u(r,a);else if(au.isString(r)&&(r=r.trim())&&!dit(r))u(cit(r),a);else if(au.isObject(r)&&au.isIterable(r)){let i={},p,l;for(const n of r){if(!au.isArray(n))throw TypeError("Object iterator must return a key-value pair");i[l=n[0]]=(p=i[l])?au.isArray(p)?[...p,n[1]]:[p,n[1]]:n[1]}u(i,a)}else r!=null&&h(a,r,v);return this}get(r,a){if(r=m9(r),r){const v=au.findKey(this,r);if(v){const $=this[v];if(!a)return $;if(a===!0)return uit($);if(au.isFunction(a))return a.call(this,$,v);if(au.isRegExp(a))return a.exec($);throw new TypeError("parser must be boolean|regexp|function")}}}has(r,a){if(r=m9(r),r){const v=au.findKey(this,r);return!!(v&&this[v]!==void 0&&(!a||gA(this,this[v],v,a)))}return!1}delete(r,a){const v=this;let $=!1;function h(u){if(u=m9(u),u){const i=au.findKey(v,u);i&&(!a||gA(v,v[i],i,a))&&(delete v[i],$=!0)}}return au.isArray(r)?r.forEach(h):h(r),$}clear(r){const a=Object.keys(this);let v=a.length,$=!1;for(;v--;){const h=a[v];(!r||gA(this,this[h],h,r,!0))&&(delete this[h],$=!0)}return $}normalize(r){const a=this,v={};return au.forEach(this,($,h)=>{const u=au.findKey(v,h);if(u){a[u]=zN($),delete a[h];return}const i=r?pit(h):String(h).trim();i!==h&&delete a[h],a[i]=zN($),v[i]=!0}),this}concat(...r){return this.constructor.concat(this,...r)}toJSON(r){const a=Object.create(null);return au.forEach(this,(v,$)=>{v!=null&&v!==!1&&(a[$]=r&&au.isArray(v)?v.join(", "):v)}),a}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([r,a])=>r+": "+a).join(`
|
|
7995
7995
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(r){return r instanceof this?r:new this(r)}static concat(r,...a){const v=new this(r);return a.forEach($=>v.set($)),v}static accessor(r){const v=(this[iJ]=this[iJ]={accessors:{}}).accessors,$=this.prototype;function h(u){const i=m9(u);v[i]||(hit($,u),v[i]=!0)}return au.isArray(r)?r.forEach(h):h(r),this}};Q_.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),au.reduceDescriptors(Q_.prototype,({value:e},r)=>{let a=r[0].toUpperCase()+r.slice(1);return{get:()=>e,set(v){this[a]=v}}}),au.freezeMethods(Q_);function vA(e,r){const a=this||f9,v=r||a,$=Q_.from(v.headers);let h=v.data;return au.forEach(e,function(i){h=i.call(a,h,$.normalize(),r?r.status:void 0)}),$.normalize(),h}function oJ(e){return!!(e&&e.__CANCEL__)}function r7(e,r,a){Rm.call(this,e??"canceled",Rm.ERR_CANCELED,r,a),this.name="CanceledError"}au.inherits(r7,Rm,{__CANCEL__:!0});function sJ(e,r,a){const v=a.config.validateStatus;!a.status||!v||v(a.status)?e(a):r(new Rm("Request failed with status code "+a.status,[Rm.ERR_BAD_REQUEST,Rm.ERR_BAD_RESPONSE][Math.floor(a.status/100)-4],a.config,a.request,a))}function fit(e){const r=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return r&&r[1]||""}function mit(e,r){e=e||10;const a=new Array(e),v=new Array(e);let $=0,h=0,u;return r=r!==void 0?r:1e3,function(p){const l=Date.now(),n=v[h];u||(u=l),a[$]=p,v[$]=l;let k=h,T=0;for(;k!==$;)T+=a[k++],k=k%e;if($=($+1)%e,$===h&&(h=(h+1)%e),l-u<r)return;const x=n&&l-n;return x?Math.round(T*1e3/x):void 0}}function yit(e,r){let a=0,v=1e3/r,$,h;const u=(l,n=Date.now())=>{a=n,$=null,h&&(clearTimeout(h),h=null),e(...l)};return[(...l)=>{const n=Date.now(),k=n-a;k>=v?u(l,n):($=l,h||(h=setTimeout(()=>{h=null,u($)},v-k)))},()=>$&&u($)]}const MN=(e,r,a=3)=>{let v=0;const $=mit(50,250);return yit(h=>{const u=h.loaded,i=h.lengthComputable?h.total:void 0,p=u-v,l=$(p),n=u<=i;v=u;const k={loaded:u,total:i,progress:i?u/i:void 0,bytes:p,rate:l||void 0,estimated:l&&i&&n?(i-u)/l:void 0,event:h,lengthComputable:i!=null,[r?"download":"upload"]:!0};e(k)},a)},lJ=(e,r)=>{const a=e!=null;return[v=>r[0]({lengthComputable:a,total:e,loaded:v}),r[1]]},cJ=e=>(...r)=>au.asap(()=>e(...r)),git=Dx.hasStandardBrowserEnv?((e,r)=>a=>(a=new URL(a,Dx.origin),e.protocol===a.protocol&&e.host===a.host&&(r||e.port===a.port)))(new URL(Dx.origin),Dx.navigator&&/(msie|trident)/i.test(Dx.navigator.userAgent)):()=>!0,vit=Dx.hasStandardBrowserEnv?{write(e,r,a,v,$,h,u){if(typeof document>"u")return;const i=[`${e}=${encodeURIComponent(r)}`];au.isNumber(a)&&i.push(`expires=${new Date(a).toUTCString()}`),au.isString(v)&&i.push(`path=${v}`),au.isString($)&&i.push(`domain=${$}`),h===!0&&i.push("secure"),au.isString(u)&&i.push(`SameSite=${u}`),document.cookie=i.join("; ")},read(e){if(typeof document>"u")return null;const r=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return r?decodeURIComponent(r[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function bit(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function xit(e,r){return r?e.replace(/\/?\/$/,"")+"/"+r.replace(/^\/+/,""):e}function uJ(e,r,a){let v=!bit(r);return e&&(v||a==!1)?xit(e,r):r}const dJ=e=>e instanceof Q_?{...e}:e;function NS(e,r){r=r||{};const a={};function v(l,n,k,T){return au.isPlainObject(l)&&au.isPlainObject(n)?au.merge.call({caseless:T},l,n):au.isPlainObject(n)?au.merge({},n):au.isArray(n)?n.slice():n}function $(l,n,k,T){if(au.isUndefined(n)){if(!au.isUndefined(l))return v(void 0,l,k,T)}else return v(l,n,k,T)}function h(l,n){if(!au.isUndefined(n))return v(void 0,n)}function u(l,n){if(au.isUndefined(n)){if(!au.isUndefined(l))return v(void 0,l)}else return v(void 0,n)}function i(l,n,k){if(k in r)return v(l,n);if(k in e)return v(void 0,l)}const p={url:h,method:h,data:h,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,withXSRFToken:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:i,headers:(l,n,k)=>$(dJ(l),dJ(n),k,!0)};return au.forEach(Object.keys({...e,...r}),function(n){const k=p[n]||$,T=k(e[n],r[n],n);au.isUndefined(T)&&k!==i||(a[n]=T)}),a}const pJ=e=>{const r=NS({},e);let{data:a,withXSRFToken:v,xsrfHeaderName:$,xsrfCookieName:h,headers:u,auth:i}=r;if(r.headers=u=Q_.from(u),r.url=tJ(uJ(r.baseURL,r.url,r.allowAbsoluteUrls),e.params,e.paramsSerializer),i&&u.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),au.isFormData(a)){if(Dx.hasStandardBrowserEnv||Dx.hasStandardBrowserWebWorkerEnv)u.setContentType(void 0);else if(au.isFunction(a.getHeaders)){const p=a.getHeaders(),l=["content-type","content-length"];Object.entries(p).forEach(([n,k])=>{l.includes(n.toLowerCase())&&u.set(n,k)})}}if(Dx.hasStandardBrowserEnv&&(v&&au.isFunction(v)&&(v=v(r)),v||v!==!1&&git(r.url))){const p=$&&h&&vit.read(h);p&&u.set($,p)}return r},_it=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(a,v){const $=pJ(e);let h=$.data;const u=Q_.from($.headers).normalize();let{responseType:i,onUploadProgress:p,onDownloadProgress:l}=$,n,k,T,x,d;function o(){x&&x(),d&&d(),$.cancelToken&&$.cancelToken.unsubscribe(n),$.signal&&$.signal.removeEventListener("abort",n)}let c=new XMLHttpRequest;c.open($.method.toUpperCase(),$.url,!0),c.timeout=$.timeout;function s(){if(!c)return;const g=Q_.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),L={data:!i||i==="text"||i==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:g,config:e,request:c};sJ(function(P){a(P),o()},function(P){v(P),o()},L),c=null}"onloadend"in c?c.onloadend=s:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(s)},c.onabort=function(){c&&(v(new Rm("Request aborted",Rm.ECONNABORTED,e,c)),c=null)},c.onerror=function(S){const L=S&&S.message?S.message:"Network Error",E=new Rm(L,Rm.ERR_NETWORK,e,c);E.event=S||null,v(E),c=null},c.ontimeout=function(){let S=$.timeout?"timeout of "+$.timeout+"ms exceeded":"timeout exceeded";const L=$.transitional||aJ;$.timeoutErrorMessage&&(S=$.timeoutErrorMessage),v(new Rm(S,L.clarifyTimeoutError?Rm.ETIMEDOUT:Rm.ECONNABORTED,e,c)),c=null},h===void 0&&u.setContentType(null),"setRequestHeader"in c&&au.forEach(u.toJSON(),function(S,L){c.setRequestHeader(L,S)}),au.isUndefined($.withCredentials)||(c.withCredentials=!!$.withCredentials),i&&i!=="json"&&(c.responseType=$.responseType),l&&([T,d]=MN(l,!0),c.addEventListener("progress",T)),p&&c.upload&&([k,x]=MN(p),c.upload.addEventListener("progress",k),c.upload.addEventListener("loadend",x)),($.cancelToken||$.signal)&&(n=g=>{c&&(v(!g||g.type?new r7(null,e,c):g),c.abort(),c=null)},$.cancelToken&&$.cancelToken.subscribe(n),$.signal&&($.signal.aborted?n():$.signal.addEventListener("abort",n)));const f=fit($.url);if(f&&Dx.protocols.indexOf(f)===-1){v(new Rm("Unsupported protocol "+f+":",Rm.ERR_BAD_REQUEST,e));return}c.send(h||null)})},wit=(e,r)=>{const{length:a}=e=e?e.filter(Boolean):[];if(r||a){let v=new AbortController,$;const h=function(l){if(!$){$=!0,i();const n=l instanceof Error?l:this.reason;v.abort(n instanceof Rm?n:new r7(n instanceof Error?n.message:n))}};let u=r&&setTimeout(()=>{u=null,h(new Rm(`timeout ${r} of ms exceeded`,Rm.ETIMEDOUT))},r);const i=()=>{e&&(u&&clearTimeout(u),u=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(h):l.removeEventListener("abort",h)}),e=null)};e.forEach(l=>l.addEventListener("abort",h));const{signal:p}=v;return p.unsubscribe=()=>au.asap(i),p}},Tit=function*(e,r){let a=e.byteLength;if(a<r){yield e;return}let v=0,$;for(;v<a;)$=v+r,yield e.slice(v,$),v=$},Sit=async function*(e,r){for await(const a of kit(e))yield*Tit(a,r)},kit=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const r=e.getReader();try{for(;;){const{done:a,value:v}=await r.read();if(a)break;yield v}}finally{await r.cancel()}},hJ=(e,r,a,v)=>{const $=Sit(e,r);let h=0,u,i=p=>{u||(u=!0,v&&v(p))};return new ReadableStream({async pull(p){try{const{done:l,value:n}=await $.next();if(l){i(),p.close();return}let k=n.byteLength;if(a){let T=h+=k;a(T)}p.enqueue(new Uint8Array(n))}catch(l){throw i(l),l}},cancel(p){return i(p),$.return()}},{highWaterMark:2})},fJ=64*1024,{isFunction:VN}=au,Lit=(({Request:e,Response:r})=>({Request:e,Response:r}))(au.global),{ReadableStream:mJ,TextEncoder:yJ}=au.global,gJ=(e,...r)=>{try{return!!e(...r)}catch{return!1}},Cit=e=>{e=au.merge.call({skipUndefined:!0},Lit,e);const{fetch:r,Request:a,Response:v}=e,$=r?VN(r):typeof fetch=="function",h=VN(a),u=VN(v);if(!$)return!1;const i=$&&VN(mJ),p=$&&(typeof yJ=="function"?(d=>o=>d.encode(o))(new yJ):async d=>new Uint8Array(await new a(d).arrayBuffer())),l=h&&i&&gJ(()=>{let d=!1;const o=new a(Dx.origin,{body:new mJ,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!o}),n=u&&i&&gJ(()=>au.isReadableStream(new v("").body)),k={stream:n&&(d=>d.body)};$&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!k[d]&&(k[d]=(o,c)=>{let s=o&&o[d];if(s)return s.call(o);throw new Rm(`Response type '${d}' is not supported`,Rm.ERR_NOT_SUPPORT,c)})});const T=async d=>{if(d==null)return 0;if(au.isBlob(d))return d.size;if(au.isSpecCompliantForm(d))return(await new a(Dx.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(au.isArrayBufferView(d)||au.isArrayBuffer(d))return d.byteLength;if(au.isURLSearchParams(d)&&(d=d+""),au.isString(d))return(await p(d)).byteLength},x=async(d,o)=>{const c=au.toFiniteNumber(d.getContentLength());return c??T(o)};return async d=>{let{url:o,method:c,data:s,signal:f,cancelToken:g,timeout:S,onDownloadProgress:L,onUploadProgress:E,responseType:P,headers:V,withCredentials:I="same-origin",fetchOptions:j}=pJ(d),F=r||fetch;P=P?(P+"").toLowerCase():"text";let W=wit([f,g&&g.toAbortSignal()],S),U=null;const z=W&&W.unsubscribe&&(()=>{W.unsubscribe()});let X;try{if(E&&l&&c!=="get"&&c!=="head"&&(X=await x(V,s))!==0){let be=new a(o,{method:"POST",body:s,duplex:"half"}),xe;if(au.isFormData(s)&&(xe=be.headers.get("content-type"))&&V.setContentType(xe),be.body){const[Ae,je]=lJ(X,MN(cJ(E)));s=hJ(be.body,fJ,Ae,je)}}au.isString(I)||(I=I?"include":"omit");const N=h&&"credentials"in a.prototype,Y={...j,signal:W,method:c.toUpperCase(),headers:V.normalize().toJSON(),body:s,duplex:"half",credentials:N?I:void 0};U=h&&new a(o,Y);let se=await(h?F(U,j):F(o,Y));const me=n&&(P==="stream"||P==="response");if(n&&(L||me&&z)){const be={};["status","statusText","headers"].forEach(_e=>{be[_e]=se[_e]});const xe=au.toFiniteNumber(se.headers.get("content-length")),[Ae,je]=L&&lJ(xe,MN(cJ(L),!0))||[];se=new v(hJ(se.body,fJ,Ae,()=>{je&&je(),z&&z()}),be)}P=P||"text";let ge=await k[au.findKey(k,P)||"text"](se,d);return!me&&z&&z(),await new Promise((be,xe)=>{sJ(be,xe,{data:ge,headers:Q_.from(se.headers),status:se.status,statusText:se.statusText,config:d,request:U})})}catch(N){throw z&&z(),N&&N.name==="TypeError"&&/Load failed|fetch/i.test(N.message)?Object.assign(new Rm("Network Error",Rm.ERR_NETWORK,d,U),{cause:N.cause||N}):Rm.from(N,N&&N.code,d,U)}}},Oit=new Map,vJ=e=>{let r=e&&e.env||{};const{fetch:a,Request:v,Response:$}=r,h=[v,$,a];let u=h.length,i=u,p,l,n=Oit;for(;i--;)p=h[i],l=n.get(p),l===void 0&&n.set(p,l=i?new Map:Cit(r)),n=l;return l};vJ();const bA={http:Hnt,xhr:_it,fetch:{get:vJ}};au.forEach(bA,(e,r)=>{if(e){try{Object.defineProperty(e,"name",{value:r})}catch{}Object.defineProperty(e,"adapterName",{value:r})}});const bJ=e=>`- ${e}`,Nit=e=>au.isFunction(e)||e===null||e===!1;function Eit(e,r){e=au.isArray(e)?e:[e];const{length:a}=e;let v,$;const h={};for(let u=0;u<a;u++){v=e[u];let i;if($=v,!Nit(v)&&($=bA[(i=String(v)).toLowerCase()],$===void 0))throw new Rm(`Unknown adapter '${i}'`);if($&&(au.isFunction($)||($=$.get(r))))break;h[i||"#"+u]=$}if(!$){const u=Object.entries(h).map(([p,l])=>`adapter ${p} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=a?u.length>1?`since :
|
|
7996
7996
|
`+u.map(bJ).join(`
|