@golstats/gsc-reports 1.0.88 → 1.0.90
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-BeAFQ8UF-BnRqs17U.js → FilterConditions-55d68355-DMqzcKBO-nUG6gA_w-BSmm9fuY.js} +1 -1
- package/dist/{FilterField-59a73e38-CNaE03Ge-B3PXAy_4-BK49X7PL.js → FilterField-59a73e38-CNaE03Ge-vpLw29tV-LMvW-0da.js} +1 -1
- package/dist/{FilterSubcategories-a9b32cc9-_h5FCZ4r-ox6dfRrG-CwDt3X4Q.js → FilterSubcategories-a9b32cc9-_h5FCZ4r-BQF_A3Lx-H4d-YxDX.js} +1 -1
- package/dist/gsc-reports.css +1 -1
- package/dist/gsc-reports.es.js +1 -1
- package/dist/gsc-reports.umd.js +1 -1
- package/dist/{index-CMWrQvfZ.js → index-DpAynz35.js} +7 -7
- package/package.json +2 -2
package/dist/gsc-reports.umd.js
CHANGED
|
@@ -4123,7 +4123,7 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
4123
4123
|
* see root license https://github.com/gridstack/gridstack.js/tree/master/LICENSE
|
|
4124
4124
|
*/const ad=new I5e;class vi{static init(a={},i=".grid-stack"){if(typeof document>"u")return null;const k=vi.getGridElement(i);return k?(k.gridstack||(k.gridstack=new vi(k,Qn.cloneDeep(a))),k.gridstack):(console.error(typeof i=="string"?'GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
|
|
4125
4125
|
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(a={},i=".grid-stack"){const k=[];return typeof document>"u"||(vi.getGridElements(i).forEach(F=>{F.gridstack||(F.gridstack=new vi(F,Qn.cloneDeep(a))),k.push(F.gridstack)}),k.length===0&&console.error('GridStack.initAll() no grid was found with selector "'+i+`" - element missing or wrong selector ?
|
|
4126
|
-
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),k}static addGrid(a,i={}){if(!a)return null;let k=a;if(k.gridstack){const F=k.gridstack;return i&&(F.opts={...F.opts,...i}),i.children!==void 0&&F.load(i.children),F}return(!a.classList.contains("grid-stack")||vi.addRemoveCB)&&(vi.addRemoveCB?k=vi.addRemoveCB(a,i,!0,!0):k=Qn.createDiv(["grid-stack",i.class],a)),vi.init(i,k)}static registerEngine(a){vi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=Qn.createDiv([this.opts.placeholderClass,Id.itemClass,this.opts.itemClass]);const a=Qn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,i={}){var k;this.el=a,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=i=i||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const F=Qn.toNumber(a.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const g=i.columnOpts;if(g){const t=g.breakpoints;!g.columnWidth&&!(t!=null&&t.length)?delete i.columnOpts:(g.columnMax=g.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((_,v)=>(v.w||0)-(_.w||0)))}const m={...Qn.cloneDeep(Id),column:Qn.toNumber(a.getAttribute("gs-column"))||Id.column,minRow:F||Qn.toNumber(a.getAttribute("gs-min-row"))||Id.minRow,maxRow:F||Qn.toNumber(a.getAttribute("gs-max-row"))||Id.maxRow,staticGrid:Qn.toBool(a.getAttribute("gs-static"))||Id.staticGrid,sizeToContent:Qn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||Id.draggable.handle},removableOptions:{accept:i.itemClass||Id.removableOptions.accept,decline:Id.removableOptions.decline}};a.getAttribute("gs-animate")&&(m.animate=Qn.toBool(a.getAttribute("gs-animate"))),i=Qn.defaults(i,m),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=a.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const n=this.el.closest("."+Id.itemClass),f=n==null?void 0:n.gridstackNode;if(f&&(f.subGrid=this,this.parentGridNode=f,this.el.classList.add("grid-stack-nested"),f.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==Id.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const t=i.cellHeight;delete i.cellHeight,this.cellHeight(t)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=Kp),this._setStaticClass();const l=i.engineClass||vi.engineClass||Mh;if(this.engine=new l({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:t=>{t.forEach(_=>{const v=_.el;v&&(_._removeDOM?(v&&v.remove(),delete _._removeDOM):this._writePosAttr(v,_))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const t=i.children;delete i.children,t.length&&this.load(t)}this.setAnimation(),i.subGridDynamic&&!Ri.pauseDrag&&(Ri.pauseDrag=!0),((k=i.draggable)==null?void 0:k.pause)!==void 0&&(Ri.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(a=this.opts){this.el.classList.add("gs-"+a.column),typeof a.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/a.column}%`)}addWidget(a){if(!a)return;if(typeof a=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(a.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(a);let i,k=a;if(k.grid=this,k.el?i=k.el:vi.addRemoveCB?i=vi.addRemoveCB(this.el,a,!0,!1):i=this.createWidgetDivs(k),!i)return;if(k=i.gridstackNode,k&&i.parentElement===this.el&&this.engine.nodes.find(g=>g._id===k._id))return i;const F=this._readAttr(i);return Qn.defaults(a,F),this.engine.prepareNode(a),this.el.appendChild(i),this.makeWidget(i,a),i}createWidgetDivs(a){const i=Qn.createDiv(["grid-stack-item",this.opts.itemClass]),k=Qn.createDiv(["grid-stack-item-content"],i);return Qn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([F])=>{var g,m;F.isIntersecting&&((g=a.visibleObservable)==null||g.disconnect(),delete a.visibleObservable,vi.renderCB(k,a),(m=a.grid)==null||m.prepareDragDrop(a.el))}),window.setTimeout(()=>{var F;return(F=a.visibleObservable)==null?void 0:F.observe(i)})):vi.renderCB(k,a),i}makeSubGrid(a,i,k,F=!0){var g,m,n;let f=a.gridstackNode;if(f||(f=this.makeWidget(a).gridstackNode),(g=f.subGrid)!=null&&g.el)return f.subGrid;let l,t=this;for(;t&&!l;)l=(m=t.opts)==null?void 0:m.subGridOpts,t=(n=t.parentGridNode)==null?void 0:n.grid;i=Qn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...i||f.subGridOpts||{}}),f.subGridOpts=i;let _;i.column==="auto"&&(_=!0,i.column=Math.max(f.w||1,(k==null?void 0:k.w)||1),delete i.columnOpts);let v=f.el.querySelector(".grid-stack-item-content"),b,d;if(F&&(this._removeDD(f.el),d={...f,x:0,y:0},Qn.removeInternalForSave(d),delete d.subGridOpts,f.content&&(d.content=f.content,delete f.content),vi.addRemoveCB?b=vi.addRemoveCB(this.el,d,!0,!1):(b=Qn.createDiv(["grid-stack-item"]),b.appendChild(v),v=Qn.createDiv(["grid-stack-item-content"],f.el)),this.prepareDragDrop(f.el)),k){const s=_?i.column:f.w,h=f.h+k.h,c=f.el.style;c.transition="none",this.update(f.el,{w:s,h}),setTimeout(()=>c.transition=null)}const o=f.subGrid=vi.addGrid(v,i);return k!=null&&k._moving&&(o._isTemp=!0),_&&(o._autoColumn=!0),F&&o.makeWidget(b,d),k&&(k._moving?window.setTimeout(()=>Qn.simulateMouseEvent(k._event,"mouseenter",o.el),0):o.makeWidget(f.el,f)),this.resizeToContentCheck(!1,f),o}removeAsSubGrid(a){var i;const k=(i=this.parentGridNode)==null?void 0:i.grid;k&&(k.batchUpdate(),k.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(F=>{F.x+=this.parentGridNode.x,F.y+=this.parentGridNode.y,k.makeWidget(F.el,F)}),k.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>Qn.simulateMouseEvent(a._event,"mouseenter",k.el),0))}save(a=!0,i=!1,k=vi.saveCB,F){const g=this.engine.save(a,k,F);if(g.forEach(m=>{var n;if(a&&m.el&&!m.subGrid&&!k){const f=m.el.querySelector(".grid-stack-item-content");m.content=f==null?void 0:f.innerHTML,m.content||delete m.content}else if(!a&&!k&&delete m.content,(n=m.subGrid)!=null&&n.el){const f=m.w||m.subGrid.getColumn(),l=m.subGrid.save(a,i,k,f);m.subGridOpts=i?l:{children:l},delete m.subGrid}delete m.el}),i){const m=Qn.cloneDeep(this.opts);m.marginBottom===m.marginTop&&m.marginRight===m.marginLeft&&m.marginTop===m.marginRight&&(m.margin=m.marginTop,delete m.marginTop,delete m.marginRight,delete m.marginBottom,delete m.marginLeft),m.rtl===(this.el.style.direction==="rtl")&&(m.rtl="auto"),this._isAutoCellHeight&&(m.cellHeight="auto"),this._autoColumn&&(m.column="auto");const n=m._alwaysShowResizeHandle;return delete m._alwaysShowResizeHandle,n!==void 0?m.alwaysShowResizeHandle=n:delete m.alwaysShowResizeHandle,Qn.removeInternalAndSame(m,Id),m.children=g,m}return g}load(a,i=vi.addRemoveCB||!0){a=Qn.cloneDeep(a);const k=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=Qn.sort(a),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let F=0;a.forEach(t=>{F=Math.max(F,(t.x||0)+t.w)}),F>this.engine.defaultColumn&&(this.engine.defaultColumn=F),F>k&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(F,k,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,F,!0));const g=vi.addRemoveCB;typeof i=="function"&&(vi.addRemoveCB=i);const m=[];this.batchUpdate();const n=!this.engine.nodes.length,f=n&&this.opts.animate;f&&this.setAnimation(!1),!n&&i&&[...this.engine.nodes].forEach(t=>{t.id&&(Qn.find(a,t.id)||(vi.addRemoveCB&&vi.addRemoveCB(this.el,t,!1,!1),m.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(t=>Qn.find(a,t.id)?(l.push(t),!1):!0),a.forEach(t=>{var _;const v=Qn.find(l,t.id);if(v){if(Qn.shouldSizeToContent(v)&&(t.h=v.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||v.w,t.h=t.h||v.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(v),Qn.samePos(v,t)&&this.engine.nodes.length>1&&(this.moveNode(v,{...t,forceCollide:!0}),Qn.copyPos(t,v)),this.update(v.el,t),(_=t.subGridOpts)!=null&&_.children){const b=v.el.querySelector(".grid-stack");b&&b.gridstack&&b.gridstack.load(t.subGridOpts.children)}}else i&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=m,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,g?vi.addRemoveCB=g:delete vi.addRemoveCB,f&&this.setAnimation(!0,!0),this}batchUpdate(a=!0){return this.engine.batchUpdate(a),a||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(a=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!a||!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 i=this.el.querySelector("."+this.opts.itemClass);if(i){const F=Qn.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/F)}const k=parseInt(this.el.getAttribute("gs-current-row"));return k?Math.round(this.el.getBoundingClientRect().height/k):this.opts.cellHeight}cellHeight(a){if(a!==void 0&&this._isAutoCellHeight!==(a==="auto")&&(this._isAutoCellHeight=a==="auto",this._updateResizeEvent()),(a==="initial"||a==="auto")&&(a=void 0),a===void 0){const k=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+k}const i=Qn.parseHeight(a);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.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(a=!1){var i;return a&&(i=this.opts.columnOpts)!=null&&i.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,i;const k=this.opts.columnOpts;if(!k||!k.columnWidth&&!((a=k.breakpoints)!=null&&a.length))return!1;const F=this.getColumn();let g=F;const m=this._widthOrContainer(!0);if(k.columnWidth)g=Math.min(Math.round(m/k.columnWidth)||1,k.columnMax);else{g=k.columnMax;let n=0;for(;n<k.breakpoints.length&&m<=k.breakpoints[n].w;)g=k.breakpoints[n++].c||F}if(g!==F){const n=(i=k.breakpoints)==null?void 0:i.find(f=>f.c===g);return this.column(g,(n==null?void 0:n.layout)||k.layout),!0}return!1}compact(a="compact",i=!0){return this.engine.compact(a,i),this._triggerChangeEvent(),this}column(a,i="moveScale"){if(!a||a<1||this.opts.column===a)return this;const k=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+k),this._updateColumnVar(),this.engine.columnChanged(k,a,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(a=>a.matches("."+this.opts.itemClass)&&!a.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(a=!0){var i;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),a?this.el.parentNode.removeChild(this.el):(this.removeAll(a),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(i=this._placeholder)==null||delete i.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(a){return this.opts.float!==a&&(this.opts.float=this.engine.float=a,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(a,i=!1){const k=this.el.getBoundingClientRect();let F;i?F={top:k.top+document.documentElement.scrollTop,left:k.left}:F={top:this.el.offsetTop,left:this.el.offsetLeft};const g=a.left-F.left,m=a.top-F.top,n=k.width/this.getColumn(),f=k.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(g/n),y:Math.floor(m/f)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,i,k,F){return this.engine.isAreaEmpty(a,i,k,F)}makeWidget(a,i){const k=vi.getElement(a);if(!k||k.gridstackNode)return k;k.parentElement||this.el.appendChild(k),this._prepareElement(k,!0,i);const F=k.gridstackNode;this._updateContainerHeight(),F.subGridOpts&&this.makeSubGrid(k,F.subGridOpts,void 0,!1);let g;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(g=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),g&&delete this._ignoreLayoutsNodeChange,k}on(a,i){return a.indexOf(" ")!==-1?(a.split(" ").forEach(k=>this.on(k,i)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=k=>i(k):this._gsEventHandler[a]=k=>{k.detail&&i(k,k.detail)},this.el.addEventListener(a,this._gsEventHandler[a])):a==="drag"||a==="dragstart"||a==="dragstop"||a==="resizestart"||a==="resize"||a==="resizestop"||a==="dropped"||a==="resizecontent"?this._gsEventHandler[a]=i:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(i=>this.off(i)),this):((a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable")&&this._gsEventHandler[a]&&this.el.removeEventListener(a,this._gsEventHandler[a]),delete this._gsEventHandler[a],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(a=>this.off(a)),this}removeWidget(a,i=!0,k=!0){return a?(vi.getElements(a).forEach(F=>{if(F.parentElement&&F.parentElement!==this.el)return;let g=F.gridstackNode;g||(g=this.engine.nodes.find(m=>F===m.el)),g&&(i&&vi.addRemoveCB&&vi.addRemoveCB(this.el,g,!1,!1),delete F.gridstackNode,this._removeDD(F),this.engine.removeNode(g,i,k),i&&F.parentElement&&F.remove())}),k&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,i=!0){return this.engine.nodes.forEach(k=>{a&&vi.addRemoveCB&&vi.addRemoveCB(this.el,k,!1,!1),delete k.el.gridstackNode,this.opts.staticGrid||this._removeDD(k.el)}),this.engine.removeAll(a,i),i&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(a)}):a?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=a,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(a,i=!0,k=!0){return!!this.opts.staticGrid===a?this:(a?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(F=>{this.prepareDragDrop(F.el),F.subGrid&&k&&F.subGrid.setStatic(a,i,k)}),i&&this._setStaticClass(),this)}updateOptions(a){var i;const k=this.opts;return a===k?this:(a.acceptWidgets!==void 0&&(k.acceptWidgets=a.acceptWidgets,this._setupAcceptWidget()),a.animate!==void 0&&this.setAnimation(a.animate),a.cellHeight&&this.cellHeight(a.cellHeight),a.class!==void 0&&a.class!==k.class&&(k.class&&this.el.classList.remove(k.class),a.class&&this.el.classList.add(a.class)),a.columnOpts?(this.opts.columnOpts=a.columnOpts,this.checkDynamicColumn()):a.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof a.column=="number"&&this.column(a.column),a.margin!==void 0&&this.margin(a.margin),a.staticGrid!==void 0&&this.setStatic(a.staticGrid),a.disableDrag!==void 0&&!a.staticGrid&&this.enableMove(!a.disableDrag),a.disableResize!==void 0&&!a.staticGrid&&this.enableResize(!a.disableResize),a.float!==void 0&&this.float(a.float),a.row!==void 0?(k.minRow=k.maxRow=k.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(k.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(k.maxRow=a.maxRow)),(i=a.children)!=null&&i.length&&this.load(a.children),this)}update(a,i){return vi.getElements(a).forEach(k=>{var F;const g=k==null?void 0:k.gridstackNode;if(!g)return;const m={...Qn.copyPos({},g),...Qn.cloneDeep(i)};this.engine.nodeBoundFix(m),delete m.autoPosition;const n=["x","y","w","h"];let f;if(n.some(_=>m[_]!==void 0&&m[_]!==g[_])&&(f={},n.forEach(_=>{f[_]=m[_]!==void 0?m[_]:g[_],delete m[_]})),!f&&(m.minW||m.minH||m.maxW||m.maxH)&&(f={}),m.content!==void 0){const _=k.querySelector(".grid-stack-item-content");_&&_.textContent!==m.content&&(g.content=m.content,vi.renderCB(_,m),(F=g.subGrid)!=null&&F.el&&(_.appendChild(g.subGrid.el),g.subGrid._updateContainerHeight())),delete m.content}let l=!1,t=!1;for(const _ in m)_[0]!=="_"&&g[_]!==m[_]&&(g[_]=m[_],l=!0,t=t||!this.opts.staticGrid&&(_==="noResize"||_==="noMove"||_==="locked"));if(Qn.sanitizeMinMax(g),f){const _=f.w!==void 0&&f.w!==g.w;this.moveNode(g,f),_&&g.subGrid?g.subGrid.onResize(this.hasAnimationCSS()?g.w:void 0):this.resizeToContentCheck(_,g),delete g._orig}(f||l)&&this._writeAttr(k,g),t&&this.prepareDragDrop(g.el),vi.updateCB&&vi.updateCB(g)}),this}moveNode(a,i){const k=a._updating;k||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,i),this._updateContainerHeight(),k||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var i,k;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const F=a.gridstackNode;if(!F)return;const g=F.grid;if(!g||a.parentElement!==g.el)return;const m=g.getCellHeight(!0);if(!m)return;let n=F.h?F.h*m:a.clientHeight,f;if(F.resizeToContentParent&&(f=a.querySelector(F.resizeToContentParent)),f||(f=a.querySelector(vi.resizeToContentParent)),!f)return;const l=a.clientHeight-f.clientHeight,t=F.h?F.h*m-l:f.clientHeight;let _;if(F.subGrid){_=F.subGrid.getRow()*F.subGrid.getCellHeight(!0);const d=F.subGrid.el.getBoundingClientRect(),o=a.getBoundingClientRect();_+=d.top-o.top}else{if((k=(i=F.subGridOpts)==null?void 0:i.children)!=null&&k.length)return;{const d=f.firstElementChild;if(!d){console.error(`Error: GridStack.resizeToContent() widget id:${F.id} '${vi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}_=d.getBoundingClientRect().height||t}}if(t===_)return;n+=_-t;let v=Math.ceil(n/m);const b=Number.isInteger(F.sizeToContent)?F.sizeToContent:0;b&&v>b&&(v=b,a.classList.add("size-to-content-max")),F.minH&&v<F.minH?v=F.minH:F.maxH&&v>F.maxH&&(v=F.maxH),v!==F.h&&(g._ignoreLayoutsNodeChange=!0,g.moveNode(F,{h:v}),delete g._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){vi.resizeToContentCB?vi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,i){return vi.getElements(a).forEach(k=>{const F=k.gridstackNode;if(!Qn.canBeRotated(F))return;const g={w:F.h,h:F.w,minH:F.minW,minW:F.minH,maxH:F.maxW,maxW:F.maxH};if(i){const n=i.left>0?Math.floor(i.left/this.cellWidth()):0,f=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;g.x=F.x+n-(F.h-(f+1)),g.y=F.y+f-n}Object.keys(g).forEach(n=>{g[n]===void 0&&delete g[n]});const m=F._orig;this.update(k,g),F._orig=m}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const i=Qn.parseHeight(a);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=a,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(a){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 i=arguments;let k=0,F={x:i[k++],y:i[k++],w:i[k++],h:i[k++],autoPosition:i[k++]};return this.willItFit(F)}return this.engine.willItFit(a)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const a=this.engine.getDirtyNodes(!0);return a&&a.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(a),this._triggerEvent("change",a)),this.engine.saveInitial(),this}_triggerAddEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.addedNodes)!=null&&a.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(k=>{delete k._dirty});const i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(a,i){const k=i?new CustomEvent(a,{bubbles:!1,detail:i}):new Event(a);let F=this;for(;F.parentGridNode;)F=F.parentGridNode.grid;return F.el.dispatchEvent(k),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const k=this.opts.cellHeight,F=this.opts.cellHeightUnit;if(!k)return this;if(!a&&!this.opts.minRow){const g=Qn.parseHeight(getComputedStyle(this.el).minHeight);if(g.h>0&&g.unit===F){const m=Math.floor(g.h/k);i<m&&(i=m)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[a?"minHeight":"height"]=i*k+F),a&&Qn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,i=!1,k){k=k||this._readAttr(a),a.gridstackNode=k,k.el=a,k.grid=this,k=this.engine.addNode(k,i),this._writeAttr(a,k),a.classList.add(Id.itemClass,this.opts.itemClass);const F=Qn.shouldSizeToContent(k);return F?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),F&&this.resizeToContentCheck(!1,k),Qn.lazyLoad(k)||this.prepareDragDrop(k.el),this}_writePosAttr(a,i){return(!i._moving&&!i._resizing||this._placeholder===a)&&(a.style.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,a.style.left=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,a.style.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,a.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null),i.x>0?a.setAttribute("gs-x",String(i.x)):a.removeAttribute("gs-x"),i.y>0?a.setAttribute("gs-y",String(i.y)):a.removeAttribute("gs-y"),i.w>1?a.setAttribute("gs-w",String(i.w)):a.removeAttribute("gs-w"),i.h>1?a.setAttribute("gs-h",String(i.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,i){if(!i)return this;this._writePosAttr(a,i);const k={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const F in k)i[F]?a.setAttribute(k[F],String(i[F])):a.removeAttribute(k[F]);return this}_readAttr(a,i=!0){const k={};k.x=Qn.toNumber(a.getAttribute("gs-x")),k.y=Qn.toNumber(a.getAttribute("gs-y")),k.w=Qn.toNumber(a.getAttribute("gs-w")),k.h=Qn.toNumber(a.getAttribute("gs-h")),k.autoPosition=Qn.toBool(a.getAttribute("gs-auto-position")),k.noResize=Qn.toBool(a.getAttribute("gs-no-resize")),k.noMove=Qn.toBool(a.getAttribute("gs-no-move")),k.locked=Qn.toBool(a.getAttribute("gs-locked"));const F=a.getAttribute("gs-size-to-content");F&&(F==="true"||F==="false"?k.sizeToContent=Qn.toBool(F):k.sizeToContent=parseInt(F,10)),k.id=a.getAttribute("gs-id"),k.maxW=Qn.toNumber(a.getAttribute("gs-max-w")),k.minW=Qn.toNumber(a.getAttribute("gs-min-w")),k.maxH=Qn.toNumber(a.getAttribute("gs-max-h")),k.minH=Qn.toNumber(a.getAttribute("gs-min-h")),i&&(k.w===1&&a.removeAttribute("gs-w"),k.h===1&&a.removeAttribute("gs-h"),k.maxW&&a.removeAttribute("gs-max-w"),k.minW&&a.removeAttribute("gs-min-w"),k.maxH&&a.removeAttribute("gs-max-h"),k.minH&&a.removeAttribute("gs-min-h"));for(const g in k){if(!k.hasOwnProperty(g))return;!k[g]&&k[g]!==0&&g!=="sizeToContent"&&delete k[g]}return k}_setStaticClass(){const a=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...a),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...a),this.el.removeAttribute("gs-static")),this}onResize(a=(i=>(i=this.el)==null?void 0:i.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(k=>{k.subGrid&&k.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,i=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)Qn.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(k=>Qn.shouldSizeToContent(k))){const k=[...this.engine.nodes];this.batchUpdate(),k.forEach(F=>{Qn.shouldSizeToContent(F)&&this.resizeToContentCBCheck(F.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(a=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(k=>k.sizeToContent));return!a&&i&&!this.resizeObserver?(this._sizeThrottle=Qn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return Qn.getElement(a)}static getElements(a=".grid-stack-item"){return Qn.getElements(a)}static getGridElement(a){return vi.getElement(a)}static getGridElements(a){return Qn.getElements(a)}_initMargin(){let a,i=0,k=[];typeof this.opts.margin=="string"&&(k=this.opts.margin.split(" ")),k.length===2?(this.opts.marginTop=this.opts.marginBottom=k[0],this.opts.marginLeft=this.opts.marginRight=k[1]):k.length===4?(this.opts.marginTop=k[0],this.opts.marginRight=k[1],this.opts.marginBottom=k[2],this.opts.marginLeft=k[3]):(a=Qn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,i=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=i:(a=Qn.parseHeight(this.opts[g]),this.opts[g]=a.h,delete this.opts.margin)}),this.opts.marginUnit=a.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 F=this.el.style;return F.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),F.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),F.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),F.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return ad}static setupDragIn(a,i,k,F=document){(i==null?void 0:i.pause)!==void 0&&(Ri.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof a=="string"?Qn.getElements(a,F):a).forEach((g,m)=>{ad.isDraggable(g)||ad.dragIn(g,i),k!=null&&k[m]&&(g.gridstackNode=k[m])})}movable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const F=k.gridstackNode;F&&(i?delete F.noMove:F.noMove=!0,this.prepareDragDrop(F.el))}),this)}resizable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const F=k.gridstackNode;F&&(i?delete F.noResize:F.noResize=!0,this.prepareDragDrop(F.el))}),this)}disable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!1,a),this.enableResize(!1,a),this._triggerEvent("disable"),this}enable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!0,a),this.enableResize(!0,a),this._triggerEvent("enable"),this}enableMove(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableMove(a,i)}),this)}enableResize(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableResize(a,i)}),this)}cancelDrag(){var a;const i=(a=this._placeholder)==null?void 0:a.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&vi._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(a){return ad.draggable(a,"destroy").resizable(a,"destroy"),a.gridstackNode&&delete a.gridstackNode._initDD,delete a.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return ad.droppable(this.el,"destroy"),this;let a,i;const k=(F,g,m)=>{var n;m=m||g;const f=m.gridstackNode;if(!f)return;if(!((n=f.grid)!=null&&n.el)){m.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const b=m.getBoundingClientRect();m.style.left=b.x+(this.dragTransform.xScale-1)*(F.clientX-b.x)/this.dragTransform.xScale+"px",m.style.top=b.y+(this.dragTransform.yScale-1)*(F.clientY-b.y)/this.dragTransform.yScale+"px",m.style.transformOrigin="0px 0px"}let{top:l,left:t}=m.getBoundingClientRect();const _=this.el.getBoundingClientRect();t-=_.left,l-=_.top;const v={position:{top:l*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(f._temporaryRemoved){if(f.x=Math.max(0,Math.round(t/i)),f.y=Math.max(0,Math.round(l/a)),delete f.autoPosition,this.engine.nodeBoundFix(f),!this.engine.willItFit(f)){if(f.autoPosition=!0,!this.engine.willItFit(f)){ad.off(g,"drag");return}f._willFitPos&&(Qn.copyPos(f,f._willFitPos),delete f._willFitPos)}this._onStartMoving(m,F,v,f,i,a)}else this._dragOrResize(m,F,v,f,i,a)};return ad.droppable(this.el,{accept:F=>{const g=F.gridstackNode||this._readAttr(F,!1);if((g==null?void 0:g.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let m=!0;if(typeof this.opts.acceptWidgets=="function")m=this.opts.acceptWidgets(F);else{const n=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;m=F.matches(n)}if(m&&g&&this.opts.maxRow){const n={w:g.w,h:g.h,minW:g.minW,minH:g.minH};m=this.engine.willItFit(n)}return m}}).on(this.el,"dropover",(F,g,m)=>{let n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._temporaryRemoved)return!1;if(n!=null&&n._sidebarOrig&&(n.w=n._sidebarOrig.w,n.h=n._sidebarOrig.h),n!=null&&n.grid&&n.grid!==this&&!n._temporaryRemoved&&n.grid._leave(g,m),m=m||g,i=this.cellWidth(),a=this.getCellHeight(!0),!n){const t=m.getAttribute("data-gs-widget")||m.getAttribute("gridstacknode");if(t){try{n=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}m.removeAttribute("data-gs-widget"),m.removeAttribute("gridstacknode")}n||(n=this._readAttr(m)),n._sidebarOrig={w:n.w,h:n.h}}n.grid||(n.el||(n={...n}),n._isExternal=!0,m.gridstackNode=n);const f=n.w||Math.round(m.offsetWidth/i)||1,l=n.h||Math.round(m.offsetHeight/a)||1;return n.grid&&n.grid!==this?(g._gridstackNodeOrig||(g._gridstackNodeOrig=n),g.gridstackNode=n={...n,w:f,h:l,grid:this},delete n.x,delete n.y,this.engine.cleanupNode(n).nodeBoundFix(n),n._initDD=n._isExternal=n._temporaryRemoved=!0):(n.w=f,n.h=l,n._temporaryRemoved=!0),vi._itemRemoving(n.el,!1),ad.on(g,"drag",k),k(F,g,m),!1}).on(this.el,"dropout",(F,g,m)=>{const n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;return n&&(!n.grid||n.grid===this)&&(this._leave(g,m),this._isTemp&&this.removeAsSubGrid(n)),!1}).on(this.el,"drop",(F,g,m)=>{var n,f,l;const t=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const _=!!this.placeholder.parentElement,v=g!==m;this.placeholder.remove(),delete this.placeholder.gridstackNode,_&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=g._gridstackNodeOrig;if(delete g._gridstackNodeOrig,_&&b!=null&&b.grid&&b.grid!==this){const o=b.grid;o.engine.removeNodeFromLayoutCache(b),o.engine.removedNodes.push(b),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!t||(_&&(this.engine.cleanupNode(t),t.grid=this),(n=t.grid)==null||delete n._isTemp,ad.off(g,"drag"),m!==g?(m.remove(),g=m):g.remove(),this._removeDD(g),!_))return!1;const d=(l=(f=t.subGrid)==null?void 0:f.el)==null?void 0:l.gridstack;return Qn.copyPos(t,this._readAttr(this.placeholder)),Qn.removePositioningStyles(g),v&&(t.content||t.subGridOpts||vi.addRemoveCB)?(delete t.el,g=this.addWidget(t)):(this._prepareElement(g,!0,t),this.el.appendChild(g),this.resizeToContentCheck(!1,t),d&&(d.parentGridNode=t),this._updateContainerHeight()),this.engine.addedNodes.push(t),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...F,type:"dropped"},b&&b.grid?b:void 0,t),!1}),this}static _itemRemoving(a,i){if(!a)return;const k=a?a.gridstackNode:void 0;!(k!=null&&k.grid)||a.classList.contains(k.grid.opts.removableOptions.decline)||(i?k._isAboutToRemove=!0:delete k._isAboutToRemove,i?a.classList.add("grid-stack-item-removing"):a.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const a=document.querySelector(this.opts.removable);return a?(!this.opts.staticGrid&&!ad.isDroppable(a)&&ad.droppable(a,this.opts.removableOptions).on(a,"dropover",(i,k)=>vi._itemRemoving(k,!0)).on(a,"dropout",(i,k)=>vi._itemRemoving(k,!1)),this):this}prepareDragDrop(a,i=!1){const k=a==null?void 0:a.gridstackNode;if(!k)return;const F=k.noMove||this.opts.disableDrag,g=k.noResize||this.opts.disableResize,m=this.opts.staticGrid||F&&g;if((i||m)&&(k._initDD&&(this._removeDD(a),delete k._initDD),m&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!i))return this;if(!k._initDD){let n,f;const l=(v,b)=>{this.triggerEvent(v,v.target),n=this.cellWidth(),f=this.getCellHeight(!0),this._onStartMoving(a,v,b,k,n,f)},t=(v,b)=>{this._dragOrResize(a,v,b,k,n,f)},_=v=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete k._moving,delete k._resizing,delete k._event,delete k._lastTried;const b=k.w!==k._orig.w,d=v.target;if(!(!d.gridstackNode||d.gridstackNode.grid!==this)){if(k.el=d,k._isAboutToRemove){const o=a.gridstackNode.grid;o._gsEventHandler[v.type]&&o._gsEventHandler[v.type](v,d),o.engine.nodes.push(k),o.removeWidget(a,!0,!0)}else Qn.removePositioningStyles(d),k._temporaryRemoved?(this._writePosAttr(d,k),this.engine.addNode(k)):this._writePosAttr(d,k),this.triggerEvent(v,d);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),v.type==="resizestop"&&(Number.isInteger(k.sizeToContent)&&(k.sizeToContent=k.h),this.resizeToContentCheck(b,k))}};ad.draggable(a,{start:l,stop:_,drag:t}).resizable(a,{start:l,stop:_,resize:t}),k._initDD=!0}return ad.draggable(a,F?"disable":"enable").resizable(a,g?"disable":"enable"),this}_onStartMoving(a,i,k,F,g,m){var n;if(this.engine.cleanNodes().beginUpdate(F),this._writePosAttr(this.placeholder,F),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=F,(n=F.grid)!=null&&n.el)this.dragTransform=Qn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const f=this.placeholder.closest(".grid-stack");this.dragTransform=Qn.getValuesFromTransformedElement(f)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(F.el=this.placeholder,F._lastUiPosition=k.position,F._prevYPix=k.position.top,F._moving=i.type==="dragstart",F._resizing=i.type==="resizestart",delete F._lastTried,i.type==="dropover"&&F._temporaryRemoved&&(this.engine.addNode(F),F._moving=!0),this.engine.cacheRects(g,m,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const f=this.getColumn()-F.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-F.y;ad.resizable(a,"option","minWidth",g*Math.min(F.minW||1,f)).resizable(a,"option","minHeight",m*Math.min(F.minH||1,l)).resizable(a,"option","maxWidth",g*Math.min(F.maxW||Number.MAX_SAFE_INTEGER,f)).resizable(a,"option","maxWidthMoveLeft",g*Math.min(F.maxW||Number.MAX_SAFE_INTEGER,F.x+F.w)).resizable(a,"option","maxHeight",m*Math.min(F.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(a,"option","maxHeightMoveUp",m*Math.min(F.maxH||Number.MAX_SAFE_INTEGER,F.y+F.h))}}_dragOrResize(a,i,k,F,g,m){const n={...F._orig};let f,l=this.opts.marginLeft,t=this.opts.marginRight,_=this.opts.marginTop,v=this.opts.marginBottom;const b=Math.round(m*.1),d=Math.round(g*.1);if(l=Math.min(l,d),t=Math.min(t,d),_=Math.min(_,b),v=Math.min(v,b),i.type==="drag"){if(F._temporaryRemoved)return;const s=k.position.top-F._prevYPix;F._prevYPix=k.position.top,this.opts.draggable.scroll!==!1&&Qn.updateScrollPosition(a,k.position,s);const h=k.position.left+(k.position.left>F._lastUiPosition.left?-t:l),c=k.position.top+(k.position.top>F._lastUiPosition.top?-v:_);n.x=Math.round(h/g),n.y=Math.round(c/m);const p=this._extraDragRow;if(this.engine.collide(F,n)){const x=this.getRow();let w=Math.max(0,n.y+F.h-x);this.opts.maxRow&&x+w>this.opts.maxRow&&(w=Math.max(0,this.opts.maxRow-x)),this._extraDragRow=w}else this._extraDragRow=0;if(this._extraDragRow!==p&&this._updateContainerHeight(),F.x===n.x&&F.y===n.y)return}else if(i.type==="resize"){if(n.x<0||(Qn.updateScrollResize(i,a,m),n.w=Math.round((k.size.width-l)/g),n.h=Math.round((k.size.height-_)/m),F.w===n.w&&F.h===n.h)||F._lastTried&&F._lastTried.w===n.w&&F._lastTried.h===n.h)return;const s=k.position.left+l,h=k.position.top+_;n.x=Math.round(s/g),n.y=Math.round(h/m),f=!0}F._event=i,F._lastTried=n;const o={x:k.position.left+l,y:k.position.top+_,w:(k.size?k.size.width:F.w*g)-l-t,h:(k.size?k.size.height:F.h*m)-_-v};if(this.engine.moveNodeCheck(F,{...n,cellWidth:g,cellHeight:m,rect:o,resizing:f})){F._lastUiPosition=k.position,this.engine.cacheRects(g,m,_,t,v,l),delete F._skipDown,f&&F.subGrid&&F.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=i.target;F._sidebarOrig||this._writePosAttr(s,F),this.triggerEvent(i,s)}}triggerEvent(a,i){let k=this;for(;k.parentGridNode;)k=k.parentGridNode.grid;k._gsEventHandler[a.type]&&k._gsEventHandler[a.type](a,i)}_leave(a,i){i=i||a;const k=i.gridstackNode;if(!k||(i.style.transform=i.style.transformOrigin=null,ad.off(a,"drag"),k._temporaryRemoved))return;k._temporaryRemoved=!0,this.engine.removeNode(k),k.el=k._isExternal&&i?i:a;const F=k._sidebarOrig;k._isExternal&&this.engine.cleanupNode(k),k._sidebarOrig=F,this.opts.removable===!0&&vi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):k._isExternal&&this.engine.restoreInitial()}commit(){return j5e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}vi.renderCB=(e,a)=>{e&&a!=null&&a.content&&(e.textContent=a.content)},vi.resizeToContentParent=".grid-stack-item-content",vi.Utils=Qn,vi.Engine=Mh,vi.GDRev="12.3.2";const X5e=[{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}],Fh=e=>X5e.find(a=>a.id===e),jh=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 Y0{constructor(a,i=[],k,F=null,g=!1,m=!1,n=null,f=null,l=null){Tp(this,"id",""),Tp(this,"childViews",[]),Tp(this,"viewId",0),Tp(this,"dynamicFilters",null),Tp(this,"componentSpecificFilters",new Map),Tp(this,"isPostMatch",!1),Tp(this,"isTemplateMode",!1),Tp(this,"filtresJSON",null),Tp(this,"token",null),Tp(this,"_isUpdating",!1),Tp(this,"filters",null),this.id=a,this.viewId=k,this.childViews=i,this.dynamicFilters=F,this.isPostMatch=g,this.isTemplateMode=m,this.filtresJSON=n,this.token=f,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new Y0(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.event_type_id===i)}hasCategoryId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.category_id===i)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,i=null){i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a}setFilters(a){this.filters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(a=>a.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(a=>!a.view.isHomeTeam)}addLastTouch(a){if(a.view.componentProps&&this.filters){let i=null;const k=this.filters.selectedCategories.map(g=>g.value),F=this.filters.selectedTeam.value;if(F===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=!0,f.view.isHomeTeam=!0,f.view.filterMultiple&&(f.view.filterMultiple.isHomeTeam=!0)});const g=this.getHomeTeamViews(),m=this.getAwayTeamViews();let n=!0;for(let f=0;f<k.length;f++){i=k[f];const l=g.find(_=>_.view.componentProps.categories[0].name===i.name),t=m.find(_=>_.view.componentProps.categories[0].name===i.name);if(!l||!t){n=!l;break}}n?this.childViews.length===0?(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((f,l,t,_)=>{let v={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 f&&(f.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[i],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=i.name,a.view.titleShort=i.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!f.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=f.categories,l.view.componentProps.analysisType=f.analysisType,l.view.componentProps.isHomeTeamForAnalysis=f.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=f.isAssistZoneVisible,l.view.componentProps.howManyGames=f.howManyGames,l.view.title=f.title,l.view.titleShort=f.titleShort,l.view.isHomeTeam=f.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}),t===_.length-1&&(a.view.componentProps.categories=v.categories,a.view.componentProps.analysisType=v.analysisType,a.view.componentProps.isHomeTeamForAnalysis=v.isHomeTeamForAnalysis,a.view.componentProps.isAssistZoneVisible=v.isAssistZoneVisible,a.view.componentProps.howManyGames=v.howManyGames,a.view.title=v.title,a.view.titleShort=v.titleShort,a.view.isHomeTeam=v.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:a.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),v},null):(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const g=F===1,m=g?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=g,a.view.isHomeTeam=g;for(let n=0;n<k.length;n++){const f=k[n];if(!m.find(l=>l.view.componentProps.categories[0].name===f.name)){a.view.componentProps.categories=[f],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=f.name,a.view.titleShort=f.name,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:f,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(a,i=!1){var k,F,g,m,n,f,l,t,_,v;if(a.view.filterAndViewsContainer=this,qa.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===10&&a.view.componentProps&&!i&&(a.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,a.isHomeTeam=a.view.componentProps.isHomeTeamForAnalysis,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis},a.view.filtersJSON=this.filtresJSON),this.viewId===7&&a.view.componentProps&&!i){const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=d[0]===1?"offensive":"defensive",s=d[1]===1;a.view.componentProps.analysisType=o,a.view.componentProps.isHomeTeamForAnalysis=s,a.isHomeTeam=s,a.view.filterMultiple={isHomeTeam:s},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:d})}if(this.viewId===1&&a.view.componentProps&&!i){const b=this.dynamicFilters[0]||[];if(b&&b.length>0){let d;if(Array.isArray(b)){const s=this.childViews.map(c=>{var p;return(p=c.view.componentProps)==null?void 0:p.type}).filter(c=>c!==void 0),h=b.filter(c=>!s.includes(c));h.length>0?d=h[0]:d=b[0]}else d=b;const o=jh.get(this.viewId);a.view.componentProps.type=d,a.view.componentProps.default=!1,a.view.title=`Comparativa ${o[d]}`,a.view.filterMultiple={category:d}}}if(this.viewId===9&&a.view.componentProps&&!i){const b=this.dynamicFilters[0].map(h=>h.join("-"));let d="";const o=this.dynamicFilters[1],s=jh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(w=>{w.view.componentProps.isHomeTeamForAnalysis=!0,w.view.isHomeTeam=!0,w.view.filterMultiple&&(w.view.filterMultiple.isHomeTeam=!0)});let h=null;const c=this.getHomeTeamViews(),p=this.getAwayTeamViews();let x=!0;for(let w=0;w<b.length;w++){d=b[w],h=s.analysisTypes.get(b[w]);const T=c.find(O=>O.view.componentProps.analysisType===h.analysisType),V=p.find(O=>O.view.componentProps.analysisType===h.analysisType);if(!T||!V){x=!T;break}}x?this.childViews.length===0?(a.view.componentProps.analysisType=h.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=h.title,a.view.titleShort=h.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:d.split("-").map(w=>parseInt(w))}):this.childViews.reduce((w,T,V,O)=>{let U={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return w&&(w.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=h.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=h.title,a.view.titleShort=h.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:d.split("-").map(z=>parseInt(z))}):!w.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=w.analysisType,T.view.componentProps.isHomeTeamForAnalysis=w.isHomeTeamForAnalysis,T.view.title=w.title,T.view.titleShort=w.titleShort,T.view.isHomeTeam=w.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:d.split("-").map(z=>parseInt(z))}),V===O.length-1&&(a.view.componentProps.analysisType=U.analysisType,a.view.componentProps.isHomeTeamForAnalysis=U.isHomeTeamForAnalysis,a.view.title=U.title,a.view.titleShort=U.titleShort,a.view.isHomeTeam=U.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:d.split("-").map(z=>parseInt(z))})),U},null):(a.view.componentProps.analysisType=h.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=h.title,a.view.titleShort=h.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:d.split("-").map(w=>parseInt(w))})}else{const h=o===1,c=h?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=h,a.view.isHomeTeam=h;for(let p=0;p<b.length;p++){const x=s.analysisTypes.get(b[p]);if(!c.find(w=>w.view.componentProps.analysisType===x.analysisType)){a.view.componentProps.analysisType=x.analysisType,a.view.title=x.title,a.view.titleShort=x.titleShort,a.view.filterMultiple={categoryIds:b[p].split("-").map(w=>parseInt(w)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!i&&a.view.componentProps){const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id),a.view.componentProps.game&&(a.view.componentProps.gameid=a.view.componentProps.game.id,a.view.componentProps.season=a.view.componentProps.game.season_id,a.view.componentProps.teamView=d[1]===2?a.view.componentProps.game.awayTeam.team_id:d[1]===1?a.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const p=this.childViews.map(w=>{var T;const V=(T=w.view.componentProps)==null?void 0:T.categoryView;return V&&V.length>0?V[0].id:null}).filter(w=>w!==null),x=o.filter(w=>!p.includes(w));x.length>0&&(s=x[0])}}else{const p=o;p&&(this.childViews.find(x=>{var w;const T=(w=x.view.componentProps)==null?void 0:w.categoryView;return T&&T.length>0&&T[0].id===p})||(s=p))}let h=null;if(s)try{h=Fh(s)}catch{}const c=d&&d.length>1?d[1]:1;a.view.filterMultiple={categoryId:s,teamType:c},a.view.componentProps.categoryView=h?[{id:s,name:h.name}]:s?[{id:s,name:`Category ${s}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!i&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(k=a.view)==null?void 0:k.game,a.view.componentProps.teamSelected={teamId:(g=(F=a.view)==null?void 0:F.game)==null?void 0:g.home_team},a.view.componentProps.isDefault=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.seasonid=2010,a.view.teamids=[1,2],a.view.componentProps.categoryids=[20,2],a.view.componentProps.teamsshow=[1,2],a.view.componentProps.analysistype=1,a.view.componentProps.gameid="",a.view.componentProps.teams=[],a.view.componentProps.game=""),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.view=1,a.view.numitems=3,a.view.typegame=1,a.view.componentProps.token=this.token,a.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===14&&a.view.componentProps&&!i&&(a.view.componentProps.isReports=!0,a.view.componentProps.isDefault=!0,a.view.componentProps.type=0,a.view.componentProps.typeView=1,a.view.componentProps.showVideos=!1,a.view.componentProps.currentSeason=2010,a.view.componentProps.localTeam=2,a.view.componentProps.awayTeam=1),this.viewId===6&&a.view.componentProps&&!i){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=d&&d.length>0?d[0]:[];if(o&&o.length>0){let s=0;for(const h of o)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===h)){s=h;break}s&&(a.view.componentProps.gameNumber=s,a.view.filterMultiple={gameNumber:s})}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:d})}if(this.viewId===3&&a.view.componentProps&&!i&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=d&&d.length>0?d[0]:!1;a.view.componentProps.desplegable=o,a.view.componentProps.key=o,a.view.componentProps.game=(m=a.view)==null?void 0:m.game,a.view.componentProps.defaultShields=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:d})}if(this.viewId===4&&a.view.componentProps&&!i&&a.view.game){if(a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),this.isPostMatch){a.view.componentProps.key=!1,a.view.componentProps.isDefault=!1,a.view.componentProps.token=this.token,a.view.componentProps.gameId=(f=(n=a.view)==null?void 0:n.game)==null?void 0:f.game_id,a.view.componentProps.homeTeam=(t=(l=a.view)==null?void 0:l.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(v=(_=a.view)==null?void 0:_.game)==null?void 0:v.visiting_team;const o=this.getComponentDynamicFilters(a.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const h=s&&s.length>0?s[0]:[],c=this.hasEventTypeId(h,1),p=this.hasCategoryId(h,8),x=this.hasCategoryId(h,9),w=this.hasEventTypeId(h,3);a.view.componentProps.goals=c,a.view.componentProps.yellowCards=p,a.view.componentProps.redCards=x,a.view.componentProps.substitutions=w}const b=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,d=b&&b.length>0?b[0]:[];a.view.componentProps.selectedEvents=d,a.view.componentProps.key=d.length>0,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:b})}this.viewId===16&&this.addLastTouch(a),this.childViews.push(a),qa.emit("view-added")}getHowManyViewsToAdd(a,i=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const k=a[0];return k===2||k===3?k:1}if(this.viewId===4)return a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0?1:0;if(this.viewId===9){const k=a[0],F=a[1];if(F===1||F===2){const g=F===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&i){const k=i.selectedCategories||[],F=i.selectedTeam.value;if(F===1||F===2){const g=F===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const k=a[0]||[],F=a[1]||1;if(!k||k.length===0)return 0;if(Array.isArray(k)){const g=this.childViews.map(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0?f[0].id:null}).filter(m=>m!==null);return k.filter(m=>!g.includes(m)).length}else{const g=k;return this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===g&&t===F})?0:1}}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return 0;if(Array.isArray(k)){const F=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!F.includes(g)).length}else{const F=k;return this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===F})?0:1}}return 0}getRequiresAddView(a,i){if(this.viewId===5)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===10)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return a[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const k=a[0];return k?k.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;return this.childViews.length===0&&k}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===16&&i){const k=[i.selectedCategories,i.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(k,i.totalCategoriesSelected)}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return!1;if(Array.isArray(k)){const F=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!F.includes(g)).length>0}else{const F=k;return!this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===F})}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){if(k.length>0){const F=this.childViews.map(g=>{var m;const n=(m=g.view.componentProps)==null?void 0:m.categoryView;return n&&n.length>0?n[0].id:null}).filter(g=>g!==null);return k.filter(g=>!F.includes(g)).length>0}return!1}else{const F=k,g=a[1]||1;return F?!this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===F&&t===g}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a,i=null){const k=this.childViews.filter(l=>l.view.isHomeTeam),F=this.childViews.filter(l=>!l.view.isHomeTeam),g=i||a[0].length,m=a[1],n=g*(m===1||m===2?1:2),f=m===3?k.length+F.length:k.length||F.length;return n>f}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===15)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const i=a[0];return i===2||i===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const i=this.childViews[0],k=document.querySelector(`[gs-id="${i.view.id}"]`),F=i.grid;if(i&&k&&F){const g=a[0],m=`min_column${g?"_2":""}`,n=`min_row${g?"_2":""}`,f=`max_column${g?"_2":""}`,l=`max_row${g?"_2":""}`,t=`colspan${g?"_2":""}`,_=`rowspan${g?"_2":""}`,v=i.view.coreView[t],b=i.view.coreView[_],d=i.view.coreView[m],o=i.view.coreView[n],s=i.view.coreView[f],h=i.view.coreView[l];i.view.w=v,i.view.h=b,i.view.maxWidth=s,i.view.maxHeight=h,i.view.minWidth=d,i.view.minHeight=o,k.setAttribute("gs-w",v),k.setAttribute("gs-h",b),k.setAttribute("gs-max-w",s),k.setAttribute("gs-max-h",h),k.setAttribute("gs-min-w",d),k.setAttribute("gs-min-h",o),F.update(k,{h:b,w:v,"gs-max-h":h,"gs-max-w":s,"gs-min-h":o,"gs-min-w":d})}}updateFilters(a){this.filters=a,this.viewId===16&&this.updateLastTouchFilters(a)}updateDynamicFilters(a,i=null){if(!this._isUpdating){this._isUpdating=!0,i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a,qa.emit("component-added-to-container",this);try{if(this.viewId===5){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:F.view.componentProps.preMatchType===1})}else{const F=this.childViews.pop(),g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===F.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.preMatchType=k,f.view.filterMultiple={isHomeTeam:f.view.componentProps.preMatchType})}else this.childViews.forEach((F,g)=>{F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:F.view.componentProps.preMatchType}})}if(this.viewId===15){const k=a[0]||1;if(i){const F=this.childViews.find(g=>g.view.id===i);F&&F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:k===1})}else if(k<3){if(this.childViews.length===1){const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:k===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const g=this.childViews.pop(),m=g.grid,n=g.page,f=document.querySelector(`[gs-id="${g.view.id}"]`);if(m&&f&&(m.removeWidget(f),n)){const l=n.items.findIndex(t=>t.id===g.view.id);l!==-1&&n.items.splice(l,1)}}const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:k===1})}}else if(this.childViews.length===2)this.childViews.forEach((F,g)=>{F.view.componentProps&&(F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:g===0})});else if(this.childViews.length<2)this.childViews.forEach((F,g)=>{F.view.componentProps&&(F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:g===0})});else{for(;this.childViews.length>2;){const F=this.childViews.pop(),g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const f=m.items.findIndex(l=>l.id===F.view.id);f!==-1&&m.items.splice(f,1)}}this.childViews.forEach((F,g)=>{F.view.componentProps&&(F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:g===0})})}}if(this.viewId===10){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.isHomeTeamForAnalysis=k===1,F.view.filterMultiple={isHomeTeam:F.view.componentProps.isHomeTeamForAnalysis})}else{const F=this.childViews.pop(),g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===F.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=k===1,f.view.filterMultiple={isHomeTeam:f.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((F,g)=>{F.view.componentProps.isHomeTeamForAnalysis=g%2===0,F.view.filterMultiple={isHomeTeam:F.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const k=a[1];if(k===3)this.childViews.forEach((F,g)=>{F.view.componentProps.isHomeTeamForAnalysis=g%2===0,F.view.isHomeTeam=g%2===0,F.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",F.view.filterMultiple={isHomeTeam:F.view.isHomeTeam}});else{const F=k===1;if(this.childViews.length>0){const g=this.childViews[0];g.view.componentProps.isHomeTeamForAnalysis=F,g.view.isHomeTeam=F,g.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",g.view.filterMultiple={isHomeTeam:F},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const k=a[0],F=a[1];if(F===3){if(this.childViews.length>k.length){const g=k.map(m=>{const n=m.join("-");return jh.get(this.viewId).analysisTypes.get(n).analysisType});this.childViews.reduce((m,n)=>(g.includes(n.view.componentProps.analysisType)||m.push(n.view.componentProps.analysisType),m),[]).forEach(m=>{const n=this.childViews.findIndex(f=>f.view.componentProps.analysisType===m);if(n!==-1){const f=this.childViews[n];this.removeChildView(f)}})}}else{const g=F===1,m=this.getHomeTeamViews(),n=this.getAwayTeamViews();if(g&&m.length===0)n.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(!g&&n.length===0)m.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(m.length===n.length)g||m.forEach(f=>{f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}}),(g?n:m).forEach(f=>{this.removeChildView(f)});else{const f=g?this.getHomeTeamViews():this.getAwayTeamViews();if(f.length>k.length){const l=k.map(t=>{const _=t.join("-");return jh.get(this.viewId).analysisTypes.get(_).analysisType});f.forEach(t=>{l.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}:this.removeChildView(t)})}else f.forEach(l=>{l.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}})}}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){const F=this.childViews.map(g=>{var m,n;const f=(m=g.view.componentProps)==null?void 0:m.categoryView,l=((n=g.view.filterMultiple)==null?void 0:n.teamType)||1,t=f&&f.length>0?f[0].id:null;return t?{categoryId:t,teamType:l,viewId:g.view.id}:null}).filter(g=>g!==null);if(i){const g=this.childViews.find(m=>m.view.id===i);if(g){const m=a[1]||1,n=k[0];if(n){let f=null;try{f=Fh(n)}catch{}g.view.filterMultiple={categoryId:n,teamType:m},g.view.componentProps.game&&(m===1?g.view.componentProps.teamView=g.view.componentProps.game.homeTeam.team_id:m===2?g.view.componentProps.teamView=g.view.componentProps.game.awayTeam.team_id:g.view.componentProps.teamView=0),g.view.componentProps.categoryView=f?[{id:n,name:f.name}]:[{id:n,name:`Category ${n}`}]}}}if(!i){const g=a[1]||1;this.childViews.forEach(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;if(f&&f.length>0){const l=f[0].id;k.includes(l)&&(m.view.filterMultiple={categoryId:l,teamType:g})}})}if(F.map(g=>g.categoryId).filter(g=>!k.includes(g)).forEach(g=>{this.childViews.filter(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0&&f[0].id===g}).forEach(m=>{this.removeChildView(m),qa.emit("component-removed",{viewId:m.view.id,categoryId:g})})}),i){const g=k[0];if(g){const m=this.childViews.find(n=>n.view.id===i);if(m){let n=null;try{n=Fh(g)}catch{}const f=a[1]||1;m.view.filterMultiple={categoryId:g,teamType:f},m.view.componentProps.game&&(m.view.componentProps.teamView=f===2?m.view.componentProps.game.awayTeam.team_id:f===1?m.view.componentProps.game.homeTeam.team_id:0),m.view.componentProps.categoryView=n?[{id:g,name:n.name}]:[{id:g,name:`Category ${g}`}]}}}}else{const F=k;if(F&&i){const g=this.childViews.find(m=>m.view.id===i);if(g){let m=null;try{m=Fh(F)}catch{}const n=a[1]||1;g.view.filterMultiple={categoryId:F,teamType:n},g.view.componentProps.game&&(g.view.componentProps.teamView=n===2?g.view.componentProps.game.awayTeam.team_id:n===1?g.view.componentProps.game.homeTeam.team_id:0),g.view.componentProps.categoryView=m?[{id:F,name:m.name}]:[{id:F,name:`Category ${F}`}]}}}}if(this.viewId===8){const k=a[0]||!1;this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),F.view.componentProps.areInactiveVisible=k,F.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}if(this.viewId===1){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const F=this.childViews.find(g=>g.view.id===i);F&&this.updateComparative(F,a)}else if(this.childViews.reduce((F,g)=>(k.includes(g.view.componentProps.type)||F.push(g.view.componentProps.type),F),[]).forEach(F=>{const g=this.childViews.findIndex(m=>m.view.componentProps.type===F);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.type=n.view.componentProps.type,f.view.title=n.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(k))this.childViews.length>0&&k.length>0&&this.childViews.forEach((F,g)=>{if(F.view.componentProps&&g<k.length){const m=k[g],n=jh.get(this.viewId);F.view.componentProps.type=m,F.view.componentProps.default=!1,F.view.title=`Comparativa ${n[m]}`,F.view.filterMultiple={category:m}}});else{const F=k;if(F&&this.childViews.length>0){const g=this.childViews[0];if(g.view.componentProps){const m=jh.get(this.viewId);g.view.componentProps.type=F,g.view.componentProps.default=!1,g.view.title=`Comparativa ${m[F]}`,g.view.filterMultiple={category:F}}}}}if(this.viewId===6){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const F=this.childViews.find(g=>g.view.id===i);F&&this.updateGSCLineupsReports(F,a)}else{if(Array.isArray(k))if(k.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((F,g)=>(k.includes(g.view.componentProps.gameNumber)||F.push(g.view.componentProps.gameNumber),F),[]).forEach(F=>{const g=this.childViews.findIndex(m=>m.view.componentProps.gameNumber===F);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.gameNumber=n.view.componentProps.gameNumber,f.view.filterMultiple={gameNumber:n.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(i){this.setDynamicFilters(a,i);const k=this.childViews.find(F=>F.view.id===i);k&&this.updateMatchSummary(k,a)}else{const k=a[0]||!1;this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),F.view.componentProps.desplegable=k,F.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===13){const k=a[1]||[];if(i){this.setDynamicFilters(a,i);const F=this.childViews.find(g=>g.view.id===i);F&&(F.view.componentProps&&(F.view.componentProps.categoryids=k,F.view.componentProps.analysistype=a[0]||1,F.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],F.view.dynamicFilters=a,F.view._updateKey=Date.now()),qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))}else this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),F.view.componentProps.categoryids=k,F.view.componentProps.analysistype=a[0]||1,F.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],F.view.dynamicFilters=a,F.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}else if(this.viewId===15){const k=a[0]||1,F=a[3]!==void 0?a[3]:typeof a[1]=="number"?a[1]:null;if(i){this.setDynamicFilters(a,i);const g=this.childViews.find(m=>m.view.id===i);g&&g.view.componentProps&&(g.view.componentProps.analysistype=k,F!==null&&(g.view.componentProps.numitems=F),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))}else this.childViews.forEach(g=>{g.view.componentProps&&(g.view.componentProps._isReactive||(g.view.componentProps=r.reactive(g.view.componentProps),g.view.componentProps._isReactive=!0),g.view.componentProps.analysistype=k,F!==null&&(g.view.componentProps.numitems=F),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))})}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(i){const F=this.childViews.find(g=>g.view.id===i);F&&F.view.componentProps.selectedEvents}else if(!k&&this.childViews.length>0)this.childViews.forEach(F=>{this.removeChildView(F)});else if(k&&this.childViews.length===0){const F={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};qa.emit("add-view",F)}else this.childViews.forEach(F=>{this.updateTimeline(F,a)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,i=!1){const k=this.childViews.findIndex(F=>F.view.id===a.view.id);if(k!==-1){const F=this.childViews[k];this.childViews.splice(k,1),F.view.id&&this.componentSpecificFilters.delete(F.view.id);const g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m&&!i)){const f=m.items.findIndex(l=>l.id===F.view.id);f!==-1&&(m.items.splice(f,1),m.items.length===0&&qa.emit("empty-page",m))}}}updateView({view:a,dynamicFilters:i,filtersJSON:k,filters:F}){this.setFiltersJSON(k),this.dynamicFilters=i;const g=this.childViews.find(m=>{var n;return((n=m.view)==null?void 0:n.id)===a.view.id});if(g){g.view.filtersJSON=k,g.view.coreView&&(g.view.coreView.filtersJSON=k);let m=i;if(this.viewId===4){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===8){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===3){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n),this.updateSummary({dynamicFilters:m})}else if(this.viewId===1){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===6){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===7){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===9){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}this.viewId===5?this.updateVolumetricField(g,m):this.viewId===7?this.updateGoalData(g,m):this.viewId===9?this.updateFieldDataByZones(g,i):this.viewId===10?this.updateXg(g,m):this.viewId===3?this.updateMatchSummary(g,m):this.viewId===4?this.updateTimeline(g,m):this.viewId===8?this.updateFieldPosesion(g,m):this.viewId===1?this.updateComparative(g,m):this.viewId===2?this.updateGSCtops(g,m):this.viewId===6?this.updateGSCLineupsReports(g,m):this.viewId===16&&this.updateLastTouchSingle(g,F)}}updateComparative(a,i){if(a.view.componentProps){const k=i[0]||[];if(k&&k.length>0){let F;if(Array.isArray(k)){const m=this.childViews.findIndex(n=>n.view.id===a.view.id);m>=0&&m<k.length?F=k[m]:F=k[0]}else F=k;const g=jh.get(this.viewId);a.view.componentProps.type=F,a.view.componentProps.default=!1,a.view.title=`Comparativa ${g[F]}`,a.view.filterMultiple={category:F}}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateVolumetricField(a,i){if(a.view.componentProps){const k=i[0]||1;a.view.isHomeTeam=k===1,a.view.componentProps.preMatchType=k,a.view.filterMultiple={isHomeTeam:k},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,i){if(a.view.componentProps){const k=i[0]===1?"offensive":"defensive",F=i[1]===1;a.view.componentProps.analysisType=k,a.view.componentProps.isHomeTeamForAnalysis=F,a.view.isHomeTeam=F,a.view.filterMultiple={isHomeTeam:F},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,i){if(a.view.componentProps){const k=i[0],F=i[1]===1;if(a.view.componentProps.isHomeTeamForAnalysis=F,a.view.isHomeTeam=F,a.view.filterMultiple={categoryIds:k,isHomeTeam:F},k&&k.length){const g=k.join("-"),m=jh.get(this.viewId).analysisTypes.get(g);m&&(a.view.componentProps.analysisType=m.analysisType,a.view.title=m.title,a.view.titleShort=m.titleShort)}}}updateXg(a,i){const k=i[0]===1;a.view.componentProps&&(a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:k})}updateMatchSummary(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.desplegable=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateTimeline(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=this.getComponentDynamicFilters(a.view.id)||i,F=k&&k.length>0?k[0]:[];a.view.componentProps.selectedEvents=F,a.view.componentProps.key=F.length>0;const g=this.hasEventTypeId(F,1),m=this.hasCategoryId(F,8),n=this.hasCategoryId(F,9),f=this.hasEventTypeId(F,3);a.view.componentProps.goals=g,a.view.componentProps.yellowCards=m,a.view.componentProps.redCards=n,a.view.componentProps.substitutions=f,a.view.componentProps._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:k}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:k}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.areInactiveVisible=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateGSCtops(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const F=k[0];let g=null;try{g=Fh(F)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:F,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:F,name:g.name}]:[{id:F,name:`Category ${F}`}]}}else{const F=k;if(F){let g=null;try{g=Fh(F)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:F,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:F,name:g.name}]:[{id:F,name:`Category ${F}`}]}}}}updateGSCLineupsReports(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const F=k[0];a.view.filterMultiple={gameNumber:F},a.view.componentProps.gameNumber=F}}else{const F=k;F&&(a.view.filterMultiple={gameNumber:F},a.view.componentProps.gameNumber=F)}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,i){if(!a||!i)return null;for(const k of i){const F=k.join("-"),g=jh.get(this.viewId);if(g&&g.analysisTypes){const m=g.analysisTypes.get(F);if(m&&m.analysisType===a)return k[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(F=>{F.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,F.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,F.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,F.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const a=this.filters.selectedCategories.map(F=>F.value),i=a.map(F=>F.name),k=this.filters.selectedTeam.value;if(k===3)this.childViews.length>a&&this.childViews.reduce((F,g)=>(i.includes(g.view.componentProps.categories[0].name)||F.push(g.view.componentProps.categories[0].name),F),[]).forEach(F=>{const g=this.childViews.findIndex(m=>m.view.componentProps.categories[0].name===F);if(g!==-1){const m=this.childViews[g];this.removeChildView(m)}});else{const F=k===1,g=this.getHomeTeamViews(),m=this.getAwayTeamViews();if(F&&g.length===0)m.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=F,n.view.isHomeTeam=F,n.view.filterMultiple.isHomeTeam=F});else if(!F&&m.length===0)g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=F,n.view.isHomeTeam=F,n.view.filterMultiple.isHomeTeam=F});else if(g.length===m.length)F||g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=F,n.view.isHomeTeam=F,n.view.filterMultiple.isHomeTeam=F}),(F?m:g).forEach(n=>{this.removeChildView(n)});else{const n=F?this.getHomeTeamViews():this.getAwayTeamViews();if(n.length>a.length){const f=a.map(l=>l.name);n.forEach(l=>{f.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=F:this.removeChildView(l)})}else n.forEach(f=>{f.view.filterMultiple.isHomeTeam=F})}}}updateLastTouchSingle(a,i){if(a.view.componentProps){const k=i.selectedTeam.value===1,F=i.selectedCategory.value;a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.componentProps.categories=[F],a.view.componentProps.analysisType=i.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=i.isAssistZoneVisible,a.view.componentProps.howManyGames=i.howManyGamesSelected.value,a.view.title=F.name,a.view.titleShort=F.name,a.view.isHomeTeam=k,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:F,selectedGamePhase:i.selectedGamePhase,howManyGamesSelected:i.howManyGamesSelected,isAssistZoneVisible:i.isAssistZoneVisible}}}}const D5e={class:"template-page__header"},J5e={class:"template-page__header__name"},B5e=["value"],G5e={class:"template-page__header__details"},Z5e={class:"template-page__header__details__teams"},H5e={class:"template-page__header__details__teams__team"},Y5e={key:0,class:"template-page__header__details__teams__team__logo"},Q5e=["src"],$5e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e_e={class:"template-page__header__details__teams__team"},t_e={key:0,class:"template-page__header__details__teams__team__logo"},r_e=["src"],n_e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a_e={class:"template-page__content"},i_e=["id"],o_e=["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"],s_e=r.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:a}){var i,k,F;const g=r.ref(null);let m=null;const n=e,f=r.ref(!1),l=a,t=r.computed(()=>n.page.items.reduce((j,K)=>(j.set(K.id,K),j),new Map)),_=r.computed(()=>{var j,K,X,D;return n.game&&n.game.homeTeam&&n.game.awayTeam?{homeTeam:{name:((j=n.game.homeTeam)==null?void 0:j.acronym)||"LOC",logo:((K=n.game.homeTeam)==null?void 0:K.logo)||null},awayTeam:{name:((X=n.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let v=null,b=null,d=!1,o=null,s=!1;const h=()=>{s=!0},c=()=>{s=!1};function p(){s||(d=!0,o&&clearTimeout(o),o=setTimeout(()=>{d=!1},150))}function x(){const j={root:null,rootMargin:"0px",threshold:.7};v=new IntersectionObserver(D=>{D.forEach(H=>{if(d){b&&clearTimeout(b),b=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},100);return}b&&clearTimeout(b),b=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},50)})},j);const K=g.value;K&&v.observe(K);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",p,{passive:!0}),document.addEventListener("programmatic-scroll-start",h),document.addEventListener("programmatic-scroll-end",c)}function w(j){n.page.title=j.target.value,l("view-changed")}const T={game_id:0,season_id:0,prematch:!1},V={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:[]}},O=new Map([[5,{component:jT,componentName:"GSCVolumetricField",props:{isGamePreMatch:!n.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:n.isTemplateMode,isTemplateMode:n.isTemplateMode,preMatchType:1}}],[2,{component:U4,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:n.game?n.game.id:V.gameId,game:n.game,season:n.game?(i=n==null?void 0:n.game)==null?void 0:i.season_id:V.seasonId,teamView:0,useDummyData:n.isTemplateMode}}],[8,{component:Ck,componentName:"FieldPosesion",props:{widthSection:600,game:V,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:W8,componentName:"GSCLineupsReports",props:{selectedOption:n.isPostMatch?"Postmatch":"Prematch",game:T,gamehome:T,gameaway:T}}],[3,{component:Rk,componentName:"GSCMatchSummary",props:{game:V,defaultShields:!0,desplegable:!1}}],[4,{component:x7,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:V.gameId,homeTeam:V.homeTeam.team_id,awayTeam:V.awayTeam.team_id,token:n.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:k9,componentName:"GSCGoalData",props:{game:n.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!n.isPostMatch,analysisType:1}}],[9,{component:M8,componentName:"GSCFieldDataByZones",props:{game:n.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!n.isPostMatch,negative:!0}}],[10,{component:n5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[13,{component:ZS,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:n.game?(k=n==null?void 0:n.game)==null?void 0:k.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:sS,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:kN,componentName:"GSCStrengths",props:{token:n.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:n5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[1,{component:_9,componentName:"GSCComparativeReports",props:{gameId:n.game?n.game.id:"",homeLogo:n.game?n.game.homeTeam.logo:"",awayLogo:n.game?n.game.awayTeam.logo:"",seasonId:n.game?(F=n==null?void 0:n.game)==null?void 0:F.season_id:0,typeGame:n.isPostMatch,type:"stoppedBall",default:n.isTemplateMode}}],[16,{component:zN,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:n.isTemplateMode,isPreMatch:!n.isPostMatch}}]]);function U(j){if(j)if(typeof j=="string"){let K=null;switch(j){case"GSCVolumetricField":K=jT;break;case"GSCGoalData":K=k9;break;case"GscTopPlayer":K=U4;break;case"FieldPosesion":K=Ck;break;case"GSCLineupsReports":K=W8;break;case"GSCMatchSummary":K=Rk;break;case"GSCTimelineReports":K=x7;break;case"GSCFieldDataByZones":K=M8;break;case"GSCGeneraltable":K=sS;break;case"GSCTimelapseTable":K=ZS;break;case"GSCGameXg":K=n5;break;case"GSCComparativeReports":K=_9;break;case"GSCStrengths":K=kN;break;case"GSCLastTouch":K=zN;break;default:K=null}return K}else return j;return null}function z({pageId:j,view:K,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:H=[],filters:re=null}){if(n.page.id===j&&m){let B=!1;K.id===3&&(B=H[0]);const ne=`min_column${B?"_2":""}`,ee=`min_row${B?"_2":""}`,Y=`colspan${B?"_2":""}`,$=`rowspan${B?"_2":""}`,le={w:D?K[ne]:K[Y],h:D?K[ee]:K[$]};if(m.willItFit(0,0,le.w,le.h,!0)){const ie=m.addWidget(le),ue=Number(ie.getAttribute("gs-x")||0),he=Number(ie.getAttribute("gs-y")||0);m.removeWidget(ie);const ae=O.get(K.id),de=r.reactive({...JSON.parse(JSON.stringify(ae.props))||{},_isReactive:!0}),ce=r.reactive({pageId:j,grid:m,page:n.page,view:{name:K.name,title:K.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ue,y:he,w:le.w,h:le.h,maxWidth:K.max_column,maxHeight:K.max_row,minWidth:K.min_column,minHeight:K.min_row,componentName:ae.componentName,componentProps:de,pageId:j,coreView:K}});X.addView(ce),qa.emit("add-page-view",ce)}else qa.emit("add-page-and-view",{pageId:j,view:K,filterAndWidgetContainer:X})}}function L(j){if(m){const K=document.querySelector(`[gs-id="${j.id}"]`);K&&(m.removeWidget(K),l("delete-view",j))}}function C(j){if(!j.filterAndViewsContainer&&j.coreView){const K=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[j],j.coreView.id,j.dynamicFilters||[],n.isPostMatch,n.isTemplateMode,j.filtersJSON,null,j.filters);j.filterAndViewsContainer=K}l("edit-view",j)}function q(){l("delete-page",n.page)}function N(){qa.emit("change-sort",n.page)}function P(j){if(d)return;const K=n.page.items.find(X=>X.id===j.itemId||X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function S(j){if(d)return;const K=n.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function E(j){if(d)return;const K=n.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps||{}),K._updateKey=Date.now())}const W=function(){qa.off("add-view",z),qa.off("force-component-update",P),qa.off("component-props-updated",S),qa.off("dynamic-filters-changed",E);const j=document.querySelector(".container-main");j&&j.removeEventListener("scroll",p),b&&clearTimeout(b),o&&clearTimeout(o)};return qa.on("add-view",z),qa.on("force-component-update",P),qa.on("component-props-updated",S),qa.on("dynamic-filters-changed",E),r.onMounted(async()=>{await r.nextTick(),m=vi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${n.id}`),m.on("change",(j,K)=>{const X=K[0];if(X){const D=t.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),x(),n.page.grid=m,n.page.offListeners=W}),r.onUnmounted(()=>{v&&v.disconnect(),W(),b&&clearTimeout(b),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",h),document.removeEventListener("programmatic-scroll-end",c)}),(j,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"templatePage",ref:g,class:"template-page"},[r.createElementVNode("div",D5e,[f.value?(r.openBlock(),r.createBlock(CN,{key:0,"options-type":"page",onClick:K[0]||(K[0]=r.withModifiers(X=>f.value=!1,["self"])),onMouseleave:K[1]||(K[1]=X=>f.value=!1),onCloseTooltip:K[2]||(K[2]=X=>f.value=!1),onDeletePage:q,onChangeSort:N})):r.createCommentVNode("",!0),r.createElementVNode("div",J5e,[K[4]||(K[4]=r.createElementVNode("div",null,[r.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),K[5]||(K[5]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:w},null,40,B5e)]),r.createElementVNode("div",G5e,[r.createElementVNode("div",Z5e,[r.createElementVNode("div",H5e,[_.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",Y5e,[r.createElementVNode("img",{src:_.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,Q5e)])):(r.openBlock(),r.createElementBlock("svg",$5e,[...K[6]||(K[6]=[r.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)])])),r.createElementVNode("span",null,r.toDisplayString(_.value.homeTeam.name),1)]),K[8]||(K[8]=r.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),r.createElementVNode("div",e_e,[r.createElementVNode("span",null,r.toDisplayString(_.value.awayTeam.name),1),_.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",t_e,[r.createElementVNode("img",{src:_.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,r_e)])):(r.openBlock(),r.createElementBlock("svg",n_e,[...K[7]||(K[7]=[r.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?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:K[3]||(K[3]=X=>f.value=!0)},[...K[9]||(K[9]=[r.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)])])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",a_e,[r.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.page.items,X=>{var D,H,re;return r.openBlock(),r.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!n.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[r.createElementVNode("div",{class:r.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[r.createVNode(E5e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((H=X.componentProps)==null?void 0:H.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((re=X==null?void 0:X.coreView)==null?void 0:re.id)||0,onEdit:B=>C(X),onDelete:B=>L(X)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(U(X.componentName)),r.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._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,o_e)}),128))],8,i_e)])],512))}}),l_e=Bc(s_e,[["__scopeId","data-v-d2aac648"]]),c_e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},u_e={key:0,class:"cover__main-logo cover__main-logo__home"},d_e={key:0,class:"team-logo"},p_e=["src"],h_e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f_e=["fill"],m_e={key:1,class:"cover__main-logo cover__main-logo__away"},y_e={key:0,class:"team-logo"},g_e=["src"],v_e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b_e=["fill"],x_e={class:"cover__title-subtitle"},w_e={class:"cover__title-subtitle__title"},__e={class:"cover__title-subtitle__subtitle"},S_e={key:2,class:"cover-type-one"},T_e={class:"team-info-one"},k_e={class:"team-data"},N_e={key:0,class:"team-logo"},V_e=["src"],O_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},L_e=["fill","opacity"],U_e={class:"team-name"},q_e={key:0,class:"team-events"},z_e={class:"score-one"},C_e={key:0},P_e={class:"team-info-one"},E_e={class:"team-data"},R_e={key:0,class:"team-logo"},W_e=["src"],M_e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},F_e=["fill","opacity"],j_e={class:"team-name"},K_e={key:0,class:"team-events"},A_e={key:3,class:"cover-type-two"},I_e={class:"team-data"},X_e={class:"team-info"},D_e={key:0,class:"team-logo"},J_e=["src"],B_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G_e=["fill","opacity"],Z_e={key:2,class:"team-score-two"},H_e={key:0,class:"team-goals"},Y_e={class:"team-data"},Q_e={class:"team-info"},$_e={key:0,class:"team-score-two"},eSe={key:1,class:"team-logo"},tSe=["src"],rSe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nSe=["fill","opacity"],aSe={key:0,class:"team-goals"},iSe={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:a}){const i=e,k=a,F=r.ref(null),g=r.computed(()=>[1,2].includes(i.coverId)),m=r.computed(()=>[1,3].includes(i.coverId)),n=r.computed(()=>i.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:i.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),f=r.computed(()=>i.game&&i.game.score?i.game.score:["0","0"]),l=r.computed(()=>{var U,z,L,C,q,N,P,S;if(i.game&&i.game.homeTeam&&i.game.awayTeam){const E={homeTeam:{name:((U=i.game.homeTeam)==null?void 0:U.acronym)||"LOC",logo:((z=i.game.homeTeam)==null?void 0:z.logo)||null},awayTeam:{name:((L=i.game.awayTeam)==null?void 0:L.acronym)||"VIS",logo:((C=i.game.awayTeam)==null?void 0:C.logo)||null}};return g.value?(E.homeTeam.goalsMinutes=o(i.game.minutes.home_goals_minutes),E.homeTeam.totalYellowCards=((q=i.game.minutes.home_yellow_cards_minutes)==null?void 0:q.length)||0,E.homeTeam.totalRedCards=((N=i.game.minutes.home_red_cards_minutes)==null?void 0:N.length)||0,E.awayTeam.goalsMinutes=o(i.game.minutes.visiting_goals_minutes),E.awayTeam.totalYellowCards=((P=i.game.minutes.away_yellow_cards_minutes)==null?void 0:P.length)||0,E.awayTeam.totalRedCards=((S=i.game.minutes.away_red_cards_minutes)==null?void 0:S.length)||0):(E.homeTeam.goalsEvents=d(i.game.report_minutes.home_goals_minutes),E.awayTeam.goalsEvents=d(i.game.report_minutes.visiting_goals_minutes)),E}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'"}]}}}),t=r.computed(()=>({"--background-image":m.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":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":i.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":i.isPostMatch?"100%":"fit-content"})),_=r.computed(()=>i.isPostMatch?"Postmatch":"Prematch"),v=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],b=r.computed(()=>{if(i.game){let U=c_e[i.game.matchday_abbreviation];U||(U=i.game.matchday_abbreviation.replace("M","J"));const[z,L,C]=i.game.date.split("-");return`${U} - ${C} ${v[Number(L)-1]}, ${z}`}return"Jornada - Día 00 Mes"});function d(U){return!U||!Array.isArray(U)||U.length===0?"":U.map(z=>{const L=z.split(", ");let C=L[0].replace("'","");C=C.replace("+",""),C=C.replace("’","");const q=C.split(" "),{strings:N,numbers:P}=q.reduce((W,j)=>(isNaN(Number(j))?W.strings.push(j):W.numbers.push(j),W),{strings:[],numbers:[]}),S=N.join(" "),E=P.length===1?`${P[0]}'`:`${P[0]}' ${P.slice(1).join(" + ")}'`;return{playerName:S,goalTime:L.length===1?E:`${E}, ${L.reduce((W,j,K)=>K===0?W:`${W}${j}${K<L.length-1?", ":""}`,"")}`}})}function o(U){return!U||!Array.isArray(U)||U.length===0?"":U.reduce((z,L,C)=>{const q=L.split(" ");let N="";return q.length===3?N=q[2]:q.length===5&&(N=`${q[2]} ${q[3]} ${q[4]}`),N&&(z+=`${N}${C<U.length-1?", ":""}`),z},"")}let s=null,h=null,c=!1,p=null,x=!1;const w=()=>{x=!0},T=()=>{x=!1};function V(){x||(c=!0,p&&clearTimeout(p),p=setTimeout(()=>{c=!1},150))}function O(){const U={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(C=>{C.forEach(q=>{if(c){h&&clearTimeout(h),h=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},100);return}h&&clearTimeout(h),h=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},50)})},U);const z=F.value;z&&s.observe(z);const L=document.querySelector(".container-main");L&&L.addEventListener("scroll",V,{passive:!0}),document.addEventListener("programmatic-scroll-start",w),document.addEventListener("programmatic-scroll-end",T)}return r.onMounted(()=>{O()}),r.onUnmounted(()=>{s&&s.disconnect();const U=document.querySelector(".container-main");U&&U.removeEventListener("scroll",V),document.removeEventListener("programmatic-scroll-start",w),document.removeEventListener("programmatic-scroll-end",T),h&&clearTimeout(h),p&&clearTimeout(p)}),(U,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"coverPage",ref:F,class:"cover",style:r.normalizeStyle(t.value)},[g.value?(r.openBlock(),r.createElementBlock("div",u_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",d_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,p_e)])):(r.openBlock(),r.createElementBlock("svg",h_e,[r.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:n.value.homeTeam},null,8,f_e)]))])):r.createCommentVNode("",!0),g.value?(r.openBlock(),r.createElementBlock("div",m_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",y_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,g_e)])):(r.openBlock(),r.createElementBlock("svg",v_e,[r.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:n.value.awayTeam},null,8,b_e)]))])):r.createCommentVNode("",!0),r.createElementVNode("div",x_e,[r.createElementVNode("div",w_e,[z[0]||(z[0]=r.createElementVNode("div",null,"Análisis",-1)),r.createElementVNode("div",null,r.toDisplayString(_.value),1)]),r.createElementVNode("div",__e,r.toDisplayString(b.value),1)]),g.value?(r.openBlock(),r.createElementBlock("div",S_e,[r.createElementVNode("div",T_e,[r.createElementVNode("div",k_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",N_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,V_e)])):(r.openBlock(),r.createElementBlock("svg",O_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,L_e)])),r.createElementVNode("div",U_e,r.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",q_e,[z[1]||(z[1]=r.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)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.goalsMinutes),1),z[2]||(z[2]=r.createElementVNode("div",{class:"separator"},null,-1)),z[3]||(z[3]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalYellowCards),1),z[4]||(z[4]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalRedCards),1)])):r.createCommentVNode("",!0)]),r.createElementVNode("div",z_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",C_e,r.toDisplayString(f.value[0])+" : "+r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0)]),r.createElementVNode("div",P_e,[r.createElementVNode("div",E_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",R_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,W_e)])):(r.openBlock(),r.createElementBlock("svg",M_e,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,F_e)])),r.createElementVNode("div",j_e,r.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",K_e,[r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalYellowCards),1),z[5]||(z[5]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalRedCards),1),z[6]||(z[6]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),z[7]||(z[7]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.goalsMinutes),1),z[8]||(z[8]=r.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))])):r.createCommentVNode("",!0)])])):(r.openBlock(),r.createElementBlock("div",A_e,[r.createElementVNode("div",I_e,[r.createElementVNode("div",X_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",D_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,J_e)])):(r.openBlock(),r.createElementBlock("svg",B_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,G_e)])),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",Z_e,r.toDisplayString(f.value[0]),1)):r.createCommentVNode("",!0)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",H_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.homeTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-${C}`,class:"goal"},[r.createElementVNode("div",null,r.toDisplayString(L.playerName),1),z[9]||(z[9]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[10]||(z[10]=r.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))])):r.createCommentVNode("",!0)]),z[13]||(z[13]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",Y_e,[r.createElementVNode("div",Q_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",$_e,r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0),l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",eSe,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,tSe)])):(r.openBlock(),r.createElementBlock("svg",rSe,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,nSe)]))]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",aSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.awayTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-a-${C}`,class:"goal"},[z[11]||(z[11]=r.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)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[12]||(z[12]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.playerName),1)]))),128))])):r.createCommentVNode("",!0)])]))],4))}},oSe=Bc(iSe,[["__scopeId","data-v-6680cbcf"]]),sSe={class:"table-category-filters"},lSe={key:0,class:"custom-radio-group filter-inline"},cSe={class:"radio-label"},uSe={class:"radio-options"},dSe=["name","value","onUpdate:modelValue","onClick"],pSe=["data-filter-type","onClick","onMousedown","onMouseup"],hSe={class:"select-display"},fSe={class:"select-label"},mSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},ySe={class:"simple-select-scroll-area"},gSe=["onClick"],vSe={class:"option-content"},bSe={class:"option-title"},xSe={key:0,class:"option-checkmark"},wSe={key:2,class:"filter-separator"},_Se={__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:a,emit:i}){const k=e,F=i,g=r.ref([]);let m=null;const n=(x,w)=>{if(!w)return!0;for(let T=0;T<x.length;T++)if(!f(x[T],w[T]))return!0;return!1},f=(x,w)=>{if(Array.isArray(x)&&Array.isArray(w)){if(x.length!==w.length)return!1;for(let T=0;T<x.length;T++)if(x[T]!==w[T])return!1;return!0}return x===w},l=r.ref(null),t=r.ref([]);let _=!1,v=null;const b=()=>{v=null},d=()=>{setTimeout(()=>{_=!1},1e3)},o=(x,w=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const T=k.filters[0].options,V=k.filters[1].options;x!=null?T.findIndex(O=>O.value===x)!==-1&&V[x]?(t.value=V[x],w&&!(()=>{const O=g.value[1];return O==null?!1:Array.isArray(O)?O.length>0:O!==""})()&&!_&&t.value.length>0&&(g.value[1]=t.value[0].value,r.nextTick(()=>{}))):(t.value=[],g.value[1]=null):(t.value=[],g.value[1]=null)}},s=()=>{k.initialValues&&k.initialValues.length>0?g.value=[...k.initialValues]:g.value=k.filters.map(x=>{var w,T,V,O;return x.type==="select"?[]:x.type==="check"?!1:x.type==="radio-button"?((T=(w=x.options)==null?void 0:w[0])==null?void 0:T.value)||null:x.type==="select-simple"&&((O=(V=x.options)==null?void 0:V[0])==null?void 0:O.value)||null}),k.componentId===13&&g.value.some(x=>x!=null&&(Array.isArray(x)?x.length>0:x!==!1&&x!==""))&&(m=[...g.value],F("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!_){const x=!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})();o(g.value[0],x)}})},300),r.watch(()=>k.initialValues,x=>{const w=!f(g.value,x),T=x&&x.length>0&&!_&&w,V=k.isEditMode&&_;T&&!V?g.value=[...x]:_?v&&v.length>0&&(g.value=[...v]):V&&v&&v.length>0&&(g.value=[...v])},{deep:!0}),r.watch(()=>k.isEditMode,(x,w)=>{w===!0&&x===!1&&b()},{immediate:!0}),r.watch(g,(x,w)=>{x.some(T=>T!=null&&(Array.isArray(T)?T.length>0:T!==!1&&T!==""))&&n(x,m)&&(m=[...x],F("filters-changed",{componentId:k.componentId,filters:x,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(x,w)=>{x!==w&&w!==void 0?o(x,!0):w===void 0&&x!==null&&x!==void 0&&o(x,!1)},{immediate:!0}),r.watch(()=>g.value,(x,w)=>{k.filters.map((T,V)=>T.type==="radio-button"?V:-1).filter(T=>T!==-1).forEach(T=>{})},{deep:!0}),r.watch(t,()=>{},{deep:!0});const h=x=>{l.value===x?l.value=null:l.value=x},c=(x,w)=>{if(_=!0,d(),g.value[x]=w,(x===0||x===1)&&(v=[...g.value]),l.value=null,x===0){g.value[1]!==void 0&&(g.value[1]=null);const T=_;_=!1,o(w,!0),_=T,g.value[1]!==null&&g.value[1]!==void 0&&(v=[...g.value])}},p=()=>{_=!0,setTimeout(()=>{_=!1},1e3)};return a({getCurrentValues:()=>g.value,initializeValues:s}),(x,w)=>(r.openBlock(),r.createElementBlock("div",sSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(T,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:V},[T.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",lSe,[r.createElementVNode("div",cSe,r.toDisplayString(T.label),1),r.createElementVNode("div",uSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(T.options,O=>(r.openBlock(),r.createElementBlock("label",{key:O.value,class:r.normalizeClass(["radio-option-card",{active:g.value[V]===O.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"table-radio-"+V,value:O.value,"onUpdate:modelValue":U=>g.value[V]=U,onChange:w[0]||(w[0]=()=>{p()}),onClick:U=>console.log("Click en radio button",V,O.value,"Valor actual:",g.value[V])},null,40,dSe),[[r.vModelRadio,g.value[V]]]),r.createElementVNode("span",null,r.toDisplayString(O.label),1)],2))),128))])])):T.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":T.type,onClick:r.withModifiers(O=>h(V),["stop"]),onMousedown:O=>console.log("Mouse down en selector",V),onMouseup:O=>console.log("Mouse up en selector",V)},[r.createElementVNode("div",hSe,[w[2]||(w[2]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",fSe,r.toDisplayString(T.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:l.value===V}])},[...w[1]||(w[1]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===V?(r.openBlock(),r.createElementBlock("div",mSe,[r.createElementVNode("div",ySe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V===1?t.value:T.options,O=>(r.openBlock(),r.createElementBlock("div",{key:O.value,class:r.normalizeClass(["option-card simple-select-option",{active:f(g.value[V],O.value)}]),onClick:r.withModifiers(U=>c(V,O.value),["stop"])},[r.createElementVNode("div",vSe,[r.createElementVNode("div",bSe,r.toDisplayString(O.label),1)]),f(g.value[V],O.value)?(r.openBlock(),r.createElementBlock("div",xSe,[...w[3]||(w[3]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,gSe))),128))])])):r.createCommentVNode("",!0)],40,pSe)):r.createCommentVNode("",!0),V===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",wSe)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},SSe=Bc(_Se,[["__scopeId","data-v-9d00f072"]]),TSe={class:"strengths-filters"},kSe={key:0,class:"custom-radio-group filter-inline"},NSe={class:"radio-label"},VSe={class:"radio-options"},OSe=["name","value","onUpdate:modelValue"],LSe={class:"filter-inline select-with-label"},USe=["data-filter-type","onClick"],qSe={class:"select-display"},zSe={class:"select-label"},CSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},PSe={class:"simple-select-scroll-area"},ESe=["onClick"],RSe={class:"option-content"},WSe={class:"option-title"},MSe={key:0,class:"option-checkmark"},FSe={key:2,class:"filter-separator"},jSe={__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:a,emit:i}){const k=e,F=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref([]);let l=!1,t=null;const _=(h,c)=>{if(Array.isArray(h)&&Array.isArray(c)){if(h.length!==c.length)return!1;for(let p=0;p<h.length;p++)if(h[p]!==c[p])return!1;return!0}return h===c},v=(h,c=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const p=k.filters[0].options,x=k.filters[1].options;h!=null?p.findIndex(w=>w.value===h)!==-1&&x[h]?(f.value=x[h],c&&!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})()&&!l&&f.value.length>0&&(g.value[1]=f.value[0].value,r.nextTick(()=>{}))):(f.value=[],g.value[1]=null):(f.value=[],g.value[1]=null)}},b=()=>{if(k.initialValues&&k.initialValues.length>0){const c=k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",c),c?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",k.initialValues),g.value=[...k.initialValues]):k.isEditMode?g.value=k.filters.map((p,x)=>{var w,T,V,O,U,z,L,C,q,N;const P=k.initialValues[x];if(console.log(`StrengthsFilters initializeValues - filter[${x}]:`,p==null?void 0:p.type,"filterData:",P),!P)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${x}, usando valor por defecto`),p.type==="select"?[]:p.type==="check"?!1:p.type==="radio-button"?((T=(w=p.options)==null?void 0:w[0])==null?void 0:T.value)||null:p.type==="select-simple"&&((O=(V=p.options)==null?void 0:V[0])==null?void 0:O.value)||null;if(p.type==="radio-button"&&P.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",P.selectedOption,"index:",x);const S=P.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",S),S}else{if(p.type==="radio-button"&&!P.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",P,"index:",x),P.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",P.selectedValue),P.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((z=(U=p.options)==null?void 0:U[0])==null?void 0:z.value)||null);if(p.type==="select-simple"&&P.selectedValue!==void 0)return Array.isArray(P.selectedValue)?P.selectedValue[0]:P.selectedValue;if(p.type==="select"&&P.selectedOptions)return P.selectedOptions.map(S=>S.value);if(p.type==="check"&&P.isChecked!==void 0)return P.isChecked}return P.selectedValue!==void 0?P.selectedValue:p.type==="select"?[]:p.type==="check"?!1:p.type==="radio-button"?((C=(L=p.options)==null?void 0:L[0])==null?void 0:C.value)||null:p.type==="select-simple"&&((N=(q=p.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]}else g.value=k.filters.map(c=>{var p,x,w,T;return c.type==="select"?[]:c.type==="check"?!1:c.type==="radio-button"?((x=(p=c.options)==null?void 0:p[0])==null?void 0:x.value)||null:c.type==="select-simple"&&((T=(w=c.options)==null?void 0:w[0])==null?void 0:T.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",g.value);const h=g.value.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",h),h&&(m=[...g.value],F("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};b(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!l){const h=!(()=>{const c=g.value[1];return c==null?!1:Array.isArray(c)?c.length>0:c!==""})();v(g.value[0],h)}})},300),r.watch(()=>k.initialValues,(h,c)=>{if(!h||h.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",h),console.log("StrengthsFilters watch initialValues - oldValues:",c),console.log("StrengthsFilters watch initialValues - props.isEditMode:",k.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const p=h.length>0&&(typeof h[0]=="number"||typeof h[0]=="boolean"||h[0]===null||Array.isArray(h[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",p);const x=!_(g.value,h),w=h&&h.length>0&&!l&&x,T=k.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",x,"shouldUpdate:",w,"isEditModeProtection:",T),w&&!T?p?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",h),g.value=[...h]):k.isEditMode?g.value=k.filters.map((V,O)=>{const U=h[O];if(!U)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",O),g.value[O];if(V.type==="radio-button"&&U.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",U.selectedOption,"index:",O);const z=U.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",z),z}else{if(V.type==="select-simple"&&U.selectedValue!==void 0)return Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue;if(V.type==="select"&&U.selectedOptions)return U.selectedOptions.map(z=>z.value);if(V.type==="check"&&U.isChecked!==void 0)return U.isChecked}return U.selectedValue!==void 0?U.selectedValue:g.value[O]}):g.value=[...h]:l?t&&t.length>0&&(g.value=[...t]):T&&t&&t.length>0&&(g.value=[...t])},{deep:!0}),r.watch(()=>k.isEditMode,(h,c)=>{c===!0&&h===!1&&(t=null)},{immediate:!0}),r.watch(g,h=>{h.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""))&&(()=>{if(!m)return!0;for(let c=0;c<h.length;c++)if(!_(h[c],m[c]))return!0;return!1})()&&(m=[...h],F("filters-changed",{componentId:k.componentId,filters:h,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(h,c)=>{h!==c&&c!==void 0?v(h,!0):c===void 0&&h!==null&&h!==void 0&&v(h,!1)},{immediate:!0});const d=h=>{n.value===h?n.value=null:n.value=h},o=(h,c)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),g.value[h]=c,(h===0||h===1)&&(t=[...g.value]),n.value=null,h===0){g.value[1]!==void 0&&(g.value[1]=null);const p=l;l=!1,v(c,!0),l=p,g.value[1]!==null&&g.value[1]!==void 0&&(t=[...g.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return a({getCurrentValues:()=>g.value,initializeValues:b}),(h,c)=>(r.openBlock(),r.createElementBlock("div",TSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(p,x)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:x},[p.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",kSe,[r.createElementVNode("div",NSe,r.toDisplayString(p.label),1),r.createElementVNode("div",VSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.options,w=>(r.openBlock(),r.createElementBlock("label",{key:w.value,class:r.normalizeClass(["radio-option-card",{active:g.value[x]===w.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"strengths-radio-"+x,value:w.value,"onUpdate:modelValue":T=>g.value[x]=T,onChange:s},null,40,OSe),[[r.vModelRadio,g.value[x]]]),r.createElementVNode("span",null,r.toDisplayString(w.label),1)],2))),128))])])):p.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[c[4]||(c[4]=r.createElementVNode("div",{class:"filter-separator"},null,-1)),r.createElementVNode("div",LSe,[c[3]||(c[3]=r.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":p.type,onClick:r.withModifiers(w=>d(x),["stop"])},[r.createElementVNode("div",qSe,[c[1]||(c[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",zSe,r.toDisplayString(p.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===x}])},[...c[0]||(c[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===x?(r.openBlock(),r.createElementBlock("div",CSe,[r.createElementVNode("div",PSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.options,w=>(r.openBlock(),r.createElementBlock("div",{key:w.value,class:r.normalizeClass(["option-card simple-select-option",{active:_(g.value[x],w.value)}]),onClick:r.withModifiers(T=>o(x,w.value),["stop"])},[r.createElementVNode("div",RSe,[r.createElementVNode("div",WSe,r.toDisplayString(w.label),1)]),_(g.value[x],w.value)?(r.openBlock(),r.createElementBlock("div",MSe,[...c[2]||(c[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,ESe))),128))])])):r.createCommentVNode("",!0)],8,USe)])],64)):r.createCommentVNode("",!0),x===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",FSe)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},KSe=Bc(jSe,[["__scopeId","data-v-4c3876bd"]]),ASe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,F]of a)i[k]=F;return i},ISe={key:1},XSe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DSe=["fill"],JSe={key:0,class:"checkbox__teams"},BSe={class:"checkbox__teams__logo"},GSe=["src"],ZSe={class:"checkbox__teams__logo"},HSe=["src"],YSe={__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:a}){const i=e;r.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const k=r.ref(!1),F=r.computed(()=>{const l={color:i.boxValueColor,"font-family":i.fontFamily,height:i.boxWidthAndHeight,width:i.boxWidthAndHeight,minWidth:i.boxWidthAndHeight,"border-radius":i.boxBorderRadius,"margin-top":i.boxMarginTop};return k.value?(l["background-color"]=i.boxBackgroundColor,l.border=`solid ${i.boxBorderWidth} ${i.boxBackgroundColor}`):l.border=`solid ${i.boxBorderWidth} ${i.boxBorderColor}`,l}),g=r.computed(()=>({"font-family":i.boxValueFontFamily,"font-size":i.boxValueFontSize,color:i.boxValueColor,"line-height":1})),m=r.computed(()=>{const l={color:i.labelColor,"font-family":i.fontFamily,"font-size":i.labelFontSize,"white-space":i.labelWhiteSpace,"text-align":i.boxPosition==="top"||i.boxPosition==="bottom"?"center":i.boxPosition};return(i.boxPosition==="left"||i.boxPosition==="right")&&(l[`margin-${i.boxPosition}`]=i.isBoxOnly?"0":i.teamsIds?"8px":"10px"),l});r.watch(()=>i.modelValue,l=>{l!==k.value&&(k.value=l)},{immediate:!0});function n(){i.avoidInteraction||!k.value&&i.avoidToCheck||(k.value=!k.value,a("update:modelValue",k.value))}function f(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,t)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:n},[r.createElementVNode("div",{class:"checkbox__box",style:r.normalizeStyle(F.value)},[k.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.boxValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"checkbox__box__value",style:r.normalizeStyle(g.value)},r.toDisplayString(e.boxValue),5)):(r.openBlock(),r.createElementBlock("div",ISe,[(r.openBlock(),r.createElementBlock("svg",XSe,[r.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,DSe)]))]))],64)):r.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(r.openBlock(),r.createElementBlock("div",JSe,[r.createElementVNode("div",BSe,[r.createElementVNode("img",{src:f(e.teamsIds[0]),alt:""},null,8,GSe)]),r.createElementVNode("div",ZSe,[r.createElementVNode("img",{src:f(e.teamsIds[1]),alt:""},null,8,HSe)])])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"checkbox__label",style:r.normalizeStyle(m.value)},r.toDisplayString(e.label),5)],2))}},FN=ASe(YSe,[["__scopeId","data-v-b6f124d8"]]),QSe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,F]of a)i[k]=F;return i},k5={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))}}},jN=()=>{r.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}))},KN=k5.setup;k5.setup=KN?(e,a)=>(jN(),KN(e,a)):jN;const $Se=e=>(r.pushScopeId("data-v-f3ee6b2b"),e=e(),r.popScopeId(),e),eTe=["src"],tTe={key:1,class:"text"},rTe=["src"],nTe={class:"stats"},aTe=$Se(()=>r.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),iTe={class:"numstats"},oTe={class:"leyend"};function sTe(e,a,i,k,F,g){return r.openBlock(),r.createElementBlock("div",null,[i.type==0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["button",F.status&&i.typeOnOff&&"button-active"]),style:r.normalizeStyle([g.customStyle,F.status&&i.typeOnOff&&g.customActive]),onClick:a[0]||(a[0]=(...m)=>g.btnClick&&g.btnClick(...m))},[i.icon&&i.iconPosition.toLowerCase()==="left"?(r.openBlock(),r.createElementBlock("img",{key:0,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,eTe)):r.createCommentVNode("",!0),i.textValue?(r.openBlock(),r.createElementBlock("div",tTe,r.toDisplayString(i.textValue),1)):r.createCommentVNode("",!0),i.icon&&i.iconPosition.toLowerCase()==="right"?(r.openBlock(),r.createElementBlock("img",{key:2,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,rTe)):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0),i.type==1?(r.openBlock(),r.createElementBlock("div",{key:1,class:"button-target",onClick:a[1]||(a[1]=(...m)=>g.btnClick&&g.btnClick(...m))},[r.createElementVNode("div",nTe,[aTe,r.createElementVNode("div",iTe,r.toDisplayString(i.textStat),1)]),r.createElementVNode("div",oTe,r.toDisplayString(i.textCategory),1)])):r.createCommentVNode("",!0)])}const lTe=QSe(k5,[["render",sTe],["__scopeId","data-v-f3ee6b2b"]]),cTe={class:"gsc-dropdown__main-container__item-selected"},uTe=["height","width"],dTe=["stroke"],pTe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},hTe=["fill"],fTe={class:"gsc-dropdown__items-container"},mTe=["onClick"],yTe={key:0,class:"gsc-dropdown__items-footer"},b2={__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(a=>a 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:a}){const i=e,k=r.ref({}),F=r.ref(null),g=r.ref(i.isMultipleOption?-1:0),m=r.ref(!1);r.watch(()=>i.items,(b,d)=>{if(!i.modelValue&&(!i.onlyFirstTime||!d||!d.length)&&b&&b.length){if(i.defaultItemByProp){const o=i.items.findIndex(s=>s[i.defaultItemByProp.propName]===i.defaultItemByProp.value);o!==-1?(g.value=o,k.value=b[o]):(g.value=0,k.value=b[0])}else k.value=b[i.defaultItemByIndex];a("input",k.value)}},{immediate:!0}),r.watch(()=>i.modelValue,b=>{if(b){const d=i.items.findIndex(o=>typeof b=="object"?JSON.stringify(o)===JSON.stringify(b):o===b);d!==-1&&(g.value=d,k.value=i.items[d],a("update:modelValue",k.value))}},{immediate:!0});const n=r.computed(()=>({height:i.height,width:i.width,backgroundColor:i.backgroundColor,borderRadius:`${i.borderRadius}px`,border:`${i.borderType} ${i.borderWidth}px ${i.borderColor}`,color:i.color,"--hover-background-color":i.hoverBackgroundColor,"--list-container-padding":i.listContainerPadding,"--list-item-padding":i.listItemPadding,"--list-item-margin":i.listItemMargin,"--list-background-color":i.listBackgroundColor,"--list-height":i.listHeight,"--list-item-border-radius":i.listItemBorderRadius,"--list-item-selected-color":i.listItemSelectedColor,"--list-item-selected-background-color":i.listItemSelectedBackgroundColor,"--list-item-color":i.listItemColor,"--list-border-radius":`${i.listBorderRadius}`,"--list-border-color":i.listBorderColor,"--list-width":i.isListSameWidth?i.width:"fit-content","--list-border-width":`${i.listBorderWidth}px`,"--list-margin-top":i.listMarginTop,"--list-left":i.listAlignment==="left"?"0":"auto","--list-right":i.listAlignment==="right"?"0":"auto","--footer-border":`${i.footerBorderWidth}px solid ${i.footerBorderColor}`,"--dropdown-opacity":i.isDisabled?"0.5":"1","--dropdown-cursor":i.isDisabled?"not-allowed":"pointer","--dropdown-font-size":i.fontSize?i.fontSize:"14px"})),f=r.computed(()=>({height:`${i.arrowHeight}px`,width:`${i.arrowWidth}px`}));function l(){i.isDisabled||(m.value=!m.value)}function t(b){F.value&&!F.value.contains(b.target)&&(m.value=!1)}function _(b,d){i.isMultipleOption?g.value=-1:(g.value=d,m.value=!1),k.value=b,a("input",k.value),a("update:modelValue",k.value)}function v(){m.value=!1,a("click-ready")}return r.onMounted(()=>{document.addEventListener("click",t)}),r.onBeforeMount(()=>{document.removeEventListener("click",t)}),(b,d)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"dropDown",ref:F,class:"gsc-dropdown",style:r.normalizeStyle(n.value)},[r.createElementVNode("div",{class:"gsc-dropdown__main-container",style:r.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[r.createElementVNode("div",cTe,[r.renderSlot(b.$slots,"default",{selectedItem:k.value})]),r.createElementVNode("div",{class:r.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":m.value}]),style:r.normalizeStyle(f.value)},[e.iconType===1?(r.openBlock(),r.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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,dTe)],8,uTe)):(r.openBlock(),r.createElementBlock("svg",pTe,[r.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,hTe)]))],6)],4),r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",fTe,[r.createElementVNode("div",null,[r.createElementVNode("div",{class:"gsc-dropdown__items",style:r.normalizeStyle({"margin-top":`${i.borderWidth}px`})},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.items,(o,s)=>(r.openBlock(),r.createElementBlock("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["gsc-dropdown__items__item",{selected:s===g.value}]),key:s,onClick:h=>_(o,s)},[r.renderSlot(b.$slots,"availableItem",{item:o})],10,mTe)),[[r.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(r.openBlock(),r.createElementBlock("div",yTe,[r.createVNode(r.unref(lTe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:v})])):r.createCommentVNode("",!0)])],512),[[r.vShow,m.value]])]),_:3})],4))}},AN={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},gTe=[{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"}}],vTe=[{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}}],bTe={class:"last-touch"},xTe={class:"selected-item"},wTe={class:"available-item"},_Te={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},STe={class:"selected-item"},TTe={class:"available-item"},kTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},NTe={key:1},VTe={class:"selected-item"},OTe={class:"available-item"},LTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},UTe={class:"last-touch__how-many-games"},qTe={class:"selected-item"},zTe={class:"available-item"},CTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},PTe={__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:a}){const i=e,k=a,F=r.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),g=r.ref({id:0,name:"Fases de juego",value:null}),m=r.ref(!1),n=r.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),f=r.ref(i.defaultFilters?null:n.value[0]),l=r.ref(null),t=r.computed(()=>({...AN})),_=r.computed(()=>({...AN,isFooterVisible:!i.isEditMode,isMultipleOption:!i.isEditMode})),v=r.computed(()=>{const K=[];return b.value.options.forEach(X=>{X.forEach(D=>{K.push(D)})}),K}),b=r.ref(null),d=r.ref(null),o=r.ref(null),s=r.ref(null);r.watch(()=>i.viewConfig,K=>{K.filters&&(b.value||h(),d.value||c(),o.value||p(),s.value||V())},{immediate:!0});function h(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="categories");K&&K.options&&(b.value={label:K.label,options:Object.entries(K.options).reduce((X,[D,H])=>(X.set(Number(D),H),X),new Map)})}b.value={label:"Tipo de jugada",options:new Map([[2,vTe],[3,gTe]])}}function c(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="gamePhases");if(K){d.value={label:K.label,options:K.options};return}}d.value={label:"Fases de juego",options:F.value}}function p(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="teamRadios");if(K){o.value={options:K.options},q(null,K.options[0]);return}}o.value={label:"Equipo",options:i.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},q(null,o.value.options[0])}const x=r.ref(i.defaultFilters?null:o.value.options[0]),w=r.ref(i.defaultFilters?null:d.value.options[0]),T=r.ref(i.defaultFilters?null:b.value.options.get(w.value.value)[0]);function V(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(K){s.value={label:K.label},N(K.value);return}}s.value={label:"Zona de asistencia"}}const O=r.computed(()=>{const K={selectedGamePhase:w.value,selectedTeam:x.value,isAssistZoneVisible:m.value,howManyGamesSelected:f.value};return i.isEditMode?(K.selectedCategory=T.value,K.totalCategoriesSelected=1):(K.selectedCategories=l.value,K.totalCategoriesSelected=0,b.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(K.totalCategoriesSelected+=1)})})),K}),U=r.computed(()=>w.value?b.value.options.get(w.value.value)||[]:[]);r.watch(()=>O.value,K=>{z()&&(console.log("before emit change:",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}),k("change",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}))},{deep:!0});function z(){return w.value&&(i.isEditMode&&T.value||!i.isEditMode&&l.value&&l.value.length)&&x.value&&f.value}function L(K){w.value=K,S(null)}function C(K){x.value=K}function q(K,X){console.log("onChangeRadio:",X.value)}function N(K){m.value=K}function P(K){f.value=K}function S(K){T.value=K}function E(K,X){X.isSelected=K,l.value=v.value.filter(D=>D.isSelected)}function W(){i.defaultFilters&&(m.value=i.defaultFilters.isAssistZoneVisible,f.value=n.value.find(K=>K.value===i.defaultFilters.howManyGamesSelected.value)||n.value[0],w.value=d.value.options.find(K=>K.value===i.defaultFilters.selectedGamePhase.value)||d.value.options[0],x.value=o.value.options.find(K=>K.value===(i.defaultFilters.isHomeTeam?1:2))||o.value.options[0],T.value=b.value.options.get(w.value.value).find(K=>K.value.name===i.defaultFilters.selectedCategory.name)||b.value.options.get(w.value.value)[0])}function j(){U.value.forEach(K=>{K.isSelected=!1}),m.value=!1,f.value=n.value[0],w.value=null,x.value=null,T.value=null,l.value=null}return r.onBeforeUnmount(()=>{j()}),r.onMounted(()=>{setTimeout(()=>{W()},500)}),(K,X)=>(r.openBlock(),r.createElementBlock("div",bTe,[r.createVNode(r.unref(b2),r.mergeProps(t.value,{items:d.value.options,"model-value":w.value,"onUpdate:modelValue":L}),{default:r.withCtx(()=>[r.createElementVNode("div",xTe,[X[0]||(X[0]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(w.value?w.value.label:d.value.label||g.value.name),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",wTe,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",_Te,[...X[1]||(X[1]=[r.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)),[[r.vShow,w.value&&w.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(b2),r.mergeProps(_.value,{items:U.value,"model-value":T.value,"onUpdate:modelValue":S}),{default:r.withCtx(()=>[r.createElementVNode("div",STe,[X[2]||(X[2]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(b.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",TTe,[e.isEditMode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",kTe,[...X[3]||(X[3]=[r.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)),[[r.vShow,T.value&&T.value.label===D.label]])])],64)):(r.openBlock(),r.createElementBlock("div",NTe,[r.createVNode(r.unref(FN),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":H=>E(H,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(b2),r.mergeProps(t.value,{items:o.value.options,"model-value":x.value,"onUpdate:modelValue":C}),{default:r.withCtx(()=>[r.createElementVNode("div",VTe,[X[4]||(X[4]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(x.value?x.value.label:o.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",OTe,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",LTe,[...X[5]||(X[5]=[r.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)),[[r.vShow,x.value&&x.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(FN),{"model-value":m.value,label:s.value.label,"onUpdate:modelValue":N},null,8,["model-value","label"]),r.withDirectives(r.createElementVNode("div",UTe,[r.createVNode(r.unref(b2),r.mergeProps(t.value,{items:n.value,"model-value":f.value,"onUpdate:modelValue":P}),{default:r.withCtx(()=>[r.createElementVNode("div",qTe,[X[6]||(X[6]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(f.value?f.value.name:"Seleccione"),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",zTe,[r.createElementVNode("div",null,r.toDisplayString(D.name),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",CTe,[...X[7]||(X[7]=[r.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)),[[r.vShow,f.value&&f.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[r.vShow,!e.isPostMatch]])]))}},ETe=Bc(PTe,[["__scopeId","data-v-b006bd89"]]),RTe={class:"resultados-filter"},WTe={class:"filter-checkboxes"},MTe=["checked","onChange"],FTe={class:"checkbox-label"},jTe={class:"filter-actions"},KTe={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[{label:"Iba ganando",value:"winning"},{label:"Iba perdiendo",value:"losing"},{label:"Iba empatado",value:"tied"}]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",RTe,[r.createElementVNode("div",WTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,MTe),r.createElementVNode("span",FTe,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",jTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},x2=Bc(KTe,[["__scopeId","data-v-1fba7a5d"]]),ATe={class:"detalles-filter"},ITe={class:"filter-checkboxes"},XTe=["checked","onChange"],DTe={class:"checkbox-label"},JTe={class:"filter-actions"},BTe={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",ATe,[r.createElementVNode("div",ITe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,XTe),r.createElementVNode("span",DTe,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",JTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},N5=Bc(BTe,[["__scopeId","data-v-175921a6"]]),GTe={class:"como-fue-cobrado-filter"},ZTe={class:"filter-checkboxes"},HTe=["checked","onChange"],YTe={class:"checkbox-label"},QTe={class:"filter-actions"},$Te={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",GTe,[r.createElementVNode("div",ZTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,HTe),r.createElementVNode("span",YTe,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",QTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},w2=Bc($Te,[["__scopeId","data-v-905a2961"]]),e6e={class:"zona-filter"},t6e={class:"filter-checkboxes"},r6e=["checked","onChange"],n6e={class:"checkbox-label"},a6e={class:"filter-actions"},i6e={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",e6e,[r.createElementVNode("div",t6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,r6e),r.createElementVNode("span",n6e,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",a6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},V5=Bc(i6e,[["__scopeId","data-v-6fb0c545"]]),o6e={class:"que-sucedio-filter"},s6e={class:"filter-checkboxes"},l6e=["checked","onChange"],c6e={class:"checkbox-label"},u6e={class:"filter-actions"},d6e={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",o6e,[r.createElementVNode("div",s6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,l6e),r.createElementVNode("span",c6e,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",u6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},D1=Bc(d6e,[["__scopeId","data-v-ecc3baf0"]]),p6e={class:"advanced-select-accordion"},h6e=["onClick"],f6e={class:"accordion-header-left"},m6e={class:"accordion-icon"},y6e=["src","alt"],g6e={class:"accordion-title"},v6e={class:"accordion-header-right"},b6e={key:0,class:"accordion-badge"},x6e={key:0,class:"accordion-content"},w6e={class:"accordion-footer"},_6e={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:a}){const i=e,k=a,F=r.ref({}),g=_=>{F.value[_]?F.value[_]=!1:(Object.keys(F.value).forEach(v=>{F.value[v]=!1}),F.value[_]=!0)},m=_=>{const v=i.filter.options[_];if(!v||!v.filters)return 0;const b=i.selectedValues[i.filterIndex];if(!b||!b[_])return 0;const d=b[_];return Array.isArray(d)?d.length:0},n=(_,v)=>_.icon?_.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${v+1}.png`,f=_=>{const v={resultados:x2,detalles:N5,"como-fue-cobrado":w2,"como fue cobrado":w2,zona:V5,"que-sucedio":D1,"qué sucedió":D1,"que sucedio":D1},b=typeof _.value=="string"?_.value:String(_.value||""),d=typeof _.label=="string"?_.label:String(_.label||""),o=b.toLowerCase().trim(),s=d.toLowerCase().trim();if(o&&v[o])return v[o];if(s&&v[s])return v[s];const h=s.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,c=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[c]||c);return h&&v[h]?v[h]:x2},l=_=>{k("update-selection",{filterIndex:i.filterIndex,optionIndex:_.optionIndex,values:_.values})},t=()=>{k("close")};return(_,v)=>(r.openBlock(),r.createElementBlock("div",p6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filter.options,(b,d)=>(r.openBlock(),r.createElementBlock("div",{key:b.value||d,class:"accordion-item"},[r.createElementVNode("div",{class:"accordion-header",onClick:r.withModifiers(o=>g(d),["stop"])},[r.createElementVNode("div",f6e,[r.createElementVNode("span",m6e,[r.createElementVNode("img",{src:n(b,d),alt:b.label},null,8,y6e)]),r.createElementVNode("span",g6e,r.toDisplayString(b.label),1)]),r.createElementVNode("div",v6e,[m(d)>0?(r.openBlock(),r.createElementBlock("span",b6e,r.toDisplayString(m(d)),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["accordion-chevron",{open:F.value[d]}])},[...v[0]||(v[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,h6e),r.createVNode(r.Transition,{name:"accordion"},{default:r.withCtx(()=>[F.value[d]?(r.openBlock(),r.createElementBlock("div",x6e,[f(b)===x2?(r.openBlock(),r.createBlock(x2,{key:0,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===N5?(r.openBlock(),r.createBlock(N5,{key:1,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===w2?(r.openBlock(),r.createBlock(w2,{key:2,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===V5?(r.openBlock(),r.createBlock(V5,{key:3,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===D1?(r.openBlock(),r.createBlock(D1,{key:4,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),_:2},1024)]))),128)),r.createElementVNode("div",w6e,[v[1]||(v[1]=r.createElementVNode("div",{class:"footer-separator"},null,-1)),r.createElementVNode("button",{class:"btn-done-footer",onClick:r.withModifiers(t,["stop"])}," Listo ")])]))}},S6e=Bc(_6e,[["__scopeId","data-v-941aab18"]]),T6e={class:"corners-zone-filters"},k6e={key:0,class:"custom-radio-group"},N6e={class:"radio-label"},V6e={class:"radio-options"},O6e=["name","value","onUpdate:modelValue"],L6e={key:0,class:"filter-separator"},U6e={class:"filter-inline select-with-label"},q6e=["data-filter-type","onClick"],z6e={class:"select-display"},C6e={class:"select-label"},P6e={key:0,class:"dropdown-menu type-menu simple-select-menu"},E6e={class:"simple-select-scroll-area"},R6e=["onClick"],W6e={class:"option-content"},M6e={class:"option-title"},F6e={key:0,class:"option-checkmark"},j6e={class:"switch-group"},K6e={class:"switch-label"},A6e={key:0,class:"switch-text switch-text-left"},I6e=["onClick"],X6e={key:1,class:"switch-text switch-text-right"},D6e={key:0,class:"filter-separator"},J6e={key:3,class:"filter-inline advanced-select-wrapper"},B6e=["data-filter-type","onClick"],G6e={class:"select-display"},Z6e={class:"select-label"},H6e={key:0,class:"dropdown-menu type-menu advanced-select-menu"},Y6e={class:"advanced-select-content"},Q6e={__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:a,emit:i}){const k=e,F=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref(null),l=r.ref([]);let t=!1,_=null;const v=(U,z)=>{if(Array.isArray(U)&&Array.isArray(z)){if(U.length!==z.length)return!1;for(let L=0;L<U.length;L++)if(U[L]!==z[L])return!1;return!0}return U===z},b=(U,z=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const L=k.filters[0].options,C=k.filters[1].options;U!=null?L.findIndex(q=>q.value===U)!==-1&&C[U]?(l.value=C[U],z&&!(()=>{const q=g.value[1];return q==null?!1:Array.isArray(q)?q.length>0:q!==""})()&&!t&&l.value.length>0&&(g.value[1]=l.value[0].value,r.nextTick(()=>{}))):(l.value=[],g.value[1]=null):(l.value=[],g.value[1]=null)}},d=()=>{k.initialValues&&k.initialValues.length>0?k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]))?g.value=[...k.initialValues]:k.isEditMode?g.value=k.filters.map((U,z)=>{var L,C,q,N,P,S,E,W,j,K;const X=k.initialValues[z];return X?U.type==="radio-button"&&X.selectedOption?X.selectedOption.value:U.type==="radio-button"&&!X.selectedOption?X.selectedValue!==void 0?X.selectedValue:((S=(P=U.options)==null?void 0:P[0])==null?void 0:S.value)||null:U.type==="select-simple"&&X.selectedValue!==void 0?Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue:U.type==="select"&&X.selectedOptions?X.selectedOptions.map(D=>D.value):U.type==="check"&&X.isChecked!==void 0?X.isChecked:X.selectedValue!==void 0?X.selectedValue:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((W=(E=U.options)==null?void 0:E[0])==null?void 0:W.value)||null:U.type==="select-simple"?((K=(j=U.options)==null?void 0:j[0])==null?void 0:K.value)||null:U.type==="advanced-select"?{}:null:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((C=(L=U.options)==null?void 0:L[0])==null?void 0:C.value)||null:U.type==="select-simple"&&((N=(q=U.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]:g.value=k.filters.map(U=>{var z,L,C,q;return U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((L=(z=U.options)==null?void 0:z[0])==null?void 0:L.value)||null:U.type==="select-simple"?((q=(C=U.options)==null?void 0:C[0])==null?void 0:q.value)||null:U.type==="advanced-select"?{}:null}),g.value.some(U=>U!=null&&(Array.isArray(U)?U.length>0:typeof U=="object"&&!Array.isArray(U)?Object.keys(U).length>0:U!==!1&&U!==""))&&(m=[...g.value],F("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};d(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!t){const U=!(()=>{const z=g.value[1];return z==null?!1:Array.isArray(z)?z.length>0:z!==""})();b(g.value[0],U)}})},300),r.watch(()=>k.initialValues,U=>{if(!U||U.length===0)return;const z=U.length>0&&(typeof U[0]=="number"||typeof U[0]=="boolean"||U[0]===null||Array.isArray(U[0])),L=!v(g.value,U),C=U&&U.length>0&&!t&&L,q=k.isEditMode&&t;C&&!q?z?g.value=[...U]:k.isEditMode?g.value=k.filters.map((N,P)=>{const S=U[P];return S?N.type==="radio-button"&&S.selectedOption?S.selectedOption.value:N.type==="select-simple"&&S.selectedValue!==void 0?Array.isArray(S.selectedValue)?S.selectedValue[0]:S.selectedValue:N.type==="select"&&S.selectedOptions?S.selectedOptions.map(E=>E.value):N.type==="check"&&S.isChecked!==void 0||N.type==="switch"&&S.isChecked!==void 0?S.isChecked:N.type==="switch"&&S.selectedValue!==void 0||N.type==="advanced-select"&&S.selectedValue!==void 0||S.selectedValue!==void 0?S.selectedValue:g.value[P]:g.value[P]}):g.value=[...U]:t?_&&_.length>0&&(g.value=[..._]):q&&_&&_.length>0&&(g.value=[..._])},{deep:!0}),r.watch(()=>k.isEditMode,(U,z)=>{z===!0&&U===!1&&(_=null)},{immediate:!0}),r.watch(g,U=>{U.some(z=>z!=null&&(Array.isArray(z)?z.length>0:typeof z=="object"&&!Array.isArray(z)?Object.keys(z).length>0:z!==!1&&z!==""))&&(()=>{if(!m)return!0;for(let z=0;z<U.length;z++)if(!v(U[z],m[z]))return!0;return!1})()&&(m=[...U],F("filters-changed",{componentId:k.componentId,filters:U,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(U,z)=>{U!==z&&z!==void 0?b(U,!0):z===void 0&&U!==null&&U!==void 0&&b(U,!1)},{immediate:!0});const o=U=>{n.value===U?n.value=null:(n.value=U,f.value=null)},s=U=>{f.value===U?f.value=null:(f.value=U,n.value=null)},h=(U,z)=>{if(t=!0,setTimeout(()=>{t=!1},1e3),g.value[U]=z,(U===0||U===1)&&(_=[...g.value]),n.value=null,U===0){g.value[1]!==void 0&&(g.value[1]=null);const L=t;t=!1,b(z,!0),t=L,g.value[1]!==null&&g.value[1]!==void 0&&(_=[...g.value])}},c=()=>{t=!0,setTimeout(()=>{t=!1},400)},p=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U]=!g.value[U]},x=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U.filterIndex]||(g.value[U.filterIndex]={}),g.value[U.filterIndex][U.optionIndex]=U.values},w=()=>g.value,T=(U,z)=>{const L=g.value[z];if(L==null)return null;if(z===1&&l.value.length>0){const C=l.value.find(q=>q.value===L);return C?C.label:null}if(U.options&&Array.isArray(U.options)){const C=U.options.find(q=>q.value===L);return C?C.label:null}return null},V=(U,z)=>{const L=g.value[z];if(!L||typeof L!="object"||Array.isArray(L))return null;const C=Object.values(L).reduce((q,N)=>Array.isArray(N)&&N.length>0?q+N.length:q,0);return C>0?`${C} seleccionado${C>1?"s":""}`:null},O=U=>{const z=U.target,L=z.closest(".advanced-select-dropdown"),C=z.closest(".custom-select.dynamic-select");!L&&!C&&(f.value=null,n.value=null)};return r.onMounted(()=>{document.addEventListener("click",O)}),r.onUnmounted(()=>{document.removeEventListener("click",O)}),a({getCurrentValues:w,initializeValues:d}),(U,z)=>(r.openBlock(),r.createElementBlock("div",T6e,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(L,C)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:C},[L.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",k6e,[r.createElementVNode("div",N6e,r.toDisplayString(L.label),1),r.createElementVNode("div",V6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(L.options,q=>(r.openBlock(),r.createElementBlock("label",{key:q.value,class:r.normalizeClass(["radio-option-card",{active:g.value[C]===q.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+C,value:q.value,"onUpdate:modelValue":N=>g.value[C]=N,onChange:c},null,40,O6e),[[r.vModelRadio,g.value[C]]]),r.createElementVNode("span",null,r.toDisplayString(q.label),1)],2))),128))])])):L.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[C==2?(r.openBlock(),r.createElementBlock("div",L6e)):r.createCommentVNode("",!0),r.createElementVNode("div",U6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":L.type,onClick:r.withModifiers(q=>o(C),["stop"])},[r.createElementVNode("div",z6e,[z[1]||(z[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",C6e,r.toDisplayString(T(L,C)||L.label_2||L.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===C}])},[...z[0]||(z[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===C?(r.openBlock(),r.createElementBlock("div",P6e,[r.createElementVNode("div",E6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C===1?l.value:L.options,q=>(r.openBlock(),r.createElementBlock("div",{key:q.value,class:r.normalizeClass(["option-card simple-select-option",{active:v(g.value[C],q.value)}]),onClick:r.withModifiers(N=>h(C,q.value),["stop"])},[r.createElementVNode("div",W6e,[r.createElementVNode("div",M6e,r.toDisplayString(q.label),1)]),v(g.value[C],q.value)?(r.openBlock(),r.createElementBlock("div",F6e,[...z[2]||(z[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,R6e))),128))])])):r.createCommentVNode("",!0)],8,q6e)])],64)):L.type==="switch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createElementVNode("div",j6e,[r.createElementVNode("label",K6e,[L.label_1?(r.openBlock(),r.createElementBlock("span",A6e,r.toDisplayString(L.label_1),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"switch",onClick:q=>p(C)},[r.createElementVNode("div",{class:r.normalizeClass(["switch-track",{"switch-on":g.value[C]}])},[r.createElementVNode("div",{class:r.normalizeClass(["switch-thumb",{on:g.value[C]}])},null,2)],2)],8,I6e),L.label_2?(r.openBlock(),r.createElementBlock("span",X6e,r.toDisplayString(L.label_2),1)):r.createCommentVNode("",!0)])]),C>=0?(r.openBlock(),r.createElementBlock("div",D6e)):r.createCommentVNode("",!0)],64)):L.type==="advanced-select"?(r.openBlock(),r.createElementBlock("div",J6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":L.type,onClick:r.withModifiers(q=>s(C),["stop"])},[r.createElementVNode("div",G6e,[z[4]||(z[4]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",Z6e,r.toDisplayString(V(L,C)||L.label||"Seleccionar"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:f.value===C}])},[...z[3]||(z[3]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),f.value===C?(r.openBlock(),r.createElementBlock("div",H6e,[r.createElementVNode("div",Y6e,[r.createVNode(S6e,{filter:L,"filter-index":C,"selected-values":g.value,onUpdateSelection:x,onClose:q=>s(C)},null,8,["filter","filter-index","selected-values","onClose"])])])):r.createCommentVNode("",!0)],8,B6e)])):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},$6e=Bc(Q6e,[["__scopeId","data-v-65027e1a"]]),e4e={class:"floating-bar"},t4e={class:"tab active"},r4e={class:"select-display"},n4e={class:"select-icon"},a4e=["src"],i4e={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},o4e={key:0,class:"select-placeholder select-label"},s4e={key:1,class:"select-label"},l4e={key:0,class:"dropdown-menu field-menu"},c4e=["onClick"],u4e={class:"option-icon"},d4e=["src","data-hover-src"],p4e={class:"option-content"},h4e={class:"option-title"},f4e={key:0,class:"option-description"},m4e={class:"select-display"},y4e={class:"select-icon"},g4e=["src"],v4e=["src"],b4e={class:"select-label"},x4e={key:0,class:"dropdown-menu type-menu type-menu-grid"},w4e={class:"option-grid"},_4e=["onClick"],S4e={class:"option-grid-title"},T4e={class:"option-grid-icon"},k4e=["src"],N4e={key:1,class:"filter-separator"},V4e=["onClick"],O4e={class:"select-display"},L4e={key:0,class:"badge-categorias"},U4e={key:0,class:"dropdown-menu type-menu multi-select-menu"},q4e={class:"multi-select-scroll-area"},z4e={class:"select-all-checkbox"},C4e=["checked","indeterminate","onChange"],P4e={class:"option-checkbox"},E4e=["checked","onChange"],R4e=["onClick"],W4e={class:"option-title"},M4e={class:"multi-select-footer"},F4e={key:1,class:"custom-radio-group filter-inline"},j4e={class:"radio-label"},K4e={class:"radio-options"},A4e=["name","value","onUpdate:modelValue","disabled","onChange"],I4e={key:2,class:"check-group filter-inline"},X4e=["onUpdate:modelValue","checked"],D4e=["data-filter-type","onClick"],J4e={class:"select-display"},B4e={key:0,class:"dropdown-menu type-menu simple-select-menu"},G4e={class:"simple-select-scroll-area"},Z4e=["onMouseenter","onClick"],H4e={class:"option-content"},Y4e={class:"option-title"},Q4e={key:0,class:"option-checkmark"},$4e={key:4,class:"filter-separator"},eke=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:a,emit:i}){const k=e,F=i,g=r.ref(new Map),m=r.ref([]);let n=null,f=null,l=null;const t=r.ref(!1),_=r.ref(!1),v=r.ref(!1),b=r.ref(!1),d=r.ref(!1),o=r.ref(!1),s=r.computed(()=>m.value),h=r.ref(null),c=r.computed(()=>s.value[h.value]||null),p=r.computed(()=>{var me;const ze=((me=c.value)==null?void 0:me.views)||[];return q(ze)}),x=r.ref(null),w=r.computed(()=>p.value.find(me=>me.id===x.value)||null),T=r.ref([]),V=r.computed(()=>{var me,ze;return t.value?((me=w.value)==null?void 0:me.filters_edition_mode)||[]:((ze=w.value)==null?void 0:ze.filters)||[]});r.watch(t,me=>{me||(_.value=!1)}),r.watch(w,me=>{var ze,We;if(!me){T.value=[];return}const Ke=me.id===6&&k.isPostMatch,rt=me.id===14;if(!Array.isArray(V.value)&&!Ke&&!rt){T.value=[];return}b.value||(Ke||rt?T.value=[]:T.value=V.value.map((nt,pt)=>{var _t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe;if(nt.type==="select"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt){if(xt.selectedOptions&&Array.isArray(xt.selectedOptions))return xt.selectedOptions.map(Rt=>Rt.value);if(xt.selectedValue&&Array.isArray(xt.selectedValue))return xt.selectedValue.length>0&&xt.selectedValue[0]&&typeof xt.selectedValue[0]=="object"?Fe(xt.selectedValue):xt.selectedValue}}return me.id===4&&nt.options&&Array.isArray(nt.options)?nt.options.map(xt=>xt.value):[]}else if(nt.type==="radio-button"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedOption){let Rt=xt.selectedOption.value;if(me.id===15&&pt===0&&Rt===3&&((Tt=(_t=f==null?void 0:f.view)==null?void 0:_t.filterMultiple)==null?void 0:Tt.isHomeTeam)!==void 0){const Wt=f.view.filterMultiple.isHomeTeam;typeof Wt=="boolean"?Rt=Wt?1:2:typeof Wt=="number"&&(Rt=Wt===1?1:2)}return Rt}}if(me.id===7&&t.value&&f!=null&&f.view){if(pt===0&&(Ft=f.view.componentProps)!=null&&Ft.analysisType)return f.view.componentProps.analysisType==="offensive"?1:2;if(pt===1&&((It=f.view.filterMultiple)==null?void 0:It.isHomeTeam)!==void 0)return f.view.filterMultiple.isHomeTeam?1:2}return((lt=(Jt=nt.options)==null?void 0:Jt[0])==null?void 0:lt.value)??null}else if(nt.type==="select-simple"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedValue!==void 0){let Rt;return me.id===2&&(dt=(tt=f==null?void 0:f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId?Rt=f.view.filterMultiple.categoryId:me.id===1&&(Et=(gt=f==null?void 0:f.view)==null?void 0:gt.filterMultiple)!=null&&Et.category?Rt=f.view.filterMultiple.category:me.id===6&&(it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.filterMultiple)!=null&&it.gameNumber?Rt=f.view.filterMultiple.gameNumber:Rt=Array.isArray(xt.selectedValue)?xt.selectedValue[0]:xt.selectedValue,Rt}}if(me.id===2&&t.value&&f!=null&&f.view){if(n&&f.view.id){const xt=n.getComponentDynamicFilters(f.view.id);if(xt&&xt[pt]!==void 0)return xt[pt]}if(f.view.filterMultiple){if(nt.type==="select-simple"&&f.view.filterMultiple.categoryId){const xt=f.view.filterMultiple.categoryId;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}if(nt.type==="radio-button"&&f.view.filterMultiple.teamType!==void 0){const xt=f.view.filterMultiple.teamType;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}}}if(me.id===1&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.category){const xt=f.view.filterMultiple.category;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}if(me.id===9&&t.value&&(Ge=f==null?void 0:f.view)!=null&&Ge.filterMultiple&&nt.type==="select-simple"&&f.view.filterMultiple.categoryIds){const xt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds],Rt=(nt.options||[]).filter(Wt=>Array.isArray(Wt.value)?Pe(Wt.value,xt):xt.includes(Wt.value));return Rt.length>0?Rt[0].value:xt}if(me.id===6&&t.value&&(ut=f==null?void 0:f.view)!=null&&ut.filterMultiple&&f.view.filterMultiple.gameNumber){const xt=f.view.filterMultiple.gameNumber;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}if(me.id===5&&t.value&&(kt=f==null?void 0:f.view)!=null&&kt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam;let Rt;if(typeof xt=="boolean"?Rt=xt?1:2:typeof xt=="number"?Rt=xt===1?1:2:Rt=1,(nt.options||[]).find(Wt=>Wt.value==Rt),nt.type==="radio-button"&&(nt.label==="Equipo"||nt.label==="Team"||nt.label==="Equipo seleccionado"))return Rt}if(me.id===15&&t.value&&(vt=f==null?void 0:f.view)!=null&&vt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0&&nt.type==="radio-button"&&pt===0){const xt=f.view.filterMultiple.isHomeTeam;let Rt;if(typeof xt=="boolean"?Rt=xt?1:2:typeof xt=="number"?Rt=xt===1?1:2:Rt=1,(nt.options||[]).find(Wt=>Wt.value==Rt))return Rt}if(me.id===9&&t.value&&(wt=f==null?void 0:f.view)!=null&&wt.filterMultiple&&nt.type==="radio-button"&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam?1:2,Rt=((Vt=nt.options)==null?void 0:Vt.map(Wt=>Wt.value))||[];return Rt.includes(xt)?xt:Rt[0]||1}return((Qe=(at=nt.options)==null?void 0:at[0])==null?void 0:Qe.value)??null}else if(nt.type==="check"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}if(me.id===8)return!0;if(me.id===3){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}return!1}return!1}return null}),!((ze=me.name)!=null&&ze.toLowerCase().includes("tops players")||(We=me.title)!=null&&We.toLowerCase().includes("tops players"))&&(!t.value||Ke)&&r.nextTick(()=>{var nt,pt;me.id===4&&t.value&&(nt=f==null?void 0:f.view)!=null&&nt.id&&n&&n.setDynamicFilters(T.value,f.view.id),me.id===3&&t.value&&(pt=f==null?void 0:f.view)!=null&&pt.id&&n&&n.setDynamicFilters(T.value,f.view.id),ae()}))},{immediate:!0}),r.watch(()=>n,me=>{me&&me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&(b.value=!0,T.value=[...me.dynamicFilters],r.nextTick(()=>{b.value=!1}))},{deep:!0}),r.watch(()=>n==null?void 0:n.dynamicFilters,me=>{if(me&&Array.isArray(me)){if(d.value)return;b.value=!0,T.value=[...me],r.nextTick(()=>{b.value=!1})}},{deep:!0}),r.watch(()=>w.value,me=>{if(t.value&&l&&me&&me.filters){if(b.value||o.value)return;if(me.id===3){if(d.value||o.value)return;const ze=l.dynamicFilters.find(We=>We.filterType==="check");ze&&ze.isChecked!==void 0&&T.value&&T.value.length>0&&(d.value=!0,T.value[0]=ze.isChecked,r.nextTick(()=>{T.value=[...T.value],d.value=!1}))}setTimeout(()=>{(!T.value||T.value.length===0)&&(Be(),Ee(),ve()),me.id===4&&qe()},100)}},{deep:!0}),r.watch(()=>{var me;return(me=w.value)==null?void 0:me.id},me=>{if(t.value&&l&&me===4){if(b.value||o.value)return;setTimeout(()=>{qe()},200)}}),r.watch(()=>T.value,me=>{if(t.value&&l&&me&&me.length>0){if(b.value||d.value||o.value)return;setTimeout(()=>{var ze;ke()&&(Be(),Ee(),ve(),((ze=w.value)==null?void 0:ze.id)===4&&qe())},50)}},{deep:!0});function O(me,ze){var We,Ke,rt,nt,pt;const _t=T.value[me];if((We=w.value)==null||We.id,(Ke=w.value)==null||Ke.id,Array.isArray(_t)){if(((rt=w.value)==null?void 0:rt.id)===4&&me===0){const Tt=_t.some(Ft=>{if(ze.category_id&&ze.event_type_id){if(Ft.category_id&&Ft.event_type_id)return Ft.category_id===ze.category_id&&Ft.event_type_id===ze.event_type_id;if(Ft.event_type_id&&!Ft.category_id)return Ft.event_type_id===ze.event_type_id;if(Ft.category_id&&!Ft.event_type_id)return Ft.category_id===ze.category_id}else{if(ze.event_type_id)return Ft.event_type_id===ze.event_type_id;if(ze.category_id)return Ft.category_id===ze.category_id}return JSON.stringify(Ft)===JSON.stringify(ze)});return(nt=w.value)==null||nt.id,Tt}return _t.includes(ze)}else if(_t!=null)return(pt=w.value)==null||pt.id,_t===ze;return!1}function U(me,ze){var We,Ke,rt;const nt=(Ke=(We=w.value)==null?void 0:We.filters)==null?void 0:Ke[me];if((nt==null?void 0:nt.type)==="select-simple"){ie(me,ze);return}Array.isArray(T.value[me])||(T.value[me]=[]);const pt=T.value[me];let _t=-1;((rt=w.value)==null?void 0:rt.id)===4&&me===0?_t=pt.findIndex(Tt=>ze.category_id&&ze.event_type_id?Tt.category_id===ze.category_id&&Tt.event_type_id===ze.event_type_id:ze.event_type_id?Tt.event_type_id===ze.event_type_id:ze.category_id?Tt.category_id===ze.category_id:!1):_t=pt.indexOf(ze),_t>-1?pt.splice(_t,1):pt.push(ze),t.value&&Ue(),ae()}function z(me){var ze,We;const Ke=T.value[me],rt=(We=(ze=w.value)==null?void 0:ze.filters)==null?void 0:We[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length===rt.options.length}function L(me){var ze,We;const Ke=T.value[me],rt=(We=(ze=w.value)==null?void 0:ze.filters)==null?void 0:We[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length>0&&Ke.length<rt.options.length}function C(){var me;return!(((me=w.value)==null?void 0:me.id)===6&&k.isPostMatch)}function q(me){return!me||!Array.isArray(me)?me:me.filter(ze=>{const We=(ze.name||ze.title||"").toLowerCase();return k.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(Ke=>We.includes(Ke))})}function N(){var me,ze;const We=((ze=(me=c.value)==null?void 0:me.name)==null?void 0:ze.toLowerCase())||"";return We.includes("cancha")||We.includes("volumétrica")||We.includes("volumetric")}function P(me,ze){if(!t.value||!N())return!1;const We=String(me||"").toLowerCase(),Ke=String(ze||"").toLowerCase();return We.includes("ambos")||Ke.includes("ambos")}function S(me){var ze,We;const Ke=(We=(ze=w.value)==null?void 0:ze.filters)==null?void 0:We[me];if(!Ke||!Ke.options)return;const rt=Ke.options.map(nt=>nt.value);Array.isArray(T.value[me])||(T.value[me]=[]),z(me)?T.value[me]=[]:T.value[me]=[...rt],K.value=me,ae()}const E=r.ref("ambos"),W=r.ref(!1),j=r.ref(!1),K=r.ref(null),X=r.ref(null);function D(me,ze=!1){const We="https://golstatsimages.blob.core.windows.net/images-library/",Ke="https://golstatsimages.blob.core.windows.net/reports-images/",rt={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"},nt=Object.keys(rt).find(pt=>me==null?void 0:me.toLowerCase().includes(pt.toLowerCase()));if(nt){const pt=rt[nt],_t=ze?"":"-def";return nt.toLowerCase().includes("tabla")?`${Ke}${pt}${_t}@2x.png`:`${We}${pt}${_t}@2x.png`}return`${We}icn_default${ze?"":"-def"}.png`}function H(){return c.value?c.value.name:"Tipo de vista"}function re(){return w.value?w.value.name||w.value.title:"Visualización"}function B(){t.value||(W.value=!W.value,W.value&&(j.value=!1,r.nextTick(()=>{Le()})))}function ne(){t.value||c.value&&(j.value=!j.value,j.value&&(W.value=!1))}function ee(me){t.value||(h.value=me,W.value=!1,x.value=null,ae())}function Y(me){var ze,We;t.value||(x.value=me.id,j.value=!1,(ze=me.name)!=null&&ze.toLowerCase().includes("tops players")||(We=me.title)==null||We.toLowerCase().includes("tops players"))}function $(me){var ze;K.value=K.value===me?null:me,((ze=w.value)==null?void 0:ze.id)===4&&t.value&&me===0&&setTimeout(()=>{T.value=[...T.value]},50)}function le(me){X.value=X.value===me?null:me}function ie(me,ze){var We,Ke,rt,nt,pt;if(((We=w.value)==null?void 0:We.id)===2){const _t=V.value.findIndex(Tt=>Tt.type==="select-simple"&&Tt.label==="Tipo de análisis");me===_t?T.value[0]=ze:T.value[me]=ze}else if(((Ke=w.value)==null?void 0:Ke.id)===1)T.value[0]=ze;else if(((rt=w.value)==null?void 0:rt.id)===6)T.value[0]=ze;else if(((nt=w.value)==null?void 0:nt.id)===9)if(me===0){Array.isArray(ze)?T.value[me]=ze:T.value[me]=[ze];const _t=((pt=V.value[me])==null?void 0:pt.options)||[],Tt=Array.isArray(ze)?ze:[ze],Ft=_t.find(It=>Array.isArray(It.value)?Pe(It.value,Tt):Tt.includes(It.value));Ft?T.value[me]=Ft.value:T.value[me]=Tt}else T.value[me]=ze;else T.value[me]=ze;X.value=null,t.value&&Ue(),ae()}function ue(me){me.target.closest(".custom-select")||(W.value=!1,j.value=!1,X.value=null)}const he=[16];function ae(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;if(he.includes((me=w.value)==null?void 0:me.id)||b.value)return;let kt=[],vt=[];w.value&&Array.isArray(V.value)&&V.value.forEach((Qe,xt)=>{if(Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2){const Rt=T.value[xt]||[];Array.isArray(Rt)&&Rt.length>0&&(kt=Rt.map(Wt=>{var qt;const Ht=(qt=Qe.options)==null?void 0:qt.find(At=>At.value===Wt);return{value:Wt,label:(Ht==null?void 0:Ht.label)||Wt}}))}});const wt=((ze=w.value)==null?void 0:ze.id)===4;if(w.value&&Array.isArray(w.value.filters)&&w.value.filters.some(Qe=>Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2)&&kt.length===0&&!wt)return;if(wt&&T.value&&T.value.length>0){const Qe=T.value[0];Array.isArray(Qe)&&Qe.length>0}vt=((We=V.value)==null?void 0:We.map((Qe,xt)=>{var Rt,Wt,qt,Ht;const At=T.value[xt];let Yt=Qe.id||`filter_${xt}`;return((Rt=w.value)==null?void 0:Rt.id)===3&&t.value&&(Wt=f==null?void 0:f.view)!=null&&Wt.id&&(Yt=`filter_${xt}_component_${f.view.id}`),{filterId:Yt,filterType:Qe.type,filterLabel:Qe.label,filterIcon:Qe.icon||null,selectedValue:At,selectedOptions:Qe.type==="select"&&Array.isArray(At)&&At.length>0?At.map(Bt=>{var Gt;const or=(Gt=Qe.options)==null?void 0:Gt.find(sr=>sr.value===Bt);return{value:Bt,label:(or==null?void 0:or.label)||Bt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:Qe.type==="radio-button"&&At!=null?{value:At,label:((Ht=(qt=Qe.options)==null?void 0:qt.find(Bt=>Bt.value===At))==null?void 0:Ht.label)||At}:null,isChecked:Qe.type==="check"?At:null}}))||[];const Vt={mainSelector:{id:((Ke=c.value)==null?void 0:Ke.id)||null,name:((rt=c.value)==null?void 0:rt.name)||null,url:((nt=c.value)==null?void 0:nt.url)||null},viewSelector:{id:((pt=w.value)==null?void 0:pt.id)||null,name:((_t=w.value)==null?void 0:_t.name)||((Tt=w.value)==null?void 0:Tt.title)||null,url:((Ft=w.value)==null?void 0:Ft.url)||null},team:E.value,dynamicFilters:vt,categoriasSeleccionadas:kt,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((It=V.value)==null?void 0:It.length)||0,activeFilters:((Jt=V.value)==null?void 0:Jt.filter((Qe,xt)=>{const Rt=T.value[xt];return Array.isArray(Rt)?Rt.length>0:Rt!=null&&Rt!==!1}).length)||0}},at={main:c.value,view:w.value,team:E.value,dynamicFilters:T.value,filtersJSON:Vt,filterAndViewsContainer:n,viewToEdit:f};if(F("filters-changed",at),t.value&&f){if(l=Vt,((lt=w.value)==null?void 0:lt.id)===2){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(dt=(tt=f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.categoryId)}if(((gt=w.value)==null?void 0:gt.id)===1){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(Lt=(Et=f.view)==null?void 0:Et.filterMultiple)!=null&&Lt.category&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.category)}}if(((it=w.value)==null?void 0:it.id)===6&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.gameNumber&&l){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Número de juego");Qe!==-1&&(ut=(Ge=f.view)==null?void 0:Ge.filterMultiple)!=null&&ut.gameNumber&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.gameNumber)}n&&!t.value?n.setDynamicFilters(T.value):n&&t.value}function de(){f=null,l=null,n=null,h.value=null,x.value=null,E.value="ambos",T.value=[],W.value=!1,j.value=!1,K.value=null,X.value=null,t.value=!1,_.value=!1,v.value=!1}function ce(me){if(me&&me.dynamicFilters){if(d.value)return;Array.isArray(me.dynamicFilters)&&me.dynamicFilters.length>0&&(b.value=!0,T.value=[...me.dynamicFilters],r.nextTick(()=>{b.value=!1}))}}function ye(me){if(t.value=!0,me.mainSelector&&me.mainSelector.id){const ze=m.value.findIndex(We=>We.id===me.mainSelector.id);ze!==-1&&(h.value=ze)}me.viewSelector&&me.viewSelector.id&&c.value&&c.value.views.findIndex(ze=>ze.id===me.viewSelector.id)!==-1&&(x.value=me.viewSelector.id),me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&r.nextTick(()=>{setTimeout(()=>{var ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt;if(w.value&&V.value){if(b.value)return;if(d.value=!0,me.dynamicFilters.forEach((wt,Vt)=>{var at,Qe,xt,Rt,Wt,qt,Ht,At,Yt,Bt,Gt,or,sr;if(Vt<V.value.length){const Ur=V.value[Vt];if(((at=w.value)==null?void 0:at.id)===3&&t.value,Ur.type==="check"){const zr=wt.isChecked;typeof zr=="boolean"&&(T.value[Vt]=zr)}else if(Ur.type==="select"&&wt.selectedOptions){const zr=wt.selectedOptions.map(Lr=>Lr.value);T.value[Vt]=zr}else if(Ur.type==="select"&&wt.selectedValue&&Array.isArray(wt.selectedValue))if(wt.selectedValue.length>0&&wt.selectedValue[0]&&typeof wt.selectedValue[0]=="object"){const zr=Fe(wt.selectedValue);T.value[Vt]=zr}else T.value[Vt]=wt.selectedValue;else if(Ur.type==="radio-button"&&wt.selectedOption)T.value[Vt]=wt.selectedOption.value;else if(Ur.type==="select-simple"&&wt.selectedValue!==void 0){let zr;((Qe=w.value)==null?void 0:Qe.id)===2&&(Rt=(xt=f==null?void 0:f.view)==null?void 0:xt.filterMultiple)!=null&&Rt.categoryId?zr=f.view.filterMultiple.categoryId:((Wt=w.value)==null?void 0:Wt.id)===1&&(Ht=(qt=f==null?void 0:f.view)==null?void 0:qt.filterMultiple)!=null&&Ht.category?zr=f.view.filterMultiple.category:((At=w.value)==null?void 0:At.id)===6&&(Bt=(Yt=f==null?void 0:f.view)==null?void 0:Yt.filterMultiple)!=null&&Bt.gameNumber?zr=f.view.filterMultiple.gameNumber:((Gt=w.value)==null?void 0:Gt.id)===9&&(sr=(or=f==null?void 0:f.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?zr=f.view.filterMultiple.categoryIds:zr=Array.isArray(wt.selectedValue)?wt.selectedValue[0]:wt.selectedValue,T.value[Vt]=zr}}}),((ze=w.value)==null?void 0:ze.id)===3&&t.value,((We=w.value)==null?void 0:We.id)===2&&t.value&&(Ke=f==null?void 0:f.view)!=null&&Ke.filterMultiple){if(f.view.filterMultiple.categoryId){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.categoryId;if(T.value[0]=Vt,f.view.componentProps&&Vt){let at=`Category ${Vt}`,Qe=null;try{Qe=Fh(Vt),Qe&&(at=Qe.name)}catch{const xt=V.value.findIndex(Rt=>Rt.type==="select-simple"&&Rt.label==="Tipo de análisis");if(xt!==-1){const Rt=(((rt=V.value[xt])==null?void 0:rt.options)||[]).find(Wt=>Wt.value==Vt);Rt&&(at=Rt.label)}}f.view.componentProps.categoryView=[{id:Vt,name:at}]}(((nt=V.value[wt])==null?void 0:nt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(f.view.filterMultiple.teamType!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.teamType;T.value[wt]=Vt,(((pt=V.value[wt])==null?void 0:pt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}}if(((_t=w.value)==null?void 0:_t.id)===9&&t.value&&(Tt=f==null?void 0:f.view)!=null&&Tt.filterMultiple){if(f.view.filterMultiple.categoryIds){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple");if(wt!==-1){const Vt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds];T.value[0]=Vt;const at=(((Ft=V.value[wt])==null?void 0:Ft.options)||[]).filter(xt=>Array.isArray(xt.value)?Pe(xt.value,Vt):Vt.includes(xt.value));if(at.length>0){const xt=at[0].value;T.value[wt]=xt}else T.value[wt]=Vt;const Qe=T.value[wt];Pe(Qe,Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(f.view.filterMultiple.isHomeTeam!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam;let at;typeof Vt=="boolean"?at=Vt?1:2:typeof Vt=="number"?at=Vt===1?1:2:at=1,T.value[wt]=at,(((It=V.value[wt])==null?void 0:It.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{T.value=[...T.value]})}}}if(((Jt=w.value)==null?void 0:Jt.id)===1&&t.value&&(lt=f==null?void 0:f.view)!=null&<.filterMultiple&&f.view.filterMultiple.category){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.category;T.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.type=Vt),(((tt=V.value[wt])==null?void 0:tt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(((dt=w.value)==null?void 0:dt.id)===6&&t.value&&(gt=f==null?void 0:f.view)!=null&>.filterMultiple&&f.view.filterMultiple.gameNumber){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Número de juego");if(wt!==-1){const Vt=f.view.filterMultiple.gameNumber;T.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.gameNumber=Vt),(((Et=V.value[wt])==null?void 0:Et.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(((Lt=w.value)==null?void 0:Lt.id)===7&&t.value&&f!=null&&f.view){if((it=f.view.componentProps)!=null&&it.analysisType&&V.value.length>0&&((ct=V.value[0])==null?void 0:ct.type)==="radio-button"){const wt=f.view.componentProps.analysisType==="offensive"?1:2;T.value[0]=wt}if(((Ge=f.view.filterMultiple)==null?void 0:Ge.isHomeTeam)!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button"&&Vt.label==="Equipo");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam?1:2;T.value[1]=Vt}else if(V.value.length>1&&((ut=V.value[1])==null?void 0:ut.type)==="radio-button"){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;T.value[1]=at,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Vt),(((kt=V.value[1])==null?void 0:kt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{T.value=[...T.value]})}if(wt!==-1&&f.view.componentProps){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;f.view.componentProps.isHomeTeamForAnalysis=Vt,(((vt=V.value[wt])==null?void 0:vt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{T.value=[...T.value]})}}}r.nextTick(()=>{d.value=!1})}},100)})}function xe(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft;return{mainSelector:{id:((me=c.value)==null?void 0:me.id)||null,name:((ze=c.value)==null?void 0:ze.name)||null,url:((We=c.value)==null?void 0:We.url)||null},viewSelector:{id:((Ke=w.value)==null?void 0:Ke.id)||null,name:((rt=w.value)==null?void 0:rt.name)||((nt=w.value)==null?void 0:nt.title)||null,url:((pt=w.value)==null?void 0:pt.url)||null},team:E.value,dynamicFilters:((_t=V.value)==null?void 0:_t.map((It,Jt)=>{var lt,tt;const dt=T.value[Jt];return{filterId:It.id||`filter_${Jt}`,filterType:It.type,filterLabel:It.label,filterIcon:It.icon||null,selectedValue:dt,selectedOptions:It.type==="select"&&Array.isArray(dt)&&dt.length>0?dt.map(gt=>{var Et;const Lt=(Et=It.options)==null?void 0:Et.find(it=>it.value===gt);return{value:gt,label:(Lt==null?void 0:Lt.label)||gt,icon:(Lt==null?void 0:Lt.icon)||null}}):null,selectedOption:It.type==="radio-button"&&dt?{value:dt,label:((tt=(lt=It.options)==null?void 0:lt.find(gt=>gt.value===dt))==null?void 0:tt.label)||dt}:null,isChecked:It.type==="check"?dt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((Tt=V.value)==null?void 0:Tt.length)||0,activeFilters:((Ft=V.value)==null?void 0:Ft.filter((It,Jt)=>{const lt=T.value[Jt];return Array.isArray(lt)?lt.length>0:lt!=null&<!==!1}).length)||0}}}a({getCurrentFiltersJSON:xe});function be(){de(),F("close",n)}function Te(){_.value=!1,be()}function Oe(){v.value&&(qa.emit("filters-cancelled",n),v.value=!1),_.value=!1,be()}r.onMounted(async()=>{document.addEventListener("click",ue),r.nextTick(()=>{Le()});const me="https://fb78a14uud.execute-api.us-east-2.amazonaws.com/qa/views";try{const ze=await(await fetch(me,{headers:{Authorization:`${k.token}`}})).json();m.value=ze.data||[],g.value.clear(),m.value&&(g.value=m.value.reduce((We,Ke)=>(Ke.views&&Array.isArray(Ke.views)&&Ke.views.forEach(rt=>{rt.filters&&Array.isArray(rt.filters)&&We.set(rt.id,rt)}),We),new Map))}catch(ze){console.error("Error al obtener datos:",ze)}});function Le(){document.querySelectorAll(".field-menu .option-card").forEach(me=>{const ze=me.querySelector(".option-img");if(!ze||!ze.dataset.hoverSrc)return;const We=ze.src,Ke=ze.dataset.hoverSrc;me.addEventListener("mouseenter",()=>{ze.src=Ke}),me.addEventListener("mouseleave",()=>{ze.src=We})})}r.onUnmounted(()=>{document.removeEventListener("click",ue)}),qa.on("set-filter-and-views-container",me=>{n=me,me&&ce(me)}),qa.on("view-added",()=>{_.value=!0,v.value=!0}),qa.on("component-added-to-container",me=>{(!t.value||n&&me.id===n.id)&&ce(me)}),qa.on("edit-view",me=>{var ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;f=me,n=((ze=me.view)==null?void 0:ze.filterAndViewsContainer)||null,l=null;const kt=[(Ke=(We=me.view)==null?void 0:We.coreView)==null?void 0:Ke.filtersJSON,(rt=me.view)==null?void 0:rt.filtersJSON,(nt=me.coreView)==null?void 0:nt.filtersJSON,me.filtersJSON,(_t=(pt=me.view)==null?void 0:pt.componentProps)==null?void 0:_t.filtersJSON];for(const vt of kt)if(vt){l=vt;break}if(n&&(n.viewId===4||n.viewId===8||n.viewId===3||n.viewId===1||n.viewId===2||n.viewId===13)&&(Tt=me.view)!=null&&Tt.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt){let wt="Unknown";n.viewId===4?wt="Timeline":n.viewId===8?wt="FieldPosesion":n.viewId===3?wt="GSCMatchSummary":n.viewId===1?wt="GSCComparativeReports":n.viewId===2?wt="GscTopPlayer":n.viewId===13&&(wt="GSCTimelapseTable"),l&&(n.viewId===13?l={...l,dynamicFilters:vt}:l={...l,dynamicFilters:vt.map((Vt,at)=>Array.isArray(Vt)?{selectedValue:Vt,selectedOptions:Vt.map(Qe=>({value:Qe,label:Qe}))}:typeof Vt=="boolean"?{isChecked:Vt}:wt==="GSCComparativeReports"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===1?{selectedOption:{value:Vt,label:Vt}}:{selectedOption:{value:Vt,label:Vt}})})}}if(n&&n.viewId===2&&(Ft=me.view)!=null&&Ft.filterMultiple){if(me.view.filterMultiple.categoryId&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.categoryId,selectedOptions:[{value:me.view.filterMultiple.categoryId,label:`Category ${me.view.filterMultiple.categoryId}`}]})}if(me.view.filterMultiple.teamType!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.teamType,Vt=wt===1?"Mi equipo":wt===2?"Rival":wt===3?"Ambos":"Equipo";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:wt,label:Vt}}}}}if(n&&n.viewId===1&&(It=me.view)!=null&&It.filterMultiple&&me.view.filterMultiple.category&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.category,selectedOptions:[{value:me.view.filterMultiple.category,label:me.view.filterMultiple.category}]})}if(n&&n.viewId===9&&(Jt=me.view)!=null&&Jt.filterMultiple){if(me.view.filterMultiple.categoryIds&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select"&&wt.filterLabel==="Tipo de análisis");if(vt!==-1){const wt=Array.isArray(me.view.filterMultiple.categoryIds)?me.view.filterMultiple.categoryIds:[me.view.filterMultiple.categoryIds];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:wt,selectedOptions:wt.map(Qe=>({value:Qe,label:`Category ${Qe}`}))};const Vt=me.view.filterMultiple.categoryIds;Pe(Vt,wt);const at=(((lt=V.value[vt])==null?void 0:lt.options)||[]).filter(Qe=>Array.isArray(Qe.value)?Pe(Qe.value,wt):wt.includes(Qe.value));if(at.length>0){const Qe=at[0];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:Qe.value,selectedOptions:[Qe]}}}}if(me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Mi equipo":"Rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Mi equipo":"Rival"):(Vt=1,at="Mi equipo"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===6&&(tt=me.view)!=null&&tt.filterMultiple&&me.view.filterMultiple.gameNumber&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Número de juego");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.gameNumber,selectedOptions:[{value:me.view.filterMultiple.gameNumber,label:`Juego ${me.view.filterMultiple.gameNumber}`}]})}if(n&&n.viewId===7&&me.view&&l){if((dt=me.view.componentProps)!=null&&dt.analysisType){const vt=l.dynamicFilters.findIndex((wt,Vt)=>wt.filterType==="radio-button"&&Vt===0);if(vt!==-1){const wt=me.view.componentProps.analysisType,Vt=wt==="offensive"?1:2,at=wt==="offensive"?"A favor":"En contra";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}if(((gt=me.view.filterMultiple)==null?void 0:gt.isHomeTeam)!==void 0){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam,Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===10&&(Et=me.view)!=null&&Et.filterMultiple&&((it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.coreView)==null?void 0:it.id)===10){const vt=me.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:vt})}if(n&&n.viewId===15&&(ct=me.view)!=null&&ct.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt&&l)l={...l,dynamicFilters:vt.map((wt,Vt)=>{var at,Qe;if(Vt===0){let xt=wt;if(wt===3&&((Qe=(at=me.view)==null?void 0:at.filterMultiple)==null?void 0:Qe.isHomeTeam)!==void 0){const Rt=me.view.filterMultiple.isHomeTeam;typeof Rt=="boolean"?xt=Rt?1:2:typeof Rt=="number"&&(xt=Rt===1?1:2)}return{selectedOption:{value:xt,label:xt===1?"Mi equipo":"Rival"}}}else if(Vt===1)return{selectedValue:wt,selectedOptions:[{value:wt,label:`${wt} fortalezas`}]};return typeof wt=="number"?{selectedValue:wt}:{selectedOption:{value:wt,label:String(wt)}}})};else if((Ge=me.view)!=null&&Ge.filterMultiple&&l&&me.view.filterMultiple.isHomeTeam!==void 0){const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button"&&Vt.filterLabel==="Mi equipo");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Local":"Visitante"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Local":"Visitante"):(at=1,Qe="Local"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}if(n&&n.viewId===5&&(ut=me.view)!=null&&ut.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Equipo propio":"Equipo rival"):(Vt=1,at="Equipo propio"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}else{const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Equipo propio":"Equipo rival"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Equipo propio":"Equipo rival"):(at=1,Qe="Equipo propio"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}l&&ye(l),_.value=!0});function _e(){K.value=null}function Ce(me,ze){var We;(We=w.value)==null||We.id}function Pe(me,ze){if(!Array.isArray(me)||!Array.isArray(ze)||me.length!==ze.length)return!1;const We=[...me].sort((rt,nt)=>rt-nt),Ke=[...ze].sort((rt,nt)=>rt-nt);return JSON.stringify(We)===JSON.stringify(Ke)}function Be(){if(t.value&&l&&l.dynamicFilters){if(o.value||b.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((me,ze)=>{var We;if(me&&(We=V.value)!=null&&We[ze]){const Ke=V.value[ze];if(Ke.type==="check"&&me.isChecked!==void 0)T.value[ze]=me.isChecked;else if(Ke.type==="select"&&me.selectedOptions){const rt=me.selectedOptions.map(nt=>nt.value);T.value[ze]=rt}else Ke.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(T.value[ze]=me.selectedValue)}}),r.nextTick(()=>{d.value=!1,o.value=!1})}}function qe(){var me;if(t.value&&l&&l.dynamicFilters&&((me=w.value)==null?void 0:me.id)===4){if(o.value||b.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((ze,We)=>{var Ke,rt;if(ze&&((rt=(Ke=V.value)==null?void 0:Ke[We])==null?void 0:rt.type)==="select"){if(ze.selectedOptions){const nt=ze.selectedOptions.map(pt=>pt.value);T.value[We]=nt}else if(ze.selectedValue&&Array.isArray(ze.selectedValue))if(ze.selectedValue.length>0&&ze.selectedValue[0]&&typeof ze.selectedValue[0]=="object"){const nt=Fe(ze.selectedValue);T.value[We]=nt}else T.value[We]=ze.selectedValue}}),setTimeout(()=>{var ze;if(T.value=[...T.value],(ze=f==null?void 0:f.view)!=null&&ze.componentProps&&T.value&&T.value.length>0){const We=T.value[0];if(Array.isArray(We)&&We.length>0){const Ke=We.some(_t=>_t.event_type_id===1||typeof _t=="string"&&_t.includes("1")),rt=We.some(_t=>_t.category_id===8||typeof _t=="string"&&_t.includes("8")),nt=We.some(_t=>_t.category_id===9||typeof _t=="string"&&_t.includes("9")),pt=We.some(_t=>_t.event_type_id===3||typeof _t=="string"&&_t.includes("3"));f.view.componentProps.selectedEvents=We,f.view.componentProps.goals=Ke,f.view.componentProps.yellowCards=rt,f.view.componentProps.redCards=nt,f.view.componentProps.substitutions=pt,f.view.componentProps.key=We.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},200),r.nextTick(()=>{d.value=!1,o.value=!1})}}function Fe(me){return!Array.isArray(me)||me.length===0?[]:me.map(ze=>{if(ze&&typeof ze=="object"){if(ze.event_type_id!==void 0||ze.category_id!==void 0)return{event_type_id:ze.event_type_id,category_id:ze.category_id,...ze.name&&{name:ze.name},...ze.label&&{label:ze.label}};if(ze.value&&typeof ze.value=="object")return{event_type_id:ze.value.event_type_id,category_id:ze.value.category_id,...ze.value.name&&{name:ze.value.name},...ze.value.label&&{label:ze.value.label}};if(typeof ze=="string"&&ze.includes("-")){const[We,Ke]=ze.split("-");return{category_id:parseInt(We),event_type_id:parseInt(Ke)}}}if(typeof ze=="string")if(ze.includes("-")){const[We,Ke]=ze.split("-");return{category_id:parseInt(We),event_type_id:parseInt(Ke)}}else{const We=parseInt(ze);if(!isNaN(We))return{event_type_id:We}}return ze})}function Ee(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt;if(t.value&&l&&l.dynamicFilters&&V.value){if(o.value||b.value)return;if(o.value=!0,d.value=!0,l.dynamicFilters.forEach((dt,gt)=>{var Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at;if(dt&&((Et=V.value[gt])==null?void 0:Et.type)==="select"){if(dt.selectedOptions){const Qe=dt.selectedOptions.map(xt=>xt.value);T.value[gt]=Qe}else if(dt.selectedValue&&Array.isArray(dt.selectedValue))if(dt.selectedValue.length>0&&dt.selectedValue[0]&&typeof dt.selectedValue[0]=="object"){const Qe=Fe(dt.selectedValue);T.value[gt]=Qe}else T.value[gt]=dt.selectedValue}else if(dt&&((Lt=V.value[gt])==null?void 0:Lt.type)==="select-simple"&&dt.selectedValue!==void 0){let Qe;((it=w.value)==null?void 0:it.id)===2&&(Ge=(ct=f==null?void 0:f.view)==null?void 0:ct.filterMultiple)!=null&&Ge.categoryId?Qe=f.view.filterMultiple.categoryId:((ut=w.value)==null?void 0:ut.id)===1&&(vt=(kt=f==null?void 0:f.view)==null?void 0:kt.filterMultiple)!=null&&vt.category?Qe=f.view.filterMultiple.category:((wt=w.value)==null?void 0:wt.id)===6&&(at=(Vt=f==null?void 0:f.view)==null?void 0:Vt.filterMultiple)!=null&&at.gameNumber?Qe=f.view.filterMultiple.gameNumber:Qe=Array.isArray(dt.selectedValue)?dt.selectedValue[0]:dt.selectedValue,T.value[gt]=Qe}}),((me=w.value)==null?void 0:me.id)===4&&setTimeout(()=>{var dt;if(T.value=[...T.value],(dt=f==null?void 0:f.view)!=null&&dt.componentProps&&T.value&&T.value.length>0){const gt=T.value[0];if(Array.isArray(gt)&>.length>0){const Et=gt.some(Ge=>Ge.event_type_id===1||typeof Ge=="string"&&Ge.includes("1")),Lt=gt.some(Ge=>Ge.category_id===8||typeof Ge=="string"&&Ge.includes("8")),it=gt.some(Ge=>Ge.category_id===9||typeof Ge=="string"&&Ge.includes("9")),ct=gt.some(Ge=>Ge.event_type_id===3||typeof Ge=="string"&&Ge.includes("3"));f.view.componentProps.selectedEvents=gt,f.view.componentProps.goals=Et,f.view.componentProps.yellowCards=Lt,f.view.componentProps.redCards=it,f.view.componentProps.substitutions=ct,f.view.componentProps.key=gt.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},100),((ze=w.value)==null?void 0:ze.id)===2&&(We=f==null?void 0:f.view)!=null&&We.filterMultiple){if(f.view.filterMultiple.categoryId){const dt=V.value.findIndex(gt=>gt.type==="select-simple"&>.label==="Tipo de análisis");if(dt!==-1){const gt=f.view.filterMultiple.categoryId;if(T.value[0]=gt,f.view.componentProps&>){let Et=`Category ${gt}`,Lt=null;try{Lt=Fh(gt),Lt&&(Et=Lt.name)}catch{const it=V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis");if(it!==-1){const ct=(((Ke=V.value[it])==null?void 0:Ke.options)||[]).find(Ge=>Ge.value==gt);ct&&(Et=ct.label)}}f.view.componentProps.categoryView=[{id:gt,name:Et}]}(((rt=V.value[dt])==null?void 0:rt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{T.value=[...T.value]})}}if(f.view.filterMultiple.teamType!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.teamType;T.value[dt]=gt,(((nt=V.value[dt])==null?void 0:nt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{T.value=[...T.value]})}}}if(((pt=w.value)==null?void 0:pt.id)===1&&(_t=f==null?void 0:f.view)!=null&&_t.filterMultiple&&f.view.filterMultiple.category&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis")!==-1){const dt=f.view.filterMultiple.category;T.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.type=dt),r.nextTick(()=>{T.value=[...T.value]})}if(((Tt=w.value)==null?void 0:Tt.id)===6&&(Ft=f==null?void 0:f.view)!=null&&Ft.filterMultiple&&f.view.filterMultiple.gameNumber&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Número de juego")!==-1){const dt=f.view.filterMultiple.gameNumber;T.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.gameNumber=dt),r.nextTick(()=>{T.value=[...T.value]})}if(((It=w.value)==null?void 0:It.id)===5&&(Jt=f==null?void 0:f.view)!=null&&Jt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0)if(V.value.findIndex(dt=>dt.type==="radio-button"&&dt.label==="Equipo")!==-1){const dt=f.view.filterMultiple.isHomeTeam;let gt;typeof dt=="boolean"?gt=dt?1:2:typeof dt=="number"?gt=dt===1?1:2:gt=1,T.value[0]=gt,f.view.componentProps&&dt!==void 0&&(f.view.componentProps.isHomeTeamForAnalysis=dt===1),r.nextTick(()=>{T.value=[...T.value]})}else{const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,T.value[dt]=Et,f.view.componentProps&>!==void 0&&(f.view.componentProps.preMatchType=gt),r.nextTick(()=>{T.value=[...T.value]})}}if(((lt=w.value)==null?void 0:lt.id)===15&&(tt=f==null?void 0:f.view)!=null&&tt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",gt,"type:",typeof gt);let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Et,"teamFilterIndex:",dt),T.value[dt]=Et,f.view.componentProps&>!==void 0&&(f.view.componentProps.preMatchType=Et),r.nextTick(()=>{T.value=[...T.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",T.value)})}else{const gt=V.value.findIndex(Et=>Et.type==="radio-button");if(gt!==-1){const Et=f.view.filterMultiple.isHomeTeam;let Lt;typeof Et=="boolean"?Lt=Et?1:2:typeof Et=="number"?Lt=Et===1?1:2:Lt=1,T.value[gt]=Lt,f.view.componentProps&&Et!==void 0&&(f.view.componentProps.preMatchType=Lt),r.nextTick(()=>{T.value=[...T.value]})}}}r.nextTick(()=>{d.value=!1,o.value=!1})}}function ve(){if(!o.value&&t.value&&l&&l.dynamicFilters&&V.value){if(b.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((me,ze)=>{var We;if(me&&((We=V.value[ze])==null?void 0:We.type)==="radio-button"&&me.selectedOption&&me.selectedOption.value!==void 0){const Ke=me.selectedOption.value;T.value[ze]=Ke}}),r.nextTick(()=>{d.value=!1,o.value=!1})}}function Ue(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe,xt,Rt,Wt,qt,Ht;if(n&&t.value&&f){if(b.value)return;if(d.value=!0,((me=w.value)==null?void 0:me.id)===4){if(n.setDynamicFilters(T.value,(ze=f.view)==null?void 0:ze.id),n.updateDynamicFilters(T.value,(We=f.view)==null?void 0:We.id),f.view.componentProps&&T.value&&T.value.length>0){const At=T.value[0];if(Array.isArray(At)&&At.length>0){const Yt=At.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Bt=At.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Gt=At.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=At.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));f.view.componentProps.selectedEvents=At,f.view.componentProps.goals=Yt,f.view.componentProps.yellowCards=Bt,f.view.componentProps.redCards=Gt,f.view.componentProps.substitutions=or,f.view.componentProps.key=At.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}}else if(((Ke=w.value)==null?void 0:Ke.id)===8)n.setDynamicFilters(T.value,(rt=f.view)==null?void 0:rt.id),n.updateDynamicFilters(T.value,(nt=f.view)==null?void 0:nt.id);else if(((pt=w.value)==null?void 0:pt.id)===3)n.setDynamicFilters(T.value,(_t=f.view)==null?void 0:_t.id),n.updateDynamicFilters(T.value,(Tt=f.view)==null?void 0:Tt.id);else if(((Ft=w.value)==null?void 0:Ft.id)===13){const At=(It=f.view)==null?void 0:It.id;n.setDynamicFilters(T.value,At),n.updateDynamicFilters(T.value,At),f.view.componentProps&&(f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps}))}else if(((Jt=w.value)==null?void 0:Jt.id)===15){const At=(lt=f.view)==null?void 0:lt.id;if(n.setDynamicFilters(T.value,At),n.updateDynamicFilters(T.value,At),f.view.componentProps){const Yt=Array.isArray(T.value)&&T.value[3]!==void 0?T.value[3]:null;Yt!==null&&(f.view.componentProps.numitems=Yt),f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}else if(((tt=w.value)==null?void 0:tt.id)===2){n.setDynamicFilters(T.value,(dt=f.view)==null?void 0:dt.id),n.updateDynamicFilters(T.value,(gt=f.view)==null?void 0:gt.id);const At=T.value[0];if(At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.categoryId,f.view.filterMultiple.categoryId=At,f.view.componentProps)){let Bt=`Category ${At}`,Gt=null;try{Gt=Fh(At),Gt&&(Bt=Gt.name)}catch{const or=V.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Et=V.value[or])==null?void 0:Et.options)||[]).find(Ur=>Ur.value==At);sr&&(Bt=sr.label)}}f.view.componentProps.categoryView=[{id:At,name:Bt}],qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple})}const Yt=T.value[1];Yt!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.teamType,f.view.filterMultiple.teamType=Yt,f.view.componentProps&&f.view.componentProps.game&&(Yt===1?f.view.componentProps.teamView=f.view.componentProps.game.homeTeam.team_id:Yt===2?f.view.componentProps.teamView=f.view.componentProps.game.awayTeam.team_id:f.view.componentProps.teamView=0),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Lt=w.value)==null?void 0:Lt.id)===1){n.setDynamicFilters(T.value,(it=f.view)==null?void 0:it.id),n.updateDynamicFilters(T.value,(ct=f.view)==null?void 0:ct.id);const At=T.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.category,f.view.filterMultiple.category=At,f.view.componentProps&&(f.view.componentProps.type=At),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Ge=w.value)==null?void 0:Ge.id)===6){n.setDynamicFilters(T.value,(ut=f.view)==null?void 0:ut.id),n.updateDynamicFilters(T.value,(kt=f.view)==null?void 0:kt.id);const At=T.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.gameNumber,f.view.filterMultiple.gameNumber=At,f.view.componentProps&&(f.view.componentProps.gameNumber=At,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(vt=w.value)==null?void 0:vt.id,viewId:f.view.id,dynamicFilters:T.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})}))}else if(((wt=w.value)==null?void 0:wt.id)===7){n.setDynamicFilters(T.value,(Vt=f.view)==null?void 0:Vt.id),n.updateDynamicFilters(T.value,(at=f.view)==null?void 0:at.id);const At=T.value[0],Yt=T.value[1];if(At!==void 0&&f.view.componentProps){const Bt=At===1?"offensive":"defensive";f.view.componentProps.analysisType=Bt}if(Yt!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Bt=Yt===1;f.view.filterMultiple.isHomeTeam=Bt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Bt,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(Qe=w.value)==null?void 0:Qe.id,viewId:f.view.id,dynamicFilters:T.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else if(((xt=w.value)==null?void 0:xt.id)===5){n.setDynamicFilters(T.value,(Rt=f.view)==null?void 0:Rt.id),n.updateDynamicFilters(T.value,(Wt=f.view)==null?void 0:Wt.id);const At=T.value[0];if(At!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Yt=At===1?1:2;f.view.filterMultiple.isHomeTeam=Yt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Yt===1,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(qt=w.value)==null?void 0:qt.id,viewId:f.view.id,dynamicFilters:T.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else((Ht=w.value)==null?void 0:Ht.id)===9||(n.setDynamicFilters(T.value),n.updateDynamicFilters(T.value));r.nextTick(()=>{d.value=!1})}}function ke(){var me,ze;if(!l||!l.dynamicFilters||!V.value)return!1;for(let We=0;We<l.dynamicFilters.length;We++){const Ke=l.dynamicFilters[We],rt=V.value[We],nt=T.value[We];if(!(!Ke||!rt)){if(rt.type==="check"){if(Ke.isChecked!==nt)return!0}else if(rt.type==="radio-button"){if(((me=Ke.selectedOption)==null?void 0:me.value)!==nt)return!0}else if(rt.type==="select"){const pt=((ze=Ke.selectedOptions)==null?void 0:ze.map(Tt=>Tt.value))||Ke.selectedValue||[],_t=Array.isArray(nt)?nt:[];if(JSON.stringify(pt)!==JSON.stringify(_t))return!0}}}return!1}function Je(me){var ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et;if(T.value=me.filters,n){const Lt=((ze=f==null?void 0:f.view)==null?void 0:ze.id)||null;n.setDynamicFilters(T.value,Lt),n.updateDynamicFilters(T.value,Lt)}if(t.value&&f&&(qa.emit("activate-save-button"),qa.emit("force-component-update",{itemId:((We=f==null?void 0:f.view)==null?void 0:We.id)||null,componentProps:f.view.componentProps}),qa.emit("dynamic-filters-changed",{containerViewId:((Ke=f==null?void 0:f.view)==null?void 0:Ke.id)||null,viewId:((rt=f==null?void 0:f.view)==null?void 0:rt.id)||null,dynamicFilters:T.value}),qa.emit("dynamic-filters-changed",{containerViewId:((nt=f==null?void 0:f.view)==null?void 0:nt.id)||null,viewId:((pt=f==null?void 0:f.view)==null?void 0:pt.id)||null,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})),!t.value&&n&&((_t=w.value)==null?void 0:_t.id)===15&&n.getRequiresAddView(T.value)){n.setDynamicFilters(T.value),F("filters-changed",{main:c.value,view:w.value,team:E.value,dynamicFilters:T.value,filtersJSON:{mainSelector:{id:((Tt=c.value)==null?void 0:Tt.id)||null,name:((Ft=c.value)==null?void 0:Ft.name)||null,url:((It=c.value)==null?void 0:It.url)||null},viewSelector:{id:((Jt=w.value)==null?void 0:Jt.id)||null,name:((lt=w.value)==null?void 0:lt.name)||((tt=w.value)==null?void 0:tt.title)||null,url:((dt=w.value)==null?void 0:dt.url)||null},team:E.value,dynamicFilters:T.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((gt=V.value)==null?void 0:gt.length)||0,activeFilters:((Et=V.value)==null?void 0:Et.filter((Lt,it)=>{const ct=T.value[it];return Array.isArray(ct)?ct.length>0:ct!=null&&ct!==!1}).length)||0}},filterAndViewsContainer:n,viewToEdit:f}),ae();return}Ue()}function Re(me){me.filterIndex!==void 0&&me.value!==void 0&&(T.value[me.filterIndex]=me.value,t.value&&Ue(),ae())}function Ie(){Oe()}function Ze(me){var ze,We,Ke,rt,nt,pt,_t;const Tt={mainSelector:{id:((ze=c.value)==null?void 0:ze.id)||null,name:((We=c.value)==null?void 0:We.name)||null,url:((Ke=c.value)==null?void 0:Ke.url)||null},viewSelector:{id:((rt=w.value)==null?void 0:rt.id)||null,name:((nt=w.value)==null?void 0:nt.name)||((pt=w.value)==null?void 0:pt.title)||null,url:((_t=w.value)==null?void 0:_t.url)||null}};F("filters-changed",{filters:me.filters,view:me.view,viewToEdit:f,filterAndViewsContainer:n,filtersJSON:Tt,isAltMode:!0})}function et(me){return JSON.parse(JSON.stringify(me))}return(me,ze)=>(r.openBlock(),r.createElementBlock("div",e4e,[r.createElementVNode("button",t4e,r.toDisplayString(t.value?"Editando visualización":"Nueva visualización"),1),r.createElementVNode("div",{class:r.normalizeClass(["custom-select main-select",{disabled:t.value}]),onClick:B},[r.createElementVNode("div",r4e,[r.createElementVNode("span",n4e,[c.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,a4e)):(r.openBlock(),r.createElementBlock("img",i4e))]),c.value?(r.openBlock(),r.createElementBlock("span",s4e,r.toDisplayString(H()),1)):(r.openBlock(),r.createElementBlock("span",o4e,"Tipo de vista")),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:W.value}])},[...ze[5]||(ze[5]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),W.value?(r.openBlock(),r.createElementBlock("div",l4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(We,Ke)=>(r.openBlock(),r.createElementBlock("div",{key:We.id,class:r.normalizeClass(["option-card",{active:h.value===Ke}]),onClick:r.withModifiers(rt=>ee(Ke),["stop"])},[r.createElementVNode("div",u4e,[r.createElementVNode("img",{src:D(We.name,!1),"data-hover-src":D(We.name,!0),alt:"icono",class:"option-img-34"},null,8,d4e)]),r.createElementVNode("div",p4e,[r.createElementVNode("div",h4e,r.toDisplayString(We.name),1),We.description?(r.openBlock(),r.createElementBlock("div",f4e,r.toDisplayString(We.description),1)):r.createCommentVNode("",!0)])],10,c4e))),128))])):r.createCommentVNode("",!0)],2),c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["custom-select second-select",{disabled:t.value}]),onClick:ne},[r.createElementVNode("div",m4e,[r.createElementVNode("span",y4e,[w.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:w.value.url,alt:"icono",class:"option-img-graph2"},null,8,g4e)):c.value?(r.openBlock(),r.createElementBlock("img",{key:1,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,v4e)):r.createCommentVNode("",!0)]),r.createElementVNode("span",b4e,r.toDisplayString(re()),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:j.value}])},[...ze[6]||(ze[6]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),j.value&&c.value?(r.openBlock(),r.createElementBlock("div",x4e,[r.createElementVNode("div",w4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,We=>(r.openBlock(),r.createElementBlock("div",{key:We.id,class:r.normalizeClass(["option-card-grid",{active:x.value===We.id}]),onClick:r.withModifiers(Ke=>Y(We),["stop"])},[r.createElementVNode("div",S4e,r.toDisplayString(We.name||We.title),1),r.createElementVNode("div",T4e,[r.createElementVNode("img",{src:We.url,alt:"icono",class:"option-img-grid"},null,8,k4e)])],10,_4e))),128))])])):r.createCommentVNode("",!0)],2)):r.createCommentVNode("",!0),w.value?(r.openBlock(),r.createElementBlock("div",N4e)):r.createCommentVNode("",!0),w.value&&w.value.id===13?(r.openBlock(),r.createBlock(SSe,{key:2,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":13,onFiltersChanged:Je,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===16?(r.openBlock(),r.createBlock(ETe,{key:3,"view-config":et(g.value.get(16)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,"is-edit-mode":!!r.unref(f),"is-post-match":e.isPostMatch,onChange:Ze,onRemoveViews:Ie},null,8,["view-config","default-filters","is-edit-mode","is-post-match"])):w.value&&w.value.id===15?(r.openBlock(),r.createBlock(KSe,{key:4,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":15,onFiltersChanged:Je,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===17?(r.openBlock(),r.createBlock($6e,{key:5,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":17,"view-config":et(g.value.get(17)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,onFiltersChanged:Je,onFilterUpdated:Re,onChange:Ze,onRemoveViews:Ie},null,8,["filters","initial-values","is-edit-mode","view-config","default-filters"])):w.value&&V.value&&C()?(r.openBlock(),r.createElementBlock("div",{key:6,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":V.value.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V.value,(We,Ke)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Ke},[We.type==="select"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:r.withModifiers(rt=>$(Ke),["stop"])},[r.createElementVNode("div",O4e,[ze[8]||(ze[8]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),ze[9]||(ze[9]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(T.value[Ke])&&T.value[Ke].length>0?(r.openBlock(),r.createElementBlock("span",L4e,r.toDisplayString(T.value[Ke].length),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:K.value===Ke}])},[...ze[7]||(ze[7]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),K.value===Ke?(r.openBlock(),r.createElementBlock("div",U4e,[r.createElementVNode("div",q4e,[r.createElementVNode("div",{class:"multi-select-header",onClick:ze[1]||(ze[1]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("label",z4e,[r.createElementVNode("input",{type:"checkbox",checked:z(Ke),indeterminate:L(Ke),onChange:r.withModifiers(rt=>S(Ke),["stop"]),onClick:ze[0]||(ze[0]=r.withModifiers(()=>{},["stop"]))},null,40,C4e),ze[10]||(ze[10]=r.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(We.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card multi-select-option",{active:O(Ke,rt.value)}]),onClick:ze[2]||(ze[2]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("div",P4e,[r.createElementVNode("input",{type:"checkbox",checked:O(Ke,rt.value),onChange:r.withModifiers(nt=>U(Ke,rt.value),["stop"])},null,40,E4e)]),r.createElementVNode("div",{class:"option-content",onClick:nt=>U(Ke,rt.value)},[r.createElementVNode("div",W4e,r.toDisplayString(rt.label),1)],8,R4e)],2))),128))]),r.createElementVNode("div",M4e,[r.createElementVNode("button",{class:"btn-listo",onClick:ze[3]||(ze[3]=r.withModifiers(rt=>_e(),["stop"]))},"Listo")])])):r.createCommentVNode("",!0)],8,V4e)):We.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",F4e,[r.createElementVNode("div",j4e,r.toDisplayString(We.label),1),r.createElementVNode("div",K4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(We.options,rt=>(r.openBlock(),r.createElementBlock("label",{key:rt.value,class:r.normalizeClass(["radio-option-card",{active:T.value[Ke]===rt.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ke,value:rt.value,"onUpdate:modelValue":nt=>T.value[Ke]=nt,disabled:P(rt.value,rt.label),onChange:()=>{var nt,pt,_t;if(((nt=w.value.value)==null?void 0:nt.id)===9&&t.value.value&&(_t=(pt=r.unref(f))==null?void 0:pt.view)!=null&&_t.filterMultiple){const Tt=T.value[Ke]===1;r.unref(f).view.filterMultiple.isHomeTeam=Tt}t.value.value&&Ue(),ae()}},null,40,A4e),[[r.vModelRadio,T.value[Ke]]]),r.createElementVNode("span",null,r.toDisplayString(rt.label),1)],2))),128))])])):We.type==="check"?(r.openBlock(),r.createElementBlock("div",I4e,[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":rt=>T.value[Ke]=rt,checked:T.value[Ke],onChange:ze[4]||(ze[4]=()=>{t.value.value&&Ue(),ae()})},null,40,X4e),[[r.vModelCheckbox,T.value[Ke]]]),r.createTextVNode(" "+r.toDisplayString(We.label),1)])])):We.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":We.type,onClick:r.withModifiers(rt=>le(Ke),["stop"])},[r.createElementVNode("div",J4e,[ze[12]||(ze[12]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),ze[13]||(ze[13]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:X.value===Ke}])},[...ze[11]||(ze[11]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),X.value===Ke?(r.openBlock(),r.createElementBlock("div",B4e,[r.createElementVNode("div",G4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(We.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card simple-select-option",{active:T.value[Ke]===rt.value}]),onMouseenter:nt=>Ce(Ke,rt.value),onClick:r.withModifiers(nt=>ie(Ke,rt.value),["stop"])},[r.createElementVNode("div",H4e,[r.createElementVNode("div",Y4e,r.toDisplayString(rt.label),1)]),T.value[Ke]===rt.value?(r.openBlock(),r.createElementBlock("div",Q4e,[...ze[14]||(ze[14]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],42,Z4e))),128))])])):r.createCommentVNode("",!0)],8,D4e)):r.createCommentVNode("",!0),Ke===1&&V.value.length>2?(r.openBlock(),r.createElementBlock("div",$4e)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0),t.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("button",{key:7,class:"cancel-btn",onClick:Oe},"Cancelar")),_.value?(r.openBlock(),r.createElementBlock("button",{key:8,class:"ok-btn",onClick:Te},"OK")):r.createCommentVNode("",!0)]))}}),tke=Bc(eke,[["__scopeId","data-v-8d571c54"]]),rke={key:0,class:"modal-simple"},nke={class:"modal-simple__content"},ake={class:"modal-simple__content__header"},ike={class:"modal-simple__content__body"},oke={class:"modal-simple__content__footer"},ske={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[e.modelValue?(r.openBlock(),r.createElementBlock("div",rke,[r.createElementVNode("div",nke,[r.createElementVNode("div",ake,[r.renderSlot(a.$slots,"header",{},void 0,!0)]),r.createElementVNode("div",ike,[r.renderSlot(a.$slots,"body",{},void 0,!0)]),r.createElementVNode("div",oke,[r.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):r.createCommentVNode("",!0)]))}},lke=Bc(ske,[["__scopeId","data-v-1cc4f590"]]),cke={class:"footer"},uke={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:a}){const i=a;function k(g){i("update:modelValue",g)}function F(g){i("action",g),i("update:modelValue",!1)}return(g,m)=>(r.openBlock(),r.createBlock(lke,{"modle-value":e.value,"onUpdate:modelValue":k},{header:r.withCtx(()=>[...m[2]||(m[2]=[r.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:r.withCtx(()=>[...m[3]||(m[3]=[r.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:r.withCtx(()=>[r.createElementVNode("div",cke,[r.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:m[0]||(m[0]=n=>F(!1))}," Seguir editando "),r.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:m[1]||(m[1]=n=>F(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},dke=Bc(uke,[["__scopeId","data-v-ed9b5088"]]),pke={key:0,class:"modal-simple"},hke={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[e.modelValue?(r.openBlock(),r.createElementBlock("div",pke,[...i[0]||(i[0]=[r.createElementVNode("div",{class:"modal-simple__content"},[r.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),r.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):r.createCommentVNode("",!0)]),_:1})]))}},fke=Bc(hke,[["__scopeId","data-v-2bc30783"]]),mke={class:"template-maker__header"},yke={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gke={class:"template-maker__content"},vke={class:"template-maker__content__main"},bke={id:"containerMain",class:"container-main"},xke={class:"template-maker__content__main__cover-selector"},wke=["id"],_ke={class:"page-indicator"},Ske={class:"page-indicator__index"},Tke=["onClick"],kke=["onClick"],Nke={key:0,class:"template-maker__content__main__footer"},Vke={class:"template-maker__content__main__footer__paginator"},Oke={class:"template-maker__content__main__footer__paginator__nav"},Lke={class:"template-maker__content__main__footer__paginator__numbers"},Uke=["onClick"],qke={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:a,emit:i}){const k=new Map,F=r.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:{}}]}]),g=r.ref(null),m=r.ref(0),n=r.ref(!1),f=r.ref(null),l=r.ref(null),t=r.ref(!0),_=r.ref(!1),v=r.ref(!1),b=r.ref(0),d=r.ref(!1),o=r.ref(null),s=r.ref(new Map),h=r.ref(null),c=r.ref(null),p=r.ref(!1),x=r.ref(!1),w=r.ref(!1),T=new Map,V=r.computed(()=>({"--overflow-y-template-maker":_.value?"scroll":"hidden","--height-container-main":_.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(_.value,"0")})),O=r.computed(()=>m.value+1);r.watch(()=>n.value,_e=>{const Ce=document.getElementById("app");_e?(m.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Ce&&(Ce.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Ce&&(Ce.style.overflow=""))});function U(_e){return _e<10?`0${_e}`:_e}async function z({templateId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/templates/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching template by ID:",Pe)}}async function L({reportId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/reports/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching report by ID:",Pe)}}let C=0;function q(_e){g.value=_e,C>0&&(p.value=!0),C++}function N(_e){_e&&ue(null,!0)}let P=null;function S(_e,Ce){let Pe=_e.getBoundingClientRect(),Be={height:_e.clientHeight,width:_e.clientWidth},qe=Ce.getBoundingClientRect();if(!(qe.top>=Pe.top&&qe.bottom<=Pe.top+Be.height)){const Fe=qe.top-Pe.top,Ee=qe.bottom-Pe.bottom;Math.abs(Fe)<Math.abs(Ee)?_e.scrollTop+=Fe:_e.scrollTop+=Ee}}function E(_e,Ce){let Pe=_e.getBoundingClientRect();const Be=Ce.getBoundingClientRect().top-Pe.top;_e.scrollTop+=Be}function W(_e,Ce=!1){const Pe={title:`Page ${F.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(xe(),_e!==void 0&&_e>=-1?F.value.splice(_e+1,0,Pe):F.value.push(Pe),r.nextTick(()=>{const Be=F.value.findIndex(Fe=>Fe.id===Pe.id),qe=document.getElementById(`page-${Be+1}`);P||(P=document.getElementById("containerMain")),qe&&P?S(P,qe):console.error("Page element or container main element not found")}),Ce)return Pe;p.value=!0}function j(_e){if(_e<0||_e>F.value.length)return;m.value=_e;const Ce=document.getElementById(`page-${_e}`);if(P||(P=document.getElementById("containerMain")),Ce&&P){const Pe=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Pe),E(P,Ce),setTimeout(()=>{const Be=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Be)},300)}else console.error("Page element or container main element not found")}function K(_e){h.value=_e,d.value=!0}function X(_e,Ce){const Pe=Ce+1;_e&&m.value!==Pe&&(m.value=Pe)}function D(_e){d.value=!0,qa.emit("edit-view",{view:_e})}async function H({templateReportId:_e,userId:Ce,isTemplateMode:Pe}){try{return Pe?z({templateId:_e,userId:Ce}):L({reportId:_e,userId:Ce})}catch(Be){throw new Error("Error fetching template or report by ID: "+Be.message)}}function re(){C=0,d.value=!1,m.value=0,h.value=null,c.value=null,s.value.clear(),P=null}async function B(_e){if(re(),t.value=_e.isTemplateMode,_.value=!!_e.isPDFMode,_e.isPDFMode?f.value=await L({reportId:_e.reportId,userId:_e.userId}):(f.value=_e.template,f.value=await H({templateReportId:_e.template.id,userId:_e.template.user_id,isTemplateMode:_e.isTemplateMode})),!f.value)return;f.value&&f.value.game&&(f.value.game=ie(f.value.game)),l.value=JSON.parse(JSON.stringify(f.value)),v.value=f.value.template_type===2;const Ce=f.value.pages.find(Pe=>Pe.is_front_page);b.value=Ce?Ce.type:1,n.value=!0,F.value=f.value.pages.reduce((Pe,Be,qe)=>{if(!Be.is_front_page){Be.name||(Be.name="");const Fe=qe,Ee={originalPage:JSON.parse(JSON.stringify(Be)),title:Be.name,id:`p-${Date.now()-qe*9}`,items:[],components:Be.components};Be.components&&Be.components.length>0&&(Ee.items=Be.components.map((ve,Ue)=>{const ke=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ve.coreView.id,ve.dynamicFilters,v.value,t.value,ve.filtersJSON||null,$.token,ve.filters),Je={originalComponent:JSON.parse(JSON.stringify(ve)),title:ve.title,shortTitle:ve.shortTitle||ve.title,game:f.value.game,idAux:ve.id,id:`w-${Date.now()-Ue*7}`,x:ve.column,y:ve.row,w:ve.colspan,h:ve.rowspan,maxWidth:ve.max_column,maxHeight:ve.max_row,minWidth:ve.min_column,minHeight:ve.min_row,noResize:!t.value,noMove:!t.value,coreView:ve.coreView||null,isTemplateMode:t.value,componentName:ve.componentName,componentProps:Y({currentProps:ve.componentProps,coreView:ve.coreView,isTemplateMode:t.value,templateToEdit:f.value,filterMultiple:ve.filterMultiple||null,game:f.value.game||null,dynamicFilters:ve.dynamicFilters,page:Fe,componentId:Ue})||{},filterMultiple:ve.filterMultiple,isHomeTeam:ee({game:f.value.game,isTemplateMode:t.value,currentIsHomeTeam:ve.isHomeTeam||ve.componentProps.isHomeTeamForAnalysis}),filtersJSON:ve.filtersJSON||null,dynamicFilters:ve.dynamicFilters||[],filterAndViewsContainer:ke},Re=r.reactive({view:Je});return ke.addView(Re,!0),s.value.set(ke.getId(),ke),Je})),Pe.push(Ee)}return Pe},[])}function ne({game:_e,isTemplateMode:Ce}){const Pe=_e&&_e.homeTeam&&_e.awayTeam&&(_e.homeTeam.team_id===$.userTeamId||_e.awayTeam.team_id===$.userTeamId);return{isUserTeamHome:Pe&&_e.homeTeam.team_id===$.userTeamId,requiresUserTeamAdjustment:Pe&&!Ce}}function ee({game:_e,isTemplateMode:Ce,currentIsHomeTeam:Pe}){const{isUserTeamHome:Be,requiresUserTeamAdjustment:qe}=ne({game:_e,isTemplateMode:Ce});return qe?Pe?Be:!Be:Pe}function Y({currentProps:_e,coreView:Ce,templateToEdit:Pe,isTemplateMode:Be,filterMultiple:qe,game:Fe,dynamicFilters:Ee,page:ve,componentId:Ue}){if(!_e||!Ce)return _e||{};const{isUserTeamHome:ke,requiresUserTeamAdjustment:Je}=ne({game:Fe,isTemplateMode:Be}),Re={..._e};if(Ce.id===5&&(Re.isGhostEffect=Be,Je)){const Ie=Re.preMatchType===1;Re.preMatchType=Ie?ke?1:2:ke?2:1}if(Ce.id===7&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===9&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===16){if(!Be&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(!Be){Re.isPreMatch=!v.value,Re.isTemplateMode=Be,Re.seasonId=Pe.season_id,Re.teamIdForAnalysis=Re.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Re.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;v.value?Re.gamesIdsForAnalysis=[Pe.game.game_id]:Re.howManyGames?Re.gamesIdsForAnalysis=Ie.slice(0,Re.howManyGames).map(Ze=>Ze.game_id):(Re.gamesIdsForAnalysis=[],Re.gameDataUTC=Pe.game.date_time_utc)}if(!Be){Re.isTemplateMode=Be,Re.seasonId=Pe.season_id,Re.teamIdForAnalysis=Re.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Re.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;v.value?Re.gamesIdsForAnalysis=[Pe.game.game_id]:Re.howManyGames?Re.gamesIdsForAnalysis=Ie.slice(0,Re.howManyGames).map(Ze=>Ze.game_id):(Re.gamesIdsForAnalysis=[],Re.gameDataUTC=Pe.game.date_time_utc)}}if(Ce.id===10&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===1&&(Re.gameId=Fe?Fe.id:"",Re.homeLogo=Fe?Fe.homeTeam.logo:"",Re.awayLogo=Fe?Fe.awayTeam.logo:"",Re.seasonId=Fe?Fe.season_id:0,Re.default=Be),Ce.id===6&&(Re.game=Fe||"",Re.lastGames=Pe.last_games,Re.selectedOption=Pe.template_type===2?"Postmatch":"Prematch"),Ce.id===13&&(Re.isdefault=Be,Re.seasonid=Fe?Fe.seasonId:2010,Re.datetimeutc=Fe?Pe.template_type===1?Fe?Fe.date_time_utc:"":null:"",Re.teamids=Fe?[Fe.home_team,Fe.visiting_team]:[1,2],Re.categoryids=Ee?Ee[1]:[20,2],Re.teamsshow=Fe?Ee?Ee[2]==1?[Fe.home_team]:Ee[2]==2?[Fe.visiting_team]:[Fe.home_team,Fe.visiting_team]:[1,2]:[1,2],Re.analysistype=Ee?Ee[0]:[],Re.gameid=Pe.template_type===1?null:Fe?Fe.id:"",Re.teams=Fe?[{id:Fe.home_team,name:Fe.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Fe.home_team+".png"},{id:Fe.visiting_team,name:Fe.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Fe.visiting_team+".png"}]:[]),Ce.id===15&&(Re.view=1,Re.token=$.token,Re.numitems=Ee?Ee[1]:3,Re.isdefault=Be,Re.reportid=Pe!=null&&Pe.id?Pe.id:0,Re.userid=Pe!=null&&Pe.user_id?Pe.user_id:0,Re.page=ve+1,Re.typegame=v.value?2:1,Re.componentid=Ue+1,Re.data={season:Fe?Fe.seasonId:2010,type:2,game:Fe?Fe.id:0,team:qe?qe.isHomeTeam?Fe.home_team:Fe.visiting_team:2}),Ce.id===14&&(Re.isReports=!0,Re.isDefault=Be,Re.type=Pe.tournament_type==1?1:0,Re.typeView=1,Re.tournament=Pe.tournament_id,Re.currentSeason=Fe?Fe.season_id:0,Re.currentSeasonId=Fe?Fe.season_id:0,Re.showVideos=!1,Re.localTeam=Fe?Fe.home_team:0,Re.awayTeam=Fe?Fe.visiting_team:0),Ce.id===3&&(Re.defaultShields=Be),Ce.id===2){let Ie=!0,Ze=0,et=0;Fe&&(Ie=Pe.main_team==Fe.home_team||Pe.main_team==Fe.visiting_team,Ze=Ie?Pe.main_team==(Fe==null?void 0:Fe.home_team)?Fe==null?void 0:Fe.home_team:Fe==null?void 0:Fe.visiting_team:Fe==null?void 0:Fe.home_team,et=Ie?Pe.main_team==(Fe==null?void 0:Fe.home_team)?Fe==null?void 0:Fe.visiting_team:Fe==null?void 0:Fe.home_team:Fe==null?void 0:Fe.visiting_team),Re.gamed=Fe?Fe.id:"",Re.game=Fe||"",Re.season=Fe?Fe.season_id:0,Re.teamView=qe.teamType==3?0:qe.teamType==1?Ze:et,Re.useDummyData=Be}return Ce.id===8&&(Re.teamSelected=Fe?{teamId:Fe.home_team}:1,Re.isDefault=Be),Ce.id===4&&(Re.gameId=Fe?Fe.id:"",Re.isDefault=Be,Re.homeTeam=Fe?Fe==null?void 0:Fe.home_team:"",Re.awayTeam=Fe?Fe==null?void 0:Fe.visiting_team:""),Fe&&(Re.game=Fe),Re}const $=e,le=i;r.watch(()=>$.token,(_e,Ce)=>{},{immediate:!0}),a({show:B}),qa.on("add-page-view",_e=>{k.set(_e.view.id,_e.view);const Ce=F.value.find(Pe=>Pe.id===_e.pageId);Ce&&(Ce.items||(Ce.items=[]),Ce.items.push(_e.view),r.nextTick(()=>{const Pe=document.querySelector(`[gs-id="${_e.view.id}"]`);_e.grid.makeWidget(Pe)}))}),qa.on("add-page-and-view",_e=>{const Ce=F.value.findIndex(Pe=>Pe.id===_e.pageId);if(Ce>-1){const Pe=W(Ce,!0);setTimeout(()=>{qa.emit("add-view",{pageId:Pe.id,view:_e.view,filterAndWidgetContainer:_e.filterAndWidgetContainer}),c.value&&(Pe.stepBackPage=c.value),c.value=Pe},500)}else console.error("Page not found for adding view:",_e.pageId)}),qa.on("empty-page",_e=>{d.value&&h.value&&h.value.id===_e.id||(be(_e),c.value&&c.value.id===_e.id&&(c.value.stepBackPage?c.value=c.value.stepBackPage:c.value=null))}),qa.on("filters-cancelled",_e=>{_e&&_e.removeAllChildViews()}),qa.on("activate-save-button",()=>{p.value=!0});function ie(_e){return{..._e,gameId:_e.game_id,id:_e.game_id,seasonId:_e.season_id,status:_e.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.home_team}.png`,team_id:_e.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.home_team}.png`,colloquial_name:_e.home_team_name,acronym:_e.home_team_acronym,team_name:_e.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.visiting_team}.png`,team_id:_e.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.visiting_team}.png`,colloquial_name:_e.visiting_team_name,acronym:_e.visiting_team_acronym,team_name:_e.visiting_team_name}}}function ue(_e,Ce=!1){Ce||!t.value?(n.value=!1,re(),le("close")):p.value?x.value=!0:(n.value=!1,re(),le("close"))}function he(){o.value=null,d.value=!1}function ae({page:_e,view:Ce,applyMinimumSize:Pe=!1}){const Be=_e.grid;if(!_e||!Ce||!Be)return null;const qe=Pe?{w:Ce.min_column,h:Ce.min_row}:{w:Ce.colspan,h:Ce.rowspan},Fe=Be.willItFit(0,0,qe.w,qe.h,!0);return Fe?{willFit:Fe,applyMinimumSize:Pe}:Pe?null:ae({page:_e,view:Ce,applyMinimumSize:!0})}const de=new Set([9]);function ce(_e){var Ce,Pe,Be,qe,Fe,Ee,ve,Ue,ke,Je,Re,Ie,Ze,et;if(_e.dynamicFilters&&_e.dynamicFilters.length>0&&_e.viewToEdit&&_e.viewToEdit.view){const me=_e.viewToEdit.view.id;F.value.forEach(ze=>{ze.items.forEach(We=>{We.id===me&&We.coreView&&We.coreView.id===3&&(We.componentProps.desplegable=_e.dynamicFilters[0]||!1,We.componentProps.key=_e.dynamicFilters[0]||!1,r.nextTick(()=>{qa.emit("force-component-update",{itemId:We.id,componentProps:We.componentProps})}))})})}if(_e.viewToEdit){if(!_e.viewToEdit.view.filterAndViewsContainer){const me=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[_e.viewToEdit],((Ce=_e.viewToEdit.view.coreView)==null?void 0:Ce.id)||_e.viewToEdit.view.id,_e.dynamicFilters||[],v.value,t.value,_e.filtersJSON,$.token,_e.filters);_e.viewToEdit.view.filterAndViewsContainer=me}_e.viewToEdit.view.filterAndViewsContainer.updateView({view:_e.viewToEdit,dynamicFilters:_e.dynamicFilters||[],filtersJSON:_e.filtersJSON||null,filters:_e.filters}),p.value=!0}else if(_e.view){_e.view.id&&_e.filterAndViewsContainer&&_e.view.id!==_e.filterAndViewsContainer.viewId&&(_e.filterAndViewsContainer.removeAllChildViews(),_e.filterAndViewsContainer.setViewId(_e.view.id),_e.filterAndViewsContainer.setFiltersJSON(_e.filtersJSON||null)),_e.view.id&&de.has(_e.view.id)&&_e.dynamicFilters[0]&&_e.dynamicFilters[0].length===0&&_e.filterAndViewsContainer&&(_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(Be=(Pe=_e.viewToEdit)==null?void 0:Pe.view)==null?void 0:Be.id),p.value=!0);const me=c.value||h.value,ze=ae({page:me,view:_e.view,applyMinimumSize:!1});_e.view.filtersJSON=_e.filtersJSON||null;const We=_e.filterAndViewsContainer,Ke=F.value.findIndex(rt=>rt.id===me.id);if(We){const rt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);if(((qe=_e.view)==null?void 0:qe.id)===15){const nt=(Fe=_e.filterAndViewsContainer)==null?void 0:Fe.getId();if(nt&&T.has(nt)){const pt=T.get(nt);clearTimeout(pt),T.delete(nt)}}if(rt){if(We.setFilters(_e.filters),We.setDynamicFilters(_e.dynamicFilters),ze||Ke===F.value.length-1){qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:We,avoidWillFit:!1,applyMinimumSize:ze?ze.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(ve=(Ee=_e.viewToEdit)==null?void 0:Ee.view)==null?void 0:ve.id),p.value=!0;let nt=null;if(((Ue=_e.view)==null?void 0:Ue.id)===15?(r.nextTick(()=>{var pt;const _t=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);((pt=_e.dynamicFilters)==null?void 0:pt[0])===3&&_t&&ce(_e)}),nt=setTimeout(()=>{var pt,_t;const Tt=(pt=_e.filterAndViewsContainer)==null?void 0:pt.getId();Tt&&T.delete(Tt);const Ft=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters);((_t=_e.dynamicFilters)==null?void 0:_t[0])===3&&Ft&&ce(_e)},200)):nt=setTimeout(()=>{_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters)&&ce(_e)},1e3),((ke=_e.view)==null?void 0:ke.id)===15&&nt){const pt=(Je=_e.filterAndViewsContainer)==null?void 0:Je.getId();pt&&T.set(pt,nt)}}}else _e.isAltMode?_e.viewToEdit||_e.filterAndViewsContainer.updateFilters(_e.filters,(Ie=(Re=_e.viewToEdit)==null?void 0:Re.view)==null?void 0:Ie.id):_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(et=(Ze=_e.viewToEdit)==null?void 0:Ze.view)==null?void 0:et.id),p.value=!0}else if(ze||Ke===F.value.length-1){const rt=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],_e.view.id,_e.dynamicFilters,v.value,t.value,_e.filtersJSON,$.token,_e.filters);qa.emit("set-filter-and-views-container",rt),s.value.set(rt.getId(),rt),_e.dynamicFilters&&Array.isArray(_e.dynamicFilters[0])?(_e.filterAndViewsContainer=rt,ce(_e)):qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:rt,avoidWillFit:!1,applyMinimumSize:ze?ze.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),p.value=!0}}}async function ye(){if(p.value)try{const _e=[{is_front_page:!0,template_type:g.value.isPostMatch?2:1,type:g.value.id},...F.value.map(Pe=>({columns:Pe.originalPage?Pe.originalPage.columns:12,rows:Pe.originalPage?Pe.originalPage.rows:12,gap:Pe.originalPage?Pe.originalPage.gap:10,name:Pe.title,width:Pe.originalPage?Pe.originalPage.width:968,height:Pe.originalPage?Pe.originalPage.height:702,components:Pe.items.reduce((Be,qe)=>(qe.isDeleted||Be.push({min_column:qe.minWidth,min_row:qe.minHeight,max_column:qe.maxWidth,max_row:qe.maxHeight,column:qe.x,row:qe.y,colspan:qe.w,rowspan:qe.h,name:qe.name,title:qe.title,titleShort:qe.titleShort||qe.title,dynamicFilters:qe.filterAndViewsContainer.getComponentDynamicFilters(qe.id)||qe.filterAndViewsContainer.getDynamicFilters()||[],coreView:qe.coreView||null,componentName:qe.componentName,componentProps:qe.componentProps||{},isHomeTeam:qe.isHomeTeam||qe.componentProps.isHomeTeamForAnalysis,filterMultiple:qe.filterMultiple}),Be),[])}))],Ce=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${f.value.user_id}/templates/${f.value.id}/pages`,{method:"PATCH",headers:{Authorization:$.token},body:JSON.stringify({pages:_e})});w.value=!0,await Ce.json(),p.value=!1,setTimeout(()=>{w.value=!1},2e3)}catch(_e){console.error("Error saving template:",_e)}}function xe(){F.value.forEach(_e=>{_e.offListeners&&_e.offListeners()})}function be(_e){const Ce=F.value.findIndex(Pe=>Pe.id===_e.id);Ce>-1&&(xe(),F.value=F.value.filter(Pe=>Pe.id!==_e.id),m.value>=Ce&&(m.value=Math.max(0,m.value-1)),p.value=!0)}function Te(){p.value=!0}function Oe(_e){const Ce=F.value.find(Pe=>Pe.items.some(Be=>Be.id===_e.id));if(Ce){const Pe=Ce.items.find(Be=>Be.id===_e.id);Pe&&(Pe.isDeleted=!0,p.value=!0)}}function Le(_e){}return(_e,Ce)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(dke,{modelValue:x.value,"onUpdate:modelValue":Ce[0]||(Ce[0]=Pe=>x.value=Pe),onAction:N},null,8,["modelValue"]),r.createVNode(fke,{"model-value":w.value},null,8,["model-value"]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[n.value&&f.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-maker",style:r.normalizeStyle(V.value)},[r.withDirectives(r.createVNode(tke,{token:e.token,view:o.value,"is-post-match":v.value,onClose:he,onFiltersChanged:ce},null,8,["token","view","is-post-match"]),[[r.vShow,t.value&&d.value]]),r.createElementVNode("div",mke,[r.createTextVNode(r.toDisplayString(f.value?f.value.name:"Nuevo template")+" ",1),r.createElementVNode("div",{class:"template-maker__header__close",onClick:ue},[_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("svg",yke,[...Ce[6]||(Ce[6]=[r.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),r.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),r.createElementVNode("div",gke,[Ce[13]||(Ce[13]=r.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),r.createElementVNode("div",vke,[r.createElementVNode("div",bke,[r.createElementVNode("div",xke,[r.withDirectives(r.createVNode($V,{"is-post-match":v.value,"initial-cover-id":b.value,onSelectCover:q},null,8,["is-post-match","initial-cover-id"]),[[r.vShow,t.value]])]),(r.openBlock(),r.createElementBlock("div",{class:"template-maker__content__main__pages",key:F.value.length},[g.value?(r.openBlock(),r.createBlock(oSe,{key:0,id:"page-0",game:f.value.game||null,"cover-id":g.value.id,"is-post-match":g.value.isPostMatch,onIntersectionChanged:Ce[1]||(Ce[1]=Pe=>X(Pe,-1))},null,8,["game","cover-id","is-post-match"])):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":F.value.length===0?"30px":"0"})},[d.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Ce[2]||(Ce[2]=Pe=>W(-1))},[...Ce[7]||(Ce[7]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{key:Be,id:`page-${Be+1}`,class:"template-maker__content__main__pages__page"},[r.createElementVNode("div",_ke,[r.createElementVNode("div",Ske,"Pag "+r.toDisplayString(U(Be+2)),1)]),g.value?(r.openBlock(),r.createBlock(l_e,{key:0,page:Pe,"is-template-mode":t.value,"is-post-match":g.value.isPostMatch,game:f.value.game||null,lastGames:f.value.lastGames||[],"is-filter-visible":d.value,onEditView:D,onIntersectionChanged:qe=>X(qe,Be),onChangeSort:Le,onDeletePage:be,onViewChanged:Te,onDeleteView:Oe},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):r.createCommentVNode("",!0),t.value&&!d.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":Be+1===F.value.length?"30px":"0","margin-top":"10px"})},[r.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:qe=>W(Be)},[...Ce[8]||(Ce[8]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Tke),r.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:qe=>K(Pe)},[...Ce[9]||(Ce[9]=[r.createElementVNode("div",null,"+ Agregar gráfico",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,kke)],4)):r.createCommentVNode("",!0)],8,wke))),128))]))]),_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Nke,[r.createElementVNode("div",Vke,[r.createElementVNode("div",Oke,[r.createElementVNode("div",null,"Páginas "+r.toDisplayString(O.value),1),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value<=0}]),onClick:Ce[3]||(Ce[3]=Pe=>m.value>0&&j(m.value-1))},[...Ce[10]||(Ce[10]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value>=F.value.length}]),onClick:Ce[4]||(Ce[4]=Pe=>m.value<F.value.length&&j(m.value+1))},[...Ce[11]||(Ce[11]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)]),r.createElementVNode("div",Lke,[r.createElementVNode("div",{role:"button",class:r.normalizeClass({active:m.value===0}),onClick:Ce[5]||(Ce[5]=Pe=>j(0))},r.toDisplayString(U(1)),3),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{role:"button",key:Be,class:r.normalizeClass({active:Be+1===m.value}),onClick:qe=>j(Be+1)},r.toDisplayString(U(Be+2)),11,Uke))),128))])]),t.value?(r.openBlock(),r.createElementBlock("div",{key:0,role:"button",class:r.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!p.value}]),onClick:ye},[...Ce[12]||(Ce[12]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),r.createElementVNode("div",null,"Guardar",-1)])],2)):r.createCommentVNode("",!0)]))])])],4)):r.createCommentVNode("",!0)]))],64))}},zke=Bc(qke,[["__scopeId","data-v-58c2a1c2"]]);function IN(e,a){return function(){return e.apply(a,arguments)}}const{toString:Cke}=Object.prototype,{getPrototypeOf:O5}=Object,{iterator:_2,toStringTag:XN}=Symbol,S2=(e=>a=>{const i=Cke.call(a);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ap=e=>(e=e.toLowerCase(),a=>S2(a)===e),T2=e=>a=>typeof a===e,{isArray:Q0}=Array,$0=T2("undefined");function J1(e){return e!==null&&!$0(e)&&e.constructor!==null&&!$0(e.constructor)&&Cd(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const DN=Ap("ArrayBuffer");function Pke(e){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&DN(e.buffer),a}const Eke=T2("string"),Cd=T2("function"),JN=T2("number"),B1=e=>e!==null&&typeof e=="object",Rke=e=>e===!0||e===!1,k2=e=>{if(S2(e)!=="object")return!1;const a=O5(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(XN in e)&&!(_2 in e)},Wke=e=>{if(!B1(e)||J1(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Mke=Ap("Date"),Fke=Ap("File"),jke=Ap("Blob"),Kke=Ap("FileList"),Ake=e=>B1(e)&&Cd(e.pipe),Ike=e=>{let a;return e&&(typeof FormData=="function"&&e instanceof FormData||Cd(e.append)&&((a=S2(e))==="formdata"||a==="object"&&Cd(e.toString)&&e.toString()==="[object FormData]"))},Xke=Ap("URLSearchParams"),[Dke,Jke,Bke,Gke]=["ReadableStream","Request","Response","Headers"].map(Ap),Zke=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function G1(e,a,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let k,F;if(typeof e!="object"&&(e=[e]),Q0(e))for(k=0,F=e.length;k<F;k++)a.call(null,e[k],k,e);else{if(J1(e))return;const g=i?Object.getOwnPropertyNames(e):Object.keys(e),m=g.length;let n;for(k=0;k<m;k++)n=g[k],a.call(null,e[n],n,e)}}function BN(e,a){if(J1(e))return null;a=a.toLowerCase();const i=Object.keys(e);let k=i.length,F;for(;k-- >0;)if(F=i[k],a===F.toLowerCase())return F;return null}const zm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,GN=e=>!$0(e)&&e!==zm;function L5(){const{caseless:e,skipUndefined:a}=GN(this)&&this||{},i={},k=(F,g)=>{const m=e&&BN(i,g)||g;k2(i[m])&&k2(F)?i[m]=L5(i[m],F):k2(F)?i[m]=L5({},F):Q0(F)?i[m]=F.slice():(!a||!$0(F))&&(i[m]=F)};for(let F=0,g=arguments.length;F<g;F++)arguments[F]&&G1(arguments[F],k);return i}const Hke=(e,a,i,{allOwnKeys:k}={})=>(G1(a,(F,g)=>{i&&Cd(F)?e[g]=IN(F,i):e[g]=F},{allOwnKeys:k}),e),Yke=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Qke=(e,a,i,k)=>{e.prototype=Object.create(a.prototype,k),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:a.prototype}),i&&Object.assign(e.prototype,i)},$ke=(e,a,i,k)=>{let F,g,m;const n={};if(a=a||{},e==null)return a;do{for(F=Object.getOwnPropertyNames(e),g=F.length;g-- >0;)m=F[g],(!k||k(m,e,a))&&!n[m]&&(a[m]=e[m],n[m]=!0);e=i!==!1&&O5(e)}while(e&&(!i||i(e,a))&&e!==Object.prototype);return a},e7e=(e,a,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=a.length;const k=e.indexOf(a,i);return k!==-1&&k===i},t7e=e=>{if(!e)return null;if(Q0(e))return e;let a=e.length;if(!JN(a))return null;const i=new Array(a);for(;a-- >0;)i[a]=e[a];return i},r7e=(e=>a=>e&&a instanceof e)(typeof Uint8Array<"u"&&O5(Uint8Array)),n7e=(e,a)=>{const k=(e&&e[_2]).call(e);let F;for(;(F=k.next())&&!F.done;){const g=F.value;a.call(e,g[0],g[1])}},a7e=(e,a)=>{let i;const k=[];for(;(i=e.exec(a))!==null;)k.push(i);return k},i7e=Ap("HTMLFormElement"),o7e=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,k,F){return k.toUpperCase()+F}),ZN=(({hasOwnProperty:e})=>(a,i)=>e.call(a,i))(Object.prototype),s7e=Ap("RegExp"),HN=(e,a)=>{const i=Object.getOwnPropertyDescriptors(e),k={};G1(i,(F,g)=>{let m;(m=a(F,g,e))!==!1&&(k[g]=m||F)}),Object.defineProperties(e,k)},l7e=e=>{HN(e,(a,i)=>{if(Cd(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const k=e[i];if(Cd(k)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},c7e=(e,a)=>{const i={},k=F=>{F.forEach(g=>{i[g]=!0})};return Q0(e)?k(e):k(String(e).split(a)),i},u7e=()=>{},d7e=(e,a)=>e!=null&&Number.isFinite(e=+e)?e:a;function p7e(e){return!!(e&&Cd(e.append)&&e[XN]==="FormData"&&e[_2])}const h7e=e=>{const a=new Array(10),i=(k,F)=>{if(B1(k)){if(a.indexOf(k)>=0)return;if(J1(k))return k;if(!("toJSON"in k)){a[F]=k;const g=Q0(k)?[]:{};return G1(k,(m,n)=>{const f=i(m,F+1);!$0(f)&&(g[n]=f)}),a[F]=void 0,g}}return k};return i(e,0)},f7e=Ap("AsyncFunction"),m7e=e=>e&&(B1(e)||Cd(e))&&Cd(e.then)&&Cd(e.catch),YN=((e,a)=>e?setImmediate:a?((i,k)=>(zm.addEventListener("message",({source:F,data:g})=>{F===zm&&g===i&&k.length&&k.shift()()},!1),F=>{k.push(F),zm.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Cd(zm.postMessage)),y7e=typeof queueMicrotask<"u"?queueMicrotask.bind(zm):typeof process<"u"&&process.nextTick||YN,$n={isArray:Q0,isArrayBuffer:DN,isBuffer:J1,isFormData:Ike,isArrayBufferView:Pke,isString:Eke,isNumber:JN,isBoolean:Rke,isObject:B1,isPlainObject:k2,isEmptyObject:Wke,isReadableStream:Dke,isRequest:Jke,isResponse:Bke,isHeaders:Gke,isUndefined:$0,isDate:Mke,isFile:Fke,isBlob:jke,isRegExp:s7e,isFunction:Cd,isStream:Ake,isURLSearchParams:Xke,isTypedArray:r7e,isFileList:Kke,forEach:G1,merge:L5,extend:Hke,trim:Zke,stripBOM:Yke,inherits:Qke,toFlatObject:$ke,kindOf:S2,kindOfTest:Ap,endsWith:e7e,toArray:t7e,forEachEntry:n7e,matchAll:a7e,isHTMLForm:i7e,hasOwnProperty:ZN,hasOwnProp:ZN,reduceDescriptors:HN,freezeMethods:l7e,toObjectSet:c7e,toCamelCase:o7e,noop:u7e,toFiniteNumber:d7e,findKey:BN,global:zm,isContextDefined:GN,isSpecCompliantForm:p7e,toJSONObject:h7e,isAsyncFn:f7e,isThenable:m7e,setImmediate:YN,asap:y7e,isIterable:e=>e!=null&&Cd(e[_2])};function fo(e,a,i,k,F){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",a&&(this.code=a),i&&(this.config=i),k&&(this.request=k),F&&(this.response=F,this.status=F.status?F.status:null)}$n.inherits(fo,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:$n.toJSONObject(this.config),code:this.code,status:this.status}}});const QN=fo.prototype,$N={};["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=>{$N[e]={value:e}}),Object.defineProperties(fo,$N),Object.defineProperty(QN,"isAxiosError",{value:!0}),fo.from=(e,a,i,k,F,g)=>{const m=Object.create(QN);$n.toFlatObject(e,m,function(t){return t!==Error.prototype},l=>l!=="isAxiosError");const n=e&&e.message?e.message:"Error",f=a==null&&e?e.code:a;return fo.call(m,n,f,i,k,F),e&&m.cause==null&&Object.defineProperty(m,"cause",{value:e,configurable:!0}),m.name=e&&e.name||"Error",g&&Object.assign(m,g),m};const g7e=null;function U5(e){return $n.isPlainObject(e)||$n.isArray(e)}function eV(e){return $n.endsWith(e,"[]")?e.slice(0,-2):e}function tV(e,a,i){return e?e.concat(a).map(function(F,g){return F=eV(F),!i&&g?"["+F+"]":F}).join(i?".":""):a}function v7e(e){return $n.isArray(e)&&!e.some(U5)}const b7e=$n.toFlatObject($n,{},null,function(a){return/^is[A-Z]/.test(a)});function N2(e,a,i){if(!$n.isObject(e))throw new TypeError("target must be an object");a=a||new FormData,i=$n.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!$n.isUndefined(s[o])});const k=i.metaTokens,F=i.visitor||t,g=i.dots,m=i.indexes,f=(i.Blob||typeof Blob<"u"&&Blob)&&$n.isSpecCompliantForm(a);if(!$n.isFunction(F))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if($n.isDate(d))return d.toISOString();if($n.isBoolean(d))return d.toString();if(!f&&$n.isBlob(d))throw new fo("Blob is not supported. Use a Buffer instead.");return $n.isArrayBuffer(d)||$n.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function t(d,o,s){let h=d;if(d&&!s&&typeof d=="object"){if($n.endsWith(o,"{}"))o=k?o:o.slice(0,-2),d=JSON.stringify(d);else if($n.isArray(d)&&v7e(d)||($n.isFileList(d)||$n.endsWith(o,"[]"))&&(h=$n.toArray(d)))return o=eV(o),h.forEach(function(p,x){!($n.isUndefined(p)||p===null)&&a.append(m===!0?tV([o],x,g):m===null?o:o+"[]",l(p))}),!1}return U5(d)?!0:(a.append(tV(s,o,g),l(d)),!1)}const _=[],v=Object.assign(b7e,{defaultVisitor:t,convertValue:l,isVisitable:U5});function b(d,o){if(!$n.isUndefined(d)){if(_.indexOf(d)!==-1)throw Error("Circular reference detected in "+o.join("."));_.push(d),$n.forEach(d,function(h,c){(!($n.isUndefined(h)||h===null)&&F.call(a,h,$n.isString(c)?c.trim():c,o,v))===!0&&b(h,o?o.concat(c):[c])}),_.pop()}}if(!$n.isObject(e))throw new TypeError("data must be an object");return b(e),a}function rV(e){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(k){return a[k]})}function q5(e,a){this._pairs=[],e&&N2(e,this,a)}const nV=q5.prototype;nV.append=function(a,i){this._pairs.push([a,i])},nV.toString=function(a){const i=a?function(k){return a.call(this,k,rV)}:rV;return this._pairs.map(function(F){return i(F[0])+"="+i(F[1])},"").join("&")};function x7e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aV(e,a,i){if(!a)return e;const k=i&&i.encode||x7e;$n.isFunction(i)&&(i={serialize:i});const F=i&&i.serialize;let g;if(F?g=F(a,i):g=$n.isURLSearchParams(a)?a.toString():new q5(a,i).toString(k),g){const m=e.indexOf("#");m!==-1&&(e=e.slice(0,m)),e+=(e.indexOf("?")===-1?"?":"&")+g}return e}class iV{constructor(){this.handlers=[]}use(a,i,k){return this.handlers.push({fulfilled:a,rejected:i,synchronous:k?k.synchronous:!1,runWhen:k?k.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){$n.forEach(this.handlers,function(k){k!==null&&a(k)})}}const oV={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},w7e={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:q5,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},z5=typeof window<"u"&&typeof document<"u",C5=typeof navigator=="object"&&navigator||void 0,_7e=z5&&(!C5||["ReactNative","NativeScript","NS"].indexOf(C5.product)<0),S7e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",T7e=z5&&window.location.href||"http://localhost",Gu={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:z5,hasStandardBrowserEnv:_7e,hasStandardBrowserWebWorkerEnv:S7e,navigator:C5,origin:T7e},Symbol.toStringTag,{value:"Module"})),...w7e};function k7e(e,a){return N2(e,new Gu.classes.URLSearchParams,{visitor:function(i,k,F,g){return Gu.isNode&&$n.isBuffer(i)?(this.append(k,i.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...a})}function N7e(e){return $n.matchAll(/\w+|\[(\w*)]/g,e).map(a=>a[0]==="[]"?"":a[1]||a[0])}function V7e(e){const a={},i=Object.keys(e);let k;const F=i.length;let g;for(k=0;k<F;k++)g=i[k],a[g]=e[g];return a}function sV(e){function a(i,k,F,g){let m=i[g++];if(m==="__proto__")return!0;const n=Number.isFinite(+m),f=g>=i.length;return m=!m&&$n.isArray(F)?F.length:m,f?($n.hasOwnProp(F,m)?F[m]=[F[m],k]:F[m]=k,!n):((!F[m]||!$n.isObject(F[m]))&&(F[m]=[]),a(i,k,F[m],g)&&$n.isArray(F[m])&&(F[m]=V7e(F[m])),!n)}if($n.isFormData(e)&&$n.isFunction(e.entries)){const i={};return $n.forEachEntry(e,(k,F)=>{a(N7e(k),F,i,0)}),i}return null}function O7e(e,a,i){if($n.isString(e))try{return(a||JSON.parse)(e),$n.trim(e)}catch(k){if(k.name!=="SyntaxError")throw k}return(i||JSON.stringify)(e)}const Z1={transitional:oV,adapter:["xhr","http","fetch"],transformRequest:[function(a,i){const k=i.getContentType()||"",F=k.indexOf("application/json")>-1,g=$n.isObject(a);if(g&&$n.isHTMLForm(a)&&(a=new FormData(a)),$n.isFormData(a))return F?JSON.stringify(sV(a)):a;if($n.isArrayBuffer(a)||$n.isBuffer(a)||$n.isStream(a)||$n.isFile(a)||$n.isBlob(a)||$n.isReadableStream(a))return a;if($n.isArrayBufferView(a))return a.buffer;if($n.isURLSearchParams(a))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let n;if(g){if(k.indexOf("application/x-www-form-urlencoded")>-1)return k7e(a,this.formSerializer).toString();if((n=$n.isFileList(a))||k.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return N2(n?{"files[]":a}:a,f&&new f,this.formSerializer)}}return g||F?(i.setContentType("application/json",!1),O7e(a)):a}],transformResponse:[function(a){const i=this.transitional||Z1.transitional,k=i&&i.forcedJSONParsing,F=this.responseType==="json";if($n.isResponse(a)||$n.isReadableStream(a))return a;if(a&&$n.isString(a)&&(k&&!this.responseType||F)){const m=!(i&&i.silentJSONParsing)&&F;try{return JSON.parse(a,this.parseReviver)}catch(n){if(m)throw n.name==="SyntaxError"?fo.from(n,fo.ERR_BAD_RESPONSE,this,null,this.response):n}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gu.classes.FormData,Blob:Gu.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$n.forEach(["delete","get","head","post","put","patch"],e=>{Z1.headers[e]={}});const L7e=$n.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"]),U7e=e=>{const a={};let i,k,F;return e&&e.split(`
|
|
4126
|
+
Note: ".grid-stack" is required for proper CSS styling and drag/drop, and is the default selector.`)),k}static addGrid(a,i={}){if(!a)return null;let k=a;if(k.gridstack){const F=k.gridstack;return i&&(F.opts={...F.opts,...i}),i.children!==void 0&&F.load(i.children),F}return(!a.classList.contains("grid-stack")||vi.addRemoveCB)&&(vi.addRemoveCB?k=vi.addRemoveCB(a,i,!0,!0):k=Qn.createDiv(["grid-stack",i.class],a)),vi.init(i,k)}static registerEngine(a){vi.engineClass=a}get placeholder(){if(!this._placeholder){this._placeholder=Qn.createDiv([this.opts.placeholderClass,Id.itemClass,this.opts.itemClass]);const a=Qn.createDiv(["placeholder-content"],this._placeholder);this.opts.placeholderText&&(a.textContent=this.opts.placeholderText)}return this._placeholder}constructor(a,i={}){var k;this.el=a,this.opts=i,this.animationDelay=310,this._gsEventHandler={},this._extraDragRow=0,this.dragTransform={xScale:1,yScale:1,xOffset:0,yOffset:0},a.gridstack=this,this.opts=i=i||{},a.classList.contains("grid-stack")||this.el.classList.add("grid-stack"),i.row&&(i.minRow=i.maxRow=i.row,delete i.row);const F=Qn.toNumber(a.getAttribute("gs-row"));i.column==="auto"&&delete i.column,i.alwaysShowResizeHandle!==void 0&&(i._alwaysShowResizeHandle=i.alwaysShowResizeHandle);const g=i.columnOpts;if(g){const t=g.breakpoints;!g.columnWidth&&!(t!=null&&t.length)?delete i.columnOpts:(g.columnMax=g.columnMax||12,(t==null?void 0:t.length)>1&&t.sort((_,v)=>(v.w||0)-(_.w||0)))}const m={...Qn.cloneDeep(Id),column:Qn.toNumber(a.getAttribute("gs-column"))||Id.column,minRow:F||Qn.toNumber(a.getAttribute("gs-min-row"))||Id.minRow,maxRow:F||Qn.toNumber(a.getAttribute("gs-max-row"))||Id.maxRow,staticGrid:Qn.toBool(a.getAttribute("gs-static"))||Id.staticGrid,sizeToContent:Qn.toBool(a.getAttribute("gs-size-to-content"))||void 0,draggable:{handle:(i.handleClass?"."+i.handleClass:i.handle?i.handle:"")||Id.draggable.handle},removableOptions:{accept:i.itemClass||Id.removableOptions.accept,decline:Id.removableOptions.decline}};a.getAttribute("gs-animate")&&(m.animate=Qn.toBool(a.getAttribute("gs-animate"))),i=Qn.defaults(i,m),this._initMargin(),this.checkDynamicColumn(),this._updateColumnVar(i),i.rtl==="auto"&&(i.rtl=a.style.direction==="rtl"),i.rtl&&this.el.classList.add("grid-stack-rtl");const n=this.el.closest("."+Id.itemClass),f=n==null?void 0:n.gridstackNode;if(f&&(f.subGrid=this,this.parentGridNode=f,this.el.classList.add("grid-stack-nested"),f.el.classList.add("grid-stack-sub-grid")),this._isAutoCellHeight=i.cellHeight==="auto",this._isAutoCellHeight||i.cellHeight==="initial")this.cellHeight(void 0);else{typeof i.cellHeight=="number"&&i.cellHeightUnit&&i.cellHeightUnit!==Id.cellHeightUnit&&(i.cellHeight=i.cellHeight+i.cellHeightUnit,delete i.cellHeightUnit);const t=i.cellHeight;delete i.cellHeight,this.cellHeight(t)}i.alwaysShowResizeHandle==="mobile"&&(i.alwaysShowResizeHandle=Kp),this._setStaticClass();const l=i.engineClass||vi.engineClass||Mh;if(this.engine=new l({column:this.getColumn(),float:i.float,maxRow:i.maxRow,onChange:t=>{t.forEach(_=>{const v=_.el;v&&(_._removeDOM?(v&&v.remove(),delete _._removeDOM):this._writePosAttr(v,_))}),this._updateContainerHeight()}}),i.auto&&(this.batchUpdate(),this.engine._loading=!0,this.getGridItems().forEach(t=>this._prepareElement(t)),delete this.engine._loading,this.batchUpdate(!1)),i.children){const t=i.children;delete i.children,t.length&&this.load(t)}this.setAnimation(),i.subGridDynamic&&!Ri.pauseDrag&&(Ri.pauseDrag=!0),((k=i.draggable)==null?void 0:k.pause)!==void 0&&(Ri.pauseDrag=i.draggable.pause),this._setupRemoveDrop(),this._setupAcceptWidget(),this._updateResizeEvent()}_updateColumnVar(a=this.opts){this.el.classList.add("gs-"+a.column),typeof a.column=="number"&&this.el.style.setProperty("--gs-column-width",`${100/a.column}%`)}addWidget(a){if(!a)return;if(typeof a=="string"){console.error("V11: GridStack.addWidget() does not support string anymore. see #2736");return}if(a.ELEMENT_NODE)return console.error("V11: GridStack.addWidget() does not support HTMLElement anymore. use makeWidget()"),this.makeWidget(a);let i,k=a;if(k.grid=this,k.el?i=k.el:vi.addRemoveCB?i=vi.addRemoveCB(this.el,a,!0,!1):i=this.createWidgetDivs(k),!i)return;if(k=i.gridstackNode,k&&i.parentElement===this.el&&this.engine.nodes.find(g=>g._id===k._id))return i;const F=this._readAttr(i);return Qn.defaults(a,F),this.engine.prepareNode(a),this.el.appendChild(i),this.makeWidget(i,a),i}createWidgetDivs(a){const i=Qn.createDiv(["grid-stack-item",this.opts.itemClass]),k=Qn.createDiv(["grid-stack-item-content"],i);return Qn.lazyLoad(a)?a.visibleObservable||(a.visibleObservable=new IntersectionObserver(([F])=>{var g,m;F.isIntersecting&&((g=a.visibleObservable)==null||g.disconnect(),delete a.visibleObservable,vi.renderCB(k,a),(m=a.grid)==null||m.prepareDragDrop(a.el))}),window.setTimeout(()=>{var F;return(F=a.visibleObservable)==null?void 0:F.observe(i)})):vi.renderCB(k,a),i}makeSubGrid(a,i,k,F=!0){var g,m,n;let f=a.gridstackNode;if(f||(f=this.makeWidget(a).gridstackNode),(g=f.subGrid)!=null&&g.el)return f.subGrid;let l,t=this;for(;t&&!l;)l=(m=t.opts)==null?void 0:m.subGridOpts,t=(n=t.parentGridNode)==null?void 0:n.grid;i=Qn.cloneDeep({...this.opts,id:void 0,children:void 0,column:"auto",columnOpts:void 0,layout:"list",subGridOpts:void 0,...l||{},...i||f.subGridOpts||{}}),f.subGridOpts=i;let _;i.column==="auto"&&(_=!0,i.column=Math.max(f.w||1,(k==null?void 0:k.w)||1),delete i.columnOpts);let v=f.el.querySelector(".grid-stack-item-content"),b,d;if(F&&(this._removeDD(f.el),d={...f,x:0,y:0},Qn.removeInternalForSave(d),delete d.subGridOpts,f.content&&(d.content=f.content,delete f.content),vi.addRemoveCB?b=vi.addRemoveCB(this.el,d,!0,!1):(b=Qn.createDiv(["grid-stack-item"]),b.appendChild(v),v=Qn.createDiv(["grid-stack-item-content"],f.el)),this.prepareDragDrop(f.el)),k){const s=_?i.column:f.w,h=f.h+k.h,c=f.el.style;c.transition="none",this.update(f.el,{w:s,h}),setTimeout(()=>c.transition=null)}const o=f.subGrid=vi.addGrid(v,i);return k!=null&&k._moving&&(o._isTemp=!0),_&&(o._autoColumn=!0),F&&o.makeWidget(b,d),k&&(k._moving?window.setTimeout(()=>Qn.simulateMouseEvent(k._event,"mouseenter",o.el),0):o.makeWidget(f.el,f)),this.resizeToContentCheck(!1,f),o}removeAsSubGrid(a){var i;const k=(i=this.parentGridNode)==null?void 0:i.grid;k&&(k.batchUpdate(),k.removeWidget(this.parentGridNode.el,!0,!0),this.engine.nodes.forEach(F=>{F.x+=this.parentGridNode.x,F.y+=this.parentGridNode.y,k.makeWidget(F.el,F)}),k.batchUpdate(!1),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,a&&window.setTimeout(()=>Qn.simulateMouseEvent(a._event,"mouseenter",k.el),0))}save(a=!0,i=!1,k=vi.saveCB,F){const g=this.engine.save(a,k,F);if(g.forEach(m=>{var n;if(a&&m.el&&!m.subGrid&&!k){const f=m.el.querySelector(".grid-stack-item-content");m.content=f==null?void 0:f.innerHTML,m.content||delete m.content}else if(!a&&!k&&delete m.content,(n=m.subGrid)!=null&&n.el){const f=m.w||m.subGrid.getColumn(),l=m.subGrid.save(a,i,k,f);m.subGridOpts=i?l:{children:l},delete m.subGrid}delete m.el}),i){const m=Qn.cloneDeep(this.opts);m.marginBottom===m.marginTop&&m.marginRight===m.marginLeft&&m.marginTop===m.marginRight&&(m.margin=m.marginTop,delete m.marginTop,delete m.marginRight,delete m.marginBottom,delete m.marginLeft),m.rtl===(this.el.style.direction==="rtl")&&(m.rtl="auto"),this._isAutoCellHeight&&(m.cellHeight="auto"),this._autoColumn&&(m.column="auto");const n=m._alwaysShowResizeHandle;return delete m._alwaysShowResizeHandle,n!==void 0?m.alwaysShowResizeHandle=n:delete m.alwaysShowResizeHandle,Qn.removeInternalAndSame(m,Id),m.children=g,m}return g}load(a,i=vi.addRemoveCB||!0){a=Qn.cloneDeep(a);const k=this.getColumn();a.forEach(t=>{t.w=t.w||t.minW||1,t.h=t.h||t.minH||1}),a=Qn.sort(a),this.engine.skipCacheUpdate=this._ignoreLayoutsNodeChange=!0;let F=0;a.forEach(t=>{F=Math.max(F,(t.x||0)+t.w)}),F>this.engine.defaultColumn&&(this.engine.defaultColumn=F),F>k&&(this.engine.nodes.length===0&&this.responseLayout?(this.engine.nodes=a,this.engine.columnChanged(F,k,this.responseLayout),a=this.engine.nodes,this.engine.nodes=[],delete this.responseLayout):this.engine.cacheLayout(a,F,!0));const g=vi.addRemoveCB;typeof i=="function"&&(vi.addRemoveCB=i);const m=[];this.batchUpdate();const n=!this.engine.nodes.length,f=n&&this.opts.animate;f&&this.setAnimation(!1),!n&&i&&[...this.engine.nodes].forEach(t=>{t.id&&(Qn.find(a,t.id)||(vi.addRemoveCB&&vi.addRemoveCB(this.el,t,!1,!1),m.push(t),this.removeWidget(t.el,!0,!1)))}),this.engine._loading=!0;const l=[];return this.engine.nodes=this.engine.nodes.filter(t=>Qn.find(a,t.id)?(l.push(t),!1):!0),a.forEach(t=>{var _;const v=Qn.find(l,t.id);if(v){if(Qn.shouldSizeToContent(v)&&(t.h=v.h),this.engine.nodeBoundFix(t),(t.autoPosition||t.x===void 0||t.y===void 0)&&(t.w=t.w||v.w,t.h=t.h||v.h,this.engine.findEmptyPosition(t)),this.engine.nodes.push(v),Qn.samePos(v,t)&&this.engine.nodes.length>1&&(this.moveNode(v,{...t,forceCollide:!0}),Qn.copyPos(t,v)),this.update(v.el,t),(_=t.subGridOpts)!=null&&_.children){const b=v.el.querySelector(".grid-stack");b&&b.gridstack&&b.gridstack.load(t.subGridOpts.children)}}else i&&this.addWidget(t)}),delete this.engine._loading,this.engine.removedNodes=m,this.batchUpdate(!1),delete this._ignoreLayoutsNodeChange,delete this.engine.skipCacheUpdate,g?vi.addRemoveCB=g:delete vi.addRemoveCB,f&&this.setAnimation(!0,!0),this}batchUpdate(a=!0){return this.engine.batchUpdate(a),a||(this._updateContainerHeight(),this._triggerRemoveEvent(),this._triggerAddEvent(),this._triggerChangeEvent()),this}getCellHeight(a=!1){if(this.opts.cellHeight&&this.opts.cellHeight!=="auto"&&(!a||!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 i=this.el.querySelector("."+this.opts.itemClass);if(i){const F=Qn.toNumber(i.getAttribute("gs-h"))||1;return Math.round(i.offsetHeight/F)}const k=parseInt(this.el.getAttribute("gs-current-row"));return k?Math.round(this.el.getBoundingClientRect().height/k):this.opts.cellHeight}cellHeight(a){if(a!==void 0&&this._isAutoCellHeight!==(a==="auto")&&(this._isAutoCellHeight=a==="auto",this._updateResizeEvent()),(a==="initial"||a==="auto")&&(a=void 0),a===void 0){const k=-this.opts.marginRight-this.opts.marginLeft+this.opts.marginTop+this.opts.marginBottom;a=this.cellWidth()+k}const i=Qn.parseHeight(a);return this.opts.cellHeightUnit===i.unit&&this.opts.cellHeight===i.h?this:(this.opts.cellHeightUnit=i.unit,this.opts.cellHeight=i.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(a=!1){var i;return a&&(i=this.opts.columnOpts)!=null&&i.breakpointForWindow?window.innerWidth:this.el.clientWidth||this.el.parentElement.clientWidth||window.innerWidth}checkDynamicColumn(){var a,i;const k=this.opts.columnOpts;if(!k||!k.columnWidth&&!((a=k.breakpoints)!=null&&a.length))return!1;const F=this.getColumn();let g=F;const m=this._widthOrContainer(!0);if(k.columnWidth)g=Math.min(Math.round(m/k.columnWidth)||1,k.columnMax);else{g=k.columnMax;let n=0;for(;n<k.breakpoints.length&&m<=k.breakpoints[n].w;)g=k.breakpoints[n++].c||F}if(g!==F){const n=(i=k.breakpoints)==null?void 0:i.find(f=>f.c===g);return this.column(g,(n==null?void 0:n.layout)||k.layout),!0}return!1}compact(a="compact",i=!0){return this.engine.compact(a,i),this._triggerChangeEvent(),this}column(a,i="moveScale"){if(!a||a<1||this.opts.column===a)return this;const k=this.getColumn();return this.opts.column=a,this.engine?(this.engine.column=a,this.el.classList.remove("gs-"+k),this._updateColumnVar(),this.engine.columnChanged(k,a,i),this._isAutoCellHeight&&this.cellHeight(),this.resizeToContentCheck(!0),this._ignoreLayoutsNodeChange=!0,this._triggerChangeEvent(),delete this._ignoreLayoutsNodeChange,this):(this.responseLayout=i,this)}getColumn(){return this.opts.column}getGridItems(){return Array.from(this.el.children).filter(a=>a.matches("."+this.opts.itemClass)&&!a.matches("."+this.opts.placeholderClass))}isIgnoreChangeCB(){return this._ignoreLayoutsNodeChange}destroy(a=!0){var i;if(this.el)return this.offAll(),this._updateResizeEvent(!0),this.setStatic(!0,!1),this.setAnimation(!1),a?this.el.parentNode.removeChild(this.el):(this.removeAll(a),this.el.removeAttribute("gs-current-row")),this.parentGridNode&&delete this.parentGridNode.subGrid,delete this.parentGridNode,delete this.opts,(i=this._placeholder)==null||delete i.gridstackNode,delete this._placeholder,delete this.engine,delete this.el.gridstack,delete this.el,this}float(a){return this.opts.float!==a&&(this.opts.float=this.engine.float=a,this._triggerChangeEvent()),this}getFloat(){return this.engine.float}getCellFromPixel(a,i=!1){const k=this.el.getBoundingClientRect();let F;i?F={top:k.top+document.documentElement.scrollTop,left:k.left}:F={top:this.el.offsetTop,left:this.el.offsetLeft};const g=a.left-F.left,m=a.top-F.top,n=k.width/this.getColumn(),f=k.height/parseInt(this.el.getAttribute("gs-current-row"));return{x:Math.floor(g/n),y:Math.floor(m/f)}}getRow(){return Math.max(this.engine.getRow(),this.opts.minRow||0)}isAreaEmpty(a,i,k,F){return this.engine.isAreaEmpty(a,i,k,F)}makeWidget(a,i){const k=vi.getElement(a);if(!k||k.gridstackNode)return k;k.parentElement||this.el.appendChild(k),this._prepareElement(k,!0,i);const F=k.gridstackNode;this._updateContainerHeight(),F.subGridOpts&&this.makeSubGrid(k,F.subGridOpts,void 0,!1);let g;return this.opts.column===1&&!this._ignoreLayoutsNodeChange&&(g=this._ignoreLayoutsNodeChange=!0),this._triggerAddEvent(),this._triggerChangeEvent(),g&&delete this._ignoreLayoutsNodeChange,k}on(a,i){return a.indexOf(" ")!==-1?(a.split(" ").forEach(k=>this.on(k,i)),this):(a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable"?(a==="enable"||a==="disable"?this._gsEventHandler[a]=k=>i(k):this._gsEventHandler[a]=k=>{k.detail&&i(k,k.detail)},this.el.addEventListener(a,this._gsEventHandler[a])):a==="drag"||a==="dragstart"||a==="dragstop"||a==="resizestart"||a==="resize"||a==="resizestop"||a==="dropped"||a==="resizecontent"?this._gsEventHandler[a]=i:console.error("GridStack.on("+a+") event not supported"),this)}off(a){return a.indexOf(" ")!==-1?(a.split(" ").forEach(i=>this.off(i)),this):((a==="change"||a==="added"||a==="removed"||a==="enable"||a==="disable")&&this._gsEventHandler[a]&&this.el.removeEventListener(a,this._gsEventHandler[a]),delete this._gsEventHandler[a],this)}offAll(){return Object.keys(this._gsEventHandler).forEach(a=>this.off(a)),this}removeWidget(a,i=!0,k=!0){return a?(vi.getElements(a).forEach(F=>{if(F.parentElement&&F.parentElement!==this.el)return;let g=F.gridstackNode;g||(g=this.engine.nodes.find(m=>F===m.el)),g&&(i&&vi.addRemoveCB&&vi.addRemoveCB(this.el,g,!1,!1),delete F.gridstackNode,this._removeDD(F),this.engine.removeNode(g,i,k),i&&F.parentElement&&F.remove())}),k&&(this._triggerRemoveEvent(),this._triggerChangeEvent()),this):(console.error("Error: GridStack.removeWidget(undefined) called"),this)}removeAll(a=!0,i=!0){return this.engine.nodes.forEach(k=>{a&&vi.addRemoveCB&&vi.addRemoveCB(this.el,k,!1,!1),delete k.el.gridstackNode,this.opts.staticGrid||this._removeDD(k.el)}),this.engine.removeAll(a,i),i&&this._triggerRemoveEvent(),this}setAnimation(a=this.opts.animate,i){return i?setTimeout(()=>{this.opts&&this.setAnimation(a)}):a?this.el.classList.add("grid-stack-animate"):this.el.classList.remove("grid-stack-animate"),this.opts.animate=a,this}hasAnimationCSS(){return this.el.classList.contains("grid-stack-animate")}setStatic(a,i=!0,k=!0){return!!this.opts.staticGrid===a?this:(a?this.opts.staticGrid=!0:delete this.opts.staticGrid,this._setupRemoveDrop(),this._setupAcceptWidget(),this.engine.nodes.forEach(F=>{this.prepareDragDrop(F.el),F.subGrid&&k&&F.subGrid.setStatic(a,i,k)}),i&&this._setStaticClass(),this)}updateOptions(a){var i;const k=this.opts;return a===k?this:(a.acceptWidgets!==void 0&&(k.acceptWidgets=a.acceptWidgets,this._setupAcceptWidget()),a.animate!==void 0&&this.setAnimation(a.animate),a.cellHeight&&this.cellHeight(a.cellHeight),a.class!==void 0&&a.class!==k.class&&(k.class&&this.el.classList.remove(k.class),a.class&&this.el.classList.add(a.class)),a.columnOpts?(this.opts.columnOpts=a.columnOpts,this.checkDynamicColumn()):a.columnOpts===null&&this.opts.columnOpts?(delete this.opts.columnOpts,this._updateResizeEvent()):typeof a.column=="number"&&this.column(a.column),a.margin!==void 0&&this.margin(a.margin),a.staticGrid!==void 0&&this.setStatic(a.staticGrid),a.disableDrag!==void 0&&!a.staticGrid&&this.enableMove(!a.disableDrag),a.disableResize!==void 0&&!a.staticGrid&&this.enableResize(!a.disableResize),a.float!==void 0&&this.float(a.float),a.row!==void 0?(k.minRow=k.maxRow=k.row=a.row,this._updateContainerHeight()):(a.minRow!==void 0&&(k.minRow=a.minRow,this._updateContainerHeight()),a.maxRow!==void 0&&(k.maxRow=a.maxRow)),(i=a.children)!=null&&i.length&&this.load(a.children),this)}update(a,i){return vi.getElements(a).forEach(k=>{var F;const g=k==null?void 0:k.gridstackNode;if(!g)return;const m={...Qn.copyPos({},g),...Qn.cloneDeep(i)};this.engine.nodeBoundFix(m),delete m.autoPosition;const n=["x","y","w","h"];let f;if(n.some(_=>m[_]!==void 0&&m[_]!==g[_])&&(f={},n.forEach(_=>{f[_]=m[_]!==void 0?m[_]:g[_],delete m[_]})),!f&&(m.minW||m.minH||m.maxW||m.maxH)&&(f={}),m.content!==void 0){const _=k.querySelector(".grid-stack-item-content");_&&_.textContent!==m.content&&(g.content=m.content,vi.renderCB(_,m),(F=g.subGrid)!=null&&F.el&&(_.appendChild(g.subGrid.el),g.subGrid._updateContainerHeight())),delete m.content}let l=!1,t=!1;for(const _ in m)_[0]!=="_"&&g[_]!==m[_]&&(g[_]=m[_],l=!0,t=t||!this.opts.staticGrid&&(_==="noResize"||_==="noMove"||_==="locked"));if(Qn.sanitizeMinMax(g),f){const _=f.w!==void 0&&f.w!==g.w;this.moveNode(g,f),_&&g.subGrid?g.subGrid.onResize(this.hasAnimationCSS()?g.w:void 0):this.resizeToContentCheck(_,g),delete g._orig}(f||l)&&this._writeAttr(k,g),t&&this.prepareDragDrop(g.el),vi.updateCB&&vi.updateCB(g)}),this}moveNode(a,i){const k=a._updating;k||this.engine.cleanNodes().beginUpdate(a),this.engine.moveNode(a,i),this._updateContainerHeight(),k||(this._triggerChangeEvent(),this.engine.endUpdate())}resizeToContent(a){var i,k;if(!a||(a.classList.remove("size-to-content-max"),!a.clientHeight))return;const F=a.gridstackNode;if(!F)return;const g=F.grid;if(!g||a.parentElement!==g.el)return;const m=g.getCellHeight(!0);if(!m)return;let n=F.h?F.h*m:a.clientHeight,f;if(F.resizeToContentParent&&(f=a.querySelector(F.resizeToContentParent)),f||(f=a.querySelector(vi.resizeToContentParent)),!f)return;const l=a.clientHeight-f.clientHeight,t=F.h?F.h*m-l:f.clientHeight;let _;if(F.subGrid){_=F.subGrid.getRow()*F.subGrid.getCellHeight(!0);const d=F.subGrid.el.getBoundingClientRect(),o=a.getBoundingClientRect();_+=d.top-o.top}else{if((k=(i=F.subGridOpts)==null?void 0:i.children)!=null&&k.length)return;{const d=f.firstElementChild;if(!d){console.error(`Error: GridStack.resizeToContent() widget id:${F.id} '${vi.resizeToContentParent}'.firstElementChild is null, make sure to have a div like container. Skipping sizing.`);return}_=d.getBoundingClientRect().height||t}}if(t===_)return;n+=_-t;let v=Math.ceil(n/m);const b=Number.isInteger(F.sizeToContent)?F.sizeToContent:0;b&&v>b&&(v=b,a.classList.add("size-to-content-max")),F.minH&&v<F.minH?v=F.minH:F.maxH&&v>F.maxH&&(v=F.maxH),v!==F.h&&(g._ignoreLayoutsNodeChange=!0,g.moveNode(F,{h:v}),delete g._ignoreLayoutsNodeChange)}resizeToContentCBCheck(a){vi.resizeToContentCB?vi.resizeToContentCB(a):this.resizeToContent(a)}rotate(a,i){return vi.getElements(a).forEach(k=>{const F=k.gridstackNode;if(!Qn.canBeRotated(F))return;const g={w:F.h,h:F.w,minH:F.minW,minW:F.minH,maxH:F.maxW,maxW:F.maxH};if(i){const n=i.left>0?Math.floor(i.left/this.cellWidth()):0,f=i.top>0?Math.floor(i.top/this.opts.cellHeight):0;g.x=F.x+n-(F.h-(f+1)),g.y=F.y+f-n}Object.keys(g).forEach(n=>{g[n]===void 0&&delete g[n]});const m=F._orig;this.update(k,g),F._orig=m}),this}margin(a){if(!(typeof a=="string"&&a.split(" ").length>1)){const i=Qn.parseHeight(a);if(this.opts.marginUnit===i.unit&&this.opts.margin===i.h)return}return this.opts.margin=a,this.opts.marginTop=this.opts.marginBottom=this.opts.marginLeft=this.opts.marginRight=void 0,this._initMargin(),this}getMargin(){return this.opts.margin}willItFit(a){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 i=arguments;let k=0,F={x:i[k++],y:i[k++],w:i[k++],h:i[k++],autoPosition:i[k++]};return this.willItFit(F)}return this.engine.willItFit(a)}_triggerChangeEvent(){if(this.engine.batchMode)return this;const a=this.engine.getDirtyNodes(!0);return a&&a.length&&(this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(a),this._triggerEvent("change",a)),this.engine.saveInitial(),this}_triggerAddEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.addedNodes)!=null&&a.length){this._ignoreLayoutsNodeChange||this.engine.layoutsNodesChange(this.engine.addedNodes),this.engine.addedNodes.forEach(k=>{delete k._dirty});const i=[...this.engine.addedNodes];this.engine.addedNodes=[],this._triggerEvent("added",i)}return this}_triggerRemoveEvent(){var a;if(this.engine.batchMode)return this;if((a=this.engine.removedNodes)!=null&&a.length){const i=[...this.engine.removedNodes];this.engine.removedNodes=[],this._triggerEvent("removed",i)}return this}_triggerEvent(a,i){const k=i?new CustomEvent(a,{bubbles:!1,detail:i}):new Event(a);let F=this;for(;F.parentGridNode;)F=F.parentGridNode.grid;return F.el.dispatchEvent(k),this}_updateContainerHeight(){if(!this.engine||this.engine.batchMode)return this;const a=this.parentGridNode;let i=this.getRow()+this._extraDragRow;const k=this.opts.cellHeight,F=this.opts.cellHeightUnit;if(!k)return this;if(!a&&!this.opts.minRow){const g=Qn.parseHeight(getComputedStyle(this.el).minHeight);if(g.h>0&&g.unit===F){const m=Math.floor(g.h/k);i<m&&(i=m)}}return this.el.setAttribute("gs-current-row",String(i)),this.el.style.removeProperty("min-height"),this.el.style.removeProperty("height"),i&&(this.el.style[a?"minHeight":"height"]=i*k+F),a&&Qn.shouldSizeToContent(a)&&a.grid.resizeToContentCBCheck(a.el),this}_prepareElement(a,i=!1,k){k=k||this._readAttr(a),a.gridstackNode=k,k.el=a,k.grid=this,k=this.engine.addNode(k,i),this._writeAttr(a,k),a.classList.add(Id.itemClass,this.opts.itemClass);const F=Qn.shouldSizeToContent(k);return F?a.classList.add("size-to-content"):a.classList.remove("size-to-content"),F&&this.resizeToContentCheck(!1,k),Qn.lazyLoad(k)||this.prepareDragDrop(k.el),this}_writePosAttr(a,i){return(!i._moving&&!i._resizing||this._placeholder===a)&&(a.style.top=i.y?i.y===1?"var(--gs-cell-height)":`calc(${i.y} * var(--gs-cell-height))`:null,a.style.left=i.x?i.x===1?"var(--gs-column-width)":`calc(${i.x} * var(--gs-column-width))`:null,a.style.width=i.w>1?`calc(${i.w} * var(--gs-column-width))`:null,a.style.height=i.h>1?`calc(${i.h} * var(--gs-cell-height))`:null),i.x>0?a.setAttribute("gs-x",String(i.x)):a.removeAttribute("gs-x"),i.y>0?a.setAttribute("gs-y",String(i.y)):a.removeAttribute("gs-y"),i.w>1?a.setAttribute("gs-w",String(i.w)):a.removeAttribute("gs-w"),i.h>1?a.setAttribute("gs-h",String(i.h)):a.removeAttribute("gs-h"),this}_writeAttr(a,i){if(!i)return this;this._writePosAttr(a,i);const k={noResize:"gs-no-resize",noMove:"gs-no-move",locked:"gs-locked",id:"gs-id",sizeToContent:"gs-size-to-content"};for(const F in k)i[F]?a.setAttribute(k[F],String(i[F])):a.removeAttribute(k[F]);return this}_readAttr(a,i=!0){const k={};k.x=Qn.toNumber(a.getAttribute("gs-x")),k.y=Qn.toNumber(a.getAttribute("gs-y")),k.w=Qn.toNumber(a.getAttribute("gs-w")),k.h=Qn.toNumber(a.getAttribute("gs-h")),k.autoPosition=Qn.toBool(a.getAttribute("gs-auto-position")),k.noResize=Qn.toBool(a.getAttribute("gs-no-resize")),k.noMove=Qn.toBool(a.getAttribute("gs-no-move")),k.locked=Qn.toBool(a.getAttribute("gs-locked"));const F=a.getAttribute("gs-size-to-content");F&&(F==="true"||F==="false"?k.sizeToContent=Qn.toBool(F):k.sizeToContent=parseInt(F,10)),k.id=a.getAttribute("gs-id"),k.maxW=Qn.toNumber(a.getAttribute("gs-max-w")),k.minW=Qn.toNumber(a.getAttribute("gs-min-w")),k.maxH=Qn.toNumber(a.getAttribute("gs-max-h")),k.minH=Qn.toNumber(a.getAttribute("gs-min-h")),i&&(k.w===1&&a.removeAttribute("gs-w"),k.h===1&&a.removeAttribute("gs-h"),k.maxW&&a.removeAttribute("gs-max-w"),k.minW&&a.removeAttribute("gs-min-w"),k.maxH&&a.removeAttribute("gs-max-h"),k.minH&&a.removeAttribute("gs-min-h"));for(const g in k){if(!k.hasOwnProperty(g))return;!k[g]&&k[g]!==0&&g!=="sizeToContent"&&delete k[g]}return k}_setStaticClass(){const a=["grid-stack-static"];return this.opts.staticGrid?(this.el.classList.add(...a),this.el.setAttribute("gs-static","true")):(this.el.classList.remove(...a),this.el.removeAttribute("gs-static")),this}onResize(a=(i=>(i=this.el)==null?void 0:i.clientWidth)()){if(!a||this.prevWidth===a)return;this.prevWidth=a,this.batchUpdate();let i=!1;return this._autoColumn&&this.parentGridNode?this.opts.column!==this.parentGridNode.w&&(this.column(this.parentGridNode.w,this.opts.layout||"list"),i=!0):i=this.checkDynamicColumn(),this._isAutoCellHeight&&this.cellHeight(),this.engine.nodes.forEach(k=>{k.subGrid&&k.subGrid.onResize()}),this._skipInitialResize||this.resizeToContentCheck(i),delete this._skipInitialResize,this.batchUpdate(!1),this}resizeToContentCheck(a=!1,i=void 0){if(this.engine){if(a&&this.hasAnimationCSS())return setTimeout(()=>this.resizeToContentCheck(!1,i),this.animationDelay);if(i)Qn.shouldSizeToContent(i)&&this.resizeToContentCBCheck(i.el);else if(this.engine.nodes.some(k=>Qn.shouldSizeToContent(k))){const k=[...this.engine.nodes];this.batchUpdate(),k.forEach(F=>{Qn.shouldSizeToContent(F)&&this.resizeToContentCBCheck(F.el)}),this._ignoreLayoutsNodeChange=!0,this.batchUpdate(!1),this._ignoreLayoutsNodeChange=!1}this._gsEventHandler.resizecontent&&this._gsEventHandler.resizecontent(null,i?[i]:this.engine.nodes)}}_updateResizeEvent(a=!1){const i=!this.parentGridNode&&(this._isAutoCellHeight||this.opts.sizeToContent||this.opts.columnOpts||this.engine.nodes.find(k=>k.sizeToContent));return!a&&i&&!this.resizeObserver?(this._sizeThrottle=Qn.throttle(()=>this.onResize(),this.opts.cellHeightThrottle),this.resizeObserver=new ResizeObserver(()=>this._sizeThrottle()),this.resizeObserver.observe(this.el),this._skipInitialResize=!0):(a||!i)&&this.resizeObserver&&(this.resizeObserver.disconnect(),delete this.resizeObserver,delete this._sizeThrottle),this}static getElement(a=".grid-stack-item"){return Qn.getElement(a)}static getElements(a=".grid-stack-item"){return Qn.getElements(a)}static getGridElement(a){return vi.getElement(a)}static getGridElements(a){return Qn.getElements(a)}_initMargin(){let a,i=0,k=[];typeof this.opts.margin=="string"&&(k=this.opts.margin.split(" ")),k.length===2?(this.opts.marginTop=this.opts.marginBottom=k[0],this.opts.marginLeft=this.opts.marginRight=k[1]):k.length===4?(this.opts.marginTop=k[0],this.opts.marginRight=k[1],this.opts.marginBottom=k[2],this.opts.marginLeft=k[3]):(a=Qn.parseHeight(this.opts.margin),this.opts.marginUnit=a.unit,i=this.opts.margin=a.h),["marginTop","marginRight","marginBottom","marginLeft"].forEach(g=>{this.opts[g]===void 0?this.opts[g]=i:(a=Qn.parseHeight(this.opts[g]),this.opts[g]=a.h,delete this.opts.margin)}),this.opts.marginUnit=a.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 F=this.el.style;return F.setProperty("--gs-item-margin-top",`${this.opts.marginTop}${this.opts.marginUnit}`),F.setProperty("--gs-item-margin-bottom",`${this.opts.marginBottom}${this.opts.marginUnit}`),F.setProperty("--gs-item-margin-right",`${this.opts.marginRight}${this.opts.marginUnit}`),F.setProperty("--gs-item-margin-left",`${this.opts.marginLeft}${this.opts.marginUnit}`),this}static getDD(){return ad}static setupDragIn(a,i,k,F=document){(i==null?void 0:i.pause)!==void 0&&(Ri.pauseDrag=i.pause),i={appendTo:"body",helper:"clone",...i||{}},(typeof a=="string"?Qn.getElements(a,F):a).forEach((g,m)=>{ad.isDraggable(g)||ad.dragIn(g,i),k!=null&&k[m]&&(g.gridstackNode=k[m])})}movable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const F=k.gridstackNode;F&&(i?delete F.noMove:F.noMove=!0,this.prepareDragDrop(F.el))}),this)}resizable(a,i){return this.opts.staticGrid?this:(vi.getElements(a).forEach(k=>{const F=k.gridstackNode;F&&(i?delete F.noResize:F.noResize=!0,this.prepareDragDrop(F.el))}),this)}disable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!1,a),this.enableResize(!1,a),this._triggerEvent("disable"),this}enable(a=!0){if(!this.opts.staticGrid)return this.enableMove(!0,a),this.enableResize(!0,a),this._triggerEvent("enable"),this}enableMove(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableDrag:this.opts.disableDrag=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableMove(a,i)}),this)}enableResize(a,i=!0){return this.opts.staticGrid?this:(a?delete this.opts.disableResize:this.opts.disableResize=!0,this.engine.nodes.forEach(k=>{this.prepareDragDrop(k.el),k.subGrid&&i&&k.subGrid.enableResize(a,i)}),this)}cancelDrag(){var a;const i=(a=this._placeholder)==null?void 0:a.gridstackNode;i&&(i._isExternal?(i._isAboutToRemove=!0,this.engine.removeNode(i)):i._isAboutToRemove&&vi._itemRemoving(i.el,!1),this.engine.restoreInitial())}_removeDD(a){return ad.draggable(a,"destroy").resizable(a,"destroy"),a.gridstackNode&&delete a.gridstackNode._initDD,delete a.ddElement,this}_setupAcceptWidget(){if(this.opts.staticGrid||!this.opts.acceptWidgets&&!this.opts.removable)return ad.droppable(this.el,"destroy"),this;let a,i;const k=(F,g,m)=>{var n;m=m||g;const f=m.gridstackNode;if(!f)return;if(!((n=f.grid)!=null&&n.el)){m.style.transform=`scale(${1/this.dragTransform.xScale},${1/this.dragTransform.yScale})`;const b=m.getBoundingClientRect();m.style.left=b.x+(this.dragTransform.xScale-1)*(F.clientX-b.x)/this.dragTransform.xScale+"px",m.style.top=b.y+(this.dragTransform.yScale-1)*(F.clientY-b.y)/this.dragTransform.yScale+"px",m.style.transformOrigin="0px 0px"}let{top:l,left:t}=m.getBoundingClientRect();const _=this.el.getBoundingClientRect();t-=_.left,l-=_.top;const v={position:{top:l*this.dragTransform.xScale,left:t*this.dragTransform.yScale}};if(f._temporaryRemoved){if(f.x=Math.max(0,Math.round(t/i)),f.y=Math.max(0,Math.round(l/a)),delete f.autoPosition,this.engine.nodeBoundFix(f),!this.engine.willItFit(f)){if(f.autoPosition=!0,!this.engine.willItFit(f)){ad.off(g,"drag");return}f._willFitPos&&(Qn.copyPos(f,f._willFitPos),delete f._willFitPos)}this._onStartMoving(m,F,v,f,i,a)}else this._dragOrResize(m,F,v,f,i,a)};return ad.droppable(this.el,{accept:F=>{const g=F.gridstackNode||this._readAttr(F,!1);if((g==null?void 0:g.grid)===this)return!0;if(!this.opts.acceptWidgets)return!1;let m=!0;if(typeof this.opts.acceptWidgets=="function")m=this.opts.acceptWidgets(F);else{const n=this.opts.acceptWidgets===!0?".grid-stack-item":this.opts.acceptWidgets;m=F.matches(n)}if(m&&g&&this.opts.maxRow){const n={w:g.w,h:g.h,minW:g.minW,minH:g.minH};m=this.engine.willItFit(n)}return m}}).on(this.el,"dropover",(F,g,m)=>{let n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((n==null?void 0:n.grid)===this&&!n._temporaryRemoved)return!1;if(n!=null&&n._sidebarOrig&&(n.w=n._sidebarOrig.w,n.h=n._sidebarOrig.h),n!=null&&n.grid&&n.grid!==this&&!n._temporaryRemoved&&n.grid._leave(g,m),m=m||g,i=this.cellWidth(),a=this.getCellHeight(!0),!n){const t=m.getAttribute("data-gs-widget")||m.getAttribute("gridstacknode");if(t){try{n=JSON.parse(t)}catch{console.error("Gridstack dropover: Bad JSON format: ",t)}m.removeAttribute("data-gs-widget"),m.removeAttribute("gridstacknode")}n||(n=this._readAttr(m)),n._sidebarOrig={w:n.w,h:n.h}}n.grid||(n.el||(n={...n}),n._isExternal=!0,m.gridstackNode=n);const f=n.w||Math.round(m.offsetWidth/i)||1,l=n.h||Math.round(m.offsetHeight/a)||1;return n.grid&&n.grid!==this?(g._gridstackNodeOrig||(g._gridstackNodeOrig=n),g.gridstackNode=n={...n,w:f,h:l,grid:this},delete n.x,delete n.y,this.engine.cleanupNode(n).nodeBoundFix(n),n._initDD=n._isExternal=n._temporaryRemoved=!0):(n.w=f,n.h=l,n._temporaryRemoved=!0),vi._itemRemoving(n.el,!1),ad.on(g,"drag",k),k(F,g,m),!1}).on(this.el,"dropout",(F,g,m)=>{const n=(m==null?void 0:m.gridstackNode)||g.gridstackNode;return n&&(!n.grid||n.grid===this)&&(this._leave(g,m),this._isTemp&&this.removeAsSubGrid(n)),!1}).on(this.el,"drop",(F,g,m)=>{var n,f,l;const t=(m==null?void 0:m.gridstackNode)||g.gridstackNode;if((t==null?void 0:t.grid)===this&&!t._isExternal)return!1;const _=!!this.placeholder.parentElement,v=g!==m;this.placeholder.remove(),delete this.placeholder.gridstackNode,_&&this.opts.animate&&(this.setAnimation(!1),this.setAnimation(!0,!0));const b=g._gridstackNodeOrig;if(delete g._gridstackNodeOrig,_&&b!=null&&b.grid&&b.grid!==this){const o=b.grid;o.engine.removeNodeFromLayoutCache(b),o.engine.removedNodes.push(b),o._triggerRemoveEvent()._triggerChangeEvent(),o.parentGridNode&&!o.engine.nodes.length&&o.opts.subGridDynamic&&o.removeAsSubGrid()}if(!t||(_&&(this.engine.cleanupNode(t),t.grid=this),(n=t.grid)==null||delete n._isTemp,ad.off(g,"drag"),m!==g?(m.remove(),g=m):g.remove(),this._removeDD(g),!_))return!1;const d=(l=(f=t.subGrid)==null?void 0:f.el)==null?void 0:l.gridstack;return Qn.copyPos(t,this._readAttr(this.placeholder)),Qn.removePositioningStyles(g),v&&(t.content||t.subGridOpts||vi.addRemoveCB)?(delete t.el,g=this.addWidget(t)):(this._prepareElement(g,!0,t),this.el.appendChild(g),this.resizeToContentCheck(!1,t),d&&(d.parentGridNode=t),this._updateContainerHeight()),this.engine.addedNodes.push(t),this._triggerAddEvent(),this._triggerChangeEvent(),this.engine.endUpdate(),this._gsEventHandler.dropped&&this._gsEventHandler.dropped({...F,type:"dropped"},b&&b.grid?b:void 0,t),!1}),this}static _itemRemoving(a,i){if(!a)return;const k=a?a.gridstackNode:void 0;!(k!=null&&k.grid)||a.classList.contains(k.grid.opts.removableOptions.decline)||(i?k._isAboutToRemove=!0:delete k._isAboutToRemove,i?a.classList.add("grid-stack-item-removing"):a.classList.remove("grid-stack-item-removing"))}_setupRemoveDrop(){if(typeof this.opts.removable!="string")return this;const a=document.querySelector(this.opts.removable);return a?(!this.opts.staticGrid&&!ad.isDroppable(a)&&ad.droppable(a,this.opts.removableOptions).on(a,"dropover",(i,k)=>vi._itemRemoving(k,!0)).on(a,"dropout",(i,k)=>vi._itemRemoving(k,!1)),this):this}prepareDragDrop(a,i=!1){const k=a==null?void 0:a.gridstackNode;if(!k)return;const F=k.noMove||this.opts.disableDrag,g=k.noResize||this.opts.disableResize,m=this.opts.staticGrid||F&&g;if((i||m)&&(k._initDD&&(this._removeDD(a),delete k._initDD),m&&a.classList.add("ui-draggable-disabled","ui-resizable-disabled"),!i))return this;if(!k._initDD){let n,f;const l=(v,b)=>{this.triggerEvent(v,v.target),n=this.cellWidth(),f=this.getCellHeight(!0),this._onStartMoving(a,v,b,k,n,f)},t=(v,b)=>{this._dragOrResize(a,v,b,k,n,f)},_=v=>{this.placeholder.remove(),delete this.placeholder.gridstackNode,delete k._moving,delete k._resizing,delete k._event,delete k._lastTried;const b=k.w!==k._orig.w,d=v.target;if(!(!d.gridstackNode||d.gridstackNode.grid!==this)){if(k.el=d,k._isAboutToRemove){const o=a.gridstackNode.grid;o._gsEventHandler[v.type]&&o._gsEventHandler[v.type](v,d),o.engine.nodes.push(k),o.removeWidget(a,!0,!0)}else Qn.removePositioningStyles(d),k._temporaryRemoved?(this._writePosAttr(d,k),this.engine.addNode(k)):this._writePosAttr(d,k),this.triggerEvent(v,d);this._extraDragRow=0,this._updateContainerHeight(),this._triggerChangeEvent(),this.engine.endUpdate(),v.type==="resizestop"&&(Number.isInteger(k.sizeToContent)&&(k.sizeToContent=k.h),this.resizeToContentCheck(b,k))}};ad.draggable(a,{start:l,stop:_,drag:t}).resizable(a,{start:l,stop:_,resize:t}),k._initDD=!0}return ad.draggable(a,F?"disable":"enable").resizable(a,g?"disable":"enable"),this}_onStartMoving(a,i,k,F,g,m){var n;if(this.engine.cleanNodes().beginUpdate(F),this._writePosAttr(this.placeholder,F),this.el.appendChild(this.placeholder),this.placeholder.gridstackNode=F,(n=F.grid)!=null&&n.el)this.dragTransform=Qn.getValuesFromTransformedElement(a);else if(this.placeholder&&this.placeholder.closest(".grid-stack")){const f=this.placeholder.closest(".grid-stack");this.dragTransform=Qn.getValuesFromTransformedElement(f)}else this.dragTransform={xScale:1,xOffset:0,yScale:1,yOffset:0};if(F.el=this.placeholder,F._lastUiPosition=k.position,F._prevYPix=k.position.top,F._moving=i.type==="dragstart",F._resizing=i.type==="resizestart",delete F._lastTried,i.type==="dropover"&&F._temporaryRemoved&&(this.engine.addNode(F),F._moving=!0),this.engine.cacheRects(g,m,this.opts.marginTop,this.opts.marginRight,this.opts.marginBottom,this.opts.marginLeft),i.type==="resizestart"){const f=this.getColumn()-F.x,l=(this.opts.maxRow||Number.MAX_SAFE_INTEGER)-F.y;ad.resizable(a,"option","minWidth",g*Math.min(F.minW||1,f)).resizable(a,"option","minHeight",m*Math.min(F.minH||1,l)).resizable(a,"option","maxWidth",g*Math.min(F.maxW||Number.MAX_SAFE_INTEGER,f)).resizable(a,"option","maxWidthMoveLeft",g*Math.min(F.maxW||Number.MAX_SAFE_INTEGER,F.x+F.w)).resizable(a,"option","maxHeight",m*Math.min(F.maxH||Number.MAX_SAFE_INTEGER,l)).resizable(a,"option","maxHeightMoveUp",m*Math.min(F.maxH||Number.MAX_SAFE_INTEGER,F.y+F.h))}}_dragOrResize(a,i,k,F,g,m){const n={...F._orig};let f,l=this.opts.marginLeft,t=this.opts.marginRight,_=this.opts.marginTop,v=this.opts.marginBottom;const b=Math.round(m*.1),d=Math.round(g*.1);if(l=Math.min(l,d),t=Math.min(t,d),_=Math.min(_,b),v=Math.min(v,b),i.type==="drag"){if(F._temporaryRemoved)return;const s=k.position.top-F._prevYPix;F._prevYPix=k.position.top,this.opts.draggable.scroll!==!1&&Qn.updateScrollPosition(a,k.position,s);const h=k.position.left+(k.position.left>F._lastUiPosition.left?-t:l),c=k.position.top+(k.position.top>F._lastUiPosition.top?-v:_);n.x=Math.round(h/g),n.y=Math.round(c/m);const p=this._extraDragRow;if(this.engine.collide(F,n)){const x=this.getRow();let w=Math.max(0,n.y+F.h-x);this.opts.maxRow&&x+w>this.opts.maxRow&&(w=Math.max(0,this.opts.maxRow-x)),this._extraDragRow=w}else this._extraDragRow=0;if(this._extraDragRow!==p&&this._updateContainerHeight(),F.x===n.x&&F.y===n.y)return}else if(i.type==="resize"){if(n.x<0||(Qn.updateScrollResize(i,a,m),n.w=Math.round((k.size.width-l)/g),n.h=Math.round((k.size.height-_)/m),F.w===n.w&&F.h===n.h)||F._lastTried&&F._lastTried.w===n.w&&F._lastTried.h===n.h)return;const s=k.position.left+l,h=k.position.top+_;n.x=Math.round(s/g),n.y=Math.round(h/m),f=!0}F._event=i,F._lastTried=n;const o={x:k.position.left+l,y:k.position.top+_,w:(k.size?k.size.width:F.w*g)-l-t,h:(k.size?k.size.height:F.h*m)-_-v};if(this.engine.moveNodeCheck(F,{...n,cellWidth:g,cellHeight:m,rect:o,resizing:f})){F._lastUiPosition=k.position,this.engine.cacheRects(g,m,_,t,v,l),delete F._skipDown,f&&F.subGrid&&F.subGrid.onResize(),this._extraDragRow=0,this._updateContainerHeight();const s=i.target;F._sidebarOrig||this._writePosAttr(s,F),this.triggerEvent(i,s)}}triggerEvent(a,i){let k=this;for(;k.parentGridNode;)k=k.parentGridNode.grid;k._gsEventHandler[a.type]&&k._gsEventHandler[a.type](a,i)}_leave(a,i){i=i||a;const k=i.gridstackNode;if(!k||(i.style.transform=i.style.transformOrigin=null,ad.off(a,"drag"),k._temporaryRemoved))return;k._temporaryRemoved=!0,this.engine.removeNode(k),k.el=k._isExternal&&i?i:a;const F=k._sidebarOrig;k._isExternal&&this.engine.cleanupNode(k),k._sidebarOrig=F,this.opts.removable===!0&&vi._itemRemoving(a,!0),a._gridstackNodeOrig?(a.gridstackNode=a._gridstackNodeOrig,delete a._gridstackNodeOrig):k._isExternal&&this.engine.restoreInitial()}commit(){return j5e(this,this.batchUpdate(!1),"commit","batchUpdate","5.2"),this}}vi.renderCB=(e,a)=>{e&&a!=null&&a.content&&(e.textContent=a.content)},vi.resizeToContentParent=".grid-stack-item-content",vi.Utils=Qn,vi.Engine=Mh,vi.GDRev="12.3.2";const X5e=[{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}],Fh=e=>X5e.find(a=>a.id===e),jh=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 Y0{constructor(a,i=[],k,F=null,g=!1,m=!1,n=null,f=null,l=null){Tp(this,"id",""),Tp(this,"childViews",[]),Tp(this,"viewId",0),Tp(this,"dynamicFilters",null),Tp(this,"componentSpecificFilters",new Map),Tp(this,"isPostMatch",!1),Tp(this,"isTemplateMode",!1),Tp(this,"filtresJSON",null),Tp(this,"token",null),Tp(this,"_isUpdating",!1),Tp(this,"filters",null),this.id=a,this.viewId=k,this.childViews=i,this.dynamicFilters=F,this.isPostMatch=g,this.isTemplateMode=m,this.filtresJSON=n,this.token=f,this.filters=l,this.componentSpecificFilters=new Map}resetClass(){this.childViews.forEach(a=>{a.view.filterAndViewsContainer=new Y0(this.id,[a],this.viewId,this.dynamicFilters,this.isPostMatch,this.isTemplateMode,this.filtresJSON,this.token,this.filters)})}hasEventTypeId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.event_type_id===i)}hasCategoryId(a,i){return!a||!Array.isArray(a)?!1:a.some(k=>k&&k.category_id===i)}getId(){return this.id}setViewId(a){this.viewId=a}setFiltersJSON(a){this.filtresJSON=a}setDynamicFilters(a,i=null){i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a}setFilters(a){this.filters=a}getComponentDynamicFilters(a){return a&&this.componentSpecificFilters.has(a)?this.componentSpecificFilters.get(a):this.dynamicFilters}getAllComponentFilters(){return this.componentSpecificFilters}debugComponentFilters(){}static debugAllComponentFilters(){}clearAllComponentFilters(){this.componentSpecificFilters.clear()}getDynamicFilters(){return this.dynamicFilters}getHomeTeamViews(){return this.childViews.filter(a=>a.view.isHomeTeam)}getAwayTeamViews(){return this.childViews.filter(a=>!a.view.isHomeTeam)}addLastTouch(a){if(a.view.componentProps&&this.filters){let i=null;const k=this.filters.selectedCategories.map(g=>g.value),F=this.filters.selectedTeam.value;if(F===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=!0,f.view.isHomeTeam=!0,f.view.filterMultiple&&(f.view.filterMultiple.isHomeTeam=!0)});const g=this.getHomeTeamViews(),m=this.getAwayTeamViews();let n=!0;for(let f=0;f<k.length;f++){i=k[f];const l=g.find(_=>_.view.componentProps.categories[0].name===i.name),t=m.find(_=>_.view.componentProps.categories[0].name===i.name);if(!l||!t){n=!l;break}}n?this.childViews.length===0?(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):this.childViews.reduce((f,l,t,_)=>{let v={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 f&&(f.isHomeTeam&&!l.view.isHomeTeam?(l.view.componentProps.categories=[i],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=i.name,a.view.titleShort=i.name,l.view.isHomeTeam=!0,l.view.filterMultiple={isHomeTeam:l.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible}):!f.isHomeTeam&&!l.view.isHomeTeam&&(l.view.componentProps.categories=f.categories,l.view.componentProps.analysisType=f.analysisType,l.view.componentProps.isHomeTeamForAnalysis=f.isHomeTeamForAnalysis,l.view.componentProps.isAssistZoneVisible=f.isAssistZoneVisible,l.view.componentProps.howManyGames=f.howManyGames,l.view.title=f.title,l.view.titleShort=f.titleShort,l.view.isHomeTeam=f.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}),t===_.length-1&&(a.view.componentProps.categories=v.categories,a.view.componentProps.analysisType=v.analysisType,a.view.componentProps.isHomeTeamForAnalysis=v.isHomeTeamForAnalysis,a.view.componentProps.isAssistZoneVisible=v.isAssistZoneVisible,a.view.componentProps.howManyGames=v.howManyGames,a.view.title=v.title,a.view.titleShort=v.titleShort,a.view.isHomeTeam=v.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:a.view.componentProps.categories[0],selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})),v},null):(a.view.componentProps.categories=[i],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=i.name,a.view.titleShort=i.name,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:i,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible})}else{const g=F===1,m=g?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=g,a.view.isHomeTeam=g;for(let n=0;n<k.length;n++){const f=k[n];if(!m.find(l=>l.view.componentProps.categories[0].name===f.name)){a.view.componentProps.categories=[f],a.view.componentProps.analysisType=this.filters.selectedGamePhase.name,a.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,a.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,a.view.title=f.name,a.view.titleShort=f.name,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:f,selectedGamePhase:this.filters.selectedGamePhase,howManyGamesSelected:this.filters.howManyGamesSelected,isAssistZoneVisible:this.filters.isAssistZoneVisible};break}}}}}addView(a,i=!1){var k,F,g,m,n,f,l,t,_,v;if(a.view.filterAndViewsContainer=this,qa.emit("component-added-to-container",this),this.viewId===5&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.preMatchType=this.dynamicFilters[0]!==3&&this.dynamicFilters[0]||1,a.view.filterMultiple={isHomeTeam:a.view.componentProps.preMatchType===1}),this.viewId===10&&a.view.componentProps&&!i&&(a.view.componentProps.isHomeTeamForAnalysis=this.dynamicFilters[0]!==3?this.dynamicFilters[0]===1:1,a.isHomeTeam=a.view.componentProps.isHomeTeamForAnalysis,a.view.filterMultiple={isHomeTeam:a.view.componentProps.isHomeTeamForAnalysis},a.view.filtersJSON=this.filtresJSON),this.viewId===7&&a.view.componentProps&&!i){const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=d[0]===1?"offensive":"defensive",s=d[1]===1;a.view.componentProps.analysisType=o,a.view.componentProps.isHomeTeamForAnalysis=s,a.isHomeTeam=s,a.view.filterMultiple={isHomeTeam:s},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:d})}if(this.viewId===1&&a.view.componentProps&&!i){const b=this.dynamicFilters[0]||[];if(b&&b.length>0){let d;if(Array.isArray(b)){const s=this.childViews.map(c=>{var p;return(p=c.view.componentProps)==null?void 0:p.type}).filter(c=>c!==void 0),h=b.filter(c=>!s.includes(c));h.length>0?d=h[0]:d=b[0]}else d=b;const o=jh.get(this.viewId);a.view.componentProps.type=d,a.view.componentProps.default=!1,a.view.title=`Comparativa ${o[d]}`,a.view.filterMultiple={category:d}}}if(this.viewId===9&&a.view.componentProps&&!i){const b=this.dynamicFilters[0].map(h=>h.join("-"));let d="";const o=this.dynamicFilters[1],s=jh.get(this.viewId);if(o===3){this.getHomeTeamViews().length===0&&this.getAwayTeamViews().length>0&&this.getAwayTeamViews().forEach(w=>{w.view.componentProps.isHomeTeamForAnalysis=!0,w.view.isHomeTeam=!0,w.view.filterMultiple&&(w.view.filterMultiple.isHomeTeam=!0)});let h=null;const c=this.getHomeTeamViews(),p=this.getAwayTeamViews();let x=!0;for(let w=0;w<b.length;w++){d=b[w],h=s.analysisTypes.get(b[w]);const T=c.find(O=>O.view.componentProps.analysisType===h.analysisType),V=p.find(O=>O.view.componentProps.analysisType===h.analysisType);if(!T||!V){x=!T;break}}x?this.childViews.length===0?(a.view.componentProps.analysisType=h.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.title=h.title,a.view.titleShort=h.titleShort,a.view.isHomeTeam=!0,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:d.split("-").map(w=>parseInt(w))}):this.childViews.reduce((w,T,V,O)=>{let U={analysisType:T.view.componentProps.analysisType,title:T.view.title,isHomeTeamForAnalysis:T.view.componentProps.isHomeTeamForAnalysis,isHomeTeam:T.view.isHomeTeam};return w&&(w.isHomeTeam&&!T.view.isHomeTeam?(T.view.componentProps.analysisType=h.analysisType,T.view.componentProps.isHomeTeamForAnalysis=!0,T.view.title=h.title,a.view.titleShort=h.titleShort,T.view.isHomeTeam=!0,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:d.split("-").map(z=>parseInt(z))}):!w.isHomeTeam&&!T.view.isHomeTeam&&(T.view.componentProps.analysisType=w.analysisType,T.view.componentProps.isHomeTeamForAnalysis=w.isHomeTeamForAnalysis,T.view.title=w.title,T.view.titleShort=w.titleShort,T.view.isHomeTeam=w.isHomeTeam,T.view.filterMultiple={isHomeTeam:T.view.isHomeTeam,categoryIds:d.split("-").map(z=>parseInt(z))}),V===O.length-1&&(a.view.componentProps.analysisType=U.analysisType,a.view.componentProps.isHomeTeamForAnalysis=U.isHomeTeamForAnalysis,a.view.title=U.title,a.view.titleShort=U.titleShort,a.view.isHomeTeam=U.isHomeTeam,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:d.split("-").map(z=>parseInt(z))})),U},null):(a.view.componentProps.analysisType=h.analysisType,a.view.componentProps.isHomeTeamForAnalysis=!1,a.view.title=h.title,a.view.titleShort=h.titleShort,a.view.isHomeTeam=!1,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,categoryIds:d.split("-").map(w=>parseInt(w))})}else{const h=o===1,c=h?this.getHomeTeamViews():this.getAwayTeamViews();a.view.componentProps.isHomeTeamForAnalysis=h,a.view.isHomeTeam=h;for(let p=0;p<b.length;p++){const x=s.analysisTypes.get(b[p]);if(!c.find(w=>w.view.componentProps.analysisType===x.analysisType)){a.view.componentProps.analysisType=x.analysisType,a.view.title=x.title,a.view.titleShort=x.titleShort,a.view.filterMultiple={categoryIds:b[p].split("-").map(w=>parseInt(w)),isHomeTeam:a.view.isHomeTeam};break}}}}if(this.viewId===2&&!i&&a.view.componentProps){const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id),a.view.componentProps.game&&(a.view.componentProps.gameid=a.view.componentProps.game.id,a.view.componentProps.season=a.view.componentProps.game.season_id,a.view.componentProps.teamView=d[1]===2?a.view.componentProps.game.awayTeam.team_id:d[1]===1?a.view.componentProps.game.homeTeam.team_id:0);const o=this.dynamicFilters[0]||[];let s=null;if(Array.isArray(o)){if(o.length>0){const p=this.childViews.map(w=>{var T;const V=(T=w.view.componentProps)==null?void 0:T.categoryView;return V&&V.length>0?V[0].id:null}).filter(w=>w!==null),x=o.filter(w=>!p.includes(w));x.length>0&&(s=x[0])}}else{const p=o;p&&(this.childViews.find(x=>{var w;const T=(w=x.view.componentProps)==null?void 0:w.categoryView;return T&&T.length>0&&T[0].id===p})||(s=p))}let h=null;if(s)try{h=Fh(s)}catch{}const c=d&&d.length>1?d[1]:1;a.view.filterMultiple={categoryId:s,teamType:c},a.view.componentProps.categoryView=h?[{id:s,name:h.name}]:s?[{id:s,name:`Category ${s}`}]:[{id:0,name:"Category"}]}if(this.viewId===8&&a.view.componentProps&&!i&&a.view.game&&(a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),a.view.componentProps.areInactiveVisible=this.dynamicFilters[0]||!1,a.view.componentProps.game=(k=a.view)==null?void 0:k.game,a.view.componentProps.teamSelected={teamId:(g=(F=a.view)==null?void 0:F.game)==null?void 0:g.home_team},a.view.componentProps.isDefault=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:this.dynamicFilters})),this.viewId===13&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.seasonid=2010,a.view.teamids=[1,2],a.view.componentProps.categoryids=[20,2],a.view.componentProps.teamsshow=[1,2],a.view.componentProps.analysistype=1,a.view.componentProps.gameid="",a.view.componentProps.teams=[],a.view.componentProps.game=""),this.viewId===15&&a.view.componentProps&&!i&&(a.view.componentProps.isdefault=!0,a.view.componentProps.view=1,a.view.numitems=3,a.view.typegame=1,a.view.componentProps.token=this.token,a.view.componentProps.data={season:2010,type:2,team:14}),this.viewId===14&&a.view.componentProps&&!i&&(a.view.componentProps.isReports=!0,a.view.componentProps.isDefault=!0,a.view.componentProps.type=0,a.view.componentProps.typeView=1,a.view.componentProps.showVideos=!1,a.view.componentProps.currentSeason=2010,a.view.componentProps.localTeam=2,a.view.componentProps.awayTeam=1),this.viewId===6&&a.view.componentProps&&!i){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=d&&d.length>0?d[0]:[];if(o&&o.length>0){let s=0;for(const h of o)if(!this.childViews.find(c=>c.view.componentProps.gameNumber===h)){s=h;break}s&&(a.view.componentProps.gameNumber=s,a.view.filterMultiple={gameNumber:s})}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:d})}if(this.viewId===3&&a.view.componentProps&&!i&&a.view.game){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const b=this.getComponentDynamicFilters(a.view.id),d=b||this.dynamicFilters;!b&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const o=d&&d.length>0?d[0]:!1;a.view.componentProps.desplegable=o,a.view.componentProps.key=o,a.view.componentProps.game=(m=a.view)==null?void 0:m.game,a.view.componentProps.defaultShields=!1,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:d})}if(this.viewId===4&&a.view.componentProps&&!i&&a.view.game){if(a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0),this.isPostMatch){a.view.componentProps.key=!1,a.view.componentProps.isDefault=!1,a.view.componentProps.token=this.token,a.view.componentProps.gameId=(f=(n=a.view)==null?void 0:n.game)==null?void 0:f.game_id,a.view.componentProps.homeTeam=(t=(l=a.view)==null?void 0:l.game)==null?void 0:t.home_team,a.view.componentProps.awayTeam=(v=(_=a.view)==null?void 0:_.game)==null?void 0:v.visiting_team;const o=this.getComponentDynamicFilters(a.view.id),s=o||this.dynamicFilters;!o&&this.dynamicFilters&&this.dynamicFilters.length>0&&this.setDynamicFilters(this.dynamicFilters,a.view.id);const h=s&&s.length>0?s[0]:[],c=this.hasEventTypeId(h,1),p=this.hasCategoryId(h,8),x=this.hasCategoryId(h,9),w=this.hasEventTypeId(h,3);a.view.componentProps.goals=c,a.view.componentProps.yellowCards=p,a.view.componentProps.redCards=x,a.view.componentProps.substitutions=w}const b=this.getComponentDynamicFilters(a.view.id)||this.dynamicFilters,d=b&&b.length>0?b[0]:[];a.view.componentProps.selectedEvents=d,a.view.componentProps.key=d.length>0,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:b})}this.viewId===16&&this.addLastTouch(a),this.childViews.push(a),qa.emit("view-added")}getHowManyViewsToAdd(a,i=null){if(this.viewId===5||this.viewId===14||this.viewId===13||this.viewId===15)return 1;if(this.viewId===6){const k=a[0];return k===2||k===3?k:1}if(this.viewId===4)return a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0?1:0;if(this.viewId===9){const k=a[0],F=a[1];if(F===1||F===2){const g=F===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===16&&i){const k=i.selectedCategories||[],F=i.selectedTeam.value;if(F===1||F===2){const g=F===1?this.getHomeTeamViews():this.getAwayTeamViews();return k.length-g.length}else return k.length*2-(this.getHomeTeamViews().length+this.getAwayTeamViews().length)}if(this.viewId===2){const k=a[0]||[],F=a[1]||1;if(!k||k.length===0)return 0;if(Array.isArray(k)){const g=this.childViews.map(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0?f[0].id:null}).filter(m=>m!==null);return k.filter(m=>!g.includes(m)).length}else{const g=k;return this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===g&&t===F})?0:1}}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return 0;if(Array.isArray(k)){const F=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!F.includes(g)).length}else{const F=k;return this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===F})?0:1}}return 0}getRequiresAddView(a,i){if(this.viewId===5)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===15)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===10)return a[0]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===7)return a[1]===3?this.childViews.length<2:this.childViews.length===0;if(this.viewId===6){const k=a[0];return k?k.length>this.childViews.length:this.childViews.length===0}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;return this.childViews.length===0&&k}if(this.viewId===9)return this.getRequiresAddViewMultipleAndBothTeams(a);if(this.viewId===16&&i){const k=[i.selectedCategories,i.selectedTeam.value];return this.getRequiresAddViewMultipleAndBothTeams(k,i.totalCategoriesSelected)}if(this.viewId===1){const k=a[0]||[];if(!k||k.length===0)return!1;if(Array.isArray(k)){const F=this.childViews.map(g=>{var m;return(m=g.view.componentProps)==null?void 0:m.type}).filter(g=>g!==void 0);return k.filter(g=>!F.includes(g)).length>0}else{const F=k;return!this.childViews.find(g=>{var m;return((m=g.view.componentProps)==null?void 0:m.type)===F})}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){if(k.length>0){const F=this.childViews.map(g=>{var m;const n=(m=g.view.componentProps)==null?void 0:m.categoryView;return n&&n.length>0?n[0].id:null}).filter(g=>g!==null);return k.filter(g=>!F.includes(g)).length>0}return!1}else{const F=k,g=a[1]||1;return F?!this.childViews.find(m=>{var n,f;const l=(n=m.view.componentProps)==null?void 0:n.categoryView,t=((f=m.view.filterMultiple)==null?void 0:f.teamType)||1;return l&&l.length>0&&l[0].id===F&&t===g}):!1}}return this.viewId===8||this.viewId===3||this.viewId===14?this.childViews.length===0:!1}getRequiresAddViewMultipleAndBothTeams(a,i=null){const k=this.childViews.filter(l=>l.view.isHomeTeam),F=this.childViews.filter(l=>!l.view.isHomeTeam),g=i||a[0].length,m=a[1],n=g*(m===1||m===2?1:2),f=m===3?k.length+F.length:k.length||F.length;return n>f}getRequiresLessViews(a){if(this.viewId===5)return a[0]!==3&&this.childViews.length>1;if(this.viewId===15)return a[0]!==3&&this.childViews.length>1;if(this.viewId===6){const i=a[0];return i===2||i===3}return this.viewId,!1}updateSummary({dynamicFilters:a}){const i=this.childViews[0],k=document.querySelector(`[gs-id="${i.view.id}"]`),F=i.grid;if(i&&k&&F){const g=a[0],m=`min_column${g?"_2":""}`,n=`min_row${g?"_2":""}`,f=`max_column${g?"_2":""}`,l=`max_row${g?"_2":""}`,t=`colspan${g?"_2":""}`,_=`rowspan${g?"_2":""}`,v=i.view.coreView[t],b=i.view.coreView[_],d=i.view.coreView[m],o=i.view.coreView[n],s=i.view.coreView[f],h=i.view.coreView[l];i.view.w=v,i.view.h=b,i.view.maxWidth=s,i.view.maxHeight=h,i.view.minWidth=d,i.view.minHeight=o,k.setAttribute("gs-w",v),k.setAttribute("gs-h",b),k.setAttribute("gs-max-w",s),k.setAttribute("gs-max-h",h),k.setAttribute("gs-min-w",d),k.setAttribute("gs-min-h",o),F.update(k,{h:b,w:v,"gs-max-h":h,"gs-max-w":s,"gs-min-h":o,"gs-min-w":d})}}updateFilters(a){this.filters=a,this.viewId===16&&this.updateLastTouchFilters(a)}updateDynamicFilters(a,i=null){if(!this._isUpdating){this._isUpdating=!0,i?this.componentSpecificFilters.set(i,[...a]):this.dynamicFilters=a,qa.emit("component-added-to-container",this);try{if(this.viewId===5){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:F.view.componentProps.preMatchType===1})}else{const F=this.childViews.pop(),g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===F.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.preMatchType=k,f.view.filterMultiple={isHomeTeam:f.view.componentProps.preMatchType})}else this.childViews.forEach((F,g)=>{F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:F.view.componentProps.preMatchType}})}if(this.viewId===15){const k=a[0]||1;if(i){const F=this.childViews.find(g=>g.view.id===i);F&&F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:k===1})}else if(k<3){if(this.childViews.length===1){const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:k===1})}else if(this.childViews.length>1){for(;this.childViews.length>1;){const g=this.childViews.pop(),m=g.grid,n=g.page,f=document.querySelector(`[gs-id="${g.view.id}"]`);if(m&&f&&(m.removeWidget(f),n)){const l=n.items.findIndex(t=>t.id===g.view.id);l!==-1&&n.items.splice(l,1)}}const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.preMatchType=k,F.view.filterMultiple={isHomeTeam:k===1})}}else if(this.childViews.length===2)this.childViews.forEach((F,g)=>{F.view.componentProps&&(F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:g===0})});else if(this.childViews.length<2)this.childViews.forEach((F,g)=>{F.view.componentProps&&(F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:g===0})});else{for(;this.childViews.length>2;){const F=this.childViews.pop(),g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const f=m.items.findIndex(l=>l.id===F.view.id);f!==-1&&m.items.splice(f,1)}}this.childViews.forEach((F,g)=>{F.view.componentProps&&(F.view.componentProps.preMatchType=g+1,F.view.filterMultiple={isHomeTeam:g===0})})}}if(this.viewId===10){const k=a[0]||1;if(k<3)if(this.childViews.length===1){const F=this.childViews[0];F.view.componentProps&&(F.view.componentProps.isHomeTeamForAnalysis=k===1,F.view.filterMultiple={isHomeTeam:F.view.componentProps.isHomeTeamForAnalysis})}else{const F=this.childViews.pop(),g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m)){const l=m.items.findIndex(t=>t.id===F.view.id);l!==-1&&m.items.splice(l,1)}const f=this.childViews[0];f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=k===1,f.view.filterMultiple={isHomeTeam:f.view.componentProps.isHomeTeamForAnalysis})}else this.childViews.forEach((F,g)=>{F.view.componentProps.isHomeTeamForAnalysis=g%2===0,F.view.filterMultiple={isHomeTeam:F.view.componentProps.isHomeTeamForAnalysis}})}if(this.viewId===7){const k=a[1];if(k===3)this.childViews.forEach((F,g)=>{F.view.componentProps.isHomeTeamForAnalysis=g%2===0,F.view.isHomeTeam=g%2===0,F.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",F.view.filterMultiple={isHomeTeam:F.view.isHomeTeam}});else{const F=k===1;if(this.childViews.length>0){const g=this.childViews[0];g.view.componentProps.isHomeTeamForAnalysis=F,g.view.isHomeTeam=F,g.view.componentProps.analysisType=this.dynamicFilters[0]===1?"offensive":"defensive",g.view.filterMultiple={isHomeTeam:F},this.childViews.length>1&&this.removeChildView(this.childViews[1])}}}if(this.viewId===9){const k=a[0],F=a[1];if(F===3){if(this.childViews.length>k.length){const g=k.map(m=>{const n=m.join("-");return jh.get(this.viewId).analysisTypes.get(n).analysisType});this.childViews.reduce((m,n)=>(g.includes(n.view.componentProps.analysisType)||m.push(n.view.componentProps.analysisType),m),[]).forEach(m=>{const n=this.childViews.findIndex(f=>f.view.componentProps.analysisType===m);if(n!==-1){const f=this.childViews[n];this.removeChildView(f)}})}}else{const g=F===1,m=this.getHomeTeamViews(),n=this.getAwayTeamViews();if(g&&m.length===0)n.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(!g&&n.length===0)m.forEach(f=>{f.view.componentProps.isHomeTeamForAnalysis=g,f.view.isHomeTeam=g,f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}});else if(m.length===n.length)g||m.forEach(f=>{f.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}}),(g?n:m).forEach(f=>{this.removeChildView(f)});else{const f=g?this.getHomeTeamViews():this.getAwayTeamViews();if(f.length>k.length){const l=k.map(t=>{const _=t.join("-");return jh.get(this.viewId).analysisTypes.get(_).analysisType});f.forEach(t=>{l.includes(t.view.componentProps.analysisType)?t.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}:this.removeChildView(t)})}else f.forEach(l=>{l.view.filterMultiple={categoryIds:k[0],isHomeTeam:g}})}}}if(this.viewId===2){const k=a[0]||[];if(Array.isArray(k)){const F=this.childViews.map(g=>{var m,n;const f=(m=g.view.componentProps)==null?void 0:m.categoryView,l=((n=g.view.filterMultiple)==null?void 0:n.teamType)||1,t=f&&f.length>0?f[0].id:null;return t?{categoryId:t,teamType:l,viewId:g.view.id}:null}).filter(g=>g!==null);if(i){const g=this.childViews.find(m=>m.view.id===i);if(g){const m=a[1]||1,n=k[0];if(n){let f=null;try{f=Fh(n)}catch{}g.view.filterMultiple={categoryId:n,teamType:m},g.view.componentProps.game&&(m===1?g.view.componentProps.teamView=g.view.componentProps.game.homeTeam.team_id:m===2?g.view.componentProps.teamView=g.view.componentProps.game.awayTeam.team_id:g.view.componentProps.teamView=0),g.view.componentProps.categoryView=f?[{id:n,name:f.name}]:[{id:n,name:`Category ${n}`}]}}}if(!i){const g=a[1]||1;this.childViews.forEach(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;if(f&&f.length>0){const l=f[0].id;k.includes(l)&&(m.view.filterMultiple={categoryId:l,teamType:g})}})}if(F.map(g=>g.categoryId).filter(g=>!k.includes(g)).forEach(g=>{this.childViews.filter(m=>{var n;const f=(n=m.view.componentProps)==null?void 0:n.categoryView;return f&&f.length>0&&f[0].id===g}).forEach(m=>{this.removeChildView(m),qa.emit("component-removed",{viewId:m.view.id,categoryId:g})})}),i){const g=k[0];if(g){const m=this.childViews.find(n=>n.view.id===i);if(m){let n=null;try{n=Fh(g)}catch{}const f=a[1]||1;m.view.filterMultiple={categoryId:g,teamType:f},m.view.componentProps.game&&(m.view.componentProps.teamView=f===2?m.view.componentProps.game.awayTeam.team_id:f===1?m.view.componentProps.game.homeTeam.team_id:0),m.view.componentProps.categoryView=n?[{id:g,name:n.name}]:[{id:g,name:`Category ${g}`}]}}}}else{const F=k;if(F&&i){const g=this.childViews.find(m=>m.view.id===i);if(g){let m=null;try{m=Fh(F)}catch{}const n=a[1]||1;g.view.filterMultiple={categoryId:F,teamType:n},g.view.componentProps.game&&(g.view.componentProps.teamView=n===2?g.view.componentProps.game.awayTeam.team_id:n===1?g.view.componentProps.game.homeTeam.team_id:0),g.view.componentProps.categoryView=m?[{id:F,name:m.name}]:[{id:F,name:`Category ${F}`}]}}}}if(this.viewId===8){const k=a[0]||!1;this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),F.view.componentProps.areInactiveVisible=k,F.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}if(this.viewId===1){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const F=this.childViews.find(g=>g.view.id===i);F&&this.updateComparative(F,a)}else if(this.childViews.reduce((F,g)=>(k.includes(g.view.componentProps.type)||F.push(g.view.componentProps.type),F),[]).forEach(F=>{const g=this.childViews.findIndex(m=>m.view.componentProps.type===F);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.type=n.view.componentProps.type,f.view.title=n.view.title)}this.removeChildView(this.childViews[this.childViews.length-1])}}),Array.isArray(k))this.childViews.length>0&&k.length>0&&this.childViews.forEach((F,g)=>{if(F.view.componentProps&&g<k.length){const m=k[g],n=jh.get(this.viewId);F.view.componentProps.type=m,F.view.componentProps.default=!1,F.view.title=`Comparativa ${n[m]}`,F.view.filterMultiple={category:m}}});else{const F=k;if(F&&this.childViews.length>0){const g=this.childViews[0];if(g.view.componentProps){const m=jh.get(this.viewId);g.view.componentProps.type=F,g.view.componentProps.default=!1,g.view.title=`Comparativa ${m[F]}`,g.view.filterMultiple={category:F}}}}}if(this.viewId===6){const k=a[0]||[];if(i){this.setDynamicFilters(a,i);const F=this.childViews.find(g=>g.view.id===i);F&&this.updateGSCLineupsReports(F,a)}else{if(Array.isArray(k))if(k.length===0)for(;this.childViews.length>0;)this.removeChildView(this.childViews[0]);else this.childViews.reduce((F,g)=>(k.includes(g.view.componentProps.gameNumber)||F.push(g.view.componentProps.gameNumber),F),[]).forEach(F=>{const g=this.childViews.findIndex(m=>m.view.componentProps.gameNumber===F);if(g!==-1){for(let m=g;m<this.childViews.length;m++){const n=this.childViews[m+1],f=this.childViews[m];n&&(f.view.componentProps.gameNumber=n.view.componentProps.gameNumber,f.view.filterMultiple={gameNumber:n.view.componentProps.gameNumber})}this.removeChildView(this.childViews[this.childViews.length-1])}});this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}}if(this.viewId===3){if(i){this.setDynamicFilters(a,i);const k=this.childViews.find(F=>F.view.id===i);k&&this.updateMatchSummary(k,a)}else{const k=a[0]||!1;this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),F.view.componentProps.desplegable=k,F.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}this.updateSummary({dynamicFilters:a})}if(this.viewId===13){const k=a[1]||[];if(i){this.setDynamicFilters(a,i);const F=this.childViews.find(g=>g.view.id===i);F&&(F.view.componentProps&&(F.view.componentProps.categoryids=k,F.view.componentProps.analysistype=a[0]||1,F.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],F.view.dynamicFilters=a,F.view._updateKey=Date.now()),qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))}else this.childViews.forEach(F=>{F.view.componentProps&&(F.view.componentProps._isReactive||(F.view.componentProps=r.reactive(F.view.componentProps),F.view.componentProps._isReactive=!0),F.view.componentProps.categoryids=k,F.view.componentProps.analysistype=a[0]||1,F.view.componentProps.teamsshow=a[2]==1?[1]:a[2]==2?[2]:[1,2],F.view.dynamicFilters=a,F.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:F.view.id,componentProps:F.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:F.view.id,dynamicFilters:a}))})}else if(this.viewId===15){const k=a[0]||1,F=a[3]!==void 0?a[3]:typeof a[1]=="number"?a[1]:null;if(i){this.setDynamicFilters(a,i);const g=this.childViews.find(m=>m.view.id===i);g&&g.view.componentProps&&(g.view.componentProps.analysistype=k,F!==null&&(g.view.componentProps.numitems=F),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))}else this.childViews.forEach(g=>{g.view.componentProps&&(g.view.componentProps._isReactive||(g.view.componentProps=r.reactive(g.view.componentProps),g.view.componentProps._isReactive=!0),g.view.componentProps.analysistype=k,F!==null&&(g.view.componentProps.numitems=F),g.view.dynamicFilters=a,g.view._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:g.view.id,componentProps:g.view.componentProps,dynamicFilters:a}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:g.view.id,dynamicFilters:a}))})}if(this.viewId===4){const k=a&&a.length>0&&Array.isArray(a[0])&&a[0].length>0;if(i){const F=this.childViews.find(g=>g.view.id===i);F&&F.view.componentProps.selectedEvents}else if(!k&&this.childViews.length>0)this.childViews.forEach(F=>{this.removeChildView(F)});else if(k&&this.childViews.length===0){const F={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};qa.emit("add-view",F)}else this.childViews.forEach(F=>{this.updateTimeline(F,a)})}}finally{this._isUpdating=!1}}}removeAllChildViews(){[...this.childViews].forEach(a=>{this.removeChildView(a)})}removeChildView(a,i=!1){const k=this.childViews.findIndex(F=>F.view.id===a.view.id);if(k!==-1){const F=this.childViews[k];this.childViews.splice(k,1),F.view.id&&this.componentSpecificFilters.delete(F.view.id);const g=F.grid,m=F.page,n=document.querySelector(`[gs-id="${F.view.id}"]`);if(g&&n&&(g.removeWidget(n),m&&!i)){const f=m.items.findIndex(l=>l.id===F.view.id);f!==-1&&(m.items.splice(f,1),m.items.length===0&&qa.emit("empty-page",m))}}}updateView({view:a,dynamicFilters:i,filtersJSON:k,filters:F}){this.setFiltersJSON(k),this.dynamicFilters=i;const g=this.childViews.find(m=>{var n;return((n=m.view)==null?void 0:n.id)===a.view.id});if(g){g.view.filtersJSON=k,g.view.coreView&&(g.view.coreView.filtersJSON=k);let m=i;if(this.viewId===4){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===8){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===3){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n),this.updateSummary({dynamicFilters:m})}else if(this.viewId===1){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===6){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===7){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}else if(this.viewId===9){const n=this.getComponentDynamicFilters(a.view.id);n&&(m=n)}this.viewId===5?this.updateVolumetricField(g,m):this.viewId===7?this.updateGoalData(g,m):this.viewId===9?this.updateFieldDataByZones(g,i):this.viewId===10?this.updateXg(g,m):this.viewId===3?this.updateMatchSummary(g,m):this.viewId===4?this.updateTimeline(g,m):this.viewId===8?this.updateFieldPosesion(g,m):this.viewId===1?this.updateComparative(g,m):this.viewId===2?this.updateGSCtops(g,m):this.viewId===6?this.updateGSCLineupsReports(g,m):this.viewId===16&&this.updateLastTouchSingle(g,F)}}updateComparative(a,i){if(a.view.componentProps){const k=i[0]||[];if(k&&k.length>0){let F;if(Array.isArray(k)){const m=this.childViews.findIndex(n=>n.view.id===a.view.id);m>=0&&m<k.length?F=k[m]:F=k[0]}else F=k;const g=jh.get(this.viewId);a.view.componentProps.type=F,a.view.componentProps.default=!1,a.view.title=`Comparativa ${g[F]}`,a.view.filterMultiple={category:F}}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateVolumetricField(a,i){if(a.view.componentProps){const k=i[0]||1;a.view.isHomeTeam=k===1,a.view.componentProps.preMatchType=k,a.view.filterMultiple={isHomeTeam:k},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateGoalData(a,i){if(a.view.componentProps){const k=i[0]===1?"offensive":"defensive",F=i[1]===1;a.view.componentProps.analysisType=k,a.view.componentProps.isHomeTeamForAnalysis=F,a.view.isHomeTeam=F,a.view.filterMultiple={isHomeTeam:F},qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldDataByZones(a,i){if(a.view.componentProps){const k=i[0],F=i[1]===1;if(a.view.componentProps.isHomeTeamForAnalysis=F,a.view.isHomeTeam=F,a.view.filterMultiple={categoryIds:k,isHomeTeam:F},k&&k.length){const g=k.join("-"),m=jh.get(this.viewId).analysisTypes.get(g);m&&(a.view.componentProps.analysisType=m.analysisType,a.view.title=m.title,a.view.titleShort=m.titleShort)}}}updateXg(a,i){const k=i[0]===1;a.view.componentProps&&(a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.filtersJSON=this.filtresJSON,a.view.filterMultiple={isHomeTeam:k})}updateMatchSummary(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.desplegable=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateTimeline(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=this.getComponentDynamicFilters(a.view.id)||i,F=k&&k.length>0?k[0]:[];a.view.componentProps.selectedEvents=F,a.view.componentProps.key=F.length>0;const g=this.hasEventTypeId(F,1),m=this.hasCategoryId(F,8),n=this.hasCategoryId(F,9),f=this.hasEventTypeId(F,3);a.view.componentProps.goals=g,a.view.componentProps.yellowCards=m,a.view.componentProps.redCards=n,a.view.componentProps.substitutions=f,a.view.componentProps._updateKey=Date.now(),qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:k}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:k}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}updateFieldPosesion(a,i){if(a.view.componentProps){a.view.componentProps._isReactive||(a.view.componentProps=r.reactive(a.view.componentProps),a.view.componentProps._isReactive=!0);const k=i&&i.length>0?i[0]:!1;a.view.componentProps.areInactiveVisible=k,a.view.componentProps.key=k,qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i})}}updateGSCtops(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const F=k[0];let g=null;try{g=Fh(F)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:F,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:F,name:g.name}]:[{id:F,name:`Category ${F}`}]}}else{const F=k;if(F){let g=null;try{g=Fh(F)}catch(n){console.warn("Error getting category by ID:",n)}const m=i[1]||1;a.view.filterMultiple={categoryId:F,teamType:m},a.view.componentProps.game&&(m===1?a.view.componentProps.teamView=a.view.componentProps.game.homeTeam.team_id:m===2?a.view.componentProps.teamView=a.view.componentProps.game.awayTeam.team_id:a.view.componentProps.teamView=0),a.view.componentProps.categoryView=g?[{id:F,name:g.name}]:[{id:F,name:`Category ${F}`}]}}}}updateGSCLineupsReports(a,i){if(a.view.componentProps){const k=i[0]||[];if(Array.isArray(k)){if(k.length>0){const F=k[0];a.view.filterMultiple={gameNumber:F},a.view.componentProps.gameNumber=F}}else{const F=k;F&&(a.view.filterMultiple={gameNumber:F},a.view.componentProps.gameNumber=F)}qa.emit("component-props-updated",{viewId:a.view.id,componentProps:a.view.componentProps,dynamicFilters:i}),qa.emit("dynamic-filters-changed",{containerViewId:this.viewId,viewId:a.view.id,dynamicFilters:i}),qa.emit("force-component-update",{itemId:a.view.id,componentProps:a.view.componentProps})}}getCategoryIdFromAnalysisType(a,i){if(!a||!i)return null;for(const k of i){const F=k.join("-"),g=jh.get(this.viewId);if(g&&g.analysisTypes){const m=g.analysisTypes.get(F);if(m&&m.analysisType===a)return k[0]||null}}return null}updateLastTouchFilters(){if(!this.filters){console.warn("No filters available in updateLastTouchFilters");return}this.childViews.forEach(F=>{F.view.componentProps.isAssistZoneVisible=this.filters.isAssistZoneVisible,F.view.componentProps.howManyGames=this.filters.howManyGamesSelected.value,F.view.filterMultiple.howManyGamesSelected=this.filters.howManyGamesSelected,F.view.filterMultiple.isAssistZoneVisible=this.filters.isAssistZoneVisible});const a=this.filters.selectedCategories.map(F=>F.value),i=a.map(F=>F.name),k=this.filters.selectedTeam.value;if(k===3)this.childViews.length>a&&this.childViews.reduce((F,g)=>(i.includes(g.view.componentProps.categories[0].name)||F.push(g.view.componentProps.categories[0].name),F),[]).forEach(F=>{const g=this.childViews.findIndex(m=>m.view.componentProps.categories[0].name===F);if(g!==-1){const m=this.childViews[g];this.removeChildView(m)}});else{const F=k===1,g=this.getHomeTeamViews(),m=this.getAwayTeamViews();if(F&&g.length===0)m.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=F,n.view.isHomeTeam=F,n.view.filterMultiple.isHomeTeam=F});else if(!F&&m.length===0)g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=F,n.view.isHomeTeam=F,n.view.filterMultiple.isHomeTeam=F});else if(g.length===m.length)F||g.forEach(n=>{n.view.componentProps.isHomeTeamForAnalysis=F,n.view.isHomeTeam=F,n.view.filterMultiple.isHomeTeam=F}),(F?m:g).forEach(n=>{this.removeChildView(n)});else{const n=F?this.getHomeTeamViews():this.getAwayTeamViews();if(n.length>a.length){const f=a.map(l=>l.name);n.forEach(l=>{f.includes(l.view.componentProps.categories[0].name)?l.view.filterMultiple.isHomeTeam=F:this.removeChildView(l)})}else n.forEach(f=>{f.view.filterMultiple.isHomeTeam=F})}}}updateLastTouchSingle(a,i){if(a.view.componentProps){const k=i.selectedTeam.value===1,F=i.selectedCategory.value;a.view.isHomeTeam=k,a.view.componentProps.isHomeTeamForAnalysis=k,a.view.componentProps.categories=[F],a.view.componentProps.analysisType=i.selectedGamePhase.name,a.view.componentProps.isHomeTeamForAnalysis=!0,a.view.componentProps.isAssistZoneVisible=i.isAssistZoneVisible,a.view.componentProps.howManyGames=i.howManyGamesSelected.value,a.view.title=F.name,a.view.titleShort=F.name,a.view.isHomeTeam=k,a.view.filterMultiple={isHomeTeam:a.view.isHomeTeam,selectedCategory:F,selectedGamePhase:i.selectedGamePhase,howManyGamesSelected:i.howManyGamesSelected,isAssistZoneVisible:i.isAssistZoneVisible}}}}const D5e={class:"template-page__header"},J5e={class:"template-page__header__name"},B5e=["value"],G5e={class:"template-page__header__details"},Z5e={class:"template-page__header__details__teams"},H5e={class:"template-page__header__details__teams__team"},Y5e={key:0,class:"template-page__header__details__teams__team__logo"},Q5e=["src"],$5e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e_e={class:"template-page__header__details__teams__team"},t_e={key:0,class:"template-page__header__details__teams__team__logo"},r_e=["src"],n_e={key:1,width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a_e={class:"template-page__content"},i_e=["id"],o_e=["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"],s_e=r.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:a}){var i,k,F;const g=r.ref(null);let m=null;const n=e,f=r.ref(!1),l=a,t=r.computed(()=>n.page.items.reduce((j,K)=>(j.set(K.id,K),j),new Map)),_=r.computed(()=>{var j,K,X,D;return n.game&&n.game.homeTeam&&n.game.awayTeam?{homeTeam:{name:((j=n.game.homeTeam)==null?void 0:j.acronym)||"LOC",logo:((K=n.game.homeTeam)==null?void 0:K.logo)||null},awayTeam:{name:((X=n.game.awayTeam)==null?void 0:X.acronym)||"VIS",logo:((D=n.game.awayTeam)==null?void 0:D.logo)||null}}:{homeTeam:{name:"LOC"},awayTeam:{name:"VIS"}}});let v=null,b=null,d=!1,o=null,s=!1;const h=()=>{s=!0},c=()=>{s=!1};function p(){s||(d=!0,o&&clearTimeout(o),o=setTimeout(()=>{d=!1},150))}function x(){const j={root:null,rootMargin:"0px",threshold:.7};v=new IntersectionObserver(D=>{D.forEach(H=>{if(d){b&&clearTimeout(b),b=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},100);return}b&&clearTimeout(b),b=setTimeout(()=>{l("intersection-changed",H.isIntersecting)},50)})},j);const K=g.value;K&&v.observe(K);const X=document.querySelector(".container-main");X&&X.addEventListener("scroll",p,{passive:!0}),document.addEventListener("programmatic-scroll-start",h),document.addEventListener("programmatic-scroll-end",c)}function w(j){n.page.title=j.target.value,l("view-changed")}const T={game_id:0,season_id:0,prematch:!1},V={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:[]}},O=new Map([[5,{component:jT,componentName:"GSCVolumetricField",props:{isGamePreMatch:!n.isPostMatch,areTeamsVisible:!1,isTitleVisible:!1,isGhostEffect:n.isTemplateMode,isTemplateMode:n.isTemplateMode,preMatchType:1}}],[2,{component:U4,componentName:"GscTopPlayer",props:{categoryView:[{id:0,name:"Category"}],gamed:n.game?n.game.id:V.gameId,game:n.game,season:n.game?(i=n==null?void 0:n.game)==null?void 0:i.season_id:V.seasonId,teamView:0,useDummyData:n.isTemplateMode}}],[8,{component:Ck,componentName:"FieldPosesion",props:{widthSection:600,game:V,teamSelected:{teamId:0},areInactiveVisible:!0,showTitle:!1,isDefault:!0,key:!1}}],[6,{component:W8,componentName:"GSCLineupsReports",props:{selectedOption:n.isPostMatch?"Postmatch":"Prematch",game:T,gamehome:T,gameaway:T}}],[3,{component:Rk,componentName:"GSCMatchSummary",props:{game:V,defaultShields:!0,desplegable:!1}}],[4,{component:x7,componentName:"GSCTimelineReports",props:{key:!0,isDefault:!0,gameId:V.gameId,homeTeam:V.homeTeam.team_id,awayTeam:V.awayTeam.team_id,token:n.token,goals:!0,yellowCards:!0,redCards:!0,substitutions:!0}}],[7,{component:k9,componentName:"GSCGoalData",props:{game:n.game,isHomeTeamForAnalysis:!0,canInteract:!1,canPlayVideos:!1,isPreMatch:!n.isPostMatch,analysisType:1}}],[9,{component:M8,componentName:"GSCFieldDataByZones",props:{game:n.game,isHomeTeamForAnalysis:!0,analysisType:"successfulPasses",canPlayVideos:!1,isPreMatch:!n.isPostMatch,negative:!0}}],[10,{component:n5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[13,{component:ZS,componentName:"GSCTimelapseTable",props:{isdefault:!0,seasonId:n.game?(k=n==null?void 0:n.game)==null?void 0:k.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:sS,componentName:"GSCGeneraltable",props:{isReports:!0,isDefault:!0,type:0,typeView:1,tournament:1,currentSeasonId:2010,showVideos:!1,localTeam:2,awayTeam:1}}],[15,{component:kN,componentName:"GSCStrengths",props:{token:n.token,view:1,numitems:3,typegame:1,isdefault:!0,data:{player:35240,season:1772,type:2,team:14}}}],[10,{component:n5,componentName:"GSCGameXg",props:{game:n.game,isHomeTeamForAnalysis:!0,isPostMatch:n.isPostMatch}}],[1,{component:_9,componentName:"GSCComparativeReports",props:{gameId:n.game?n.game.id:"",homeLogo:n.game?n.game.homeTeam.logo:"",awayLogo:n.game?n.game.awayTeam.logo:"",seasonId:n.game?(F=n==null?void 0:n.game)==null?void 0:F.season_id:0,typeGame:n.isPostMatch,type:"stoppedBall",default:n.isTemplateMode}}],[16,{component:zN,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:n.isTemplateMode,isPreMatch:!n.isPostMatch}}]]);function U(j){if(j)if(typeof j=="string"){let K=null;switch(j){case"GSCVolumetricField":K=jT;break;case"GSCGoalData":K=k9;break;case"GscTopPlayer":K=U4;break;case"FieldPosesion":K=Ck;break;case"GSCLineupsReports":K=W8;break;case"GSCMatchSummary":K=Rk;break;case"GSCTimelineReports":K=x7;break;case"GSCFieldDataByZones":K=M8;break;case"GSCGeneraltable":K=sS;break;case"GSCTimelapseTable":K=ZS;break;case"GSCGameXg":K=n5;break;case"GSCComparativeReports":K=_9;break;case"GSCStrengths":K=kN;break;case"GSCLastTouch":K=zN;break;default:K=null}return K}else return j;return null}function z({pageId:j,view:K,filterAndWidgetContainer:X,applyMinimumSize:D=!1,dynamicFilters:H=[],filters:re=null}){if(n.page.id===j&&m){let B=!1;K.id===3&&(B=H[0]);const ne=`min_column${B?"_2":""}`,ee=`min_row${B?"_2":""}`,Y=`colspan${B?"_2":""}`,$=`rowspan${B?"_2":""}`,le={w:D?K[ne]:K[Y],h:D?K[ee]:K[$]};if(m.willItFit(0,0,le.w,le.h,!0)){const ie=m.addWidget(le),ue=Number(ie.getAttribute("gs-x")||0),he=Number(ie.getAttribute("gs-y")||0);m.removeWidget(ie);const ae=O.get(K.id),de=r.reactive({...JSON.parse(JSON.stringify(ae.props))||{},_isReactive:!0}),ce=r.reactive({pageId:j,grid:m,page:n.page,view:{name:K.name,title:K.title,key:Date.now()-7*Math.random(),id:`w-${String(Date.now())}`,x:ue,y:he,w:le.w,h:le.h,maxWidth:K.max_column,maxHeight:K.max_row,minWidth:K.min_column,minHeight:K.min_row,componentName:ae.componentName,componentProps:de,pageId:j,coreView:K}});X.addView(ce),qa.emit("add-page-view",ce)}else qa.emit("add-page-and-view",{pageId:j,view:K,filterAndWidgetContainer:X})}}function L(j){if(m){const K=document.querySelector(`[gs-id="${j.id}"]`);K&&(m.removeWidget(K),l("delete-view",j))}}function C(j){if(!j.filterAndViewsContainer&&j.coreView){const K=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[j],j.coreView.id,j.dynamicFilters||[],n.isPostMatch,n.isTemplateMode,j.filtersJSON,null,j.filters);j.filterAndViewsContainer=K}l("edit-view",j)}function q(){l("delete-page",n.page)}function N(){qa.emit("change-sort",n.page)}function P(j){if(d)return;const K=n.page.items.find(X=>X.id===j.itemId||X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function S(j){if(d)return;const K=n.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps),K._updateKey=Date.now())}function E(j){if(d)return;const K=n.page.items.find(X=>X.id===j.viewId);K&&(Object.assign(K.componentProps,j.componentProps||{}),K._updateKey=Date.now())}const W=function(){qa.off("add-view",z),qa.off("force-component-update",P),qa.off("component-props-updated",S),qa.off("dynamic-filters-changed",E);const j=document.querySelector(".container-main");j&&j.removeEventListener("scroll",p),b&&clearTimeout(b),o&&clearTimeout(o)};return qa.on("add-view",z),qa.on("force-component-update",P),qa.on("component-props-updated",S),qa.on("dynamic-filters-changed",E),r.onMounted(async()=>{await r.nextTick(),m=vi.init({column:12,row:12,maxRow:12,cellHeight:60,float:!0,resizable:{handles:"e, se, s, sw, w"}},`#grid-stack-${n.id}`),m.on("change",(j,K)=>{const X=K[0];if(X){const D=t.value.get(X.id);D&&(D.x=X.x,D.y=X.y,D.w=X.w,D.h=X.h,l("view-changed"))}}),x(),n.page.grid=m,n.page.offListeners=W}),r.onUnmounted(()=>{v&&v.disconnect(),W(),b&&clearTimeout(b),o&&clearTimeout(o),document.removeEventListener("programmatic-scroll-start",h),document.removeEventListener("programmatic-scroll-end",c)}),(j,K)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"templatePage",ref:g,class:"template-page"},[r.createElementVNode("div",D5e,[f.value?(r.openBlock(),r.createBlock(CN,{key:0,"options-type":"page",onClick:K[0]||(K[0]=r.withModifiers(X=>f.value=!1,["self"])),onMouseleave:K[1]||(K[1]=X=>f.value=!1),onCloseTooltip:K[2]||(K[2]=X=>f.value=!1),onDeletePage:q,onChangeSort:N})):r.createCommentVNode("",!0),r.createElementVNode("div",J5e,[K[4]||(K[4]=r.createElementVNode("div",null,[r.createElementVNode("svg",{width:"19",height:"21",viewBox:"0 0 19 21",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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)),K[5]||(K[5]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("input",{value:e.page.title,type:"text",class:"page-title-input",onclick:"this.select()",onInput:w},null,40,B5e)]),r.createElementVNode("div",G5e,[r.createElementVNode("div",Z5e,[r.createElementVNode("div",H5e,[_.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",Y5e,[r.createElementVNode("img",{src:_.value.homeTeam.logo,alt:"Home Team Logo",width:"25",height:"25"},null,8,Q5e)])):(r.openBlock(),r.createElementBlock("svg",$5e,[...K[6]||(K[6]=[r.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)])])),r.createElementVNode("span",null,r.toDisplayString(_.value.homeTeam.name),1)]),K[8]||(K[8]=r.createElementVNode("div",{class:"template-page__header__details__teams__vs"}," VS ",-1)),r.createElementVNode("div",e_e,[r.createElementVNode("span",null,r.toDisplayString(_.value.awayTeam.name),1),_.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",t_e,[r.createElementVNode("img",{src:_.value.awayTeam.logo,alt:"Away Team Logo",width:"25",height:"25"},null,8,r_e)])):(r.openBlock(),r.createElementBlock("svg",n_e,[...K[7]||(K[7]=[r.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?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-page__header__details__options",onClick:K[3]||(K[3]=X=>f.value=!0)},[...K[9]||(K[9]=[r.createElementVNode("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)])])):r.createCommentVNode("",!0)])]),r.createElementVNode("div",a_e,[r.createElementVNode("div",{id:`grid-stack-${e.id}`,class:"grid-stack"},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.page.items,X=>{var D,H,re;return r.openBlock(),r.createElementBlock("div",{class:"grid-stack-item",key:X.key,"gs-id":X.id,"gs-x":X.x,"gs-y":X.y,"gs-w":X.w,"gs-h":X.h,"gs-max-w":X.maxWidth,"gs-max-h":X.maxHeight,"gs-min-w":X.minWidth,"gs-min-h":X.minHeight,"gs-no-resize":!e.isTemplateMode,"gs-no-move":!n.isTemplateMode,"gs-auto-position":X.x===0&&X.y===0},[r.createElementVNode("div",{class:r.normalizeClass(["grid-stack-item-content",{"is-selected":X.isSelected}])},[r.createVNode(E5e,{view:X,"is-template-mode":e.isTemplateMode,"is-post-match":e.isPostMatch,game:e.game,lastGames:e.lastGames,"is-home-team":(D=X.componentProps)!=null&&D.preMatchType?((H=X.componentProps)==null?void 0:H.preMatchType)===1:X.isHomeTeam,"is-filter-visible":e.isFilterVisible,"view-id":((re=X==null?void 0:X.coreView)==null?void 0:re.id)||0,onEdit:B=>C(X),onDelete:B=>L(X)},{default:r.withCtx(()=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(U(X.componentName)),r.mergeProps({ref_for:!0},X.componentProps,{key:`${X.id}-${X._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,o_e)}),128))],8,i_e)])],512))}}),l_e=Bc(s_e,[["__scopeId","data-v-d2aac648"]]),c_e={PO1:"CFI",PO2:"CFV",PO3:"SFI",PO4:"SFV",PO5:"FI",PO6:"FV"},u_e={key:0,class:"cover__main-logo cover__main-logo__home"},d_e={key:0,class:"team-logo"},p_e=["src"],h_e={key:1,width:"575",height:"675",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},f_e=["fill"],m_e={key:1,class:"cover__main-logo cover__main-logo__away"},y_e={key:0,class:"team-logo"},g_e=["src"],v_e={key:1,width:"575",height:"575",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b_e=["fill"],x_e={class:"cover__title-subtitle"},w_e={class:"cover__title-subtitle__title"},__e={class:"cover__title-subtitle__subtitle"},S_e={key:2,class:"cover-type-one"},T_e={class:"team-info-one"},k_e={class:"team-data"},N_e={key:0,class:"team-logo"},V_e=["src"],O_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},L_e=["fill","opacity"],U_e={class:"team-name"},q_e={key:0,class:"team-events"},z_e={class:"score-one"},C_e={key:0},P_e={class:"team-info-one"},E_e={class:"team-data"},R_e={key:0,class:"team-logo"},W_e=["src"],M_e={key:1,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},F_e=["fill","opacity"],j_e={class:"team-name"},K_e={key:0,class:"team-events"},A_e={key:3,class:"cover-type-two"},I_e={class:"team-data"},X_e={class:"team-info"},D_e={key:0,class:"team-logo"},J_e=["src"],B_e={key:1,width:"160",height:"161",viewBox:"0 0 160 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G_e=["fill","opacity"],Z_e={key:2,class:"team-score-two"},H_e={key:0,class:"team-goals"},Y_e={class:"team-data"},Q_e={class:"team-info"},$_e={key:0,class:"team-score-two"},eSe={key:1,class:"team-logo"},tSe=["src"],rSe={key:2,width:"161",height:"161",viewBox:"0 0 161 161",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nSe=["fill","opacity"],aSe={key:0,class:"team-goals"},iSe={__name:"CoverPage",props:{game:{type:Object,default:()=>null},coverId:{type:Number,default:1},isPostMatch:{type:Boolean,default:!0}},emits:["intersection-changed"],setup(e,{emit:a}){const i=e,k=a,F=r.ref(null),g=r.computed(()=>[1,2].includes(i.coverId)),m=r.computed(()=>[1,3].includes(i.coverId)),n=r.computed(()=>i.coverId===1?{homeTeam:"#1558CC",awayTeam:"#0046BF",opacity:1}:i.coverId===3?{homeTeam:"#000A1A",awayTeam:"#000A1A",opacity:.4}:{homeTeam:"#576883",awayTeam:"#576883",opacity:.4}),f=r.computed(()=>i.game&&i.game.score?i.game.score:["0","0"]),l=r.computed(()=>{var U,z,L,C,q,N,P,S;if(i.game&&i.game.homeTeam&&i.game.awayTeam){const E={homeTeam:{name:((U=i.game.homeTeam)==null?void 0:U.acronym)||"LOC",logo:((z=i.game.homeTeam)==null?void 0:z.logo)||null},awayTeam:{name:((L=i.game.awayTeam)==null?void 0:L.acronym)||"VIS",logo:((C=i.game.awayTeam)==null?void 0:C.logo)||null}};return g.value?(E.homeTeam.goalsMinutes=o(i.game.minutes.home_goals_minutes),E.homeTeam.totalYellowCards=((q=i.game.minutes.home_yellow_cards_minutes)==null?void 0:q.length)||0,E.homeTeam.totalRedCards=((N=i.game.minutes.home_red_cards_minutes)==null?void 0:N.length)||0,E.awayTeam.goalsMinutes=o(i.game.minutes.visiting_goals_minutes),E.awayTeam.totalYellowCards=((P=i.game.minutes.away_yellow_cards_minutes)==null?void 0:P.length)||0,E.awayTeam.totalRedCards=((S=i.game.minutes.away_red_cards_minutes)==null?void 0:S.length)||0):(E.homeTeam.goalsEvents=d(i.game.report_minutes.home_goals_minutes),E.awayTeam.goalsEvents=d(i.game.report_minutes.visiting_goals_minutes)),E}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'"}]}}}),t=r.computed(()=>({"--background-image":m.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":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-one":i.isPostMatch?"100%":"fit-content","--grid-template-columns-type-two":i.isPostMatch?"1fr min-content 1fr":"320px min-content 320px","--width-type-two":i.isPostMatch?"100%":"fit-content"})),_=r.computed(()=>i.isPostMatch?"Postmatch":"Prematch"),v=["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],b=r.computed(()=>{if(i.game){let U=c_e[i.game.matchday_abbreviation];U||(U=i.game.matchday_abbreviation.replace("M","J"));const[z,L,C]=i.game.date.split("-");return`${U} - ${C} ${v[Number(L)-1]}, ${z}`}return"Jornada - Día 00 Mes"});function d(U){return!U||!Array.isArray(U)||U.length===0?"":U.map(z=>{const L=z.split(", ");let C=L[0].replace("'","");C=C.replace("+",""),C=C.replace("’","");const q=C.split(" "),{strings:N,numbers:P}=q.reduce((W,j)=>(isNaN(Number(j))?W.strings.push(j):W.numbers.push(j),W),{strings:[],numbers:[]}),S=N.join(" "),E=P.length===1?`${P[0]}'`:`${P[0]}' ${P.slice(1).join(" + ")}'`;return{playerName:S,goalTime:L.length===1?E:`${E}, ${L.reduce((W,j,K)=>K===0?W:`${W}${j}${K<L.length-1?", ":""}`,"")}`}})}function o(U){return!U||!Array.isArray(U)||U.length===0?"":U.reduce((z,L,C)=>{const q=L.split(" ");let N="";return q.length===3?N=q[2]:q.length===5&&(N=`${q[2]} ${q[3]} ${q[4]}`),N&&(z+=`${N}${C<U.length-1?", ":""}`),z},"")}let s=null,h=null,c=!1,p=null,x=!1;const w=()=>{x=!0},T=()=>{x=!1};function V(){x||(c=!0,p&&clearTimeout(p),p=setTimeout(()=>{c=!1},150))}function O(){const U={root:null,rootMargin:"0px",threshold:.7};s=new IntersectionObserver(C=>{C.forEach(q=>{if(c){h&&clearTimeout(h),h=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},100);return}h&&clearTimeout(h),h=setTimeout(()=>{k("intersection-changed",q.isIntersecting)},50)})},U);const z=F.value;z&&s.observe(z);const L=document.querySelector(".container-main");L&&L.addEventListener("scroll",V,{passive:!0}),document.addEventListener("programmatic-scroll-start",w),document.addEventListener("programmatic-scroll-end",T)}return r.onMounted(()=>{O()}),r.onUnmounted(()=>{s&&s.disconnect();const U=document.querySelector(".container-main");U&&U.removeEventListener("scroll",V),document.removeEventListener("programmatic-scroll-start",w),document.removeEventListener("programmatic-scroll-end",T),h&&clearTimeout(h),p&&clearTimeout(p)}),(U,z)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"coverPage",ref:F,class:"cover",style:r.normalizeStyle(t.value)},[g.value?(r.openBlock(),r.createElementBlock("div",u_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",d_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,p_e)])):(r.openBlock(),r.createElementBlock("svg",h_e,[r.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:n.value.homeTeam},null,8,f_e)]))])):r.createCommentVNode("",!0),g.value?(r.openBlock(),r.createElementBlock("div",m_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",y_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,g_e)])):(r.openBlock(),r.createElementBlock("svg",v_e,[r.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:n.value.awayTeam},null,8,b_e)]))])):r.createCommentVNode("",!0),r.createElementVNode("div",x_e,[r.createElementVNode("div",w_e,[z[0]||(z[0]=r.createElementVNode("div",null,"Análisis",-1)),r.createElementVNode("div",null,r.toDisplayString(_.value),1)]),r.createElementVNode("div",__e,r.toDisplayString(b.value),1)]),g.value?(r.openBlock(),r.createElementBlock("div",S_e,[r.createElementVNode("div",T_e,[r.createElementVNode("div",k_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",N_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,V_e)])):(r.openBlock(),r.createElementBlock("svg",O_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,L_e)])),r.createElementVNode("div",U_e,r.toDisplayString(l.value.homeTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",q_e,[z[1]||(z[1]=r.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)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.goalsMinutes),1),z[2]||(z[2]=r.createElementVNode("div",{class:"separator"},null,-1)),z[3]||(z[3]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalYellowCards),1),z[4]||(z[4]=r.createElementVNode("svg",{class:"card",width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.homeTeam.totalRedCards),1)])):r.createCommentVNode("",!0)]),r.createElementVNode("div",z_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",C_e,r.toDisplayString(f.value[0])+" : "+r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0)]),r.createElementVNode("div",P_e,[r.createElementVNode("div",E_e,[l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",R_e,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,W_e)])):(r.openBlock(),r.createElementBlock("svg",M_e,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,F_e)])),r.createElementVNode("div",j_e,r.toDisplayString(l.value.awayTeam.name),1)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",K_e,[r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalYellowCards),1),z[5]||(z[5]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.367188",y:"0.09375",width:"9.14286",height:"13.7143",rx:"2.28571",fill:"#F7C330"})],-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.totalRedCards),1),z[6]||(z[6]=r.createElementVNode("svg",{width:"10",height:"14",viewBox:"0 0 10 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("rect",{x:"0.109375",y:"0.09375",width:"9.14286",height:"13.7143",rx:"1.82857",fill:"#FF0000"})],-1)),z[7]||(z[7]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(l.value.awayTeam.goalsMinutes),1),z[8]||(z[8]=r.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))])):r.createCommentVNode("",!0)])])):(r.openBlock(),r.createElementBlock("div",A_e,[r.createElementVNode("div",I_e,[r.createElementVNode("div",X_e,[l.value.homeTeam.logo?(r.openBlock(),r.createElementBlock("div",D_e,[r.createElementVNode("img",{src:l.value.homeTeam.logo||"/default-logo.png",alt:"Team 1 Logo"},null,8,J_e)])):(r.openBlock(),r.createElementBlock("svg",B_e,[r.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:n.value.homeTeam,opacity:n.value.opacity},null,8,G_e)])),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",Z_e,r.toDisplayString(f.value[0]),1)):r.createCommentVNode("",!0)]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",H_e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.homeTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-${C}`,class:"goal"},[r.createElementVNode("div",null,r.toDisplayString(L.playerName),1),z[9]||(z[9]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[10]||(z[10]=r.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))])):r.createCommentVNode("",!0)]),z[13]||(z[13]=r.createElementVNode("div",{class:"separator"},null,-1)),r.createElementVNode("div",Y_e,[r.createElementVNode("div",Q_e,[e.isPostMatch?(r.openBlock(),r.createElementBlock("div",$_e,r.toDisplayString(f.value[1]),1)):r.createCommentVNode("",!0),l.value.awayTeam.logo?(r.openBlock(),r.createElementBlock("div",eSe,[r.createElementVNode("img",{src:l.value.awayTeam.logo||"/default-logo.png",alt:"Team 2 Logo"},null,8,tSe)])):(r.openBlock(),r.createElementBlock("svg",rSe,[r.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:n.value.awayTeam,opacity:n.value.opacity},null,8,nSe)]))]),e.isPostMatch?(r.openBlock(),r.createElementBlock("div",aSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.value.awayTeam.goalsEvents,(L,C)=>(r.openBlock(),r.createElementBlock("div",{key:`goal-a-${C}`,class:"goal"},[z[11]||(z[11]=r.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)),r.createElementVNode("div",null,r.toDisplayString(L.goalTime),1),z[12]||(z[12]=r.createElementVNode("div",{class:"bullet"},null,-1)),r.createElementVNode("div",null,r.toDisplayString(L.playerName),1)]))),128))])):r.createCommentVNode("",!0)])]))],4))}},oSe=Bc(iSe,[["__scopeId","data-v-6680cbcf"]]),sSe={class:"table-category-filters"},lSe={key:0,class:"custom-radio-group filter-inline"},cSe={class:"radio-label"},uSe={class:"radio-options"},dSe=["name","value","onUpdate:modelValue","onClick"],pSe=["data-filter-type","onClick","onMousedown","onMouseup"],hSe={class:"select-display"},fSe={class:"select-label"},mSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},ySe={class:"simple-select-scroll-area"},gSe=["onClick"],vSe={class:"option-content"},bSe={class:"option-title"},xSe={key:0,class:"option-checkmark"},wSe={key:2,class:"filter-separator"},_Se={__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:a,emit:i}){const k=e,F=i,g=r.ref([]);let m=null;const n=(x,w)=>{if(!w)return!0;for(let T=0;T<x.length;T++)if(!f(x[T],w[T]))return!0;return!1},f=(x,w)=>{if(Array.isArray(x)&&Array.isArray(w)){if(x.length!==w.length)return!1;for(let T=0;T<x.length;T++)if(x[T]!==w[T])return!1;return!0}return x===w},l=r.ref(null),t=r.ref([]);let _=!1,v=null;const b=()=>{v=null},d=()=>{setTimeout(()=>{_=!1},1e3)},o=(x,w=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const T=k.filters[0].options,V=k.filters[1].options;x!=null?T.findIndex(O=>O.value===x)!==-1&&V[x]?(t.value=V[x],w&&!(()=>{const O=g.value[1];return O==null?!1:Array.isArray(O)?O.length>0:O!==""})()&&!_&&t.value.length>0&&(g.value[1]=t.value[0].value,r.nextTick(()=>{}))):(t.value=[],g.value[1]=null):(t.value=[],g.value[1]=null)}},s=()=>{k.initialValues&&k.initialValues.length>0?g.value=[...k.initialValues]:g.value=k.filters.map(x=>{var w,T,V,O;return x.type==="select"?[]:x.type==="check"?!1:x.type==="radio-button"?((T=(w=x.options)==null?void 0:w[0])==null?void 0:T.value)||null:x.type==="select-simple"&&((O=(V=x.options)==null?void 0:V[0])==null?void 0:O.value)||null}),k.componentId===13&&g.value.some(x=>x!=null&&(Array.isArray(x)?x.length>0:x!==!1&&x!==""))&&(m=[...g.value],F("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};s(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!_){const x=!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})();o(g.value[0],x)}})},300),r.watch(()=>k.initialValues,x=>{const w=!f(g.value,x),T=x&&x.length>0&&!_&&w,V=k.isEditMode&&_;T&&!V?g.value=[...x]:_?v&&v.length>0&&(g.value=[...v]):V&&v&&v.length>0&&(g.value=[...v])},{deep:!0}),r.watch(()=>k.isEditMode,(x,w)=>{w===!0&&x===!1&&b()},{immediate:!0}),r.watch(g,(x,w)=>{x.some(T=>T!=null&&(Array.isArray(T)?T.length>0:T!==!1&&T!==""))&&n(x,m)&&(m=[...x],F("filters-changed",{componentId:k.componentId,filters:x,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(x,w)=>{x!==w&&w!==void 0?o(x,!0):w===void 0&&x!==null&&x!==void 0&&o(x,!1)},{immediate:!0}),r.watch(()=>g.value,(x,w)=>{k.filters.map((T,V)=>T.type==="radio-button"?V:-1).filter(T=>T!==-1).forEach(T=>{})},{deep:!0}),r.watch(t,()=>{},{deep:!0});const h=x=>{l.value===x?l.value=null:l.value=x},c=(x,w)=>{if(_=!0,d(),g.value[x]=w,(x===0||x===1)&&(v=[...g.value]),l.value=null,x===0){g.value[1]!==void 0&&(g.value[1]=null);const T=_;_=!1,o(w,!0),_=T,g.value[1]!==null&&g.value[1]!==void 0&&(v=[...g.value])}},p=()=>{_=!0,setTimeout(()=>{_=!1},1e3)};return a({getCurrentValues:()=>g.value,initializeValues:s}),(x,w)=>(r.openBlock(),r.createElementBlock("div",sSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(T,V)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:V},[T.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",lSe,[r.createElementVNode("div",cSe,r.toDisplayString(T.label),1),r.createElementVNode("div",uSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(T.options,O=>(r.openBlock(),r.createElementBlock("label",{key:O.value,class:r.normalizeClass(["radio-option-card",{active:g.value[V]===O.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"table-radio-"+V,value:O.value,"onUpdate:modelValue":U=>g.value[V]=U,onChange:w[0]||(w[0]=()=>{p()}),onClick:U=>console.log("Click en radio button",V,O.value,"Valor actual:",g.value[V])},null,40,dSe),[[r.vModelRadio,g.value[V]]]),r.createElementVNode("span",null,r.toDisplayString(O.label),1)],2))),128))])])):T.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:1,class:"custom-select dynamic-select filter-inline","data-filter-type":T.type,onClick:r.withModifiers(O=>h(V),["stop"]),onMousedown:O=>console.log("Mouse down en selector",V),onMouseup:O=>console.log("Mouse up en selector",V)},[r.createElementVNode("div",hSe,[w[2]||(w[2]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",fSe,r.toDisplayString(T.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:l.value===V}])},[...w[1]||(w[1]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),l.value===V?(r.openBlock(),r.createElementBlock("div",mSe,[r.createElementVNode("div",ySe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V===1?t.value:T.options,O=>(r.openBlock(),r.createElementBlock("div",{key:O.value,class:r.normalizeClass(["option-card simple-select-option",{active:f(g.value[V],O.value)}]),onClick:r.withModifiers(U=>c(V,O.value),["stop"])},[r.createElementVNode("div",vSe,[r.createElementVNode("div",bSe,r.toDisplayString(O.label),1)]),f(g.value[V],O.value)?(r.openBlock(),r.createElementBlock("div",xSe,[...w[3]||(w[3]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,gSe))),128))])])):r.createCommentVNode("",!0)],40,pSe)):r.createCommentVNode("",!0),V===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",wSe)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},SSe=Bc(_Se,[["__scopeId","data-v-9d00f072"]]),TSe={class:"strengths-filters"},kSe={key:0,class:"custom-radio-group filter-inline"},NSe={class:"radio-label"},VSe={class:"radio-options"},OSe=["name","value","onUpdate:modelValue"],LSe={class:"filter-inline select-with-label"},USe=["data-filter-type","onClick"],qSe={class:"select-display"},zSe={class:"select-label"},CSe={key:0,class:"dropdown-menu type-menu simple-select-menu"},PSe={class:"simple-select-scroll-area"},ESe=["onClick"],RSe={class:"option-content"},WSe={class:"option-title"},MSe={key:0,class:"option-checkmark"},FSe={key:2,class:"filter-separator"},jSe={__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:a,emit:i}){const k=e,F=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref([]);let l=!1,t=null;const _=(h,c)=>{if(Array.isArray(h)&&Array.isArray(c)){if(h.length!==c.length)return!1;for(let p=0;p<h.length;p++)if(h[p]!==c[p])return!1;return!0}return h===c},v=(h,c=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const p=k.filters[0].options,x=k.filters[1].options;h!=null?p.findIndex(w=>w.value===h)!==-1&&x[h]?(f.value=x[h],c&&!(()=>{const w=g.value[1];return w==null?!1:Array.isArray(w)?w.length>0:w!==""})()&&!l&&f.value.length>0&&(g.value[1]=f.value[0].value,r.nextTick(()=>{}))):(f.value=[],g.value[1]=null):(f.value=[],g.value[1]=null)}},b=()=>{if(k.initialValues&&k.initialValues.length>0){const c=k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]));console.log("StrengthsFilters initializeValues - isSimpleFormat:",c),c?(console.log("StrengthsFilters initializeValues - Usando formato simple, valores:",k.initialValues),g.value=[...k.initialValues]):k.isEditMode?g.value=k.filters.map((p,x)=>{var w,T,V,O,U,z,L,C,q,N;const P=k.initialValues[x];if(console.log(`StrengthsFilters initializeValues - filter[${x}]:`,p==null?void 0:p.type,"filterData:",P),!P)return console.log(`StrengthsFilters initializeValues - No hay filterData para índice ${x}, usando valor por defecto`),p.type==="select"?[]:p.type==="check"?!1:p.type==="radio-button"?((T=(w=p.options)==null?void 0:w[0])==null?void 0:T.value)||null:p.type==="select-simple"&&((O=(V=p.options)==null?void 0:V[0])==null?void 0:O.value)||null;if(p.type==="radio-button"&&P.selectedOption){console.log("StrengthsFilters initializeValues - filterData.selectedOption: ",P.selectedOption,"index:",x);const S=P.selectedOption.value;return console.log("StrengthsFilters initializeValues - selectedValue extraído:",S),S}else{if(p.type==="radio-button"&&!P.selectedOption)return console.log("StrengthsFilters initializeValues - filterData NO tiene selectedOption:",P,"index:",x),P.selectedValue!==void 0?(console.log("StrengthsFilters initializeValues - Usando selectedValue:",P.selectedValue),P.selectedValue):(console.log("StrengthsFilters initializeValues - Usando valor por defecto del filter"),((z=(U=p.options)==null?void 0:U[0])==null?void 0:z.value)||null);if(p.type==="select-simple"&&P.selectedValue!==void 0)return Array.isArray(P.selectedValue)?P.selectedValue[0]:P.selectedValue;if(p.type==="select"&&P.selectedOptions)return P.selectedOptions.map(S=>S.value);if(p.type==="check"&&P.isChecked!==void 0)return P.isChecked}return P.selectedValue!==void 0?P.selectedValue:p.type==="select"?[]:p.type==="check"?!1:p.type==="radio-button"?((C=(L=p.options)==null?void 0:L[0])==null?void 0:C.value)||null:p.type==="select-simple"&&((N=(q=p.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]}else g.value=k.filters.map(c=>{var p,x,w,T;return c.type==="select"?[]:c.type==="check"?!1:c.type==="radio-button"?((x=(p=c.options)==null?void 0:p[0])==null?void 0:x.value)||null:c.type==="select-simple"&&((T=(w=c.options)==null?void 0:w[0])==null?void 0:T.value)||null});console.log("StrengthsFilters initializeValues - selectedValues.value final:",g.value);const h=g.value.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""));console.log("StrengthsFilters initializeValues - hasValidValues:",h),h&&(m=[...g.value],F("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};b(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!l){const h=!(()=>{const c=g.value[1];return c==null?!1:Array.isArray(c)?c.length>0:c!==""})();v(g.value[0],h)}})},300),r.watch(()=>k.initialValues,(h,c)=>{if(!h||h.length===0)return;console.log("StrengthsFilters watch initialValues - newValues:",h),console.log("StrengthsFilters watch initialValues - oldValues:",c),console.log("StrengthsFilters watch initialValues - props.isEditMode:",k.isEditMode),console.log("StrengthsFilters watch initialValues - isUserInteracting:",l);const p=h.length>0&&(typeof h[0]=="number"||typeof h[0]=="boolean"||h[0]===null||Array.isArray(h[0]));console.log("StrengthsFilters watch initialValues - isSimpleFormat:",p);const x=!_(g.value,h),w=h&&h.length>0&&!l&&x,T=k.isEditMode&&l;console.log("StrengthsFilters watch initialValues - valuesAreDifferent:",x,"shouldUpdate:",w,"isEditModeProtection:",T),w&&!T?p?(console.log("StrengthsFilters watch initialValues - Usando formato simple, valores:",h),g.value=[...h]):k.isEditMode?g.value=k.filters.map((V,O)=>{const U=h[O];if(!U)return console.log("StrengthsFilters watch initialValues - No hay filterData para índice",O),g.value[O];if(V.type==="radio-button"&&U.selectedOption){console.log("StrengthsFilters watch initialValues - filterData.selectedOption: ",U.selectedOption,"index:",O);const z=U.selectedOption.value;return console.log("StrengthsFilters watch initialValues - selectedValue extraído:",z),z}else{if(V.type==="select-simple"&&U.selectedValue!==void 0)return Array.isArray(U.selectedValue)?U.selectedValue[0]:U.selectedValue;if(V.type==="select"&&U.selectedOptions)return U.selectedOptions.map(z=>z.value);if(V.type==="check"&&U.isChecked!==void 0)return U.isChecked}return U.selectedValue!==void 0?U.selectedValue:g.value[O]}):g.value=[...h]:l?t&&t.length>0&&(g.value=[...t]):T&&t&&t.length>0&&(g.value=[...t])},{deep:!0}),r.watch(()=>k.isEditMode,(h,c)=>{c===!0&&h===!1&&(t=null)},{immediate:!0}),r.watch(g,h=>{h.some(c=>c!=null&&(Array.isArray(c)?c.length>0:c!==!1&&c!==""))&&(()=>{if(!m)return!0;for(let c=0;c<h.length;c++)if(!_(h[c],m[c]))return!0;return!1})()&&(m=[...h],F("filters-changed",{componentId:k.componentId,filters:h,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(h,c)=>{h!==c&&c!==void 0?v(h,!0):c===void 0&&h!==null&&h!==void 0&&v(h,!1)},{immediate:!0});const d=h=>{n.value===h?n.value=null:n.value=h},o=(h,c)=>{if(l=!0,setTimeout(()=>{l=!1},1e3),g.value[h]=c,(h===0||h===1)&&(t=[...g.value]),n.value=null,h===0){g.value[1]!==void 0&&(g.value[1]=null);const p=l;l=!1,v(c,!0),l=p,g.value[1]!==null&&g.value[1]!==void 0&&(t=[...g.value])}},s=()=>{l=!0,setTimeout(()=>{l=!1},400)};return a({getCurrentValues:()=>g.value,initializeValues:b}),(h,c)=>(r.openBlock(),r.createElementBlock("div",TSe,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(p,x)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:x},[p.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",kSe,[r.createElementVNode("div",NSe,r.toDisplayString(p.label),1),r.createElementVNode("div",VSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.options,w=>(r.openBlock(),r.createElementBlock("label",{key:w.value,class:r.normalizeClass(["radio-option-card",{active:g.value[x]===w.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"strengths-radio-"+x,value:w.value,"onUpdate:modelValue":T=>g.value[x]=T,onChange:s},null,40,OSe),[[r.vModelRadio,g.value[x]]]),r.createElementVNode("span",null,r.toDisplayString(w.label),1)],2))),128))])])):p.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[c[4]||(c[4]=r.createElementVNode("div",{class:"filter-separator"},null,-1)),r.createElementVNode("div",LSe,[c[3]||(c[3]=r.createElementVNode("div",{class:"radio-label"},"Mostrar: ",-1)),r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":p.type,onClick:r.withModifiers(w=>d(x),["stop"])},[r.createElementVNode("div",qSe,[c[1]||(c[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",zSe,r.toDisplayString(p.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===x}])},[...c[0]||(c[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===x?(r.openBlock(),r.createElementBlock("div",CSe,[r.createElementVNode("div",PSe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.options,w=>(r.openBlock(),r.createElementBlock("div",{key:w.value,class:r.normalizeClass(["option-card simple-select-option",{active:_(g.value[x],w.value)}]),onClick:r.withModifiers(T=>o(x,w.value),["stop"])},[r.createElementVNode("div",RSe,[r.createElementVNode("div",WSe,r.toDisplayString(w.label),1)]),_(g.value[x],w.value)?(r.openBlock(),r.createElementBlock("div",MSe,[...c[2]||(c[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,ESe))),128))])])):r.createCommentVNode("",!0)],8,USe)])],64)):r.createCommentVNode("",!0),x===1&&e.filters.length>2?(r.openBlock(),r.createElementBlock("div",FSe)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},KSe=Bc(jSe,[["__scopeId","data-v-4c3876bd"]]),ASe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,F]of a)i[k]=F;return i},ISe={key:1},XSe={width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",xmlns:"http://www.w3.org/2000/svg"},DSe=["fill"],JSe={key:0,class:"checkbox__teams"},BSe={class:"checkbox__teams__logo"},GSe=["src"],ZSe={class:"checkbox__teams__logo"},HSe=["src"],YSe={__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:a}){const i=e;r.useCssVars(l=>({"7bd9d47b":e.width,"34dc7ddc":e.height}));const k=r.ref(!1),F=r.computed(()=>{const l={color:i.boxValueColor,"font-family":i.fontFamily,height:i.boxWidthAndHeight,width:i.boxWidthAndHeight,minWidth:i.boxWidthAndHeight,"border-radius":i.boxBorderRadius,"margin-top":i.boxMarginTop};return k.value?(l["background-color"]=i.boxBackgroundColor,l.border=`solid ${i.boxBorderWidth} ${i.boxBackgroundColor}`):l.border=`solid ${i.boxBorderWidth} ${i.boxBorderColor}`,l}),g=r.computed(()=>({"font-family":i.boxValueFontFamily,"font-size":i.boxValueFontSize,color:i.boxValueColor,"line-height":1})),m=r.computed(()=>{const l={color:i.labelColor,"font-family":i.fontFamily,"font-size":i.labelFontSize,"white-space":i.labelWhiteSpace,"text-align":i.boxPosition==="top"||i.boxPosition==="bottom"?"center":i.boxPosition};return(i.boxPosition==="left"||i.boxPosition==="right")&&(l[`margin-${i.boxPosition}`]=i.isBoxOnly?"0":i.teamsIds?"8px":"10px"),l});r.watch(()=>i.modelValue,l=>{l!==k.value&&(k.value=l)},{immediate:!0});function n(){i.avoidInteraction||!k.value&&i.avoidToCheck||(k.value=!k.value,a("update:modelValue",k.value))}function f(l){return`${{}.TEAM_LOGOS_URL||"https://golstatsimages.blob.core.windows.net/teams-80/"}${l}.png`}return(l,t)=>(r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["checkbox",`box-${e.boxPosition}`]),onClick:n},[r.createElementVNode("div",{class:"checkbox__box",style:r.normalizeStyle(F.value)},[k.value?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[i.boxValue?(r.openBlock(),r.createElementBlock("div",{key:0,class:"checkbox__box__value",style:r.normalizeStyle(g.value)},r.toDisplayString(e.boxValue),5)):(r.openBlock(),r.createElementBlock("div",ISe,[(r.openBlock(),r.createElementBlock("svg",XSe,[r.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,DSe)]))]))],64)):r.createCommentVNode("",!0)],4),e.teamsIds&&e.teamsIds.length?(r.openBlock(),r.createElementBlock("div",JSe,[r.createElementVNode("div",BSe,[r.createElementVNode("img",{src:f(e.teamsIds[0]),alt:""},null,8,GSe)]),r.createElementVNode("div",ZSe,[r.createElementVNode("img",{src:f(e.teamsIds[1]),alt:""},null,8,HSe)])])):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"checkbox__label",style:r.normalizeStyle(m.value)},r.toDisplayString(e.label),5)],2))}},FN=ASe(YSe,[["__scopeId","data-v-b6f124d8"]]),QSe=(e,a)=>{const i=e.__vccOpts||e;for(const[k,F]of a)i[k]=F;return i},k5={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))}}},jN=()=>{r.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}))},KN=k5.setup;k5.setup=KN?(e,a)=>(jN(),KN(e,a)):jN;const $Se=e=>(r.pushScopeId("data-v-f3ee6b2b"),e=e(),r.popScopeId(),e),eTe=["src"],tTe={key:1,class:"text"},rTe=["src"],nTe={class:"stats"},aTe=$Se(()=>r.createElementVNode("img",{class:"iconstats",src:"https://golstatsimages.blob.core.windows.net/todoelfut/playdes.png"},null,-1)),iTe={class:"numstats"},oTe={class:"leyend"};function sTe(e,a,i,k,F,g){return r.openBlock(),r.createElementBlock("div",null,[i.type==0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["button",F.status&&i.typeOnOff&&"button-active"]),style:r.normalizeStyle([g.customStyle,F.status&&i.typeOnOff&&g.customActive]),onClick:a[0]||(a[0]=(...m)=>g.btnClick&&g.btnClick(...m))},[i.icon&&i.iconPosition.toLowerCase()==="left"?(r.openBlock(),r.createElementBlock("img",{key:0,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,eTe)):r.createCommentVNode("",!0),i.textValue?(r.openBlock(),r.createElementBlock("div",tTe,r.toDisplayString(i.textValue),1)):r.createCommentVNode("",!0),i.icon&&i.iconPosition.toLowerCase()==="right"?(r.openBlock(),r.createElementBlock("img",{key:2,class:"icon",style:r.normalizeStyle({width:i.iconSize}),src:i.icon},null,12,rTe)):r.createCommentVNode("",!0)],6)):r.createCommentVNode("",!0),i.type==1?(r.openBlock(),r.createElementBlock("div",{key:1,class:"button-target",onClick:a[1]||(a[1]=(...m)=>g.btnClick&&g.btnClick(...m))},[r.createElementVNode("div",nTe,[aTe,r.createElementVNode("div",iTe,r.toDisplayString(i.textStat),1)]),r.createElementVNode("div",oTe,r.toDisplayString(i.textCategory),1)])):r.createCommentVNode("",!0)])}const lTe=QSe(k5,[["render",sTe],["__scopeId","data-v-f3ee6b2b"]]),cTe={class:"gsc-dropdown__main-container__item-selected"},uTe=["height","width"],dTe=["stroke"],pTe={key:1,width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},hTe=["fill"],fTe={class:"gsc-dropdown__items-container"},mTe=["onClick"],yTe={key:0,class:"gsc-dropdown__items-footer"},b2={__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(a=>a 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:a}){const i=e,k=r.ref({}),F=r.ref(null),g=r.ref(i.isMultipleOption?-1:0),m=r.ref(!1);r.watch(()=>i.items,(b,d)=>{if(!i.modelValue&&(!i.onlyFirstTime||!d||!d.length)&&b&&b.length){if(i.defaultItemByProp){const o=i.items.findIndex(s=>s[i.defaultItemByProp.propName]===i.defaultItemByProp.value);o!==-1?(g.value=o,k.value=b[o]):(g.value=0,k.value=b[0])}else k.value=b[i.defaultItemByIndex];a("input",k.value)}},{immediate:!0}),r.watch(()=>i.modelValue,b=>{if(b){const d=i.items.findIndex(o=>typeof b=="object"?JSON.stringify(o)===JSON.stringify(b):o===b);d!==-1&&(g.value=d,k.value=i.items[d],a("update:modelValue",k.value))}},{immediate:!0});const n=r.computed(()=>({height:i.height,width:i.width,backgroundColor:i.backgroundColor,borderRadius:`${i.borderRadius}px`,border:`${i.borderType} ${i.borderWidth}px ${i.borderColor}`,color:i.color,"--hover-background-color":i.hoverBackgroundColor,"--list-container-padding":i.listContainerPadding,"--list-item-padding":i.listItemPadding,"--list-item-margin":i.listItemMargin,"--list-background-color":i.listBackgroundColor,"--list-height":i.listHeight,"--list-item-border-radius":i.listItemBorderRadius,"--list-item-selected-color":i.listItemSelectedColor,"--list-item-selected-background-color":i.listItemSelectedBackgroundColor,"--list-item-color":i.listItemColor,"--list-border-radius":`${i.listBorderRadius}`,"--list-border-color":i.listBorderColor,"--list-width":i.isListSameWidth?i.width:"fit-content","--list-border-width":`${i.listBorderWidth}px`,"--list-margin-top":i.listMarginTop,"--list-left":i.listAlignment==="left"?"0":"auto","--list-right":i.listAlignment==="right"?"0":"auto","--footer-border":`${i.footerBorderWidth}px solid ${i.footerBorderColor}`,"--dropdown-opacity":i.isDisabled?"0.5":"1","--dropdown-cursor":i.isDisabled?"not-allowed":"pointer","--dropdown-font-size":i.fontSize?i.fontSize:"14px"})),f=r.computed(()=>({height:`${i.arrowHeight}px`,width:`${i.arrowWidth}px`}));function l(){i.isDisabled||(m.value=!m.value)}function t(b){F.value&&!F.value.contains(b.target)&&(m.value=!1)}function _(b,d){i.isMultipleOption?g.value=-1:(g.value=d,m.value=!1),k.value=b,a("input",k.value),a("update:modelValue",k.value)}function v(){m.value=!1,a("click-ready")}return r.onMounted(()=>{document.addEventListener("click",t)}),r.onBeforeMount(()=>{document.removeEventListener("click",t)}),(b,d)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"dropDown",ref:F,class:"gsc-dropdown",style:r.normalizeStyle(n.value)},[r.createElementVNode("div",{class:"gsc-dropdown__main-container",style:r.normalizeStyle({"padding-right":`${e.arrowWidth+8}px`}),onClick:l},[r.createElementVNode("div",cTe,[r.renderSlot(b.$slots,"default",{selectedItem:k.value})]),r.createElementVNode("div",{class:r.normalizeClass(["gsc-dropdown__main-container__icon",{"rotated-180":m.value}]),style:r.normalizeStyle(f.value)},[e.iconType===1?(r.openBlock(),r.createElementBlock("svg",{key:0,height:e.arrowHeight,width:e.arrowWidth,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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,dTe)],8,uTe)):(r.openBlock(),r.createElementBlock("svg",pTe,[r.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,hTe)]))],6)],4),r.createVNode(r.Transition,null,{default:r.withCtx(()=>[r.withDirectives(r.createElementVNode("div",fTe,[r.createElementVNode("div",null,[r.createElementVNode("div",{class:"gsc-dropdown__items",style:r.normalizeStyle({"margin-top":`${i.borderWidth}px`})},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.items,(o,s)=>(r.openBlock(),r.createElementBlock("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("div",{class:r.normalizeClass(["gsc-dropdown__items__item",{selected:s===g.value}]),key:s,onClick:h=>_(o,s)},[r.renderSlot(b.$slots,"availableItem",{item:o})],10,mTe)),[[r.vShow,!o.isHidden]])]))),256))],4),e.isFooterVisible?(r.openBlock(),r.createElementBlock("div",yTe,[r.createVNode(r.unref(lTe),{"text-value":"Listo","border-color":"#cbee6b","font-size":"12px",width:"72px",height:"22px","border-radius":"62px","border-width":.8,onClick:v})])):r.createCommentVNode("",!0)])],512),[[r.vShow,m.value]])]),_:3})],4))}},AN={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},gTe=[{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"}}],vTe=[{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}}],bTe={class:"last-touch"},xTe={class:"selected-item"},wTe={class:"available-item"},_Te={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},STe={class:"selected-item"},TTe={class:"available-item"},kTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},NTe={key:1},VTe={class:"selected-item"},OTe={class:"available-item"},LTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},UTe={class:"last-touch__how-many-games"},qTe={class:"selected-item"},zTe={class:"available-item"},CTe={width:"13",height:"9",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},PTe={__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:a}){const i=e,k=a,F=r.ref([{label:"Ofensivo",value:2,name:"offensive"},{label:"Defensivo",value:3,name:"defensive"}]),g=r.ref({id:0,name:"Fases de juego",value:null}),m=r.ref(!1),n=r.ref([{id:1,name:"Último partido",value:1},{id:3,name:"Últimos 3 partidos",value:3},{id:0,name:"Todos mis partidos",value:0}]),f=r.ref(i.defaultFilters?null:n.value[0]),l=r.ref(null),t=r.computed(()=>({...AN})),_=r.computed(()=>({...AN,isFooterVisible:!i.isEditMode,isMultipleOption:!i.isEditMode})),v=r.computed(()=>{const K=[];return b.value.options.forEach(X=>{X.forEach(D=>{K.push(D)})}),K}),b=r.ref(null),d=r.ref(null),o=r.ref(null),s=r.ref(null);r.watch(()=>i.viewConfig,K=>{K.filters&&(b.value||h(),d.value||c(),o.value||p(),s.value||V())},{immediate:!0});function h(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="categories");K&&K.options&&(b.value={label:K.label,options:Object.entries(K.options).reduce((X,[D,H])=>(X.set(Number(D),H),X),new Map)})}b.value={label:"Tipo de jugada",options:new Map([[2,vTe],[3,gTe]])}}function c(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="gamePhases");if(K){d.value={label:K.label,options:K.options};return}}d.value={label:"Fases de juego",options:F.value}}function p(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="teamRadios");if(K){o.value={options:K.options},q(null,K.options[0]);return}}o.value={label:"Equipo",options:i.defaultFilters?[{label:"Mi equipo",value:1},{label:"Rival",value:2}]:[{label:"Mi equipo",value:1},{label:"Rival",value:2},{label:"Ambos",value:3}]},q(null,o.value.options[0])}const x=r.ref(i.defaultFilters?null:o.value.options[0]),w=r.ref(i.defaultFilters?null:d.value.options[0]),T=r.ref(i.defaultFilters?null:b.value.options.get(w.value.value)[0]);function V(){if(i.viewConfig&&i.viewConfig.filters){const K=i.viewConfig.filters.find(X=>X.key==="assistZoneCheckbox");if(K){s.value={label:K.label},N(K.value);return}}s.value={label:"Zona de asistencia"}}const O=r.computed(()=>{const K={selectedGamePhase:w.value,selectedTeam:x.value,isAssistZoneVisible:m.value,howManyGamesSelected:f.value};return i.isEditMode?(K.selectedCategory=T.value,K.totalCategoriesSelected=1):(K.selectedCategories=l.value,K.totalCategoriesSelected=0,b.value.options.forEach(X=>{X.forEach(D=>{D.isSelected&&(K.totalCategoriesSelected+=1)})})),K}),U=r.computed(()=>w.value?b.value.options.get(w.value.value)||[]:[]);r.watch(()=>O.value,K=>{z()&&(console.log("before emit change:",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}),k("change",{areAllFiltersFilled:z(),filters:K,view:i.viewConfig}))},{deep:!0});function z(){return w.value&&(i.isEditMode&&T.value||!i.isEditMode&&l.value&&l.value.length)&&x.value&&f.value}function L(K){w.value=K,S(null)}function C(K){x.value=K}function q(K,X){console.log("onChangeRadio:",X.value)}function N(K){m.value=K}function P(K){f.value=K}function S(K){T.value=K}function E(K,X){X.isSelected=K,l.value=v.value.filter(D=>D.isSelected)}function W(){i.defaultFilters&&(m.value=i.defaultFilters.isAssistZoneVisible,f.value=n.value.find(K=>K.value===i.defaultFilters.howManyGamesSelected.value)||n.value[0],w.value=d.value.options.find(K=>K.value===i.defaultFilters.selectedGamePhase.value)||d.value.options[0],x.value=o.value.options.find(K=>K.value===(i.defaultFilters.isHomeTeam?1:2))||o.value.options[0],T.value=b.value.options.get(w.value.value).find(K=>K.value.name===i.defaultFilters.selectedCategory.name)||b.value.options.get(w.value.value)[0])}function j(){U.value.forEach(K=>{K.isSelected=!1}),m.value=!1,f.value=n.value[0],w.value=null,x.value=null,T.value=null,l.value=null}return r.onBeforeUnmount(()=>{j()}),r.onMounted(()=>{setTimeout(()=>{W()},500)}),(K,X)=>(r.openBlock(),r.createElementBlock("div",bTe,[r.createVNode(r.unref(b2),r.mergeProps(t.value,{items:d.value.options,"model-value":w.value,"onUpdate:modelValue":L}),{default:r.withCtx(()=>[r.createElementVNode("div",xTe,[X[0]||(X[0]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(w.value?w.value.label:d.value.label||g.value.name),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",wTe,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",_Te,[...X[1]||(X[1]=[r.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)),[[r.vShow,w.value&&w.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(b2),r.mergeProps(_.value,{items:U.value,"model-value":T.value,"onUpdate:modelValue":S}),{default:r.withCtx(()=>[r.createElementVNode("div",STe,[X[2]||(X[2]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(b.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",TTe,[e.isEditMode?(r.openBlock(),r.createElementBlock(r.Fragment,{key:0},[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",kTe,[...X[3]||(X[3]=[r.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)),[[r.vShow,T.value&&T.value.label===D.label]])])],64)):(r.openBlock(),r.createElementBlock("div",NTe,[r.createVNode(r.unref(FN),{"model-value":D.isSelected,label:D.label,"onUpdate:modelValue":H=>E(H,D)},null,8,["model-value","label","onUpdate:modelValue"])]))])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(b2),r.mergeProps(t.value,{items:o.value.options,"model-value":x.value,"onUpdate:modelValue":C}),{default:r.withCtx(()=>[r.createElementVNode("div",VTe,[X[4]||(X[4]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(x.value?x.value.label:o.value.label),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",OTe,[r.createElementVNode("div",null,r.toDisplayString(D.label),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",LTe,[...X[5]||(X[5]=[r.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)),[[r.vShow,x.value&&x.value.label===D.label]])])])]),_:1},16,["items","model-value"]),r.createVNode(r.unref(FN),{"model-value":m.value,label:s.value.label,"onUpdate:modelValue":N},null,8,["model-value","label"]),r.withDirectives(r.createElementVNode("div",UTe,[r.createVNode(r.unref(b2),r.mergeProps(t.value,{items:n.value,"model-value":f.value,"onUpdate:modelValue":P}),{default:r.withCtx(()=>[r.createElementVNode("div",qTe,[X[6]||(X[6]=r.createElementVNode("svg",{"data-v-1238b29e":"",width:"17",height:"18",viewBox:"0 0 17 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.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"}),r.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)),r.createElementVNode("div",null,r.toDisplayString(f.value?f.value.name:"Seleccione"),1)])]),availableItem:r.withCtx(({item:D})=>[r.createElementVNode("div",zTe,[r.createElementVNode("div",null,r.toDisplayString(D.name),1),r.createElementVNode("div",null,[r.withDirectives((r.openBlock(),r.createElementBlock("svg",CTe,[...X[7]||(X[7]=[r.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)),[[r.vShow,f.value&&f.value.name===D.name]])])])]),_:1},16,["items","model-value"])],512),[[r.vShow,!e.isPostMatch]])]))}},ETe=Bc(PTe,[["__scopeId","data-v-b006bd89"]]),RTe={class:"resultados-filter"},WTe={class:"filter-checkboxes"},MTe=["checked","onChange"],FTe={class:"checkbox-label"},jTe={class:"filter-actions"},KTe={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[{label:"Iba ganando",value:"winning"},{label:"Iba perdiendo",value:"losing"},{label:"Iba empatado",value:"tied"}]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",RTe,[r.createElementVNode("div",WTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,MTe),r.createElementVNode("span",FTe,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",jTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},x2=Bc(KTe,[["__scopeId","data-v-1fba7a5d"]]),ATe={class:"detalles-filter"},ITe={class:"filter-checkboxes"},XTe=["checked","onChange"],DTe={class:"checkbox-label"},JTe={class:"filter-actions"},BTe={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",ATe,[r.createElementVNode("div",ITe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,XTe),r.createElementVNode("span",DTe,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",JTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},N5=Bc(BTe,[["__scopeId","data-v-175921a6"]]),GTe={class:"como-fue-cobrado-filter"},ZTe={class:"filter-checkboxes"},HTe=["checked","onChange"],YTe={class:"checkbox-label"},QTe={class:"filter-actions"},$Te={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",GTe,[r.createElementVNode("div",ZTe,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,HTe),r.createElementVNode("span",YTe,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",QTe,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},w2=Bc($Te,[["__scopeId","data-v-905a2961"]]),e6e={class:"zona-filter"},t6e={class:"filter-checkboxes"},r6e=["checked","onChange"],n6e={class:"checkbox-label"},a6e={class:"filter-actions"},i6e={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",e6e,[r.createElementVNode("div",t6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,r6e),r.createElementVNode("span",n6e,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",a6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},V5=Bc(i6e,[["__scopeId","data-v-6fb0c545"]]),o6e={class:"que-sucedio-filter"},s6e={class:"filter-checkboxes"},l6e=["checked","onChange"],c6e={class:"checkbox-label"},u6e={class:"filter-actions"},d6e={__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"],setup(e,{emit:a}){const i=e,k=a,F=r.computed(()=>i.option.filters||[]),g=r.computed(()=>{const t=i.selectedValues[i.filterIndex];return!t||!t[i.optionIndex]?[]:Array.isArray(t[i.optionIndex])?t[i.optionIndex]:[]}),m=t=>g.value.includes(t),n=(t,_)=>{let v=[...g.value];_?v.includes(t)||v.push(t):v=v.filter(b=>b!==t),k("update-selection",{optionIndex:i.optionIndex,values:v})},f=()=>{k("update-selection",{optionIndex:i.optionIndex,values:[]})},l=()=>{};return(t,_)=>(r.openBlock(),r.createElementBlock("div",o6e,[r.createElementVNode("div",s6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,v=>(r.openBlock(),r.createElementBlock("label",{key:v.value,class:"checkbox-item"},[r.createElementVNode("input",{type:"checkbox",checked:m(v.value),onChange:r.withModifiers(b=>n(v.value,b.target.checked),["stop"])},null,40,l6e),r.createElementVNode("span",c6e,r.toDisplayString(v.label),1)]))),128))]),r.createElementVNode("div",u6e,[r.createElementVNode("button",{class:"btn-remove-filters",onClick:r.withModifiers(f,["stop"])}," Quitar filtros "),r.createElementVNode("button",{class:"btn-done",onClick:r.withModifiers(l,["stop"])}," Listo ")])]))}},D1=Bc(d6e,[["__scopeId","data-v-ecc3baf0"]]),p6e={class:"advanced-select-accordion"},h6e=["onClick"],f6e={class:"accordion-header-left"},m6e={class:"accordion-icon"},y6e=["src","alt"],g6e={class:"accordion-title"},v6e={class:"accordion-header-right"},b6e={key:0,class:"accordion-badge"},x6e={key:0,class:"accordion-content"},w6e={class:"accordion-footer"},_6e={__name:"AdvancedSelectAccordion",props:{filter:{type:Object,required:!0},filterIndex:{type:Number,required:!0},selectedValues:{type:Array,default:()=>[]}},emits:["update-selection","close"],setup(e,{emit:a}){const i=e,k=a,F=r.ref({}),g=_=>{F.value[_]?F.value[_]=!1:(Object.keys(F.value).forEach(v=>{F.value[v]=!1}),F.value[_]=!0)},m=_=>{const v=i.filter.options[_];if(!v||!v.filters)return 0;const b=i.selectedValues[i.filterIndex];if(!b||!b[_])return 0;const d=b[_];return Array.isArray(d)?d.length:0},n=(_,v)=>_.icon?_.icon:`https://golstatsimages.blob.core.windows.net/todoelfut/f${v+1}.png`,f=_=>{const v={resultados:x2,detalles:N5,"como-fue-cobrado":w2,"como fue cobrado":w2,zona:V5,"que-sucedio":D1,"qué sucedió":D1,"que sucedio":D1},b=typeof _.value=="string"?_.value:String(_.value||""),d=typeof _.label=="string"?_.label:String(_.label||""),o=b.toLowerCase().trim(),s=d.toLowerCase().trim();if(o&&v[o])return v[o];if(s&&v[s])return v[s];const h=s.replace(/\s+/g,"-").replace(/[¿?]/g,"").replace(/[áéíóú]/g,c=>({á:"a",é:"e",í:"i",ó:"o",ú:"u"})[c]||c);return h&&v[h]?v[h]:x2},l=_=>{k("update-selection",{filterIndex:i.filterIndex,optionIndex:_.optionIndex,values:_.values})},t=()=>{k("close")};return(_,v)=>(r.openBlock(),r.createElementBlock("div",p6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filter.options,(b,d)=>(r.openBlock(),r.createElementBlock("div",{key:b.value||d,class:"accordion-item"},[r.createElementVNode("div",{class:"accordion-header",onClick:r.withModifiers(o=>g(d),["stop"])},[r.createElementVNode("div",f6e,[r.createElementVNode("span",m6e,[r.createElementVNode("img",{src:n(b,d),alt:b.label},null,8,y6e)]),r.createElementVNode("span",g6e,r.toDisplayString(b.label),1)]),r.createElementVNode("div",v6e,[m(d)>0?(r.openBlock(),r.createElementBlock("span",b6e,r.toDisplayString(m(d)),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["accordion-chevron",{open:F.value[d]}])},[...v[0]||(v[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)])],8,h6e),r.createVNode(r.Transition,{name:"accordion"},{default:r.withCtx(()=>[F.value[d]?(r.openBlock(),r.createElementBlock("div",x6e,[f(b)===x2?(r.openBlock(),r.createBlock(x2,{key:0,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===N5?(r.openBlock(),r.createBlock(N5,{key:1,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===w2?(r.openBlock(),r.createBlock(w2,{key:2,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===V5?(r.openBlock(),r.createBlock(V5,{key:3,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):f(b)===D1?(r.openBlock(),r.createBlock(D1,{key:4,option:b,"filter-index":e.filterIndex,"option-index":d,"selected-values":e.selectedValues,onUpdateSelection:l},null,8,["option","filter-index","option-index","selected-values"])):r.createCommentVNode("",!0)])):r.createCommentVNode("",!0)]),_:2},1024)]))),128)),r.createElementVNode("div",w6e,[v[1]||(v[1]=r.createElementVNode("div",{class:"footer-separator"},null,-1)),r.createElementVNode("button",{class:"btn-done-footer",onClick:r.withModifiers(t,["stop"])}," Listo ")])]))}},S6e=Bc(_6e,[["__scopeId","data-v-941aab18"]]),T6e={class:"corners-zone-filters"},k6e={key:0,class:"custom-radio-group"},N6e={class:"radio-label"},V6e={class:"radio-options"},O6e=["name","value","onUpdate:modelValue"],L6e={key:0,class:"filter-separator"},U6e={class:"filter-inline select-with-label"},q6e=["data-filter-type","onClick"],z6e={class:"select-display"},C6e={class:"select-label"},P6e={key:0,class:"dropdown-menu type-menu simple-select-menu"},E6e={class:"simple-select-scroll-area"},R6e=["onClick"],W6e={class:"option-content"},M6e={class:"option-title"},F6e={key:0,class:"option-checkmark"},j6e={class:"switch-group"},K6e={class:"switch-label"},A6e={key:0,class:"switch-text switch-text-left"},I6e=["onClick"],X6e={key:1,class:"switch-text switch-text-right"},D6e={key:0,class:"filter-separator"},J6e={key:3,class:"filter-inline advanced-select-wrapper"},B6e=["data-filter-type","onClick"],G6e={class:"select-display"},Z6e={class:"select-label"},H6e={key:0,class:"dropdown-menu type-menu advanced-select-menu"},Y6e={class:"advanced-select-content"},Q6e={__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:a,emit:i}){const k=e,F=i,g=r.ref([]);let m=null;const n=r.ref(null),f=r.ref(null),l=r.ref([]);let t=!1,_=null;const v=(U,z)=>{if(Array.isArray(U)&&Array.isArray(z)){if(U.length!==z.length)return!1;for(let L=0;L<U.length;L++)if(U[L]!==z[L])return!1;return!0}return U===z},b=(U,z=!0)=>{if(k.filters&&k.filters[0]&&k.filters[1]&&k.filters[1].options){const L=k.filters[0].options,C=k.filters[1].options;U!=null?L.findIndex(q=>q.value===U)!==-1&&C[U]?(l.value=C[U],z&&!(()=>{const q=g.value[1];return q==null?!1:Array.isArray(q)?q.length>0:q!==""})()&&!t&&l.value.length>0&&(g.value[1]=l.value[0].value,r.nextTick(()=>{}))):(l.value=[],g.value[1]=null):(l.value=[],g.value[1]=null)}},d=()=>{k.initialValues&&k.initialValues.length>0?k.initialValues.length>0&&(typeof k.initialValues[0]=="number"||typeof k.initialValues[0]=="boolean"||k.initialValues[0]===null||Array.isArray(k.initialValues[0]))?g.value=[...k.initialValues]:k.isEditMode?g.value=k.filters.map((U,z)=>{var L,C,q,N,P,S,E,W,j,K;const X=k.initialValues[z];return X?U.type==="radio-button"&&X.selectedOption?X.selectedOption.value:U.type==="radio-button"&&!X.selectedOption?X.selectedValue!==void 0?X.selectedValue:((S=(P=U.options)==null?void 0:P[0])==null?void 0:S.value)||null:U.type==="select-simple"&&X.selectedValue!==void 0?Array.isArray(X.selectedValue)?X.selectedValue[0]:X.selectedValue:U.type==="select"&&X.selectedOptions?X.selectedOptions.map(D=>D.value):U.type==="check"&&X.isChecked!==void 0?X.isChecked:X.selectedValue!==void 0?X.selectedValue:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((W=(E=U.options)==null?void 0:E[0])==null?void 0:W.value)||null:U.type==="select-simple"?((K=(j=U.options)==null?void 0:j[0])==null?void 0:K.value)||null:U.type==="advanced-select"?{}:null:U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((C=(L=U.options)==null?void 0:L[0])==null?void 0:C.value)||null:U.type==="select-simple"&&((N=(q=U.options)==null?void 0:q[0])==null?void 0:N.value)||null}):g.value=[...k.initialValues]:g.value=k.filters.map(U=>{var z,L,C,q;return U.type==="select"?[]:U.type==="check"||U.type==="switch"?!1:U.type==="radio-button"?((L=(z=U.options)==null?void 0:z[0])==null?void 0:L.value)||null:U.type==="select-simple"?((q=(C=U.options)==null?void 0:C[0])==null?void 0:q.value)||null:U.type==="advanced-select"?{}:null}),g.value.some(U=>U!=null&&(Array.isArray(U)?U.length>0:typeof U=="object"&&!Array.isArray(U)?Object.keys(U).length>0:U!==!1&&U!==""))&&(m=[...g.value],F("filters-changed",{componentId:k.componentId,filters:g.value,timestamp:new Date().toISOString()}))};d(),setTimeout(()=>{r.nextTick(()=>{if(g.value[0]!==null&&g.value[0]!==void 0&&!t){const U=!(()=>{const z=g.value[1];return z==null?!1:Array.isArray(z)?z.length>0:z!==""})();b(g.value[0],U)}})},300),r.watch(()=>k.initialValues,U=>{if(!U||U.length===0)return;const z=U.length>0&&(typeof U[0]=="number"||typeof U[0]=="boolean"||U[0]===null||Array.isArray(U[0])),L=!v(g.value,U),C=U&&U.length>0&&!t&&L,q=k.isEditMode&&t;C&&!q?z?g.value=[...U]:k.isEditMode?g.value=k.filters.map((N,P)=>{const S=U[P];return S?N.type==="radio-button"&&S.selectedOption?S.selectedOption.value:N.type==="select-simple"&&S.selectedValue!==void 0?Array.isArray(S.selectedValue)?S.selectedValue[0]:S.selectedValue:N.type==="select"&&S.selectedOptions?S.selectedOptions.map(E=>E.value):N.type==="check"&&S.isChecked!==void 0||N.type==="switch"&&S.isChecked!==void 0?S.isChecked:N.type==="switch"&&S.selectedValue!==void 0||N.type==="advanced-select"&&S.selectedValue!==void 0||S.selectedValue!==void 0?S.selectedValue:g.value[P]:g.value[P]}):g.value=[...U]:t?_&&_.length>0&&(g.value=[..._]):q&&_&&_.length>0&&(g.value=[..._])},{deep:!0}),r.watch(()=>k.isEditMode,(U,z)=>{z===!0&&U===!1&&(_=null)},{immediate:!0}),r.watch(g,U=>{U.some(z=>z!=null&&(Array.isArray(z)?z.length>0:typeof z=="object"&&!Array.isArray(z)?Object.keys(z).length>0:z!==!1&&z!==""))&&(()=>{if(!m)return!0;for(let z=0;z<U.length;z++)if(!v(U[z],m[z]))return!0;return!1})()&&(m=[...U],F("filters-changed",{componentId:k.componentId,filters:U,timestamp:new Date().toISOString()}))},{deep:!0,flush:"post"}),r.watch(()=>g.value[0],(U,z)=>{U!==z&&z!==void 0?b(U,!0):z===void 0&&U!==null&&U!==void 0&&b(U,!1)},{immediate:!0});const o=U=>{n.value===U?n.value=null:(n.value=U,f.value=null)},s=U=>{f.value===U?f.value=null:(f.value=U,n.value=null)},h=(U,z)=>{if(t=!0,setTimeout(()=>{t=!1},1e3),g.value[U]=z,(U===0||U===1)&&(_=[...g.value]),n.value=null,U===0){g.value[1]!==void 0&&(g.value[1]=null);const L=t;t=!1,b(z,!0),t=L,g.value[1]!==null&&g.value[1]!==void 0&&(_=[...g.value])}},c=()=>{t=!0,setTimeout(()=>{t=!1},400)},p=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U]=!g.value[U]},x=U=>{t=!0,setTimeout(()=>{t=!1},400),g.value[U.filterIndex]||(g.value[U.filterIndex]={}),g.value[U.filterIndex][U.optionIndex]=U.values},w=()=>g.value,T=(U,z)=>{const L=g.value[z];if(L==null)return null;if(z===1&&l.value.length>0){const C=l.value.find(q=>q.value===L);return C?C.label:null}if(U.options&&Array.isArray(U.options)){const C=U.options.find(q=>q.value===L);return C?C.label:null}return null},V=(U,z)=>{const L=g.value[z];if(!L||typeof L!="object"||Array.isArray(L))return null;const C=Object.values(L).reduce((q,N)=>Array.isArray(N)&&N.length>0?q+N.length:q,0);return C>0?`${C} seleccionado${C>1?"s":""}`:null},O=U=>{const z=U.target,L=z.closest(".advanced-select-dropdown"),C=z.closest(".custom-select.dynamic-select");!L&&!C&&(f.value=null,n.value=null)};return r.onMounted(()=>{document.addEventListener("click",O)}),r.onUnmounted(()=>{document.removeEventListener("click",O)}),a({getCurrentValues:w,initializeValues:d}),(U,z)=>(r.openBlock(),r.createElementBlock("div",T6e,[e.filters&&e.filters.length>0?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":e.filters.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(e.filters,(L,C)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:C},[L.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",k6e,[r.createElementVNode("div",N6e,r.toDisplayString(L.label),1),r.createElementVNode("div",V6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(L.options,q=>(r.openBlock(),r.createElementBlock("label",{key:q.value,class:r.normalizeClass(["radio-option-card",{active:g.value[C]===q.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"corners-zone-radio-"+C,value:q.value,"onUpdate:modelValue":N=>g.value[C]=N,onChange:c},null,40,O6e),[[r.vModelRadio,g.value[C]]]),r.createElementVNode("span",null,r.toDisplayString(q.label),1)],2))),128))])])):L.type==="select-simple"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:1},[C==2?(r.openBlock(),r.createElementBlock("div",L6e)):r.createCommentVNode("",!0),r.createElementVNode("div",U6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline","data-filter-type":L.type,onClick:r.withModifiers(q=>o(C),["stop"])},[r.createElementVNode("div",z6e,[z[1]||(z[1]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",C6e,r.toDisplayString(T(L,C)||L.label_2||L.label||"Tipo de análisis"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:n.value===C}])},[...z[0]||(z[0]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),n.value===C?(r.openBlock(),r.createElementBlock("div",P6e,[r.createElementVNode("div",E6e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(C===1?l.value:L.options,q=>(r.openBlock(),r.createElementBlock("div",{key:q.value,class:r.normalizeClass(["option-card simple-select-option",{active:v(g.value[C],q.value)}]),onClick:r.withModifiers(N=>h(C,q.value),["stop"])},[r.createElementVNode("div",W6e,[r.createElementVNode("div",M6e,r.toDisplayString(q.label),1)]),v(g.value[C],q.value)?(r.openBlock(),r.createElementBlock("div",F6e,[...z[2]||(z[2]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],10,R6e))),128))])])):r.createCommentVNode("",!0)],8,q6e)])],64)):L.type==="switch"?(r.openBlock(),r.createElementBlock(r.Fragment,{key:2},[r.createElementVNode("div",j6e,[r.createElementVNode("label",K6e,[L.label_1?(r.openBlock(),r.createElementBlock("span",A6e,r.toDisplayString(L.label_1),1)):r.createCommentVNode("",!0),r.createElementVNode("div",{class:"switch",onClick:q=>p(C)},[r.createElementVNode("div",{class:r.normalizeClass(["switch-track",{"switch-on":g.value[C]}])},[r.createElementVNode("div",{class:r.normalizeClass(["switch-thumb",{on:g.value[C]}])},null,2)],2)],8,I6e),L.label_2?(r.openBlock(),r.createElementBlock("span",X6e,r.toDisplayString(L.label_2),1)):r.createCommentVNode("",!0)])]),C>=0?(r.openBlock(),r.createElementBlock("div",D6e)):r.createCommentVNode("",!0)],64)):L.type==="advanced-select"?(r.openBlock(),r.createElementBlock("div",J6e,[r.createElementVNode("div",{class:"custom-select dynamic-select filter-inline advanced-select-dropdown","data-filter-type":L.type,onClick:r.withModifiers(q=>s(C),["stop"])},[r.createElementVNode("div",G6e,[z[4]||(z[4]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),r.createElementVNode("span",Z6e,r.toDisplayString(V(L,C)||L.label||"Seleccionar"),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:f.value===C}])},[...z[3]||(z[3]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),f.value===C?(r.openBlock(),r.createElementBlock("div",H6e,[r.createElementVNode("div",Y6e,[r.createVNode(S6e,{filter:L,"filter-index":C,"selected-values":g.value,onUpdateSelection:x,onClose:q=>s(C)},null,8,["filter","filter-index","selected-values","onClose"])])])):r.createCommentVNode("",!0)],8,B6e)])):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0)]))}},$6e=Bc(Q6e,[["__scopeId","data-v-65027e1a"]]),e4e={class:"floating-bar"},t4e={class:"tab active"},r4e={class:"select-display"},n4e={class:"select-icon"},a4e=["src"],i4e={key:1,src:"https://golstatsimages.blob.core.windows.net/images-library/vector2.png",alt:"icono",class:"option-img-default"},o4e={key:0,class:"select-placeholder select-label"},s4e={key:1,class:"select-label"},l4e={key:0,class:"dropdown-menu field-menu"},c4e=["onClick"],u4e={class:"option-icon"},d4e=["src","data-hover-src"],p4e={class:"option-content"},h4e={class:"option-title"},f4e={key:0,class:"option-description"},m4e={class:"select-display"},y4e={class:"select-icon"},g4e=["src"],v4e=["src"],b4e={class:"select-label"},x4e={key:0,class:"dropdown-menu type-menu type-menu-grid"},w4e={class:"option-grid"},_4e=["onClick"],S4e={class:"option-grid-title"},T4e={class:"option-grid-icon"},k4e=["src"],N4e={key:1,class:"filter-separator"},V4e=["onClick"],O4e={class:"select-display"},L4e={key:0,class:"badge-categorias"},U4e={key:0,class:"dropdown-menu type-menu multi-select-menu"},q4e={class:"multi-select-scroll-area"},z4e={class:"select-all-checkbox"},C4e=["checked","indeterminate","onChange"],P4e={class:"option-checkbox"},E4e=["checked","onChange"],R4e=["onClick"],W4e={class:"option-title"},M4e={class:"multi-select-footer"},F4e={key:1,class:"custom-radio-group filter-inline"},j4e={class:"radio-label"},K4e={class:"radio-options"},A4e=["name","value","onUpdate:modelValue","disabled","onChange"],I4e={key:2,class:"check-group filter-inline"},X4e=["onUpdate:modelValue","checked"],D4e=["data-filter-type","onClick"],J4e={class:"select-display"},B4e={key:0,class:"dropdown-menu type-menu simple-select-menu"},G4e={class:"simple-select-scroll-area"},Z4e=["onMouseenter","onClick"],H4e={class:"option-content"},Y4e={class:"option-title"},Q4e={key:0,class:"option-checkmark"},$4e={key:4,class:"filter-separator"},eke=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:a,emit:i}){const k=e,F=i,g=r.ref(new Map),m=r.ref([]);let n=null,f=null,l=null;const t=r.ref(!1),_=r.ref(!1),v=r.ref(!1),b=r.ref(!1),d=r.ref(!1),o=r.ref(!1),s=r.computed(()=>m.value),h=r.ref(null),c=r.computed(()=>s.value[h.value]||null),p=r.computed(()=>{var me;const ze=((me=c.value)==null?void 0:me.views)||[];return q(ze)}),x=r.ref(null),w=r.computed(()=>p.value.find(me=>me.id===x.value)||null),T=r.ref([]),V=r.computed(()=>{var me,ze;return t.value?((me=w.value)==null?void 0:me.filters_edition_mode)||[]:((ze=w.value)==null?void 0:ze.filters)||[]});r.watch(t,me=>{me||(_.value=!1)}),r.watch(w,me=>{var ze,We;if(!me){T.value=[];return}const Ke=me.id===6&&k.isPostMatch,rt=me.id===14;if(!Array.isArray(V.value)&&!Ke&&!rt){T.value=[];return}b.value||(Ke||rt?T.value=[]:T.value=V.value.map((nt,pt)=>{var _t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe;if(nt.type==="select"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt){if(xt.selectedOptions&&Array.isArray(xt.selectedOptions))return xt.selectedOptions.map(Rt=>Rt.value);if(xt.selectedValue&&Array.isArray(xt.selectedValue))return xt.selectedValue.length>0&&xt.selectedValue[0]&&typeof xt.selectedValue[0]=="object"?Fe(xt.selectedValue):xt.selectedValue}}return me.id===4&&nt.options&&Array.isArray(nt.options)?nt.options.map(xt=>xt.value):[]}else if(nt.type==="radio-button"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedOption){let Rt=xt.selectedOption.value;if(me.id===15&&pt===0&&Rt===3&&((Tt=(_t=f==null?void 0:f.view)==null?void 0:_t.filterMultiple)==null?void 0:Tt.isHomeTeam)!==void 0){const Wt=f.view.filterMultiple.isHomeTeam;typeof Wt=="boolean"?Rt=Wt?1:2:typeof Wt=="number"&&(Rt=Wt===1?1:2)}return Rt}}if(me.id===7&&t.value&&f!=null&&f.view){if(pt===0&&(Ft=f.view.componentProps)!=null&&Ft.analysisType)return f.view.componentProps.analysisType==="offensive"?1:2;if(pt===1&&((It=f.view.filterMultiple)==null?void 0:It.isHomeTeam)!==void 0)return f.view.filterMultiple.isHomeTeam?1:2}return((lt=(Jt=nt.options)==null?void 0:Jt[0])==null?void 0:lt.value)??null}else if(nt.type==="select-simple"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.selectedValue!==void 0){let Rt;return me.id===2&&(dt=(tt=f==null?void 0:f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId?Rt=f.view.filterMultiple.categoryId:me.id===1&&(Et=(gt=f==null?void 0:f.view)==null?void 0:gt.filterMultiple)!=null&&Et.category?Rt=f.view.filterMultiple.category:me.id===6&&(it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.filterMultiple)!=null&&it.gameNumber?Rt=f.view.filterMultiple.gameNumber:Rt=Array.isArray(xt.selectedValue)?xt.selectedValue[0]:xt.selectedValue,Rt}}if(me.id===2&&t.value&&f!=null&&f.view){if(n&&f.view.id){const xt=n.getComponentDynamicFilters(f.view.id);if(xt&&xt[pt]!==void 0)return xt[pt]}if(f.view.filterMultiple){if(nt.type==="select-simple"&&f.view.filterMultiple.categoryId){const xt=f.view.filterMultiple.categoryId;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}if(nt.type==="radio-button"&&f.view.filterMultiple.teamType!==void 0){const xt=f.view.filterMultiple.teamType;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}}}if(me.id===1&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.category){const xt=f.view.filterMultiple.category;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}if(me.id===9&&t.value&&(Ge=f==null?void 0:f.view)!=null&&Ge.filterMultiple&&nt.type==="select-simple"&&f.view.filterMultiple.categoryIds){const xt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds],Rt=(nt.options||[]).filter(Wt=>Array.isArray(Wt.value)?Pe(Wt.value,xt):xt.includes(Wt.value));return Rt.length>0?Rt[0].value:xt}if(me.id===6&&t.value&&(ut=f==null?void 0:f.view)!=null&&ut.filterMultiple&&f.view.filterMultiple.gameNumber){const xt=f.view.filterMultiple.gameNumber;return(nt.options||[]).find(Rt=>Rt.value==xt),xt}if(me.id===5&&t.value&&(kt=f==null?void 0:f.view)!=null&&kt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam;let Rt;if(typeof xt=="boolean"?Rt=xt?1:2:typeof xt=="number"?Rt=xt===1?1:2:Rt=1,(nt.options||[]).find(Wt=>Wt.value==Rt),nt.type==="radio-button"&&(nt.label==="Equipo"||nt.label==="Team"||nt.label==="Equipo seleccionado"))return Rt}if(me.id===15&&t.value&&(vt=f==null?void 0:f.view)!=null&&vt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0&&nt.type==="radio-button"&&pt===0){const xt=f.view.filterMultiple.isHomeTeam;let Rt;if(typeof xt=="boolean"?Rt=xt?1:2:typeof xt=="number"?Rt=xt===1?1:2:Rt=1,(nt.options||[]).find(Wt=>Wt.value==Rt))return Rt}if(me.id===9&&t.value&&(wt=f==null?void 0:f.view)!=null&&wt.filterMultiple&&nt.type==="radio-button"&&f.view.filterMultiple.isHomeTeam!==void 0){const xt=f.view.filterMultiple.isHomeTeam?1:2,Rt=((Vt=nt.options)==null?void 0:Vt.map(Wt=>Wt.value))||[];return Rt.includes(xt)?xt:Rt[0]||1}return((Qe=(at=nt.options)==null?void 0:at[0])==null?void 0:Qe.value)??null}else if(nt.type==="check"){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}if(me.id===8)return!0;if(me.id===3){if(t.value&&l&&l.dynamicFilters){const xt=l.dynamicFilters[pt];if(xt&&xt.isChecked!==void 0)return xt.isChecked}return!1}return!1}return null}),!((ze=me.name)!=null&&ze.toLowerCase().includes("tops players")||(We=me.title)!=null&&We.toLowerCase().includes("tops players"))&&(!t.value||Ke)&&r.nextTick(()=>{var nt,pt;me.id===4&&t.value&&(nt=f==null?void 0:f.view)!=null&&nt.id&&n&&n.setDynamicFilters(T.value,f.view.id),me.id===3&&t.value&&(pt=f==null?void 0:f.view)!=null&&pt.id&&n&&n.setDynamicFilters(T.value,f.view.id),ae()}))},{immediate:!0}),r.watch(()=>n,me=>{me&&me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&(b.value=!0,T.value=[...me.dynamicFilters],r.nextTick(()=>{b.value=!1}))},{deep:!0}),r.watch(()=>n==null?void 0:n.dynamicFilters,me=>{if(me&&Array.isArray(me)){if(d.value)return;b.value=!0,T.value=[...me],r.nextTick(()=>{b.value=!1})}},{deep:!0}),r.watch(()=>w.value,me=>{if(t.value&&l&&me&&me.filters){if(b.value||o.value)return;if(me.id===3){if(d.value||o.value)return;const ze=l.dynamicFilters.find(We=>We.filterType==="check");ze&&ze.isChecked!==void 0&&T.value&&T.value.length>0&&(d.value=!0,T.value[0]=ze.isChecked,r.nextTick(()=>{T.value=[...T.value],d.value=!1}))}setTimeout(()=>{(!T.value||T.value.length===0)&&(Be(),Ee(),ve()),me.id===4&&qe()},100)}},{deep:!0}),r.watch(()=>{var me;return(me=w.value)==null?void 0:me.id},me=>{if(t.value&&l&&me===4){if(b.value||o.value)return;setTimeout(()=>{qe()},200)}}),r.watch(()=>T.value,me=>{if(t.value&&l&&me&&me.length>0){if(b.value||d.value||o.value)return;setTimeout(()=>{var ze;ke()&&(Be(),Ee(),ve(),((ze=w.value)==null?void 0:ze.id)===4&&qe())},50)}},{deep:!0});function O(me,ze){var We,Ke,rt,nt,pt;const _t=T.value[me];if((We=w.value)==null||We.id,(Ke=w.value)==null||Ke.id,Array.isArray(_t)){if(((rt=w.value)==null?void 0:rt.id)===4&&me===0){const Tt=_t.some(Ft=>{if(ze.category_id&&ze.event_type_id){if(Ft.category_id&&Ft.event_type_id)return Ft.category_id===ze.category_id&&Ft.event_type_id===ze.event_type_id;if(Ft.event_type_id&&!Ft.category_id)return Ft.event_type_id===ze.event_type_id;if(Ft.category_id&&!Ft.event_type_id)return Ft.category_id===ze.category_id}else{if(ze.event_type_id)return Ft.event_type_id===ze.event_type_id;if(ze.category_id)return Ft.category_id===ze.category_id}return JSON.stringify(Ft)===JSON.stringify(ze)});return(nt=w.value)==null||nt.id,Tt}return _t.includes(ze)}else if(_t!=null)return(pt=w.value)==null||pt.id,_t===ze;return!1}function U(me,ze){var We,Ke,rt;const nt=(Ke=(We=w.value)==null?void 0:We.filters)==null?void 0:Ke[me];if((nt==null?void 0:nt.type)==="select-simple"){ie(me,ze);return}Array.isArray(T.value[me])||(T.value[me]=[]);const pt=T.value[me];let _t=-1;((rt=w.value)==null?void 0:rt.id)===4&&me===0?_t=pt.findIndex(Tt=>ze.category_id&&ze.event_type_id?Tt.category_id===ze.category_id&&Tt.event_type_id===ze.event_type_id:ze.event_type_id?Tt.event_type_id===ze.event_type_id:ze.category_id?Tt.category_id===ze.category_id:!1):_t=pt.indexOf(ze),_t>-1?pt.splice(_t,1):pt.push(ze),t.value&&Ue(),ae()}function z(me){var ze,We;const Ke=T.value[me],rt=(We=(ze=w.value)==null?void 0:ze.filters)==null?void 0:We[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length===rt.options.length}function L(me){var ze,We;const Ke=T.value[me],rt=(We=(ze=w.value)==null?void 0:ze.filters)==null?void 0:We[me];return(rt==null?void 0:rt.type)==="select-simple"||!rt||!rt.options||!Array.isArray(Ke)?!1:Ke.length>0&&Ke.length<rt.options.length}function C(){var me;return!(((me=w.value)==null?void 0:me.id)===6&&k.isPostMatch)}function q(me){return!me||!Array.isArray(me)?me:me.filter(ze=>{const We=(ze.name||ze.title||"").toLowerCase();return k.isPostMatch?!0:!["resumen general","timeline","datos relevantes"].some(Ke=>We.includes(Ke))})}function N(){var me,ze;const We=((ze=(me=c.value)==null?void 0:me.name)==null?void 0:ze.toLowerCase())||"";return We.includes("cancha")||We.includes("volumétrica")||We.includes("volumetric")}function P(me,ze){if(!t.value||!N())return!1;const We=String(me||"").toLowerCase(),Ke=String(ze||"").toLowerCase();return We.includes("ambos")||Ke.includes("ambos")}function S(me){var ze,We;const Ke=(We=(ze=w.value)==null?void 0:ze.filters)==null?void 0:We[me];if(!Ke||!Ke.options)return;const rt=Ke.options.map(nt=>nt.value);Array.isArray(T.value[me])||(T.value[me]=[]),z(me)?T.value[me]=[]:T.value[me]=[...rt],K.value=me,ae()}const E=r.ref("ambos"),W=r.ref(!1),j=r.ref(!1),K=r.ref(null),X=r.ref(null);function D(me,ze=!1){const We="https://golstatsimages.blob.core.windows.net/images-library/",Ke="https://golstatsimages.blob.core.windows.net/reports-images/",rt={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"},nt=Object.keys(rt).find(pt=>me==null?void 0:me.toLowerCase().includes(pt.toLowerCase()));if(nt){const pt=rt[nt],_t=ze?"":"-def";return nt.toLowerCase().includes("tabla")?`${Ke}${pt}${_t}@2x.png`:`${We}${pt}${_t}@2x.png`}return`${We}icn_default${ze?"":"-def"}.png`}function H(){return c.value?c.value.name:"Tipo de vista"}function re(){return w.value?w.value.name||w.value.title:"Visualización"}function B(){t.value||(W.value=!W.value,W.value&&(j.value=!1,r.nextTick(()=>{Le()})))}function ne(){t.value||c.value&&(j.value=!j.value,j.value&&(W.value=!1))}function ee(me){t.value||(h.value=me,W.value=!1,x.value=null,ae())}function Y(me){var ze,We;t.value||(x.value=me.id,j.value=!1,(ze=me.name)!=null&&ze.toLowerCase().includes("tops players")||(We=me.title)==null||We.toLowerCase().includes("tops players"))}function $(me){var ze;K.value=K.value===me?null:me,((ze=w.value)==null?void 0:ze.id)===4&&t.value&&me===0&&setTimeout(()=>{T.value=[...T.value]},50)}function le(me){X.value=X.value===me?null:me}function ie(me,ze){var We,Ke,rt,nt,pt;if(((We=w.value)==null?void 0:We.id)===2){const _t=V.value.findIndex(Tt=>Tt.type==="select-simple"&&Tt.label==="Tipo de análisis");me===_t?T.value[0]=ze:T.value[me]=ze}else if(((Ke=w.value)==null?void 0:Ke.id)===1)T.value[0]=ze;else if(((rt=w.value)==null?void 0:rt.id)===6)T.value[0]=ze;else if(((nt=w.value)==null?void 0:nt.id)===9)if(me===0){Array.isArray(ze)?T.value[me]=ze:T.value[me]=[ze];const _t=((pt=V.value[me])==null?void 0:pt.options)||[],Tt=Array.isArray(ze)?ze:[ze],Ft=_t.find(It=>Array.isArray(It.value)?Pe(It.value,Tt):Tt.includes(It.value));Ft?T.value[me]=Ft.value:T.value[me]=Tt}else T.value[me]=ze;else T.value[me]=ze;X.value=null,t.value&&Ue(),ae()}function ue(me){me.target.closest(".custom-select")||(W.value=!1,j.value=!1,X.value=null)}const he=[16];function ae(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;if(he.includes((me=w.value)==null?void 0:me.id)||b.value)return;let kt=[],vt=[];w.value&&Array.isArray(V.value)&&V.value.forEach((Qe,xt)=>{if(Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2){const Rt=T.value[xt]||[];Array.isArray(Rt)&&Rt.length>0&&(kt=Rt.map(Wt=>{var qt;const Ht=(qt=Qe.options)==null?void 0:qt.find(At=>At.value===Wt);return{value:Wt,label:(Ht==null?void 0:Ht.label)||Wt}}))}});const wt=((ze=w.value)==null?void 0:ze.id)===4;if(w.value&&Array.isArray(w.value.filters)&&w.value.filters.some(Qe=>Qe.type==="select"&&Qe.label==="Tipo de análisis"&&Qe.id===2)&&kt.length===0&&!wt)return;if(wt&&T.value&&T.value.length>0){const Qe=T.value[0];Array.isArray(Qe)&&Qe.length>0}vt=((We=V.value)==null?void 0:We.map((Qe,xt)=>{var Rt,Wt,qt,Ht;const At=T.value[xt];let Yt=Qe.id||`filter_${xt}`;return((Rt=w.value)==null?void 0:Rt.id)===3&&t.value&&(Wt=f==null?void 0:f.view)!=null&&Wt.id&&(Yt=`filter_${xt}_component_${f.view.id}`),{filterId:Yt,filterType:Qe.type,filterLabel:Qe.label,filterIcon:Qe.icon||null,selectedValue:At,selectedOptions:Qe.type==="select"&&Array.isArray(At)&&At.length>0?At.map(Bt=>{var Gt;const or=(Gt=Qe.options)==null?void 0:Gt.find(sr=>sr.value===Bt);return{value:Bt,label:(or==null?void 0:or.label)||Bt,icon:(or==null?void 0:or.icon)||null}}):null,selectedOption:Qe.type==="radio-button"&&At!=null?{value:At,label:((Ht=(qt=Qe.options)==null?void 0:qt.find(Bt=>Bt.value===At))==null?void 0:Ht.label)||At}:null,isChecked:Qe.type==="check"?At:null}}))||[];const Vt={mainSelector:{id:((Ke=c.value)==null?void 0:Ke.id)||null,name:((rt=c.value)==null?void 0:rt.name)||null,url:((nt=c.value)==null?void 0:nt.url)||null},viewSelector:{id:((pt=w.value)==null?void 0:pt.id)||null,name:((_t=w.value)==null?void 0:_t.name)||((Tt=w.value)==null?void 0:Tt.title)||null,url:((Ft=w.value)==null?void 0:Ft.url)||null},team:E.value,dynamicFilters:vt,categoriasSeleccionadas:kt,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((It=V.value)==null?void 0:It.length)||0,activeFilters:((Jt=V.value)==null?void 0:Jt.filter((Qe,xt)=>{const Rt=T.value[xt];return Array.isArray(Rt)?Rt.length>0:Rt!=null&&Rt!==!1}).length)||0}},at={main:c.value,view:w.value,team:E.value,dynamicFilters:T.value,filtersJSON:Vt,filterAndViewsContainer:n,viewToEdit:f};if(F("filters-changed",at),t.value&&f){if(l=Vt,((lt=w.value)==null?void 0:lt.id)===2){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(dt=(tt=f.view)==null?void 0:tt.filterMultiple)!=null&&dt.categoryId&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.categoryId)}if(((gt=w.value)==null?void 0:gt.id)===1){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Tipo de análisis");Qe!==-1&&(Lt=(Et=f.view)==null?void 0:Et.filterMultiple)!=null&&Lt.category&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.category)}}if(((it=w.value)==null?void 0:it.id)===6&&t.value&&(ct=f==null?void 0:f.view)!=null&&ct.filterMultiple&&f.view.filterMultiple.gameNumber&&l){const Qe=l.dynamicFilters.findIndex(xt=>xt.filterType==="select-simple"&&xt.filterLabel==="Número de juego");Qe!==-1&&(ut=(Ge=f.view)==null?void 0:Ge.filterMultiple)!=null&&ut.gameNumber&&(l.dynamicFilters[Qe].selectedValue=f.view.filterMultiple.gameNumber)}n&&!t.value?n.setDynamicFilters(T.value):n&&t.value}function de(){f=null,l=null,n=null,h.value=null,x.value=null,E.value="ambos",T.value=[],W.value=!1,j.value=!1,K.value=null,X.value=null,t.value=!1,_.value=!1,v.value=!1}function ce(me){if(me&&me.dynamicFilters){if(d.value)return;Array.isArray(me.dynamicFilters)&&me.dynamicFilters.length>0&&(b.value=!0,T.value=[...me.dynamicFilters],r.nextTick(()=>{b.value=!1}))}}function ye(me){if(t.value=!0,me.mainSelector&&me.mainSelector.id){const ze=m.value.findIndex(We=>We.id===me.mainSelector.id);ze!==-1&&(h.value=ze)}me.viewSelector&&me.viewSelector.id&&c.value&&c.value.views.findIndex(ze=>ze.id===me.viewSelector.id)!==-1&&(x.value=me.viewSelector.id),me.dynamicFilters&&Array.isArray(me.dynamicFilters)&&r.nextTick(()=>{setTimeout(()=>{var ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt;if(w.value&&V.value){if(b.value)return;if(d.value=!0,me.dynamicFilters.forEach((wt,Vt)=>{var at,Qe,xt,Rt,Wt,qt,Ht,At,Yt,Bt,Gt,or,sr;if(Vt<V.value.length){const Ur=V.value[Vt];if(((at=w.value)==null?void 0:at.id)===3&&t.value,Ur.type==="check"){const zr=wt.isChecked;typeof zr=="boolean"&&(T.value[Vt]=zr)}else if(Ur.type==="select"&&wt.selectedOptions){const zr=wt.selectedOptions.map(Lr=>Lr.value);T.value[Vt]=zr}else if(Ur.type==="select"&&wt.selectedValue&&Array.isArray(wt.selectedValue))if(wt.selectedValue.length>0&&wt.selectedValue[0]&&typeof wt.selectedValue[0]=="object"){const zr=Fe(wt.selectedValue);T.value[Vt]=zr}else T.value[Vt]=wt.selectedValue;else if(Ur.type==="radio-button"&&wt.selectedOption)T.value[Vt]=wt.selectedOption.value;else if(Ur.type==="select-simple"&&wt.selectedValue!==void 0){let zr;((Qe=w.value)==null?void 0:Qe.id)===2&&(Rt=(xt=f==null?void 0:f.view)==null?void 0:xt.filterMultiple)!=null&&Rt.categoryId?zr=f.view.filterMultiple.categoryId:((Wt=w.value)==null?void 0:Wt.id)===1&&(Ht=(qt=f==null?void 0:f.view)==null?void 0:qt.filterMultiple)!=null&&Ht.category?zr=f.view.filterMultiple.category:((At=w.value)==null?void 0:At.id)===6&&(Bt=(Yt=f==null?void 0:f.view)==null?void 0:Yt.filterMultiple)!=null&&Bt.gameNumber?zr=f.view.filterMultiple.gameNumber:((Gt=w.value)==null?void 0:Gt.id)===9&&(sr=(or=f==null?void 0:f.view)==null?void 0:or.filterMultiple)!=null&&sr.categoryIds?zr=f.view.filterMultiple.categoryIds:zr=Array.isArray(wt.selectedValue)?wt.selectedValue[0]:wt.selectedValue,T.value[Vt]=zr}}}),((ze=w.value)==null?void 0:ze.id)===3&&t.value,((We=w.value)==null?void 0:We.id)===2&&t.value&&(Ke=f==null?void 0:f.view)!=null&&Ke.filterMultiple){if(f.view.filterMultiple.categoryId){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.categoryId;if(T.value[0]=Vt,f.view.componentProps&&Vt){let at=`Category ${Vt}`,Qe=null;try{Qe=Fh(Vt),Qe&&(at=Qe.name)}catch{const xt=V.value.findIndex(Rt=>Rt.type==="select-simple"&&Rt.label==="Tipo de análisis");if(xt!==-1){const Rt=(((rt=V.value[xt])==null?void 0:rt.options)||[]).find(Wt=>Wt.value==Vt);Rt&&(at=Rt.label)}}f.view.componentProps.categoryView=[{id:Vt,name:at}]}(((nt=V.value[wt])==null?void 0:nt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(f.view.filterMultiple.teamType!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.teamType;T.value[wt]=Vt,(((pt=V.value[wt])==null?void 0:pt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}}if(((_t=w.value)==null?void 0:_t.id)===9&&t.value&&(Tt=f==null?void 0:f.view)!=null&&Tt.filterMultiple){if(f.view.filterMultiple.categoryIds){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple");if(wt!==-1){const Vt=Array.isArray(f.view.filterMultiple.categoryIds)?f.view.filterMultiple.categoryIds:[f.view.filterMultiple.categoryIds];T.value[0]=Vt;const at=(((Ft=V.value[wt])==null?void 0:Ft.options)||[]).filter(xt=>Array.isArray(xt.value)?Pe(xt.value,Vt):Vt.includes(xt.value));if(at.length>0){const xt=at[0].value;T.value[wt]=xt}else T.value[wt]=Vt;const Qe=T.value[wt];Pe(Qe,Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(f.view.filterMultiple.isHomeTeam!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam;let at;typeof Vt=="boolean"?at=Vt?1:2:typeof Vt=="number"?at=Vt===1?1:2:at=1,T.value[wt]=at,(((It=V.value[wt])==null?void 0:It.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{T.value=[...T.value]})}}}if(((Jt=w.value)==null?void 0:Jt.id)===1&&t.value&&(lt=f==null?void 0:f.view)!=null&<.filterMultiple&&f.view.filterMultiple.category){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Tipo de análisis");if(wt!==-1){const Vt=f.view.filterMultiple.category;T.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.type=Vt),(((tt=V.value[wt])==null?void 0:tt.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(((dt=w.value)==null?void 0:dt.id)===6&&t.value&&(gt=f==null?void 0:f.view)!=null&>.filterMultiple&&f.view.filterMultiple.gameNumber){const wt=V.value.findIndex(Vt=>Vt.type==="select-simple"&&Vt.label==="Número de juego");if(wt!==-1){const Vt=f.view.filterMultiple.gameNumber;T.value[0]=Vt,f.view.componentProps&&Vt&&(f.view.componentProps.gameNumber=Vt),(((Et=V.value[wt])==null?void 0:Et.options)||[]).find(at=>at.value==Vt),r.nextTick(()=>{T.value=[...T.value]})}}if(((Lt=w.value)==null?void 0:Lt.id)===7&&t.value&&f!=null&&f.view){if((it=f.view.componentProps)!=null&&it.analysisType&&V.value.length>0&&((ct=V.value[0])==null?void 0:ct.type)==="radio-button"){const wt=f.view.componentProps.analysisType==="offensive"?1:2;T.value[0]=wt}if(((Ge=f.view.filterMultiple)==null?void 0:Ge.isHomeTeam)!==void 0){const wt=V.value.findIndex(Vt=>Vt.type==="radio-button"&&Vt.label==="Equipo");if(wt!==-1){const Vt=f.view.filterMultiple.isHomeTeam?1:2;T.value[1]=Vt}else if(V.value.length>1&&((ut=V.value[1])==null?void 0:ut.type)==="radio-button"){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;T.value[1]=at,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Vt),(((kt=V.value[1])==null?void 0:kt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{T.value=[...T.value]})}if(wt!==-1&&f.view.componentProps){const Vt=f.view.filterMultiple.isHomeTeam,at=Vt?1:2;f.view.componentProps.isHomeTeamForAnalysis=Vt,(((vt=V.value[wt])==null?void 0:vt.options)||[]).find(Qe=>Qe.value==at),r.nextTick(()=>{T.value=[...T.value]})}}}r.nextTick(()=>{d.value=!1})}},100)})}function xe(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft;return{mainSelector:{id:((me=c.value)==null?void 0:me.id)||null,name:((ze=c.value)==null?void 0:ze.name)||null,url:((We=c.value)==null?void 0:We.url)||null},viewSelector:{id:((Ke=w.value)==null?void 0:Ke.id)||null,name:((rt=w.value)==null?void 0:rt.name)||((nt=w.value)==null?void 0:nt.title)||null,url:((pt=w.value)==null?void 0:pt.url)||null},team:E.value,dynamicFilters:((_t=V.value)==null?void 0:_t.map((It,Jt)=>{var lt,tt;const dt=T.value[Jt];return{filterId:It.id||`filter_${Jt}`,filterType:It.type,filterLabel:It.label,filterIcon:It.icon||null,selectedValue:dt,selectedOptions:It.type==="select"&&Array.isArray(dt)&&dt.length>0?dt.map(gt=>{var Et;const Lt=(Et=It.options)==null?void 0:Et.find(it=>it.value===gt);return{value:gt,label:(Lt==null?void 0:Lt.label)||gt,icon:(Lt==null?void 0:Lt.icon)||null}}):null,selectedOption:It.type==="radio-button"&&dt?{value:dt,label:((tt=(lt=It.options)==null?void 0:lt.find(gt=>gt.value===dt))==null?void 0:tt.label)||dt}:null,isChecked:It.type==="check"?dt:null}}))||[],timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((Tt=V.value)==null?void 0:Tt.length)||0,activeFilters:((Ft=V.value)==null?void 0:Ft.filter((It,Jt)=>{const lt=T.value[Jt];return Array.isArray(lt)?lt.length>0:lt!=null&<!==!1}).length)||0}}}a({getCurrentFiltersJSON:xe});function be(){de(),F("close",n)}function Te(){_.value=!1,be()}function Oe(){v.value&&(qa.emit("filters-cancelled",n),v.value=!1),_.value=!1,be()}r.onMounted(async()=>{document.addEventListener("click",ue),r.nextTick(()=>{Le()});const me="https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/views";try{const ze=await(await fetch(me,{headers:{Authorization:`${k.token}`}})).json();m.value=ze.data||[],g.value.clear(),m.value&&(g.value=m.value.reduce((We,Ke)=>(Ke.views&&Array.isArray(Ke.views)&&Ke.views.forEach(rt=>{rt.filters&&Array.isArray(rt.filters)&&We.set(rt.id,rt)}),We),new Map))}catch(ze){console.error("Error al obtener datos:",ze)}});function Le(){document.querySelectorAll(".field-menu .option-card").forEach(me=>{const ze=me.querySelector(".option-img");if(!ze||!ze.dataset.hoverSrc)return;const We=ze.src,Ke=ze.dataset.hoverSrc;me.addEventListener("mouseenter",()=>{ze.src=Ke}),me.addEventListener("mouseleave",()=>{ze.src=We})})}r.onUnmounted(()=>{document.removeEventListener("click",ue)}),qa.on("set-filter-and-views-container",me=>{n=me,me&&ce(me)}),qa.on("view-added",()=>{_.value=!0,v.value=!0}),qa.on("component-added-to-container",me=>{(!t.value||n&&me.id===n.id)&&ce(me)}),qa.on("edit-view",me=>{var ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut;f=me,n=((ze=me.view)==null?void 0:ze.filterAndViewsContainer)||null,l=null;const kt=[(Ke=(We=me.view)==null?void 0:We.coreView)==null?void 0:Ke.filtersJSON,(rt=me.view)==null?void 0:rt.filtersJSON,(nt=me.coreView)==null?void 0:nt.filtersJSON,me.filtersJSON,(_t=(pt=me.view)==null?void 0:pt.componentProps)==null?void 0:_t.filtersJSON];for(const vt of kt)if(vt){l=vt;break}if(n&&(n.viewId===4||n.viewId===8||n.viewId===3||n.viewId===1||n.viewId===2||n.viewId===13)&&(Tt=me.view)!=null&&Tt.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt){let wt="Unknown";n.viewId===4?wt="Timeline":n.viewId===8?wt="FieldPosesion":n.viewId===3?wt="GSCMatchSummary":n.viewId===1?wt="GSCComparativeReports":n.viewId===2?wt="GscTopPlayer":n.viewId===13&&(wt="GSCTimelapseTable"),l&&(n.viewId===13?l={...l,dynamicFilters:vt}:l={...l,dynamicFilters:vt.map((Vt,at)=>Array.isArray(Vt)?{selectedValue:Vt,selectedOptions:Vt.map(Qe=>({value:Qe,label:Qe}))}:typeof Vt=="boolean"?{isChecked:Vt}:wt==="GSCComparativeReports"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===0?{selectedValue:Vt,selectedOptions:[{value:Vt,label:Vt}]}:wt==="GscTopPlayer"&&at===1?{selectedOption:{value:Vt,label:Vt}}:{selectedOption:{value:Vt,label:Vt}})})}}if(n&&n.viewId===2&&(Ft=me.view)!=null&&Ft.filterMultiple){if(me.view.filterMultiple.categoryId&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.categoryId,selectedOptions:[{value:me.view.filterMultiple.categoryId,label:`Category ${me.view.filterMultiple.categoryId}`}]})}if(me.view.filterMultiple.teamType!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.teamType,Vt=wt===1?"Mi equipo":wt===2?"Rival":wt===3?"Ambos":"Equipo";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:wt,label:Vt}}}}}if(n&&n.viewId===1&&(It=me.view)!=null&&It.filterMultiple&&me.view.filterMultiple.category&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Tipo de análisis");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.category,selectedOptions:[{value:me.view.filterMultiple.category,label:me.view.filterMultiple.category}]})}if(n&&n.viewId===9&&(Jt=me.view)!=null&&Jt.filterMultiple){if(me.view.filterMultiple.categoryIds&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select"&&wt.filterLabel==="Tipo de análisis");if(vt!==-1){const wt=Array.isArray(me.view.filterMultiple.categoryIds)?me.view.filterMultiple.categoryIds:[me.view.filterMultiple.categoryIds];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:wt,selectedOptions:wt.map(Qe=>({value:Qe,label:`Category ${Qe}`}))};const Vt=me.view.filterMultiple.categoryIds;Pe(Vt,wt);const at=(((lt=V.value[vt])==null?void 0:lt.options)||[]).filter(Qe=>Array.isArray(Qe.value)?Pe(Qe.value,wt):wt.includes(Qe.value));if(at.length>0){const Qe=at[0];l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:Qe.value,selectedOptions:[Qe]}}}}if(me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Mi equipo":"Rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Mi equipo":"Rival"):(Vt=1,at="Mi equipo"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===6&&(tt=me.view)!=null&&tt.filterMultiple&&me.view.filterMultiple.gameNumber&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="select-simple"&&wt.filterLabel==="Número de juego");vt!==-1&&(l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedValue:me.view.filterMultiple.gameNumber,selectedOptions:[{value:me.view.filterMultiple.gameNumber,label:`Juego ${me.view.filterMultiple.gameNumber}`}]})}if(n&&n.viewId===7&&me.view&&l){if((dt=me.view.componentProps)!=null&&dt.analysisType){const vt=l.dynamicFilters.findIndex((wt,Vt)=>wt.filterType==="radio-button"&&Vt===0);if(vt!==-1){const wt=me.view.componentProps.analysisType,Vt=wt==="offensive"?1:2,at=wt==="offensive"?"A favor":"En contra";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}if(((gt=me.view.filterMultiple)==null?void 0:gt.isHomeTeam)!==void 0){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam,Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival";l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}}}if(n&&n.viewId===10&&(Et=me.view)!=null&&Et.filterMultiple&&((it=(Lt=f==null?void 0:f.view)==null?void 0:Lt.coreView)==null?void 0:it.id)===10){const vt=me.view.componentProps.isHomeTeamForAnalysis?{label:"Equipo propio",value:1}:{label:"Rival",value:2};l&&(l.dynamicFilters[0]={...l.dynamicFilters[0],selectedOption:vt})}if(n&&n.viewId===15&&(ct=me.view)!=null&&ct.id){const vt=n.getComponentDynamicFilters(me.view.id);if(vt&&l)l={...l,dynamicFilters:vt.map((wt,Vt)=>{var at,Qe;if(Vt===0){let xt=wt;if(wt===3&&((Qe=(at=me.view)==null?void 0:at.filterMultiple)==null?void 0:Qe.isHomeTeam)!==void 0){const Rt=me.view.filterMultiple.isHomeTeam;typeof Rt=="boolean"?xt=Rt?1:2:typeof Rt=="number"&&(xt=Rt===1?1:2)}return{selectedOption:{value:xt,label:xt===1?"Mi equipo":"Rival"}}}else if(Vt===1)return{selectedValue:wt,selectedOptions:[{value:wt,label:`${wt} fortalezas`}]};return typeof wt=="number"?{selectedValue:wt}:{selectedOption:{value:wt,label:String(wt)}}})};else if((Ge=me.view)!=null&&Ge.filterMultiple&&l&&me.view.filterMultiple.isHomeTeam!==void 0){const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button"&&Vt.filterLabel==="Mi equipo");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Local":"Visitante"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Local":"Visitante"):(at=1,Qe="Local"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}if(n&&n.viewId===5&&(ut=me.view)!=null&&ut.filterMultiple&&me.view.filterMultiple.isHomeTeam!==void 0&&l){const vt=l.dynamicFilters.findIndex(wt=>wt.filterType==="radio-button"&&wt.filterLabel==="Equipo");if(vt!==-1){const wt=me.view.filterMultiple.isHomeTeam;let Vt,at;typeof wt=="boolean"?(Vt=wt?1:2,at=wt?"Equipo propio":"Equipo rival"):typeof wt=="number"?(Vt=wt===1?1:2,at=wt===1?"Equipo propio":"Equipo rival"):(Vt=1,at="Equipo propio"),l.dynamicFilters[vt]={...l.dynamicFilters[vt],selectedOption:{value:Vt,label:at}}}else{const wt=l.dynamicFilters.findIndex(Vt=>Vt.filterType==="radio-button");if(wt!==-1){const Vt=me.view.filterMultiple.isHomeTeam;let at,Qe;typeof Vt=="boolean"?(at=Vt?1:2,Qe=Vt?"Equipo propio":"Equipo rival"):typeof Vt=="number"?(at=Vt===1?1:2,Qe=Vt===1?"Equipo propio":"Equipo rival"):(at=1,Qe="Equipo propio"),l.dynamicFilters[wt]={...l.dynamicFilters[wt],selectedOption:{value:at,label:Qe}}}}}l&&ye(l),_.value=!0});function _e(){K.value=null}function Ce(me,ze){var We;(We=w.value)==null||We.id}function Pe(me,ze){if(!Array.isArray(me)||!Array.isArray(ze)||me.length!==ze.length)return!1;const We=[...me].sort((rt,nt)=>rt-nt),Ke=[...ze].sort((rt,nt)=>rt-nt);return JSON.stringify(We)===JSON.stringify(Ke)}function Be(){if(t.value&&l&&l.dynamicFilters){if(o.value||b.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((me,ze)=>{var We;if(me&&(We=V.value)!=null&&We[ze]){const Ke=V.value[ze];if(Ke.type==="check"&&me.isChecked!==void 0)T.value[ze]=me.isChecked;else if(Ke.type==="select"&&me.selectedOptions){const rt=me.selectedOptions.map(nt=>nt.value);T.value[ze]=rt}else Ke.type==="select"&&me.selectedValue&&Array.isArray(me.selectedValue)&&(T.value[ze]=me.selectedValue)}}),r.nextTick(()=>{d.value=!1,o.value=!1})}}function qe(){var me;if(t.value&&l&&l.dynamicFilters&&((me=w.value)==null?void 0:me.id)===4){if(o.value||b.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((ze,We)=>{var Ke,rt;if(ze&&((rt=(Ke=V.value)==null?void 0:Ke[We])==null?void 0:rt.type)==="select"){if(ze.selectedOptions){const nt=ze.selectedOptions.map(pt=>pt.value);T.value[We]=nt}else if(ze.selectedValue&&Array.isArray(ze.selectedValue))if(ze.selectedValue.length>0&&ze.selectedValue[0]&&typeof ze.selectedValue[0]=="object"){const nt=Fe(ze.selectedValue);T.value[We]=nt}else T.value[We]=ze.selectedValue}}),setTimeout(()=>{var ze;if(T.value=[...T.value],(ze=f==null?void 0:f.view)!=null&&ze.componentProps&&T.value&&T.value.length>0){const We=T.value[0];if(Array.isArray(We)&&We.length>0){const Ke=We.some(_t=>_t.event_type_id===1||typeof _t=="string"&&_t.includes("1")),rt=We.some(_t=>_t.category_id===8||typeof _t=="string"&&_t.includes("8")),nt=We.some(_t=>_t.category_id===9||typeof _t=="string"&&_t.includes("9")),pt=We.some(_t=>_t.event_type_id===3||typeof _t=="string"&&_t.includes("3"));f.view.componentProps.selectedEvents=We,f.view.componentProps.goals=Ke,f.view.componentProps.yellowCards=rt,f.view.componentProps.redCards=nt,f.view.componentProps.substitutions=pt,f.view.componentProps.key=We.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},200),r.nextTick(()=>{d.value=!1,o.value=!1})}}function Fe(me){return!Array.isArray(me)||me.length===0?[]:me.map(ze=>{if(ze&&typeof ze=="object"){if(ze.event_type_id!==void 0||ze.category_id!==void 0)return{event_type_id:ze.event_type_id,category_id:ze.category_id,...ze.name&&{name:ze.name},...ze.label&&{label:ze.label}};if(ze.value&&typeof ze.value=="object")return{event_type_id:ze.value.event_type_id,category_id:ze.value.category_id,...ze.value.name&&{name:ze.value.name},...ze.value.label&&{label:ze.value.label}};if(typeof ze=="string"&&ze.includes("-")){const[We,Ke]=ze.split("-");return{category_id:parseInt(We),event_type_id:parseInt(Ke)}}}if(typeof ze=="string")if(ze.includes("-")){const[We,Ke]=ze.split("-");return{category_id:parseInt(We),event_type_id:parseInt(Ke)}}else{const We=parseInt(ze);if(!isNaN(We))return{event_type_id:We}}return ze})}function Ee(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt;if(t.value&&l&&l.dynamicFilters&&V.value){if(o.value||b.value)return;if(o.value=!0,d.value=!0,l.dynamicFilters.forEach((dt,gt)=>{var Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at;if(dt&&((Et=V.value[gt])==null?void 0:Et.type)==="select"){if(dt.selectedOptions){const Qe=dt.selectedOptions.map(xt=>xt.value);T.value[gt]=Qe}else if(dt.selectedValue&&Array.isArray(dt.selectedValue))if(dt.selectedValue.length>0&&dt.selectedValue[0]&&typeof dt.selectedValue[0]=="object"){const Qe=Fe(dt.selectedValue);T.value[gt]=Qe}else T.value[gt]=dt.selectedValue}else if(dt&&((Lt=V.value[gt])==null?void 0:Lt.type)==="select-simple"&&dt.selectedValue!==void 0){let Qe;((it=w.value)==null?void 0:it.id)===2&&(Ge=(ct=f==null?void 0:f.view)==null?void 0:ct.filterMultiple)!=null&&Ge.categoryId?Qe=f.view.filterMultiple.categoryId:((ut=w.value)==null?void 0:ut.id)===1&&(vt=(kt=f==null?void 0:f.view)==null?void 0:kt.filterMultiple)!=null&&vt.category?Qe=f.view.filterMultiple.category:((wt=w.value)==null?void 0:wt.id)===6&&(at=(Vt=f==null?void 0:f.view)==null?void 0:Vt.filterMultiple)!=null&&at.gameNumber?Qe=f.view.filterMultiple.gameNumber:Qe=Array.isArray(dt.selectedValue)?dt.selectedValue[0]:dt.selectedValue,T.value[gt]=Qe}}),((me=w.value)==null?void 0:me.id)===4&&setTimeout(()=>{var dt;if(T.value=[...T.value],(dt=f==null?void 0:f.view)!=null&&dt.componentProps&&T.value&&T.value.length>0){const gt=T.value[0];if(Array.isArray(gt)&>.length>0){const Et=gt.some(Ge=>Ge.event_type_id===1||typeof Ge=="string"&&Ge.includes("1")),Lt=gt.some(Ge=>Ge.category_id===8||typeof Ge=="string"&&Ge.includes("8")),it=gt.some(Ge=>Ge.category_id===9||typeof Ge=="string"&&Ge.includes("9")),ct=gt.some(Ge=>Ge.event_type_id===3||typeof Ge=="string"&&Ge.includes("3"));f.view.componentProps.selectedEvents=gt,f.view.componentProps.goals=Et,f.view.componentProps.yellowCards=Lt,f.view.componentProps.redCards=it,f.view.componentProps.substitutions=ct,f.view.componentProps.key=gt.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}},100),((ze=w.value)==null?void 0:ze.id)===2&&(We=f==null?void 0:f.view)!=null&&We.filterMultiple){if(f.view.filterMultiple.categoryId){const dt=V.value.findIndex(gt=>gt.type==="select-simple"&>.label==="Tipo de análisis");if(dt!==-1){const gt=f.view.filterMultiple.categoryId;if(T.value[0]=gt,f.view.componentProps&>){let Et=`Category ${gt}`,Lt=null;try{Lt=Fh(gt),Lt&&(Et=Lt.name)}catch{const it=V.value.findIndex(ct=>ct.type==="select-simple"&&ct.label==="Tipo de análisis");if(it!==-1){const ct=(((Ke=V.value[it])==null?void 0:Ke.options)||[]).find(Ge=>Ge.value==gt);ct&&(Et=ct.label)}}f.view.componentProps.categoryView=[{id:gt,name:Et}]}(((rt=V.value[dt])==null?void 0:rt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{T.value=[...T.value]})}}if(f.view.filterMultiple.teamType!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.teamType;T.value[dt]=gt,(((nt=V.value[dt])==null?void 0:nt.options)||[]).find(Et=>Et.value==gt),r.nextTick(()=>{T.value=[...T.value]})}}}if(((pt=w.value)==null?void 0:pt.id)===1&&(_t=f==null?void 0:f.view)!=null&&_t.filterMultiple&&f.view.filterMultiple.category&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Tipo de análisis")!==-1){const dt=f.view.filterMultiple.category;T.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.type=dt),r.nextTick(()=>{T.value=[...T.value]})}if(((Tt=w.value)==null?void 0:Tt.id)===6&&(Ft=f==null?void 0:f.view)!=null&&Ft.filterMultiple&&f.view.filterMultiple.gameNumber&&V.value.findIndex(dt=>dt.type==="select-simple"&&dt.label==="Número de juego")!==-1){const dt=f.view.filterMultiple.gameNumber;T.value[0]=dt,f.view.componentProps&&dt&&(f.view.componentProps.gameNumber=dt),r.nextTick(()=>{T.value=[...T.value]})}if(((It=w.value)==null?void 0:It.id)===5&&(Jt=f==null?void 0:f.view)!=null&&Jt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0)if(V.value.findIndex(dt=>dt.type==="radio-button"&&dt.label==="Equipo")!==-1){const dt=f.view.filterMultiple.isHomeTeam;let gt;typeof dt=="boolean"?gt=dt?1:2:typeof dt=="number"?gt=dt===1?1:2:gt=1,T.value[0]=gt,f.view.componentProps&&dt!==void 0&&(f.view.componentProps.isHomeTeamForAnalysis=dt===1),r.nextTick(()=>{T.value=[...T.value]})}else{const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,T.value[dt]=Et,f.view.componentProps&>!==void 0&&(f.view.componentProps.preMatchType=gt),r.nextTick(()=>{T.value=[...T.value]})}}if(((lt=w.value)==null?void 0:lt.id)===15&&(tt=f==null?void 0:f.view)!=null&&tt.filterMultiple&&f.view.filterMultiple.isHomeTeam!==void 0){const dt=V.value.findIndex(gt=>gt.type==="radio-button");if(dt!==-1){const gt=f.view.filterMultiple.isHomeTeam;console.log("Strengths forceRadioFilterUpdate - isHomeTeam:",gt,"type:",typeof gt);let Et;typeof gt=="boolean"?Et=gt?1:2:typeof gt=="number"?Et=gt===1?1:2:Et=1,console.log("Strengths forceRadioFilterUpdate - teamValue calculado:",Et,"teamFilterIndex:",dt),T.value[dt]=Et,f.view.componentProps&>!==void 0&&(f.view.componentProps.preMatchType=Et),r.nextTick(()=>{T.value=[...T.value],console.log("Strengths forceRadioFilterUpdate - dynamicFilters.value después:",T.value)})}else{const gt=V.value.findIndex(Et=>Et.type==="radio-button");if(gt!==-1){const Et=f.view.filterMultiple.isHomeTeam;let Lt;typeof Et=="boolean"?Lt=Et?1:2:typeof Et=="number"?Lt=Et===1?1:2:Lt=1,T.value[gt]=Lt,f.view.componentProps&&Et!==void 0&&(f.view.componentProps.preMatchType=Lt),r.nextTick(()=>{T.value=[...T.value]})}}}r.nextTick(()=>{d.value=!1,o.value=!1})}}function ve(){if(!o.value&&t.value&&l&&l.dynamicFilters&&V.value){if(b.value)return;o.value=!0,d.value=!0,l.dynamicFilters.forEach((me,ze)=>{var We;if(me&&((We=V.value[ze])==null?void 0:We.type)==="radio-button"&&me.selectedOption&&me.selectedOption.value!==void 0){const Ke=me.selectedOption.value;T.value[ze]=Ke}}),r.nextTick(()=>{d.value=!1,o.value=!1})}}function Ue(){var me,ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et,Lt,it,ct,Ge,ut,kt,vt,wt,Vt,at,Qe,xt,Rt,Wt,qt,Ht;if(n&&t.value&&f){if(b.value)return;if(d.value=!0,((me=w.value)==null?void 0:me.id)===4){if(n.setDynamicFilters(T.value,(ze=f.view)==null?void 0:ze.id),n.updateDynamicFilters(T.value,(We=f.view)==null?void 0:We.id),f.view.componentProps&&T.value&&T.value.length>0){const At=T.value[0];if(Array.isArray(At)&&At.length>0){const Yt=At.some(sr=>sr.event_type_id===1||typeof sr=="string"&&sr.includes("1")),Bt=At.some(sr=>sr.category_id===8||typeof sr=="string"&&sr.includes("8")),Gt=At.some(sr=>sr.category_id===9||typeof sr=="string"&&sr.includes("9")),or=At.some(sr=>sr.event_type_id===3||typeof sr=="string"&&sr.includes("3"));f.view.componentProps.selectedEvents=At,f.view.componentProps.goals=Yt,f.view.componentProps.yellowCards=Bt,f.view.componentProps.redCards=Gt,f.view.componentProps.substitutions=or,f.view.componentProps.key=At.length>0,f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}}else if(((Ke=w.value)==null?void 0:Ke.id)===8)n.setDynamicFilters(T.value,(rt=f.view)==null?void 0:rt.id),n.updateDynamicFilters(T.value,(nt=f.view)==null?void 0:nt.id);else if(((pt=w.value)==null?void 0:pt.id)===3)n.setDynamicFilters(T.value,(_t=f.view)==null?void 0:_t.id),n.updateDynamicFilters(T.value,(Tt=f.view)==null?void 0:Tt.id);else if(((Ft=w.value)==null?void 0:Ft.id)===13){const At=(It=f.view)==null?void 0:It.id;n.setDynamicFilters(T.value,At),n.updateDynamicFilters(T.value,At),f.view.componentProps&&(f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps}))}else if(((Jt=w.value)==null?void 0:Jt.id)===15){const At=(lt=f.view)==null?void 0:lt.id;if(n.setDynamicFilters(T.value,At),n.updateDynamicFilters(T.value,At),f.view.componentProps){const Yt=Array.isArray(T.value)&&T.value[3]!==void 0?T.value[3]:null;Yt!==null&&(f.view.componentProps.numitems=Yt),f.view.componentProps._updateKey=Date.now(),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps})}}else if(((tt=w.value)==null?void 0:tt.id)===2){n.setDynamicFilters(T.value,(dt=f.view)==null?void 0:dt.id),n.updateDynamicFilters(T.value,(gt=f.view)==null?void 0:gt.id);const At=T.value[0];if(At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.categoryId,f.view.filterMultiple.categoryId=At,f.view.componentProps)){let Bt=`Category ${At}`,Gt=null;try{Gt=Fh(At),Gt&&(Bt=Gt.name)}catch{const or=V.value.findIndex(sr=>sr.type==="select-simple"&&sr.label==="Tipo de análisis");if(or!==-1){const sr=(((Et=V.value[or])==null?void 0:Et.options)||[]).find(Ur=>Ur.value==At);sr&&(Bt=sr.label)}}f.view.componentProps.categoryView=[{id:At,name:Bt}],qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple})}const Yt=T.value[1];Yt!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.teamType,f.view.filterMultiple.teamType=Yt,f.view.componentProps&&f.view.componentProps.game&&(Yt===1?f.view.componentProps.teamView=f.view.componentProps.game.homeTeam.team_id:Yt===2?f.view.componentProps.teamView=f.view.componentProps.game.awayTeam.team_id:f.view.componentProps.teamView=0),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Lt=w.value)==null?void 0:Lt.id)===1){n.setDynamicFilters(T.value,(it=f.view)==null?void 0:it.id),n.updateDynamicFilters(T.value,(ct=f.view)==null?void 0:ct.id);const At=T.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.category,f.view.filterMultiple.category=At,f.view.componentProps&&(f.view.componentProps.type=At),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}))}else if(((Ge=w.value)==null?void 0:Ge.id)===6){n.setDynamicFilters(T.value,(ut=f.view)==null?void 0:ut.id),n.updateDynamicFilters(T.value,(kt=f.view)==null?void 0:kt.id);const At=T.value[0];At!==void 0&&(f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.gameNumber,f.view.filterMultiple.gameNumber=At,f.view.componentProps&&(f.view.componentProps.gameNumber=At,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(vt=w.value)==null?void 0:vt.id,viewId:f.view.id,dynamicFilters:T.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})}))}else if(((wt=w.value)==null?void 0:wt.id)===7){n.setDynamicFilters(T.value,(Vt=f.view)==null?void 0:Vt.id),n.updateDynamicFilters(T.value,(at=f.view)==null?void 0:at.id);const At=T.value[0],Yt=T.value[1];if(At!==void 0&&f.view.componentProps){const Bt=At===1?"offensive":"defensive";f.view.componentProps.analysisType=Bt}if(Yt!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Bt=Yt===1;f.view.filterMultiple.isHomeTeam=Bt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Bt,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(Qe=w.value)==null?void 0:Qe.id,viewId:f.view.id,dynamicFilters:T.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else if(((xt=w.value)==null?void 0:xt.id)===5){n.setDynamicFilters(T.value,(Rt=f.view)==null?void 0:Rt.id),n.updateDynamicFilters(T.value,(Wt=f.view)==null?void 0:Wt.id);const At=T.value[0];if(At!==void 0){f.view.filterMultiple||(f.view.filterMultiple={}),f.view.filterMultiple.isHomeTeam;const Yt=At===1?1:2;f.view.filterMultiple.isHomeTeam=Yt,f.view.componentProps&&(f.view.componentProps.isHomeTeamForAnalysis=Yt===1,f.view._updateKey,f.view._updateKey=Date.now()),qa.emit("force-component-update",{itemId:f.view.id,componentProps:f.view.componentProps,filterMultiple:f.view.filterMultiple}),qa.emit("dynamic-filters-changed",{containerViewId:(qt=w.value)==null?void 0:qt.id,viewId:f.view.id,dynamicFilters:T.value}),qa.emit("component-props-updated",{viewId:f.view.id,componentProps:f.view.componentProps,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})}}else((Ht=w.value)==null?void 0:Ht.id)===9||(n.setDynamicFilters(T.value),n.updateDynamicFilters(T.value));r.nextTick(()=>{d.value=!1})}}function ke(){var me,ze;if(!l||!l.dynamicFilters||!V.value)return!1;for(let We=0;We<l.dynamicFilters.length;We++){const Ke=l.dynamicFilters[We],rt=V.value[We],nt=T.value[We];if(!(!Ke||!rt)){if(rt.type==="check"){if(Ke.isChecked!==nt)return!0}else if(rt.type==="radio-button"){if(((me=Ke.selectedOption)==null?void 0:me.value)!==nt)return!0}else if(rt.type==="select"){const pt=((ze=Ke.selectedOptions)==null?void 0:ze.map(Tt=>Tt.value))||Ke.selectedValue||[],_t=Array.isArray(nt)?nt:[];if(JSON.stringify(pt)!==JSON.stringify(_t))return!0}}}return!1}function Je(me){var ze,We,Ke,rt,nt,pt,_t,Tt,Ft,It,Jt,lt,tt,dt,gt,Et;if(T.value=me.filters,n){const Lt=((ze=f==null?void 0:f.view)==null?void 0:ze.id)||null;n.setDynamicFilters(T.value,Lt),n.updateDynamicFilters(T.value,Lt)}if(t.value&&f&&(qa.emit("activate-save-button"),qa.emit("force-component-update",{itemId:((We=f==null?void 0:f.view)==null?void 0:We.id)||null,componentProps:f.view.componentProps}),qa.emit("dynamic-filters-changed",{containerViewId:((Ke=f==null?void 0:f.view)==null?void 0:Ke.id)||null,viewId:((rt=f==null?void 0:f.view)==null?void 0:rt.id)||null,dynamicFilters:T.value}),qa.emit("dynamic-filters-changed",{containerViewId:((nt=f==null?void 0:f.view)==null?void 0:nt.id)||null,viewId:((pt=f==null?void 0:f.view)==null?void 0:pt.id)||null,dynamicFilters:T.value}),r.nextTick(()=>{f.view.componentProps&&(f.view.componentProps={...f.view.componentProps})})),!t.value&&n&&((_t=w.value)==null?void 0:_t.id)===15&&n.getRequiresAddView(T.value)){n.setDynamicFilters(T.value),F("filters-changed",{main:c.value,view:w.value,team:E.value,dynamicFilters:T.value,filtersJSON:{mainSelector:{id:((Tt=c.value)==null?void 0:Tt.id)||null,name:((Ft=c.value)==null?void 0:Ft.name)||null,url:((It=c.value)==null?void 0:It.url)||null},viewSelector:{id:((Jt=w.value)==null?void 0:Jt.id)||null,name:((lt=w.value)==null?void 0:lt.name)||((tt=w.value)==null?void 0:tt.title)||null,url:((dt=w.value)==null?void 0:dt.url)||null},team:E.value,dynamicFilters:T.value,timestamp:new Date().toISOString(),summary:{mainSelected:!!c.value,viewSelected:!!w.value,totalDynamicFilters:((gt=V.value)==null?void 0:gt.length)||0,activeFilters:((Et=V.value)==null?void 0:Et.filter((Lt,it)=>{const ct=T.value[it];return Array.isArray(ct)?ct.length>0:ct!=null&&ct!==!1}).length)||0}},filterAndViewsContainer:n,viewToEdit:f}),ae();return}Ue()}function Re(me){me.filterIndex!==void 0&&me.value!==void 0&&(T.value[me.filterIndex]=me.value,t.value&&Ue(),ae())}function Ie(){Oe()}function Ze(me){var ze,We,Ke,rt,nt,pt,_t;const Tt={mainSelector:{id:((ze=c.value)==null?void 0:ze.id)||null,name:((We=c.value)==null?void 0:We.name)||null,url:((Ke=c.value)==null?void 0:Ke.url)||null},viewSelector:{id:((rt=w.value)==null?void 0:rt.id)||null,name:((nt=w.value)==null?void 0:nt.name)||((pt=w.value)==null?void 0:pt.title)||null,url:((_t=w.value)==null?void 0:_t.url)||null}};F("filters-changed",{filters:me.filters,view:me.view,viewToEdit:f,filterAndViewsContainer:n,filtersJSON:Tt,isAltMode:!0})}function et(me){return JSON.parse(JSON.stringify(me))}return(me,ze)=>(r.openBlock(),r.createElementBlock("div",e4e,[r.createElementVNode("button",t4e,r.toDisplayString(t.value?"Editando visualización":"Nueva visualización"),1),r.createElementVNode("div",{class:r.normalizeClass(["custom-select main-select",{disabled:t.value}]),onClick:B},[r.createElementVNode("div",r4e,[r.createElementVNode("span",n4e,[c.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,a4e)):(r.openBlock(),r.createElementBlock("img",i4e))]),c.value?(r.openBlock(),r.createElementBlock("span",s4e,r.toDisplayString(H()),1)):(r.openBlock(),r.createElementBlock("span",o4e,"Tipo de vista")),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:W.value}])},[...ze[5]||(ze[5]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),W.value?(r.openBlock(),r.createElementBlock("div",l4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,(We,Ke)=>(r.openBlock(),r.createElementBlock("div",{key:We.id,class:r.normalizeClass(["option-card",{active:h.value===Ke}]),onClick:r.withModifiers(rt=>ee(Ke),["stop"])},[r.createElementVNode("div",u4e,[r.createElementVNode("img",{src:D(We.name,!1),"data-hover-src":D(We.name,!0),alt:"icono",class:"option-img-34"},null,8,d4e)]),r.createElementVNode("div",p4e,[r.createElementVNode("div",h4e,r.toDisplayString(We.name),1),We.description?(r.openBlock(),r.createElementBlock("div",f4e,r.toDisplayString(We.description),1)):r.createCommentVNode("",!0)])],10,c4e))),128))])):r.createCommentVNode("",!0)],2),c.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:r.normalizeClass(["custom-select second-select",{disabled:t.value}]),onClick:ne},[r.createElementVNode("div",m4e,[r.createElementVNode("span",y4e,[w.value?(r.openBlock(),r.createElementBlock("img",{key:0,src:w.value.url,alt:"icono",class:"option-img-graph2"},null,8,g4e)):c.value?(r.openBlock(),r.createElementBlock("img",{key:1,src:D(c.value.name,!1),alt:"icono",class:"option-img"},null,8,v4e)):r.createCommentVNode("",!0)]),r.createElementVNode("span",b4e,r.toDisplayString(re()),1),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:j.value}])},[...ze[6]||(ze[6]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),j.value&&c.value?(r.openBlock(),r.createElementBlock("div",x4e,[r.createElementVNode("div",w4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(p.value,We=>(r.openBlock(),r.createElementBlock("div",{key:We.id,class:r.normalizeClass(["option-card-grid",{active:x.value===We.id}]),onClick:r.withModifiers(Ke=>Y(We),["stop"])},[r.createElementVNode("div",S4e,r.toDisplayString(We.name||We.title),1),r.createElementVNode("div",T4e,[r.createElementVNode("img",{src:We.url,alt:"icono",class:"option-img-grid"},null,8,k4e)])],10,_4e))),128))])])):r.createCommentVNode("",!0)],2)):r.createCommentVNode("",!0),w.value?(r.openBlock(),r.createElementBlock("div",N4e)):r.createCommentVNode("",!0),w.value&&w.value.id===13?(r.openBlock(),r.createBlock(SSe,{key:2,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":13,onFiltersChanged:Je,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===16?(r.openBlock(),r.createBlock(ETe,{key:3,"view-config":et(g.value.get(16)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,"is-edit-mode":!!r.unref(f),"is-post-match":e.isPostMatch,onChange:Ze,onRemoveViews:Ie},null,8,["view-config","default-filters","is-edit-mode","is-post-match"])):w.value&&w.value.id===15?(r.openBlock(),r.createBlock(KSe,{key:4,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":15,onFiltersChanged:Je,onFilterUpdated:Re},null,8,["filters","initial-values","is-edit-mode"])):w.value&&w.value.id===17?(r.openBlock(),r.createBlock($6e,{key:5,filters:V.value,"initial-values":t.value?r.unref(l).dynamicFilters:T.value,"is-edit-mode":t.value,"component-id":17,"view-config":et(g.value.get(17)),"default-filters":r.unref(f)?r.unref(f).view.filterMultiple:null,onFiltersChanged:Je,onFilterUpdated:Re,onChange:Ze,onRemoveViews:Ie},null,8,["filters","initial-values","is-edit-mode","view-config","default-filters"])):w.value&&V.value&&C()?(r.openBlock(),r.createElementBlock("div",{key:6,class:r.normalizeClass(["dynamic-filters",{"dynamic-filters-wide":V.value.length>=2}])},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(V.value,(We,Ke)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:Ke},[We.type==="select"?(r.openBlock(),r.createElementBlock("div",{key:0,class:"custom-select dynamic-select filter-inline",onClick:r.withModifiers(rt=>$(Ke),["stop"])},[r.createElementVNode("div",O4e,[ze[8]||(ze[8]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),ze[9]||(ze[9]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),Array.isArray(T.value[Ke])&&T.value[Ke].length>0?(r.openBlock(),r.createElementBlock("span",L4e,r.toDisplayString(T.value[Ke].length),1)):r.createCommentVNode("",!0),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:K.value===Ke}])},[...ze[7]||(ze[7]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),K.value===Ke?(r.openBlock(),r.createElementBlock("div",U4e,[r.createElementVNode("div",q4e,[r.createElementVNode("div",{class:"multi-select-header",onClick:ze[1]||(ze[1]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("label",z4e,[r.createElementVNode("input",{type:"checkbox",checked:z(Ke),indeterminate:L(Ke),onChange:r.withModifiers(rt=>S(Ke),["stop"]),onClick:ze[0]||(ze[0]=r.withModifiers(()=>{},["stop"]))},null,40,C4e),ze[10]||(ze[10]=r.createElementVNode("span",{class:"select-all-label"},"Agregar todas",-1))])]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(We.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card multi-select-option",{active:O(Ke,rt.value)}]),onClick:ze[2]||(ze[2]=r.withModifiers(()=>{},["stop"]))},[r.createElementVNode("div",P4e,[r.createElementVNode("input",{type:"checkbox",checked:O(Ke,rt.value),onChange:r.withModifiers(nt=>U(Ke,rt.value),["stop"])},null,40,E4e)]),r.createElementVNode("div",{class:"option-content",onClick:nt=>U(Ke,rt.value)},[r.createElementVNode("div",W4e,r.toDisplayString(rt.label),1)],8,R4e)],2))),128))]),r.createElementVNode("div",M4e,[r.createElementVNode("button",{class:"btn-listo",onClick:ze[3]||(ze[3]=r.withModifiers(rt=>_e(),["stop"]))},"Listo")])])):r.createCommentVNode("",!0)],8,V4e)):We.type==="radio-button"?(r.openBlock(),r.createElementBlock("div",F4e,[r.createElementVNode("div",j4e,r.toDisplayString(We.label),1),r.createElementVNode("div",K4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(We.options,rt=>(r.openBlock(),r.createElementBlock("label",{key:rt.value,class:r.normalizeClass(["radio-option-card",{active:T.value[Ke]===rt.value}])},[r.withDirectives(r.createElementVNode("input",{type:"radio",name:"dynamic-radio-"+Ke,value:rt.value,"onUpdate:modelValue":nt=>T.value[Ke]=nt,disabled:P(rt.value,rt.label),onChange:()=>{var nt,pt,_t;if(((nt=w.value.value)==null?void 0:nt.id)===9&&t.value.value&&(_t=(pt=r.unref(f))==null?void 0:pt.view)!=null&&_t.filterMultiple){const Tt=T.value[Ke]===1;r.unref(f).view.filterMultiple.isHomeTeam=Tt}t.value.value&&Ue(),ae()}},null,40,A4e),[[r.vModelRadio,T.value[Ke]]]),r.createElementVNode("span",null,r.toDisplayString(rt.label),1)],2))),128))])])):We.type==="check"?(r.openBlock(),r.createElementBlock("div",I4e,[r.createElementVNode("label",null,[r.withDirectives(r.createElementVNode("input",{type:"checkbox","onUpdate:modelValue":rt=>T.value[Ke]=rt,checked:T.value[Ke],onChange:ze[4]||(ze[4]=()=>{t.value.value&&Ue(),ae()})},null,40,X4e),[[r.vModelCheckbox,T.value[Ke]]]),r.createTextVNode(" "+r.toDisplayString(We.label),1)])])):We.type==="select-simple"?(r.openBlock(),r.createElementBlock("div",{key:3,class:"custom-select dynamic-select filter-inline","data-filter-type":We.type,onClick:r.withModifiers(rt=>le(Ke),["stop"])},[r.createElementVNode("div",J4e,[ze[12]||(ze[12]=r.createElementVNode("span",{class:"select-icon select-analisis-icon"},[r.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)),ze[13]||(ze[13]=r.createElementVNode("span",{class:"select-label"}," Tipo de análisis ",-1)),r.createElementVNode("span",{class:r.normalizeClass(["arrow",{open:X.value===Ke}])},[...ze[11]||(ze[11]=[r.createElementVNode("svg",{width:"16",height:"14",viewBox:"0 0 16 14",fill:"none"},[r.createElementVNode("path",{d:"M3 5L8 10L13 5",stroke:"#AAB4BE","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],2)]),X.value===Ke?(r.openBlock(),r.createElementBlock("div",B4e,[r.createElementVNode("div",G4e,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(We.options,rt=>(r.openBlock(),r.createElementBlock("div",{key:rt.value,class:r.normalizeClass(["option-card simple-select-option",{active:T.value[Ke]===rt.value}]),onMouseenter:nt=>Ce(Ke,rt.value),onClick:r.withModifiers(nt=>ie(Ke,rt.value),["stop"])},[r.createElementVNode("div",H4e,[r.createElementVNode("div",Y4e,r.toDisplayString(rt.label),1)]),T.value[Ke]===rt.value?(r.openBlock(),r.createElementBlock("div",Q4e,[...ze[14]||(ze[14]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none"},[r.createElementVNode("path",{d:"M13.5 4.5L6 12L2.5 8.5",stroke:"#cbee6b","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])):r.createCommentVNode("",!0)],42,Z4e))),128))])])):r.createCommentVNode("",!0)],8,D4e)):r.createCommentVNode("",!0),Ke===1&&V.value.length>2?(r.openBlock(),r.createElementBlock("div",$4e)):r.createCommentVNode("",!0)],64))),128))],2)):r.createCommentVNode("",!0),t.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("button",{key:7,class:"cancel-btn",onClick:Oe},"Cancelar")),_.value?(r.openBlock(),r.createElementBlock("button",{key:8,class:"ok-btn",onClick:Te},"OK")):r.createCommentVNode("",!0)]))}}),tke=Bc(eke,[["__scopeId","data-v-9b2a2afd"]]),rke={key:0,class:"modal-simple"},nke={class:"modal-simple__content"},ake={class:"modal-simple__content__header"},ike={class:"modal-simple__content__body"},oke={class:"modal-simple__content__footer"},ske={__name:"ModalSimple",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[e.modelValue?(r.openBlock(),r.createElementBlock("div",rke,[r.createElementVNode("div",nke,[r.createElementVNode("div",ake,[r.renderSlot(a.$slots,"header",{},void 0,!0)]),r.createElementVNode("div",ike,[r.renderSlot(a.$slots,"body",{},void 0,!0)]),r.createElementVNode("div",oke,[r.renderSlot(a.$slots,"footer",{},void 0,!0)])])])):r.createCommentVNode("",!0)]))}},lke=Bc(ske,[["__scopeId","data-v-1cc4f590"]]),cke={class:"footer"},uke={__name:"ModalCautionClose",props:{value:{type:Boolean,default:!1}},emits:["update:modelValue","action"],setup(e,{emit:a}){const i=a;function k(g){i("update:modelValue",g)}function F(g){i("action",g),i("update:modelValue",!1)}return(g,m)=>(r.openBlock(),r.createBlock(lke,{"modle-value":e.value,"onUpdate:modelValue":k},{header:r.withCtx(()=>[...m[2]||(m[2]=[r.createElementVNode("div",{class:"header"},"Descartar template",-1)])]),body:r.withCtx(()=>[...m[3]||(m[3]=[r.createElementVNode("div",{class:"body"},"¿Estás seguro que deseas abandonar el proceso?",-1)])]),footer:r.withCtx(()=>[r.createElementVNode("div",cke,[r.createElementVNode("div",{role:"button",class:"btn btn-cancel",onClick:m[0]||(m[0]=n=>F(!1))}," Seguir editando "),r.createElementVNode("div",{role:"button",class:"btn btn-confirm",onClick:m[1]||(m[1]=n=>F(!0))}," Descartar ")])]),_:1},8,["modle-value"]))}},dke=Bc(uke,[["__scopeId","data-v-ed9b5088"]]),pke={key:0,class:"modal-simple"},hke={__name:"ModalChangesSaved",props:{modelValue:{type:Boolean,default:!1}},setup(e){return(a,i)=>(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[r.createVNode(r.Transition,null,{default:r.withCtx(()=>[e.modelValue?(r.openBlock(),r.createElementBlock("div",pke,[...i[0]||(i[0]=[r.createElementVNode("div",{class:"modal-simple__content"},[r.createElementVNode("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M29.3333 5.33203L16 18.6787L12 14.6787",stroke:"#CDEF71","stroke-width":"2.66667","stroke-linecap":"round","stroke-linejoin":"round"})]),r.createElementVNode("div",{class:"modal-simple__content__text"}," Los cambios se han guardado correctamente ")],-1)])])):r.createCommentVNode("",!0)]),_:1})]))}},fke=Bc(hke,[["__scopeId","data-v-2bc30783"]]),mke={class:"template-maker__header"},yke={key:0,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},gke={class:"template-maker__content"},vke={class:"template-maker__content__main"},bke={id:"containerMain",class:"container-main"},xke={class:"template-maker__content__main__cover-selector"},wke=["id"],_ke={class:"page-indicator"},Ske={class:"page-indicator__index"},Tke=["onClick"],kke=["onClick"],Nke={key:0,class:"template-maker__content__main__footer"},Vke={class:"template-maker__content__main__footer__paginator"},Oke={class:"template-maker__content__main__footer__paginator__nav"},Lke={class:"template-maker__content__main__footer__paginator__numbers"},Uke=["onClick"],qke={__name:"GSC-TemplateReportMaker",props:{token:{type:String,default:""},userTeamId:{type:Number,default:0}},emits:["close"],setup(e,{expose:a,emit:i}){const k=new Map,F=r.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:{}}]}]),g=r.ref(null),m=r.ref(0),n=r.ref(!1),f=r.ref(null),l=r.ref(null),t=r.ref(!0),_=r.ref(!1),v=r.ref(!1),b=r.ref(0),d=r.ref(!1),o=r.ref(null),s=r.ref(new Map),h=r.ref(null),c=r.ref(null),p=r.ref(!1),x=r.ref(!1),w=r.ref(!1),T=new Map,V=r.computed(()=>({"--overflow-y-template-maker":_.value?"scroll":"hidden","--height-container-main":_.value?"fit-content":"calc(100vh - 64px)","--margin-bottom-container-main":(_.value,"0")})),O=r.computed(()=>m.value+1);r.watch(()=>n.value,_e=>{const Ce=document.getElementById("app");_e?(m.value=0,document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden",Ce&&(Ce.style.overflow="hidden")):(document.body.style.overflow="",document.documentElement.style.overflow="",Ce&&(Ce.style.overflow=""))});function U(_e){return _e<10?`0${_e}`:_e}async function z({templateId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/templates/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching template by ID:",Pe)}}async function L({reportId:_e,userId:Ce}){try{return(await(await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${Ce}/reports/${_e}`,{method:"GET",headers:{Authorization:$.token}})).json()).data}catch(Pe){console.error("Error fetching report by ID:",Pe)}}let C=0;function q(_e){g.value=_e,C>0&&(p.value=!0),C++}function N(_e){_e&&ue(null,!0)}let P=null;function S(_e,Ce){let Pe=_e.getBoundingClientRect(),Be={height:_e.clientHeight,width:_e.clientWidth},qe=Ce.getBoundingClientRect();if(!(qe.top>=Pe.top&&qe.bottom<=Pe.top+Be.height)){const Fe=qe.top-Pe.top,Ee=qe.bottom-Pe.bottom;Math.abs(Fe)<Math.abs(Ee)?_e.scrollTop+=Fe:_e.scrollTop+=Ee}}function E(_e,Ce){let Pe=_e.getBoundingClientRect();const Be=Ce.getBoundingClientRect().top-Pe.top;_e.scrollTop+=Be}function W(_e,Ce=!1){const Pe={title:`Page ${F.value.length+1}`,id:`p-${Date.now()}`,items:[]};if(xe(),_e!==void 0&&_e>=-1?F.value.splice(_e+1,0,Pe):F.value.push(Pe),r.nextTick(()=>{const Be=F.value.findIndex(Fe=>Fe.id===Pe.id),qe=document.getElementById(`page-${Be+1}`);P||(P=document.getElementById("containerMain")),qe&&P?S(P,qe):console.error("Page element or container main element not found")}),Ce)return Pe;p.value=!0}function j(_e){if(_e<0||_e>F.value.length)return;m.value=_e;const Ce=document.getElementById(`page-${_e}`);if(P||(P=document.getElementById("containerMain")),Ce&&P){const Pe=new CustomEvent("programmatic-scroll-start");document.dispatchEvent(Pe),E(P,Ce),setTimeout(()=>{const Be=new CustomEvent("programmatic-scroll-end");document.dispatchEvent(Be)},300)}else console.error("Page element or container main element not found")}function K(_e){h.value=_e,d.value=!0}function X(_e,Ce){const Pe=Ce+1;_e&&m.value!==Pe&&(m.value=Pe)}function D(_e){d.value=!0,qa.emit("edit-view",{view:_e})}async function H({templateReportId:_e,userId:Ce,isTemplateMode:Pe}){try{return Pe?z({templateId:_e,userId:Ce}):L({reportId:_e,userId:Ce})}catch(Be){throw new Error("Error fetching template or report by ID: "+Be.message)}}function re(){C=0,d.value=!1,m.value=0,h.value=null,c.value=null,s.value.clear(),P=null}async function B(_e){if(re(),t.value=_e.isTemplateMode,_.value=!!_e.isPDFMode,_e.isPDFMode?f.value=await L({reportId:_e.reportId,userId:_e.userId}):(f.value=_e.template,f.value=await H({templateReportId:_e.template.id,userId:_e.template.user_id,isTemplateMode:_e.isTemplateMode})),!f.value)return;f.value&&f.value.game&&(f.value.game=ie(f.value.game)),l.value=JSON.parse(JSON.stringify(f.value)),v.value=f.value.template_type===2;const Ce=f.value.pages.find(Pe=>Pe.is_front_page);b.value=Ce?Ce.type:1,n.value=!0,F.value=f.value.pages.reduce((Pe,Be,qe)=>{if(!Be.is_front_page){Be.name||(Be.name="");const Fe=qe,Ee={originalPage:JSON.parse(JSON.stringify(Be)),title:Be.name,id:`p-${Date.now()-qe*9}`,items:[],components:Be.components};Be.components&&Be.components.length>0&&(Ee.items=Be.components.map((ve,Ue)=>{const ke=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],ve.coreView.id,ve.dynamicFilters,v.value,t.value,ve.filtersJSON||null,$.token,ve.filters),Je={originalComponent:JSON.parse(JSON.stringify(ve)),title:ve.title,shortTitle:ve.shortTitle||ve.title,game:f.value.game,idAux:ve.id,id:`w-${Date.now()-Ue*7}`,x:ve.column,y:ve.row,w:ve.colspan,h:ve.rowspan,maxWidth:ve.max_column,maxHeight:ve.max_row,minWidth:ve.min_column,minHeight:ve.min_row,noResize:!t.value,noMove:!t.value,coreView:ve.coreView||null,isTemplateMode:t.value,componentName:ve.componentName,componentProps:Y({currentProps:ve.componentProps,coreView:ve.coreView,isTemplateMode:t.value,templateToEdit:f.value,filterMultiple:ve.filterMultiple||null,game:f.value.game||null,dynamicFilters:ve.dynamicFilters,page:Fe,componentId:Ue})||{},filterMultiple:ve.filterMultiple,isHomeTeam:ee({game:f.value.game,isTemplateMode:t.value,currentIsHomeTeam:ve.isHomeTeam||ve.componentProps.isHomeTeamForAnalysis}),filtersJSON:ve.filtersJSON||null,dynamicFilters:ve.dynamicFilters||[],filterAndViewsContainer:ke},Re=r.reactive({view:Je});return ke.addView(Re,!0),s.value.set(ke.getId(),ke),Je})),Pe.push(Ee)}return Pe},[])}function ne({game:_e,isTemplateMode:Ce}){const Pe=_e&&_e.homeTeam&&_e.awayTeam&&(_e.homeTeam.team_id===$.userTeamId||_e.awayTeam.team_id===$.userTeamId);return{isUserTeamHome:Pe&&_e.homeTeam.team_id===$.userTeamId,requiresUserTeamAdjustment:Pe&&!Ce}}function ee({game:_e,isTemplateMode:Ce,currentIsHomeTeam:Pe}){const{isUserTeamHome:Be,requiresUserTeamAdjustment:qe}=ne({game:_e,isTemplateMode:Ce});return qe?Pe?Be:!Be:Pe}function Y({currentProps:_e,coreView:Ce,templateToEdit:Pe,isTemplateMode:Be,filterMultiple:qe,game:Fe,dynamicFilters:Ee,page:ve,componentId:Ue}){if(!_e||!Ce)return _e||{};const{isUserTeamHome:ke,requiresUserTeamAdjustment:Je}=ne({game:Fe,isTemplateMode:Be}),Re={..._e};if(Ce.id===5&&(Re.isGhostEffect=Be,Je)){const Ie=Re.preMatchType===1;Re.preMatchType=Ie?ke?1:2:ke?2:1}if(Ce.id===7&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===9&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===16){if(!Be&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(!Be){Re.isPreMatch=!v.value,Re.isTemplateMode=Be,Re.seasonId=Pe.season_id,Re.teamIdForAnalysis=Re.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Re.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;v.value?Re.gamesIdsForAnalysis=[Pe.game.game_id]:Re.howManyGames?Re.gamesIdsForAnalysis=Ie.slice(0,Re.howManyGames).map(Ze=>Ze.game_id):(Re.gamesIdsForAnalysis=[],Re.gameDataUTC=Pe.game.date_time_utc)}if(!Be){Re.isTemplateMode=Be,Re.seasonId=Pe.season_id,Re.teamIdForAnalysis=Re.isHomeTeamForAnalysis?Pe.game.home_team:Pe.game.visiting_team;const Ie=Re.isHomeTeamForAnalysis?Pe.last_games.last_home_games:Pe.last_games.last_visiting_games;v.value?Re.gamesIdsForAnalysis=[Pe.game.game_id]:Re.howManyGames?Re.gamesIdsForAnalysis=Ie.slice(0,Re.howManyGames).map(Ze=>Ze.game_id):(Re.gamesIdsForAnalysis=[],Re.gameDataUTC=Pe.game.date_time_utc)}}if(Ce.id===10&&Je){const Ie=Re.isHomeTeamForAnalysis;Re.isHomeTeamForAnalysis=Ie?ke:!ke}if(Ce.id===1&&(Re.gameId=Fe?Fe.id:"",Re.homeLogo=Fe?Fe.homeTeam.logo:"",Re.awayLogo=Fe?Fe.awayTeam.logo:"",Re.seasonId=Fe?Fe.season_id:0,Re.default=Be),Ce.id===6&&(Re.game=Fe||"",Re.lastGames=Pe.last_games,Re.selectedOption=Pe.template_type===2?"Postmatch":"Prematch"),Ce.id===13&&(Re.isdefault=Be,Re.seasonid=Fe?Fe.seasonId:2010,Re.datetimeutc=Fe?Pe.template_type===1?Fe?Fe.date_time_utc:"":null:"",Re.teamids=Fe?[Fe.home_team,Fe.visiting_team]:[1,2],Re.categoryids=Ee?Ee[1]:[20,2],Re.teamsshow=Fe?Ee?Ee[2]==1?[Fe.home_team]:Ee[2]==2?[Fe.visiting_team]:[Fe.home_team,Fe.visiting_team]:[1,2]:[1,2],Re.analysistype=Ee?Ee[0]:[],Re.gameid=Pe.template_type===1?null:Fe?Fe.id:"",Re.teams=Fe?[{id:Fe.home_team,name:Fe.home_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Fe.home_team+".png"},{id:Fe.visiting_team,name:Fe.visiting_team_acronym,logo:"https://golstatsimages.blob.core.windows.net/teams-80/"+Fe.visiting_team+".png"}]:[]),Ce.id===15&&(Re.view=1,Re.token=$.token,Re.numitems=Ee?Ee[1]:3,Re.isdefault=Be,Re.reportid=Pe!=null&&Pe.id?Pe.id:0,Re.userid=Pe!=null&&Pe.user_id?Pe.user_id:0,Re.page=ve+1,Re.typegame=v.value?2:1,Re.componentid=Ue+1,Re.data={season:Fe?Fe.seasonId:2010,type:2,game:Fe?Fe.id:0,team:Be?2:qe?qe.isHomeTeam?Fe.home_team||2:Fe.visiting_team||2:2}),Ce.id===14&&(Re.isReports=!0,Re.isDefault=Be,Re.type=Pe.tournament_type==1?1:0,Re.typeView=1,Re.tournament=Pe.tournament_id,Re.currentSeason=Fe?Fe.season_id:0,Re.currentSeasonId=Fe?Fe.season_id:0,Re.showVideos=!1,Re.localTeam=Fe?Fe.home_team:0,Re.awayTeam=Fe?Fe.visiting_team:0),Ce.id===3&&(Re.defaultShields=Be),Ce.id===2){let Ie=!0,Ze=0,et=0;Fe&&(Ie=Pe.main_team==Fe.home_team||Pe.main_team==Fe.visiting_team,Ze=Ie?Pe.main_team==(Fe==null?void 0:Fe.home_team)?Fe==null?void 0:Fe.home_team:Fe==null?void 0:Fe.visiting_team:Fe==null?void 0:Fe.home_team,et=Ie?Pe.main_team==(Fe==null?void 0:Fe.home_team)?Fe==null?void 0:Fe.visiting_team:Fe==null?void 0:Fe.home_team:Fe==null?void 0:Fe.visiting_team),Re.gamed=Fe?Fe.id:"",Re.game=Fe||"",Re.season=Fe?Fe.season_id:0,Re.teamView=qe.teamType==3?0:qe.teamType==1?Ze:et,Re.useDummyData=Be}return Ce.id===8&&(Re.teamSelected=Fe?{teamId:Fe.home_team}:1,Re.isDefault=Be),Ce.id===4&&(Re.gameId=Fe?Fe.id:"",Re.isDefault=Be,Re.homeTeam=Fe?Fe==null?void 0:Fe.home_team:"",Re.awayTeam=Fe?Fe==null?void 0:Fe.visiting_team:""),Fe&&(Re.game=Fe),Re}const $=e,le=i;r.watch(()=>$.token,(_e,Ce)=>{},{immediate:!0}),a({show:B}),qa.on("add-page-view",_e=>{k.set(_e.view.id,_e.view);const Ce=F.value.find(Pe=>Pe.id===_e.pageId);Ce&&(Ce.items||(Ce.items=[]),Ce.items.push(_e.view),r.nextTick(()=>{const Pe=document.querySelector(`[gs-id="${_e.view.id}"]`);_e.grid.makeWidget(Pe)}))}),qa.on("add-page-and-view",_e=>{const Ce=F.value.findIndex(Pe=>Pe.id===_e.pageId);if(Ce>-1){const Pe=W(Ce,!0);setTimeout(()=>{qa.emit("add-view",{pageId:Pe.id,view:_e.view,filterAndWidgetContainer:_e.filterAndWidgetContainer}),c.value&&(Pe.stepBackPage=c.value),c.value=Pe},500)}else console.error("Page not found for adding view:",_e.pageId)}),qa.on("empty-page",_e=>{d.value&&h.value&&h.value.id===_e.id||(be(_e),c.value&&c.value.id===_e.id&&(c.value.stepBackPage?c.value=c.value.stepBackPage:c.value=null))}),qa.on("filters-cancelled",_e=>{_e&&_e.removeAllChildViews()}),qa.on("activate-save-button",()=>{p.value=!0});function ie(_e){return{..._e,gameId:_e.game_id,id:_e.game_id,seasonId:_e.season_id,status:_e.game_status,homeTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.home_team}.png`,team_id:_e.home_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.home_team}.png`,colloquial_name:_e.home_team_name,acronym:_e.home_team_acronym,team_name:_e.home_team_name},awayTeam:{logo:`https://golstatsimages.blob.core.windows.net/teams-150/${_e.visiting_team}.png`,team_id:_e.visiting_team,provisional_logo:`https://golstatsimages.blob.core.windows.net/teams-provisional/${_e.visiting_team}.png`,colloquial_name:_e.visiting_team_name,acronym:_e.visiting_team_acronym,team_name:_e.visiting_team_name}}}function ue(_e,Ce=!1){Ce||!t.value?(n.value=!1,re(),le("close")):p.value?x.value=!0:(n.value=!1,re(),le("close"))}function he(){o.value=null,d.value=!1}function ae({page:_e,view:Ce,applyMinimumSize:Pe=!1}){const Be=_e.grid;if(!_e||!Ce||!Be)return null;const qe=Pe?{w:Ce.min_column,h:Ce.min_row}:{w:Ce.colspan,h:Ce.rowspan},Fe=Be.willItFit(0,0,qe.w,qe.h,!0);return Fe?{willFit:Fe,applyMinimumSize:Pe}:Pe?null:ae({page:_e,view:Ce,applyMinimumSize:!0})}const de=new Set([9]);function ce(_e){var Ce,Pe,Be,qe,Fe,Ee,ve,Ue,ke,Je,Re,Ie,Ze,et;if(_e.dynamicFilters&&_e.dynamicFilters.length>0&&_e.viewToEdit&&_e.viewToEdit.view){const me=_e.viewToEdit.view.id;F.value.forEach(ze=>{ze.items.forEach(We=>{We.id===me&&We.coreView&&We.coreView.id===3&&(We.componentProps.desplegable=_e.dynamicFilters[0]||!1,We.componentProps.key=_e.dynamicFilters[0]||!1,r.nextTick(()=>{qa.emit("force-component-update",{itemId:We.id,componentProps:We.componentProps})}))})})}if(_e.viewToEdit){if(!_e.viewToEdit.view.filterAndViewsContainer){const me=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[_e.viewToEdit],((Ce=_e.viewToEdit.view.coreView)==null?void 0:Ce.id)||_e.viewToEdit.view.id,_e.dynamicFilters||[],v.value,t.value,_e.filtersJSON,$.token,_e.filters);_e.viewToEdit.view.filterAndViewsContainer=me}_e.viewToEdit.view.filterAndViewsContainer.updateView({view:_e.viewToEdit,dynamicFilters:_e.dynamicFilters||[],filtersJSON:_e.filtersJSON||null,filters:_e.filters}),p.value=!0}else if(_e.view){_e.view.id&&_e.filterAndViewsContainer&&_e.view.id!==_e.filterAndViewsContainer.viewId&&(_e.filterAndViewsContainer.removeAllChildViews(),_e.filterAndViewsContainer.setViewId(_e.view.id),_e.filterAndViewsContainer.setFiltersJSON(_e.filtersJSON||null)),_e.view.id&&de.has(_e.view.id)&&_e.dynamicFilters[0]&&_e.dynamicFilters[0].length===0&&_e.filterAndViewsContainer&&(_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(Be=(Pe=_e.viewToEdit)==null?void 0:Pe.view)==null?void 0:Be.id),p.value=!0);const me=c.value||h.value,ze=ae({page:me,view:_e.view,applyMinimumSize:!1});_e.view.filtersJSON=_e.filtersJSON||null;const We=_e.filterAndViewsContainer,Ke=F.value.findIndex(rt=>rt.id===me.id);if(We){const rt=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);if(((qe=_e.view)==null?void 0:qe.id)===15){const nt=(Fe=_e.filterAndViewsContainer)==null?void 0:Fe.getId();if(nt&&T.has(nt)){const pt=T.get(nt);clearTimeout(pt),T.delete(nt)}}if(rt){if(We.setFilters(_e.filters),We.setDynamicFilters(_e.dynamicFilters),ze||Ke===F.value.length-1){qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:We,avoidWillFit:!1,applyMinimumSize:ze?ze.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(ve=(Ee=_e.viewToEdit)==null?void 0:Ee.view)==null?void 0:ve.id),p.value=!0;let nt=null;if(((Ue=_e.view)==null?void 0:Ue.id)===15?(r.nextTick(()=>{var pt;const _t=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters);((pt=_e.dynamicFilters)==null?void 0:pt[0])===3&&_t&&ce(_e)}),nt=setTimeout(()=>{var pt,_t;const Tt=(pt=_e.filterAndViewsContainer)==null?void 0:pt.getId();Tt&&T.delete(Tt);const Ft=_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters);((_t=_e.dynamicFilters)==null?void 0:_t[0])===3&&Ft&&ce(_e)},200)):nt=setTimeout(()=>{_e.filterAndViewsContainer.getRequiresAddView(_e.dynamicFilters,_e.filters)&&ce(_e)},1e3),((ke=_e.view)==null?void 0:ke.id)===15&&nt){const pt=(Je=_e.filterAndViewsContainer)==null?void 0:Je.getId();pt&&T.set(pt,nt)}}}else _e.isAltMode?_e.viewToEdit||_e.filterAndViewsContainer.updateFilters(_e.filters,(Ie=(Re=_e.viewToEdit)==null?void 0:Re.view)==null?void 0:Ie.id):_e.filterAndViewsContainer.updateDynamicFilters(_e.dynamicFilters,(et=(Ze=_e.viewToEdit)==null?void 0:Ze.view)==null?void 0:et.id),p.value=!0}else if(ze||Ke===F.value.length-1){const rt=new Y0(`FAWC-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,[],_e.view.id,_e.dynamicFilters,v.value,t.value,_e.filtersJSON,$.token,_e.filters);qa.emit("set-filter-and-views-container",rt),s.value.set(rt.getId(),rt),_e.dynamicFilters&&Array.isArray(_e.dynamicFilters[0])?(_e.filterAndViewsContainer=rt,ce(_e)):qa.emit("add-view",{pageId:me.id,view:_e.view,filterAndWidgetContainer:rt,avoidWillFit:!1,applyMinimumSize:ze?ze.applyMinimumSize:!1,dynamicFilters:_e.dynamicFilters,filters:_e.filters}),p.value=!0}}}async function ye(){if(p.value)try{const _e=[{is_front_page:!0,template_type:g.value.isPostMatch?2:1,type:g.value.id},...F.value.map(Pe=>({columns:Pe.originalPage?Pe.originalPage.columns:12,rows:Pe.originalPage?Pe.originalPage.rows:12,gap:Pe.originalPage?Pe.originalPage.gap:10,name:Pe.title,width:Pe.originalPage?Pe.originalPage.width:968,height:Pe.originalPage?Pe.originalPage.height:702,components:Pe.items.reduce((Be,qe)=>(qe.isDeleted||Be.push({min_column:qe.minWidth,min_row:qe.minHeight,max_column:qe.maxWidth,max_row:qe.maxHeight,column:qe.x,row:qe.y,colspan:qe.w,rowspan:qe.h,name:qe.name,title:qe.title,titleShort:qe.titleShort||qe.title,dynamicFilters:qe.filterAndViewsContainer.getComponentDynamicFilters(qe.id)||qe.filterAndViewsContainer.getDynamicFilters()||[],coreView:qe.coreView||null,componentName:qe.componentName,componentProps:qe.componentProps||{},isHomeTeam:qe.isHomeTeam||qe.componentProps.isHomeTeamForAnalysis,filterMultiple:qe.filterMultiple}),Be),[])}))],Ce=await fetch(`https://m9qip57rsh.execute-api.us-east-2.amazonaws.com/prod/users/${f.value.user_id}/templates/${f.value.id}/pages`,{method:"PATCH",headers:{Authorization:$.token},body:JSON.stringify({pages:_e})});w.value=!0,await Ce.json(),p.value=!1,setTimeout(()=>{w.value=!1},2e3)}catch(_e){console.error("Error saving template:",_e)}}function xe(){F.value.forEach(_e=>{_e.offListeners&&_e.offListeners()})}function be(_e){const Ce=F.value.findIndex(Pe=>Pe.id===_e.id);Ce>-1&&(xe(),F.value=F.value.filter(Pe=>Pe.id!==_e.id),m.value>=Ce&&(m.value=Math.max(0,m.value-1)),p.value=!0)}function Te(){p.value=!0}function Oe(_e){const Ce=F.value.find(Pe=>Pe.items.some(Be=>Be.id===_e.id));if(Ce){const Pe=Ce.items.find(Be=>Be.id===_e.id);Pe&&(Pe.isDeleted=!0,p.value=!0)}}function Le(_e){}return(_e,Ce)=>(r.openBlock(),r.createElementBlock(r.Fragment,null,[r.createVNode(dke,{modelValue:x.value,"onUpdate:modelValue":Ce[0]||(Ce[0]=Pe=>x.value=Pe),onAction:N},null,8,["modelValue"]),r.createVNode(fke,{"model-value":w.value},null,8,["model-value"]),(r.openBlock(),r.createBlock(r.Teleport,{to:"body"},[n.value&&f.value?(r.openBlock(),r.createElementBlock("div",{key:0,class:"template-maker",style:r.normalizeStyle(V.value)},[r.withDirectives(r.createVNode(tke,{token:e.token,view:o.value,"is-post-match":v.value,onClose:he,onFiltersChanged:ce},null,8,["token","view","is-post-match"]),[[r.vShow,t.value&&d.value]]),r.createElementVNode("div",mke,[r.createTextVNode(r.toDisplayString(f.value?f.value.name:"Nuevo template")+" ",1),r.createElementVNode("div",{class:"template-maker__header__close",onClick:ue},[_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("svg",yke,[...Ce[6]||(Ce[6]=[r.createElementVNode("path",{d:"M1.33398 1.33398L14.6673 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),r.createElementVNode("path",{d:"M14.666 1.33398L1.33268 14.6673",stroke:"#FFFFFF","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])]))])]),r.createElementVNode("div",gke,[Ce[13]||(Ce[13]=r.createElementVNode("div",{class:"template-maker__content__sidebar"},null,-1)),r.createElementVNode("div",vke,[r.createElementVNode("div",bke,[r.createElementVNode("div",xke,[r.withDirectives(r.createVNode($V,{"is-post-match":v.value,"initial-cover-id":b.value,onSelectCover:q},null,8,["is-post-match","initial-cover-id"]),[[r.vShow,t.value]])]),(r.openBlock(),r.createElementBlock("div",{class:"template-maker__content__main__pages",key:F.value.length},[g.value?(r.openBlock(),r.createBlock(oSe,{key:0,id:"page-0",game:f.value.game||null,"cover-id":g.value.id,"is-post-match":g.value.isPostMatch,onIntersectionChanged:Ce[1]||(Ce[1]=Pe=>X(Pe,-1))},null,8,["game","cover-id","is-post-match"])):r.createCommentVNode("",!0),t.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":F.value.length===0?"30px":"0"})},[d.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",{key:0,class:"new-items-buttons__add-page new-item-button",onClick:Ce[2]||(Ce[2]=Pe=>W(-1))},[...Ce[7]||(Ce[7]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]))],4)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{key:Be,id:`page-${Be+1}`,class:"template-maker__content__main__pages__page"},[r.createElementVNode("div",_ke,[r.createElementVNode("div",Ske,"Pag "+r.toDisplayString(U(Be+2)),1)]),g.value?(r.openBlock(),r.createBlock(l_e,{key:0,page:Pe,"is-template-mode":t.value,"is-post-match":g.value.isPostMatch,game:f.value.game||null,lastGames:f.value.lastGames||[],"is-filter-visible":d.value,onEditView:D,onIntersectionChanged:qe=>X(qe,Be),onChangeSort:Le,onDeletePage:be,onViewChanged:Te,onDeleteView:Oe},null,8,["page","is-template-mode","is-post-match","game","lastGames","is-filter-visible","onIntersectionChanged"])):r.createCommentVNode("",!0),t.value&&!d.value?(r.openBlock(),r.createElementBlock("div",{key:1,class:"new-items-buttons",style:r.normalizeStyle({"margin-bottom":Be+1===F.value.length?"30px":"0","margin-top":"10px"})},[r.createElementVNode("div",{class:"new-items-buttons__add-page new-item-button",onClick:qe=>W(Be)},[...Ce[8]||(Ce[8]=[r.createElementVNode("div",null,"+ Nueva página",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M8.66797 1.33203V5.9987H13.3346",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Tke),r.createElementVNode("div",{class:"new-items-buttons__add-item new-item-button",onClick:qe=>K(Pe)},[...Ce[9]||(Ce[9]=[r.createElementVNode("div",null,"+ Agregar gráfico",-1),r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.createElementVNode("path",{d:"M12 13.3346V6.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M8 13.3346V2.66797",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4 13.332V9.33203",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,kke)],4)):r.createCommentVNode("",!0)],8,wke))),128))]))]),_.value?r.createCommentVNode("",!0):(r.openBlock(),r.createElementBlock("div",Nke,[r.createElementVNode("div",Vke,[r.createElementVNode("div",Oke,[r.createElementVNode("div",null,"Páginas "+r.toDisplayString(O.value),1),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value<=0}]),onClick:Ce[3]||(Ce[3]=Pe=>m.value>0&&j(m.value-1))},[...Ce[10]||(Ce[10]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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),r.createElementVNode("div",{class:r.normalizeClass(["template-maker__content__main__footer__paginator__nav__arrow",{disabled:m.value>=F.value.length}]),onClick:Ce[4]||(Ce[4]=Pe=>m.value<F.value.length&&j(m.value+1))},[...Ce[11]||(Ce[11]=[r.createElementVNode("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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)]),r.createElementVNode("div",Lke,[r.createElementVNode("div",{role:"button",class:r.normalizeClass({active:m.value===0}),onClick:Ce[5]||(Ce[5]=Pe=>j(0))},r.toDisplayString(U(1)),3),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(F.value,(Pe,Be)=>(r.openBlock(),r.createElementBlock("div",{role:"button",key:Be,class:r.normalizeClass({active:Be+1===m.value}),onClick:qe=>j(Be+1)},r.toDisplayString(U(Be+2)),11,Uke))),128))])]),t.value?(r.openBlock(),r.createElementBlock("div",{key:0,role:"button",class:r.normalizeClass(["template-maker__content__main__footer__save save-button",{disabled:!p.value}]),onClick:ye},[...Ce[12]||(Ce[12]=[r.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[r.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"}),r.createElementVNode("path",{d:"M11.3346 14.0013V8.66797H4.66797V14.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"}),r.createElementVNode("path",{d:"M4.66797 2V5.33333H10.0013",stroke:"white","stroke-width":"1.33333","stroke-linecap":"round","stroke-linejoin":"round"})],-1),r.createElementVNode("div",null,"Guardar",-1)])],2)):r.createCommentVNode("",!0)]))])])],4)):r.createCommentVNode("",!0)]))],64))}},zke=Bc(qke,[["__scopeId","data-v-df316ce8"]]);function IN(e,a){return function(){return e.apply(a,arguments)}}const{toString:Cke}=Object.prototype,{getPrototypeOf:O5}=Object,{iterator:_2,toStringTag:XN}=Symbol,S2=(e=>a=>{const i=Cke.call(a);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Ap=e=>(e=e.toLowerCase(),a=>S2(a)===e),T2=e=>a=>typeof a===e,{isArray:Q0}=Array,$0=T2("undefined");function J1(e){return e!==null&&!$0(e)&&e.constructor!==null&&!$0(e.constructor)&&Cd(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const DN=Ap("ArrayBuffer");function Pke(e){let a;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?a=ArrayBuffer.isView(e):a=e&&e.buffer&&DN(e.buffer),a}const Eke=T2("string"),Cd=T2("function"),JN=T2("number"),B1=e=>e!==null&&typeof e=="object",Rke=e=>e===!0||e===!1,k2=e=>{if(S2(e)!=="object")return!1;const a=O5(e);return(a===null||a===Object.prototype||Object.getPrototypeOf(a)===null)&&!(XN in e)&&!(_2 in e)},Wke=e=>{if(!B1(e)||J1(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},Mke=Ap("Date"),Fke=Ap("File"),jke=Ap("Blob"),Kke=Ap("FileList"),Ake=e=>B1(e)&&Cd(e.pipe),Ike=e=>{let a;return e&&(typeof FormData=="function"&&e instanceof FormData||Cd(e.append)&&((a=S2(e))==="formdata"||a==="object"&&Cd(e.toString)&&e.toString()==="[object FormData]"))},Xke=Ap("URLSearchParams"),[Dke,Jke,Bke,Gke]=["ReadableStream","Request","Response","Headers"].map(Ap),Zke=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function G1(e,a,{allOwnKeys:i=!1}={}){if(e===null||typeof e>"u")return;let k,F;if(typeof e!="object"&&(e=[e]),Q0(e))for(k=0,F=e.length;k<F;k++)a.call(null,e[k],k,e);else{if(J1(e))return;const g=i?Object.getOwnPropertyNames(e):Object.keys(e),m=g.length;let n;for(k=0;k<m;k++)n=g[k],a.call(null,e[n],n,e)}}function BN(e,a){if(J1(e))return null;a=a.toLowerCase();const i=Object.keys(e);let k=i.length,F;for(;k-- >0;)if(F=i[k],a===F.toLowerCase())return F;return null}const zm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,GN=e=>!$0(e)&&e!==zm;function L5(){const{caseless:e,skipUndefined:a}=GN(this)&&this||{},i={},k=(F,g)=>{const m=e&&BN(i,g)||g;k2(i[m])&&k2(F)?i[m]=L5(i[m],F):k2(F)?i[m]=L5({},F):Q0(F)?i[m]=F.slice():(!a||!$0(F))&&(i[m]=F)};for(let F=0,g=arguments.length;F<g;F++)arguments[F]&&G1(arguments[F],k);return i}const Hke=(e,a,i,{allOwnKeys:k}={})=>(G1(a,(F,g)=>{i&&Cd(F)?e[g]=IN(F,i):e[g]=F},{allOwnKeys:k}),e),Yke=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Qke=(e,a,i,k)=>{e.prototype=Object.create(a.prototype,k),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:a.prototype}),i&&Object.assign(e.prototype,i)},$ke=(e,a,i,k)=>{let F,g,m;const n={};if(a=a||{},e==null)return a;do{for(F=Object.getOwnPropertyNames(e),g=F.length;g-- >0;)m=F[g],(!k||k(m,e,a))&&!n[m]&&(a[m]=e[m],n[m]=!0);e=i!==!1&&O5(e)}while(e&&(!i||i(e,a))&&e!==Object.prototype);return a},e7e=(e,a,i)=>{e=String(e),(i===void 0||i>e.length)&&(i=e.length),i-=a.length;const k=e.indexOf(a,i);return k!==-1&&k===i},t7e=e=>{if(!e)return null;if(Q0(e))return e;let a=e.length;if(!JN(a))return null;const i=new Array(a);for(;a-- >0;)i[a]=e[a];return i},r7e=(e=>a=>e&&a instanceof e)(typeof Uint8Array<"u"&&O5(Uint8Array)),n7e=(e,a)=>{const k=(e&&e[_2]).call(e);let F;for(;(F=k.next())&&!F.done;){const g=F.value;a.call(e,g[0],g[1])}},a7e=(e,a)=>{let i;const k=[];for(;(i=e.exec(a))!==null;)k.push(i);return k},i7e=Ap("HTMLFormElement"),o7e=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,k,F){return k.toUpperCase()+F}),ZN=(({hasOwnProperty:e})=>(a,i)=>e.call(a,i))(Object.prototype),s7e=Ap("RegExp"),HN=(e,a)=>{const i=Object.getOwnPropertyDescriptors(e),k={};G1(i,(F,g)=>{let m;(m=a(F,g,e))!==!1&&(k[g]=m||F)}),Object.defineProperties(e,k)},l7e=e=>{HN(e,(a,i)=>{if(Cd(e)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const k=e[i];if(Cd(k)){if(a.enumerable=!1,"writable"in a){a.writable=!1;return}a.set||(a.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},c7e=(e,a)=>{const i={},k=F=>{F.forEach(g=>{i[g]=!0})};return Q0(e)?k(e):k(String(e).split(a)),i},u7e=()=>{},d7e=(e,a)=>e!=null&&Number.isFinite(e=+e)?e:a;function p7e(e){return!!(e&&Cd(e.append)&&e[XN]==="FormData"&&e[_2])}const h7e=e=>{const a=new Array(10),i=(k,F)=>{if(B1(k)){if(a.indexOf(k)>=0)return;if(J1(k))return k;if(!("toJSON"in k)){a[F]=k;const g=Q0(k)?[]:{};return G1(k,(m,n)=>{const f=i(m,F+1);!$0(f)&&(g[n]=f)}),a[F]=void 0,g}}return k};return i(e,0)},f7e=Ap("AsyncFunction"),m7e=e=>e&&(B1(e)||Cd(e))&&Cd(e.then)&&Cd(e.catch),YN=((e,a)=>e?setImmediate:a?((i,k)=>(zm.addEventListener("message",({source:F,data:g})=>{F===zm&&g===i&&k.length&&k.shift()()},!1),F=>{k.push(F),zm.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Cd(zm.postMessage)),y7e=typeof queueMicrotask<"u"?queueMicrotask.bind(zm):typeof process<"u"&&process.nextTick||YN,$n={isArray:Q0,isArrayBuffer:DN,isBuffer:J1,isFormData:Ike,isArrayBufferView:Pke,isString:Eke,isNumber:JN,isBoolean:Rke,isObject:B1,isPlainObject:k2,isEmptyObject:Wke,isReadableStream:Dke,isRequest:Jke,isResponse:Bke,isHeaders:Gke,isUndefined:$0,isDate:Mke,isFile:Fke,isBlob:jke,isRegExp:s7e,isFunction:Cd,isStream:Ake,isURLSearchParams:Xke,isTypedArray:r7e,isFileList:Kke,forEach:G1,merge:L5,extend:Hke,trim:Zke,stripBOM:Yke,inherits:Qke,toFlatObject:$ke,kindOf:S2,kindOfTest:Ap,endsWith:e7e,toArray:t7e,forEachEntry:n7e,matchAll:a7e,isHTMLForm:i7e,hasOwnProperty:ZN,hasOwnProp:ZN,reduceDescriptors:HN,freezeMethods:l7e,toObjectSet:c7e,toCamelCase:o7e,noop:u7e,toFiniteNumber:d7e,findKey:BN,global:zm,isContextDefined:GN,isSpecCompliantForm:p7e,toJSONObject:h7e,isAsyncFn:f7e,isThenable:m7e,setImmediate:YN,asap:y7e,isIterable:e=>e!=null&&Cd(e[_2])};function fo(e,a,i,k,F){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",a&&(this.code=a),i&&(this.config=i),k&&(this.request=k),F&&(this.response=F,this.status=F.status?F.status:null)}$n.inherits(fo,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:$n.toJSONObject(this.config),code:this.code,status:this.status}}});const QN=fo.prototype,$N={};["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=>{$N[e]={value:e}}),Object.defineProperties(fo,$N),Object.defineProperty(QN,"isAxiosError",{value:!0}),fo.from=(e,a,i,k,F,g)=>{const m=Object.create(QN);$n.toFlatObject(e,m,function(t){return t!==Error.prototype},l=>l!=="isAxiosError");const n=e&&e.message?e.message:"Error",f=a==null&&e?e.code:a;return fo.call(m,n,f,i,k,F),e&&m.cause==null&&Object.defineProperty(m,"cause",{value:e,configurable:!0}),m.name=e&&e.name||"Error",g&&Object.assign(m,g),m};const g7e=null;function U5(e){return $n.isPlainObject(e)||$n.isArray(e)}function eV(e){return $n.endsWith(e,"[]")?e.slice(0,-2):e}function tV(e,a,i){return e?e.concat(a).map(function(F,g){return F=eV(F),!i&&g?"["+F+"]":F}).join(i?".":""):a}function v7e(e){return $n.isArray(e)&&!e.some(U5)}const b7e=$n.toFlatObject($n,{},null,function(a){return/^is[A-Z]/.test(a)});function N2(e,a,i){if(!$n.isObject(e))throw new TypeError("target must be an object");a=a||new FormData,i=$n.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(o,s){return!$n.isUndefined(s[o])});const k=i.metaTokens,F=i.visitor||t,g=i.dots,m=i.indexes,f=(i.Blob||typeof Blob<"u"&&Blob)&&$n.isSpecCompliantForm(a);if(!$n.isFunction(F))throw new TypeError("visitor must be a function");function l(d){if(d===null)return"";if($n.isDate(d))return d.toISOString();if($n.isBoolean(d))return d.toString();if(!f&&$n.isBlob(d))throw new fo("Blob is not supported. Use a Buffer instead.");return $n.isArrayBuffer(d)||$n.isTypedArray(d)?f&&typeof Blob=="function"?new Blob([d]):Buffer.from(d):d}function t(d,o,s){let h=d;if(d&&!s&&typeof d=="object"){if($n.endsWith(o,"{}"))o=k?o:o.slice(0,-2),d=JSON.stringify(d);else if($n.isArray(d)&&v7e(d)||($n.isFileList(d)||$n.endsWith(o,"[]"))&&(h=$n.toArray(d)))return o=eV(o),h.forEach(function(p,x){!($n.isUndefined(p)||p===null)&&a.append(m===!0?tV([o],x,g):m===null?o:o+"[]",l(p))}),!1}return U5(d)?!0:(a.append(tV(s,o,g),l(d)),!1)}const _=[],v=Object.assign(b7e,{defaultVisitor:t,convertValue:l,isVisitable:U5});function b(d,o){if(!$n.isUndefined(d)){if(_.indexOf(d)!==-1)throw Error("Circular reference detected in "+o.join("."));_.push(d),$n.forEach(d,function(h,c){(!($n.isUndefined(h)||h===null)&&F.call(a,h,$n.isString(c)?c.trim():c,o,v))===!0&&b(h,o?o.concat(c):[c])}),_.pop()}}if(!$n.isObject(e))throw new TypeError("data must be an object");return b(e),a}function rV(e){const a={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(k){return a[k]})}function q5(e,a){this._pairs=[],e&&N2(e,this,a)}const nV=q5.prototype;nV.append=function(a,i){this._pairs.push([a,i])},nV.toString=function(a){const i=a?function(k){return a.call(this,k,rV)}:rV;return this._pairs.map(function(F){return i(F[0])+"="+i(F[1])},"").join("&")};function x7e(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function aV(e,a,i){if(!a)return e;const k=i&&i.encode||x7e;$n.isFunction(i)&&(i={serialize:i});const F=i&&i.serialize;let g;if(F?g=F(a,i):g=$n.isURLSearchParams(a)?a.toString():new q5(a,i).toString(k),g){const m=e.indexOf("#");m!==-1&&(e=e.slice(0,m)),e+=(e.indexOf("?")===-1?"?":"&")+g}return e}class iV{constructor(){this.handlers=[]}use(a,i,k){return this.handlers.push({fulfilled:a,rejected:i,synchronous:k?k.synchronous:!1,runWhen:k?k.runWhen:null}),this.handlers.length-1}eject(a){this.handlers[a]&&(this.handlers[a]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(a){$n.forEach(this.handlers,function(k){k!==null&&a(k)})}}const oV={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},w7e={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:q5,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},z5=typeof window<"u"&&typeof document<"u",C5=typeof navigator=="object"&&navigator||void 0,_7e=z5&&(!C5||["ReactNative","NativeScript","NS"].indexOf(C5.product)<0),S7e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",T7e=z5&&window.location.href||"http://localhost",Gu={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:z5,hasStandardBrowserEnv:_7e,hasStandardBrowserWebWorkerEnv:S7e,navigator:C5,origin:T7e},Symbol.toStringTag,{value:"Module"})),...w7e};function k7e(e,a){return N2(e,new Gu.classes.URLSearchParams,{visitor:function(i,k,F,g){return Gu.isNode&&$n.isBuffer(i)?(this.append(k,i.toString("base64")),!1):g.defaultVisitor.apply(this,arguments)},...a})}function N7e(e){return $n.matchAll(/\w+|\[(\w*)]/g,e).map(a=>a[0]==="[]"?"":a[1]||a[0])}function V7e(e){const a={},i=Object.keys(e);let k;const F=i.length;let g;for(k=0;k<F;k++)g=i[k],a[g]=e[g];return a}function sV(e){function a(i,k,F,g){let m=i[g++];if(m==="__proto__")return!0;const n=Number.isFinite(+m),f=g>=i.length;return m=!m&&$n.isArray(F)?F.length:m,f?($n.hasOwnProp(F,m)?F[m]=[F[m],k]:F[m]=k,!n):((!F[m]||!$n.isObject(F[m]))&&(F[m]=[]),a(i,k,F[m],g)&&$n.isArray(F[m])&&(F[m]=V7e(F[m])),!n)}if($n.isFormData(e)&&$n.isFunction(e.entries)){const i={};return $n.forEachEntry(e,(k,F)=>{a(N7e(k),F,i,0)}),i}return null}function O7e(e,a,i){if($n.isString(e))try{return(a||JSON.parse)(e),$n.trim(e)}catch(k){if(k.name!=="SyntaxError")throw k}return(i||JSON.stringify)(e)}const Z1={transitional:oV,adapter:["xhr","http","fetch"],transformRequest:[function(a,i){const k=i.getContentType()||"",F=k.indexOf("application/json")>-1,g=$n.isObject(a);if(g&&$n.isHTMLForm(a)&&(a=new FormData(a)),$n.isFormData(a))return F?JSON.stringify(sV(a)):a;if($n.isArrayBuffer(a)||$n.isBuffer(a)||$n.isStream(a)||$n.isFile(a)||$n.isBlob(a)||$n.isReadableStream(a))return a;if($n.isArrayBufferView(a))return a.buffer;if($n.isURLSearchParams(a))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),a.toString();let n;if(g){if(k.indexOf("application/x-www-form-urlencoded")>-1)return k7e(a,this.formSerializer).toString();if((n=$n.isFileList(a))||k.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return N2(n?{"files[]":a}:a,f&&new f,this.formSerializer)}}return g||F?(i.setContentType("application/json",!1),O7e(a)):a}],transformResponse:[function(a){const i=this.transitional||Z1.transitional,k=i&&i.forcedJSONParsing,F=this.responseType==="json";if($n.isResponse(a)||$n.isReadableStream(a))return a;if(a&&$n.isString(a)&&(k&&!this.responseType||F)){const m=!(i&&i.silentJSONParsing)&&F;try{return JSON.parse(a,this.parseReviver)}catch(n){if(m)throw n.name==="SyntaxError"?fo.from(n,fo.ERR_BAD_RESPONSE,this,null,this.response):n}}return a}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gu.classes.FormData,Blob:Gu.classes.Blob},validateStatus:function(a){return a>=200&&a<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};$n.forEach(["delete","get","head","post","put","patch"],e=>{Z1.headers[e]={}});const L7e=$n.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"]),U7e=e=>{const a={};let i,k,F;return e&&e.split(`
|
|
4127
4127
|
`).forEach(function(m){F=m.indexOf(":"),i=m.substring(0,F).trim().toLowerCase(),k=m.substring(F+1).trim(),!(!i||a[i]&&L7e[i])&&(i==="set-cookie"?a[i]?a[i].push(k):a[i]=[k]:a[i]=a[i]?a[i]+", "+k:k)}),a},lV=Symbol("internals");function H1(e){return e&&String(e).trim().toLowerCase()}function V2(e){return e===!1||e==null?e:$n.isArray(e)?e.map(V2):String(e)}function q7e(e){const a=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let k;for(;k=i.exec(e);)a[k[1]]=k[2];return a}const z7e=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function P5(e,a,i,k,F){if($n.isFunction(k))return k.call(this,a,i);if(F&&(a=i),!!$n.isString(a)){if($n.isString(k))return a.indexOf(k)!==-1;if($n.isRegExp(k))return k.test(a)}}function C7e(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(a,i,k)=>i.toUpperCase()+k)}function P7e(e,a){const i=$n.toCamelCase(" "+a);["get","set","has"].forEach(k=>{Object.defineProperty(e,k+i,{value:function(F,g,m){return this[k].call(this,a,F,g,m)},configurable:!0})})}let Pd=class{constructor(a){a&&this.set(a)}set(a,i,k){const F=this;function g(n,f,l){const t=H1(f);if(!t)throw new Error("header name must be a non-empty string");const _=$n.findKey(F,t);(!_||F[_]===void 0||l===!0||l===void 0&&F[_]!==!1)&&(F[_||f]=V2(n))}const m=(n,f)=>$n.forEach(n,(l,t)=>g(l,t,f));if($n.isPlainObject(a)||a instanceof this.constructor)m(a,i);else if($n.isString(a)&&(a=a.trim())&&!z7e(a))m(U7e(a),i);else if($n.isObject(a)&&$n.isIterable(a)){let n={},f,l;for(const t of a){if(!$n.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[l=t[0]]=(f=n[l])?$n.isArray(f)?[...f,t[1]]:[f,t[1]]:t[1]}m(n,i)}else a!=null&&g(i,a,k);return this}get(a,i){if(a=H1(a),a){const k=$n.findKey(this,a);if(k){const F=this[k];if(!i)return F;if(i===!0)return q7e(F);if($n.isFunction(i))return i.call(this,F,k);if($n.isRegExp(i))return i.exec(F);throw new TypeError("parser must be boolean|regexp|function")}}}has(a,i){if(a=H1(a),a){const k=$n.findKey(this,a);return!!(k&&this[k]!==void 0&&(!i||P5(this,this[k],k,i)))}return!1}delete(a,i){const k=this;let F=!1;function g(m){if(m=H1(m),m){const n=$n.findKey(k,m);n&&(!i||P5(k,k[n],n,i))&&(delete k[n],F=!0)}}return $n.isArray(a)?a.forEach(g):g(a),F}clear(a){const i=Object.keys(this);let k=i.length,F=!1;for(;k--;){const g=i[k];(!a||P5(this,this[g],g,a,!0))&&(delete this[g],F=!0)}return F}normalize(a){const i=this,k={};return $n.forEach(this,(F,g)=>{const m=$n.findKey(k,g);if(m){i[m]=V2(F),delete i[g];return}const n=a?C7e(g):String(g).trim();n!==g&&delete i[g],i[n]=V2(F),k[n]=!0}),this}concat(...a){return this.constructor.concat(this,...a)}toJSON(a){const i=Object.create(null);return $n.forEach(this,(k,F)=>{k!=null&&k!==!1&&(i[F]=a&&$n.isArray(k)?k.join(", "):k)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([a,i])=>a+": "+i).join(`
|
|
4128
4128
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(a){return a instanceof this?a:new this(a)}static concat(a,...i){const k=new this(a);return i.forEach(F=>k.set(F)),k}static accessor(a){const k=(this[lV]=this[lV]={accessors:{}}).accessors,F=this.prototype;function g(m){const n=H1(m);k[n]||(P7e(F,m),k[n]=!0)}return $n.isArray(a)?a.forEach(g):g(a),this}};Pd.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),$n.reduceDescriptors(Pd.prototype,({value:e},a)=>{let i=a[0].toUpperCase()+a.slice(1);return{get:()=>e,set(k){this[i]=k}}}),$n.freezeMethods(Pd);function E5(e,a){const i=this||Z1,k=a||i,F=Pd.from(k.headers);let g=k.data;return $n.forEach(e,function(n){g=n.call(i,g,F.normalize(),a?a.status:void 0)}),F.normalize(),g}function cV(e){return!!(e&&e.__CANCEL__)}function ey(e,a,i){fo.call(this,e??"canceled",fo.ERR_CANCELED,a,i),this.name="CanceledError"}$n.inherits(ey,fo,{__CANCEL__:!0});function uV(e,a,i){const k=i.config.validateStatus;!i.status||!k||k(i.status)?e(i):a(new fo("Request failed with status code "+i.status,[fo.ERR_BAD_REQUEST,fo.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function E7e(e){const a=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return a&&a[1]||""}function R7e(e,a){e=e||10;const i=new Array(e),k=new Array(e);let F=0,g=0,m;return a=a!==void 0?a:1e3,function(f){const l=Date.now(),t=k[g];m||(m=l),i[F]=f,k[F]=l;let _=g,v=0;for(;_!==F;)v+=i[_++],_=_%e;if(F=(F+1)%e,F===g&&(g=(g+1)%e),l-m<a)return;const b=t&&l-t;return b?Math.round(v*1e3/b):void 0}}function W7e(e,a){let i=0,k=1e3/a,F,g;const m=(l,t=Date.now())=>{i=t,F=null,g&&(clearTimeout(g),g=null),e(...l)};return[(...l)=>{const t=Date.now(),_=t-i;_>=k?m(l,t):(F=l,g||(g=setTimeout(()=>{g=null,m(F)},k-_)))},()=>F&&m(F)]}const O2=(e,a,i=3)=>{let k=0;const F=R7e(50,250);return W7e(g=>{const m=g.loaded,n=g.lengthComputable?g.total:void 0,f=m-k,l=F(f),t=m<=n;k=m;const _={loaded:m,total:n,progress:n?m/n:void 0,bytes:f,rate:l||void 0,estimated:l&&n&&t?(n-m)/l:void 0,event:g,lengthComputable:n!=null,[a?"download":"upload"]:!0};e(_)},i)},dV=(e,a)=>{const i=e!=null;return[k=>a[0]({lengthComputable:i,total:e,loaded:k}),a[1]]},pV=e=>(...a)=>$n.asap(()=>e(...a)),M7e=Gu.hasStandardBrowserEnv?((e,a)=>i=>(i=new URL(i,Gu.origin),e.protocol===i.protocol&&e.host===i.host&&(a||e.port===i.port)))(new URL(Gu.origin),Gu.navigator&&/(msie|trident)/i.test(Gu.navigator.userAgent)):()=>!0,F7e=Gu.hasStandardBrowserEnv?{write(e,a,i,k,F,g,m){if(typeof document>"u")return;const n=[`${e}=${encodeURIComponent(a)}`];$n.isNumber(i)&&n.push(`expires=${new Date(i).toUTCString()}`),$n.isString(k)&&n.push(`path=${k}`),$n.isString(F)&&n.push(`domain=${F}`),g===!0&&n.push("secure"),$n.isString(m)&&n.push(`SameSite=${m}`),document.cookie=n.join("; ")},read(e){if(typeof document>"u")return null;const a=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return a?decodeURIComponent(a[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function j7e(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function K7e(e,a){return a?e.replace(/\/?\/$/,"")+"/"+a.replace(/^\/+/,""):e}function hV(e,a,i){let k=!j7e(a);return e&&(k||i==!1)?K7e(e,a):a}const fV=e=>e instanceof Pd?{...e}:e;function Cm(e,a){a=a||{};const i={};function k(l,t,_,v){return $n.isPlainObject(l)&&$n.isPlainObject(t)?$n.merge.call({caseless:v},l,t):$n.isPlainObject(t)?$n.merge({},t):$n.isArray(t)?t.slice():t}function F(l,t,_,v){if($n.isUndefined(t)){if(!$n.isUndefined(l))return k(void 0,l,_,v)}else return k(l,t,_,v)}function g(l,t){if(!$n.isUndefined(t))return k(void 0,t)}function m(l,t){if($n.isUndefined(t)){if(!$n.isUndefined(l))return k(void 0,l)}else return k(void 0,t)}function n(l,t,_){if(_ in a)return k(l,t);if(_ in e)return k(void 0,l)}const f={url:g,method:g,data:g,baseURL:m,transformRequest:m,transformResponse:m,paramsSerializer:m,timeout:m,timeoutMessage:m,withCredentials:m,withXSRFToken:m,adapter:m,responseType:m,xsrfCookieName:m,xsrfHeaderName:m,onUploadProgress:m,onDownloadProgress:m,decompress:m,maxContentLength:m,maxBodyLength:m,beforeRedirect:m,transport:m,httpAgent:m,httpsAgent:m,cancelToken:m,socketPath:m,responseEncoding:m,validateStatus:n,headers:(l,t,_)=>F(fV(l),fV(t),_,!0)};return $n.forEach(Object.keys({...e,...a}),function(t){const _=f[t]||F,v=_(e[t],a[t],t);$n.isUndefined(v)&&_!==n||(i[t]=v)}),i}const mV=e=>{const a=Cm({},e);let{data:i,withXSRFToken:k,xsrfHeaderName:F,xsrfCookieName:g,headers:m,auth:n}=a;if(a.headers=m=Pd.from(m),a.url=aV(hV(a.baseURL,a.url,a.allowAbsoluteUrls),e.params,e.paramsSerializer),n&&m.set("Authorization","Basic "+btoa((n.username||"")+":"+(n.password?unescape(encodeURIComponent(n.password)):""))),$n.isFormData(i)){if(Gu.hasStandardBrowserEnv||Gu.hasStandardBrowserWebWorkerEnv)m.setContentType(void 0);else if($n.isFunction(i.getHeaders)){const f=i.getHeaders(),l=["content-type","content-length"];Object.entries(f).forEach(([t,_])=>{l.includes(t.toLowerCase())&&m.set(t,_)})}}if(Gu.hasStandardBrowserEnv&&(k&&$n.isFunction(k)&&(k=k(a)),k||k!==!1&&M7e(a.url))){const f=F&&g&&F7e.read(g);f&&m.set(F,f)}return a},A7e=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(i,k){const F=mV(e);let g=F.data;const m=Pd.from(F.headers).normalize();let{responseType:n,onUploadProgress:f,onDownloadProgress:l}=F,t,_,v,b,d;function o(){b&&b(),d&&d(),F.cancelToken&&F.cancelToken.unsubscribe(t),F.signal&&F.signal.removeEventListener("abort",t)}let s=new XMLHttpRequest;s.open(F.method.toUpperCase(),F.url,!0),s.timeout=F.timeout;function h(){if(!s)return;const p=Pd.from("getAllResponseHeaders"in s&&s.getAllResponseHeaders()),w={data:!n||n==="text"||n==="json"?s.responseText:s.response,status:s.status,statusText:s.statusText,headers:p,config:e,request:s};uV(function(V){i(V),o()},function(V){k(V),o()},w),s=null}"onloadend"in s?s.onloadend=h:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(h)},s.onabort=function(){s&&(k(new fo("Request aborted",fo.ECONNABORTED,e,s)),s=null)},s.onerror=function(x){const w=x&&x.message?x.message:"Network Error",T=new fo(w,fo.ERR_NETWORK,e,s);T.event=x||null,k(T),s=null},s.ontimeout=function(){let x=F.timeout?"timeout of "+F.timeout+"ms exceeded":"timeout exceeded";const w=F.transitional||oV;F.timeoutErrorMessage&&(x=F.timeoutErrorMessage),k(new fo(x,w.clarifyTimeoutError?fo.ETIMEDOUT:fo.ECONNABORTED,e,s)),s=null},g===void 0&&m.setContentType(null),"setRequestHeader"in s&&$n.forEach(m.toJSON(),function(x,w){s.setRequestHeader(w,x)}),$n.isUndefined(F.withCredentials)||(s.withCredentials=!!F.withCredentials),n&&n!=="json"&&(s.responseType=F.responseType),l&&([v,d]=O2(l,!0),s.addEventListener("progress",v)),f&&s.upload&&([_,b]=O2(f),s.upload.addEventListener("progress",_),s.upload.addEventListener("loadend",b)),(F.cancelToken||F.signal)&&(t=p=>{s&&(k(!p||p.type?new ey(null,e,s):p),s.abort(),s=null)},F.cancelToken&&F.cancelToken.subscribe(t),F.signal&&(F.signal.aborted?t():F.signal.addEventListener("abort",t)));const c=E7e(F.url);if(c&&Gu.protocols.indexOf(c)===-1){k(new fo("Unsupported protocol "+c+":",fo.ERR_BAD_REQUEST,e));return}s.send(g||null)})},I7e=(e,a)=>{const{length:i}=e=e?e.filter(Boolean):[];if(a||i){let k=new AbortController,F;const g=function(l){if(!F){F=!0,n();const t=l instanceof Error?l:this.reason;k.abort(t instanceof fo?t:new ey(t instanceof Error?t.message:t))}};let m=a&&setTimeout(()=>{m=null,g(new fo(`timeout ${a} of ms exceeded`,fo.ETIMEDOUT))},a);const n=()=>{e&&(m&&clearTimeout(m),m=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(g):l.removeEventListener("abort",g)}),e=null)};e.forEach(l=>l.addEventListener("abort",g));const{signal:f}=k;return f.unsubscribe=()=>$n.asap(n),f}},X7e=function*(e,a){let i=e.byteLength;if(i<a){yield e;return}let k=0,F;for(;k<i;)F=k+a,yield e.slice(k,F),k=F},D7e=async function*(e,a){for await(const i of J7e(e))yield*X7e(i,a)},J7e=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const a=e.getReader();try{for(;;){const{done:i,value:k}=await a.read();if(i)break;yield k}}finally{await a.cancel()}},yV=(e,a,i,k)=>{const F=D7e(e,a);let g=0,m,n=f=>{m||(m=!0,k&&k(f))};return new ReadableStream({async pull(f){try{const{done:l,value:t}=await F.next();if(l){n(),f.close();return}let _=t.byteLength;if(i){let v=g+=_;i(v)}f.enqueue(new Uint8Array(t))}catch(l){throw n(l),l}},cancel(f){return n(f),F.return()}},{highWaterMark:2})},gV=64*1024,{isFunction:L2}=$n,B7e=(({Request:e,Response:a})=>({Request:e,Response:a}))($n.global),{ReadableStream:vV,TextEncoder:bV}=$n.global,xV=(e,...a)=>{try{return!!e(...a)}catch{return!1}},G7e=e=>{e=$n.merge.call({skipUndefined:!0},B7e,e);const{fetch:a,Request:i,Response:k}=e,F=a?L2(a):typeof fetch=="function",g=L2(i),m=L2(k);if(!F)return!1;const n=F&&L2(vV),f=F&&(typeof bV=="function"?(d=>o=>d.encode(o))(new bV):async d=>new Uint8Array(await new i(d).arrayBuffer())),l=g&&n&&xV(()=>{let d=!1;const o=new i(Gu.origin,{body:new vV,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!o}),t=m&&n&&xV(()=>$n.isReadableStream(new k("").body)),_={stream:t&&(d=>d.body)};F&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!_[d]&&(_[d]=(o,s)=>{let h=o&&o[d];if(h)return h.call(o);throw new fo(`Response type '${d}' is not supported`,fo.ERR_NOT_SUPPORT,s)})});const v=async d=>{if(d==null)return 0;if($n.isBlob(d))return d.size;if($n.isSpecCompliantForm(d))return(await new i(Gu.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if($n.isArrayBufferView(d)||$n.isArrayBuffer(d))return d.byteLength;if($n.isURLSearchParams(d)&&(d=d+""),$n.isString(d))return(await f(d)).byteLength},b=async(d,o)=>{const s=$n.toFiniteNumber(d.getContentLength());return s??v(o)};return async d=>{let{url:o,method:s,data:h,signal:c,cancelToken:p,timeout:x,onDownloadProgress:w,onUploadProgress:T,responseType:V,headers:O,withCredentials:U="same-origin",fetchOptions:z}=mV(d),L=a||fetch;V=V?(V+"").toLowerCase():"text";let C=I7e([c,p&&p.toAbortSignal()],x),q=null;const N=C&&C.unsubscribe&&(()=>{C.unsubscribe()});let P;try{if(T&&l&&s!=="get"&&s!=="head"&&(P=await b(O,h))!==0){let X=new i(o,{method:"POST",body:h,duplex:"half"}),D;if($n.isFormData(h)&&(D=X.headers.get("content-type"))&&O.setContentType(D),X.body){const[H,re]=dV(P,O2(pV(T)));h=yV(X.body,gV,H,re)}}$n.isString(U)||(U=U?"include":"omit");const S=g&&"credentials"in i.prototype,E={...z,signal:C,method:s.toUpperCase(),headers:O.normalize().toJSON(),body:h,duplex:"half",credentials:S?U:void 0};q=g&&new i(o,E);let W=await(g?L(q,z):L(o,E));const j=t&&(V==="stream"||V==="response");if(t&&(w||j&&N)){const X={};["status","statusText","headers"].forEach(B=>{X[B]=W[B]});const D=$n.toFiniteNumber(W.headers.get("content-length")),[H,re]=w&&dV(D,O2(pV(w),!0))||[];W=new k(yV(W.body,gV,H,()=>{re&&re(),N&&N()}),X)}V=V||"text";let K=await _[$n.findKey(_,V)||"text"](W,d);return!j&&N&&N(),await new Promise((X,D)=>{uV(X,D,{data:K,headers:Pd.from(W.headers),status:W.status,statusText:W.statusText,config:d,request:q})})}catch(S){throw N&&N(),S&&S.name==="TypeError"&&/Load failed|fetch/i.test(S.message)?Object.assign(new fo("Network Error",fo.ERR_NETWORK,d,q),{cause:S.cause||S}):fo.from(S,S&&S.code,d,q)}}},Z7e=new Map,wV=e=>{let a=e&&e.env||{};const{fetch:i,Request:k,Response:F}=a,g=[k,F,i];let m=g.length,n=m,f,l,t=Z7e;for(;n--;)f=g[n],l=t.get(f),l===void 0&&t.set(f,l=n?new Map:G7e(a)),t=l;return l};wV();const R5={http:g7e,xhr:A7e,fetch:{get:wV}};$n.forEach(R5,(e,a)=>{if(e){try{Object.defineProperty(e,"name",{value:a})}catch{}Object.defineProperty(e,"adapterName",{value:a})}});const _V=e=>`- ${e}`,H7e=e=>$n.isFunction(e)||e===null||e===!1;function Y7e(e,a){e=$n.isArray(e)?e:[e];const{length:i}=e;let k,F;const g={};for(let m=0;m<i;m++){k=e[m];let n;if(F=k,!H7e(k)&&(F=R5[(n=String(k)).toLowerCase()],F===void 0))throw new fo(`Unknown adapter '${n}'`);if(F&&($n.isFunction(F)||(F=F.get(a))))break;g[n||"#"+m]=F}if(!F){const m=Object.entries(g).map(([f,l])=>`adapter ${f} `+(l===!1?"is not supported by the environment":"is not available in the build"));let n=i?m.length>1?`since :
|
|
4129
4129
|
`+m.map(_V).join(`
|