import{D as e,H as t,S as n,U as r,V as i,g as a,k as o,y as s,z as c}from"./vendor-vue-DQuhj895.js";import{i as l,t as u}from"./championStatistics-CCHjRJM3.js";import{n as d}from"./teamMemberRole-BdsZIh6l.js";import{o as f,t as p}from"./utils-CI131Z9l.js";var m=[];for(let e=0;e<256;++e)m.push((e+256).toString(16).slice(1));function h(e,t=0){return(m[e[t+0]]+m[e[t+1]]+m[e[t+2]]+m[e[t+3]]+`-`+m[e[t+4]]+m[e[t+5]]+`-`+m[e[t+6]]+m[e[t+7]]+`-`+m[e[t+8]]+m[e[t+9]]+`-`+m[e[t+10]]+m[e[t+11]]+m[e[t+12]]+m[e[t+13]]+m[e[t+14]]+m[e[t+15]]).toLowerCase()}var g=new Uint8Array(16);function _(){return crypto.getRandomValues(g)}function v(e,t,n){return!t&&!e&&crypto.randomUUID?crypto.randomUUID():y(e,t,n)}function y(e,t,n){e||={};let r=e.random??e.rng?.()??_();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return h(r)}var b=[`id`],x=`system-ui`,S=d(n({__name:`ChampionStats`,props:{stats:{},playerName:{},championName:{},width:{},textStyling:{},colorStyling:{},durationInSeconds:{},valueDisplay:{default:()=>l.Percentage},minSampleGames:{default:()=>5}},setup(n){let l=c(!1),d=v(),m=n.textStyling?.fontSize??`1rem`,h=n.textStyling?.textColor??`white`;return e(()=>{setTimeout(()=>{l.value=!0},1e3),setTimeout(()=>{l.value=!1},n.durationInSeconds?n.durationInSeconds*1e3+1e3:7500);let e=document.getElementById(d),t=e.getContext(`2d`);t.fillStyle=f(h).background??`white`,t.textBaseline=`top`,t.letterSpacing=`0rem`,t.font=`${m} ${x}`;let r=u(n.stats,n.valueDisplay,n.minSampleGames),i=30;i+=p(e,t,r.presence,`900 system-ui`,10,i,80),i+=10,i+=p(e,t,`Pick/Ban`,`system-ui`,10,i,50),i+=80,t.fillText(r.pick,20,i,e.width),i+=25,t.fillText(`Pick`,20,i,e.width),i+=40,t.fillText(r.win,20,i,e.width),i+=25,t.fillText(r.showRecord?`Record`:`Win`,20,i,e.width),t.textBaseline=`bottom`,t.fillText(n.playerName,20,e.height-10,e.width),t.save(),t.translate(e.width,e.height),t.rotate(-Math.PI/2),t.textAlign=`left`,t.font=`30px system-ui`,t.fillText(n.championName??``,50,-10,e.width),t.restore()}),(e,c)=>(o(),s(`div`,{class:t([`absolute champ-stats`,{show:l.value}]),style:r(i(f)(n.colorStyling))},[a(`canvas`,{id:i(d),width:`200`,height:`400`,class:`h-full`,style:r({width:n.width})},null,12,b)],6))}}),[[`__scopeId`,`data-v-38110bbf`]]);export{S as t};