import{a as e,f as r,x as t,r as n,y as o}from"./index-4c745ab9.js";import{U as a}from"./vendor-edc0678f.js";const i=(t,n,o)=>{switch(t){case 1:return a(new Date).add(n||0,"day").format("DD/MM/YYYY");case 2:return r("daily_settlement");case 3:const t=e();return a(o).add(n||0,"day").tz(t.timezone).format("DD/MM/YYYY HH:mm:ss")}},s=e=>{switch(e){case 0:return{color:"#2654FF",name:r("In_position")};case 1:return{color:"#838B9C",name:r("Settled")};case 2:return{color:"#17AC74",name:r("host_redeemed")}}},c=(e,r)=>e.slice().sort((e,t)=>e[r].toLowerCase().localeCompare(t[r].toLowerCase())),u=(e,r)=>e.slice().sort((e,t)=>t[r].toLowerCase().localeCompare(e[r].toLowerCase())),l=(e,r,n,o=0)=>{if(o){e.forEach(e=>{var o,a;switch(t(null==(o=r[e.coin])?void 0:o.open,null==(a=r[e.coin])?void 0:a.close)){case"rise":default:e.latestPrice=Number(r[e.coin][n]);break;case"fall":e.latestPrice=-Number(r[e.coin][n])}});a=e}else var a=e.map(function(e){return{...e,latestPrice:r[e.coin][n]?Number(r[e.coin][n]):0}});return a.slice(0).sort(function(e,r){return e.latestPrice-r.latestPrice})},f=(e,r,n,o=0)=>{if(o){e.forEach(e=>{var o,a;switch(t(null==(o=r[e.coin])?void 0:o.open,null==(a=r[e.coin])?void 0:a.close)){case"rise":default:e.latestPrice=Number(r[e.coin][n]);break;case"fall":e.latestPrice=-Number(r[e.coin][n])}});a=e}else var a=e.map(function(e){return{...e,latestPrice:r[e.coin][n]?Number(r[e.coin][n]):0}});return a.slice(0).sort(function(e,r){return r.latestPrice-e.latestPrice})},m=(e,r)=>e.filter(function(e){return 2===e.customizeFlag?-1!==e.showSymbol.indexOf(r.toUpperCase()):-1!==e.coin.indexOf(r.toLowerCase())}),d=(e,r,t)=>{let n=[];return n=r.length?2==t?e.filter((e,t)=>-1!==e.coin.indexOf(r.toLowerCase())):e.filter((e,t)=>-1!==e.showSymbol.indexOf(r.toUpperCase())):e,n},h=e=>{e=Math.round(Number(e));const r=Math.floor(e/60).toString().padStart(2,"0"),t=(e%60).toString().padStart(2,"0");return"".concat(r,":").concat(t)},p=e=>{e=Math.round(Number(e));const r=Math.floor(e/3600),t=Math.floor((e-3600*r)/60),n=e-3600*r-60*t;return"".concat(r.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"))},b=(e,r)=>{let t=[];return e.length>0?(e.forEach(e=>{e.symbol===r&&t.push(e)}),t):e},g=(e,r,t,o,a,i)=>{r=Number(r),t=Number(t),o=Number(o);const s=n(o,a);if(i)if(e){if(r>t)return"-"+o;if(r===t)return"0.00";if(r<t)return"+"+s}else{if(r>t)return"+"+s;if(r===t)return"0.00";if(r<t)return"-"+o}else if(e){if(r>t)return"-"+s;if(r===t)return"0.00";if(r<t)return"+"+s}else{if(r>t)return"+"+s;if(r===t)return"0.00";if(r<t)return"-"+s}},w=(e,r,t)=>{if(r=Number(r),t=Number(t),e){if(r>t)return"hightDown";if(r===t)return"";if(r<t)return"hightUp"}else{if(r>t)return"hightUp";if(r===t)return"";if(r<t)return"hightDown"}},N=(e,r)=>e>r?"-"+o(e,r):e===r?0:e<r?"+"+o(r,e):void 0,S=(e,r)=>e>r?"hightDown":e===r?"":e<r?"hightUp":void 0,C=(e,r)=>{if(r){const t=e.indexOf(r);return e.substring(0,t)}return e};export{l as L,u as a,f as b,N as c,w as d,g as e,d as f,p as g,b as h,h as i,m as j,s as k,c as l,C as m,S as p,i as t};
