import{b7 as M,r as m,O as q,c as A,ca as x,Q as z,aY as a,aT as o,a$ as e,b9 as T,b0 as n,bg as _,bh as p,N as v,bf as $,bc as k,bq as H,bo as O,p as Q,aX as W}from"./index-xnhGKCfe.js";import{_ as X}from"./index.vue_vue_type_style_index_0_lang-9szultRB.js";import{C as Y,R as j}from"./index-BprM6Ssl.js";import{u as G}from"./index-DsQfWyiL.js";import{b as J,a as K}from"./main.vue_vue_type_style_index_0_scoped_cf719de6_lang-BLJh8Idj.js";import"./currency-DTUBf2lI.js";import"./dragon-65oA2ftS.js";import"./useWorkerIntervalFn.hook-BuwsgSxq.js";/* empty css              *//* empty css              */import"./tips-DJIxz9GI.js";import"./trxWingo-CmIrGfKh.js";import"./downIcon-Cn_QdKhc.js";import"./index-D09RZK4J.js";import"./index-BaI210iY.js";const U={class:"t"},Z={class:"t-b1"},ee={class:"t-b1-l w"},te={class:"w"},se={class:"t-b1-l"},ae={class:"t-b1-l-n"},oe={class:"t-b1-l"},ne={class:"t-b1-l-n"},le={class:"t-b1-l"},ie={class:"t-b1-l-n"},ce={class:"t-b1-l"},re={class:"t-b1-l-n"},ue={class:"t-b2"},de=["IssueNumber","Number","Colour","rowId"],ve={class:"t-b2-i"},me={class:"t-b2-Num"},_e=["id"],pe={key:0,class:"flex-center t-b2-loading",style:{height:"100%"}},be={key:1,class:"t-b2-empty flex-center"},ge={key:0,class:"t-foot"},he={class:"t-foot-page"},fe=M({__name:"trend",setup(ye){const{historyIssues:L,gameCode:B,historyIssuesTotalPage:I}=G(),S=m([]),r=A(()=>S.value.length?S.value:L.value),b=m([]),i=m(1),E=m(10),h=m(!1),g=m(I.value);function f(){Q(()=>{for(let t=0;t<r.value.length;t++)r.value[t+1]&&R(t,r.value[t],r.value[t+1])})}function R(t,u,y){const C=parseInt(u.number),N=parseInt(y.number),d=document.getElementById("myCanvas"+t);if(d&&d.getContext){const c=d.getContext("2d");c.clearRect(0,0,d.width,d.height),c.beginPath(),c.moveTo(C==0?20:C*29+20,0),c.lineTo(N==0?20:N*29+20,d.height),c.strokeStyle="red",c.stroke(),c.closePath()}}const D=()=>{i.value<2||(i.value--,P())},V=()=>{i.value++,!(i.value>g.value)&&P()},F=async()=>{const{result:t,data:u}=await J({gameCode:B.value,pageNo:i.value,pageSize:10});t&&(b.value=u)},P=async()=>{try{h.value=!0;const{result:t,data:u}=await K({gameCode:B.value,pageNo:i.value,pageSize:E.value});t&&(S.value=u.list||[],i.value=u.pageNo||1,g.value=u.totalPage||0)}catch{}finally{h.value=!1}};return q(async()=>{r.value.length&&f(),await F()}),x(()=>{f()}),z(r,()=>{f()}),x(()=>{f()}),z(I,()=>{g.value=I.value}),(t,u)=>{const y=Y,C=j,N=H,d=X,c=O;return o(),a("div",U,[e("div",Z,[e("div",ee,[e("span",te,n(t.$t("common.w8")),1),e("span",null,n(t.$t("common.w9")),1)]),e("div",se,[e("div",null,n(t.$t("common.w12")),1),e("div",ae,[(o(!0),a(_,null,p(b.value,(s,l)=>(o(),a("div",{key:"4"+l},n(s.missingCount),1))),128))])]),e("div",oe,[e("div",null,n(t.$t("common.w13")),1),e("div",ne,[(o(!0),a(_,null,p(b.value,(s,l)=>(o(),a("div",{key:"2"+l},n(s.avgMissing),1))),128))])]),e("div",le,[e("div",null,n(t.$t("common.w14")),1),e("div",ie,[(o(!0),a(_,null,p(b.value,(s,l)=>(o(),a("div",{key:"5"+l},n(s.openCount),1))),128))])]),e("div",ce,[e("div",null,n(t.$t("common.w15")),1),e("div",re,[(o(!0),a(_,null,p(b.value,(s,l)=>(o(),a("div",{key:"3"+l},n(s.maxContinuous),1))),128))])])]),e("div",ue,[(o(!0),a(_,null,p(r.value,(s,l)=>(o(),a("div",{key:l,IssueNumber:s.issueNumber,Number:s.number,Colour:s.colour,rowId:l,class:"t-b2-item"},[v(C,null,{default:$(()=>[v(y,{span:"9"},{default:$(()=>[e("div",ve,n(s.issueNumber),1)]),_:2},1024),v(y,{span:"15"},{default:$(()=>[e("div",me,[e("canvas",{id:"myCanvas"+l,ref_for:!0,ref:"canvas",class:"line-canvas"},null,8,_e),(o(),a(_,null,p(10,w=>e("div",{class:k(["t-b2-Num-item",Number(s.number)==w-1?"action"+(w-1):""]),key:w},n(w-1),3)),64)),e("div",{class:k(["t-b2-Num-BS",{isB:Number(s.number)>4}])},n(Number(s.number)>4?"B":"S"),3)])]),_:2},1024)]),_:2},1024)],8,de))),128)),h.value?(o(),a("div",pe,[v(N,{type:"spinner",color:"#FD565C"})])):T("",!0),r.value.length===0&&!h.value?(o(),a("div",be,[v(d)])):T("",!0)]),r.value.length?(o(),a("div",ge,[e("div",{class:k(["t-foot-previous",{disabled:i.value<=1}]),onClick:D},[v(c,{name:"arrow-left",class:"t-icon",size:"20"})],2),e("div",he,n(i.value)+"/"+n(g.value),1),e("div",{class:k(["t-foot-next",{disabled:i.value>=g.value}]),onClick:V},[v(c,{name:"arrow",class:"t-icon",size:"20"})],2)])):T("",!0)])}}}),De=W(fe,[["__scopeId","data-v-db1e2c01"]]);export{De as default};
