"use strict";(globalThis.webpackChunkinfinity_hitab_client=globalThis.webpackChunkinfinity_hitab_client||[]).push([[8051],{38051:(e,a,t)=>{t.r(a),t.d(a,{useCalcBinaryStore:()=>s});var i=t(10435),n=t(14754);const s=(0,i.Q_)("calc-components-binary",{state:()=>({activeIndex:0,baseItems:[{name:"二进制",radix:2},{name:"八进制",radix:8},{name:"十进制",radix:10},{name:"十六进制",radix:16}],barItems:[{name:"Binary"},{name:"Octal"},{name:"Decimal"},{name:"Hex"}],disabledKeys:["7","8","9","F","4","5","6","E","2","3","D","A","B","C"]}),getters:{getCurrentItemValue(){return this.baseItems[this.activeIndex].value||""}},actions:{changeActive(e){switch(this.activeIndex=e,e){case 0:this.disabledKeys=["7","8","9","F","4","5","6","E","2","3","D","A","B","C"];break;case 1:this.disabledKeys=["8","9","F","E","D","C","B","A"];break;case 2:this.disabledKeys=["F","E","D","C","B","A"];break;case 3:this.disabledKeys=[]}},changeValue(e,a){this.baseItems[a].value=e;const t=[...this.baseItems],i=t[a].radix,s=String(e).indexOf(".")>-1?(0,n.zX)(e,i):parseInt(String(e),i);return e?isNaN(s)?(t.forEach((e=>e.value="")),void(this.baseItems=t)):(t.forEach(((t,i)=>{if(i===a)t.value=String(e).toUpperCase();else try{const e=s.toString(t.radix);t.value=e.toUpperCase()}catch(e){t.value=""}})),void(this.baseItems=t)):(t.forEach((e=>e.value="")),void(this.baseItems=t))},calcBaseArr(){const e=[...this.baseItems];this.baseItems=e}}})},14754:(e,a,t)=>{t.d(a,{D:()=>h,Mb:()=>b,UC:()=>s,WS:()=>o,fS:()=>d,uf:()=>i,vZ:()=>n,zX:()=>r});const i=function(e){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;if(!e)return 0;const i=Math.floor(Math.log(Math.abs(e))/Math.LN10);if(Math.abs(i)<=a)return Number(e.toFixed(t));{const a=e*Math.pow(10,-i);return Number(a.toFixed(t))+"e"+(i>0?"+"+i:i)}},n=(e,a)=>{const t=[...a],i=t.find((e=>e.base)),n=t.find((a=>a.name===e.name));return i.base=!1,n.base=!0,n.value=i.value,t},s=e=>{const a=[...e],t=e.find((e=>e.calcBase)),i=e.find((e=>e.base));var n;t.base?a.map((e=>{var a;e.base||e.calcBase||(e.value=null===(a=e.getValue)||void 0===a?void 0:a.call(null,Number(t.value)))})):(t.value=null===(n=i.reverseValue)||void 0===n?void 0:n.call(null,Number(i.value)),a.map((e=>{var a;e.base||e.calcBase||(e.value=null===(a=e.getValue)||void 0===a?void 0:a.call(null,Number(t.value)))})));return a},r=(e,a)=>{const t=String(e).split("."),i=t[1].split("");let n=0;for(let e=0;e<t[1].length;e++)n+=i[e]*Math.pow(a,-1*(e+1));return parseInt(t[0],a)+n},d=e=>Number(e||0).toFixed(2).replace(/\d+/,(e=>e.replace(/(\d)(?=(?:\d{3})+$)/g,"$1,"))),l=[{min:-1/0,max:36e3,rate:.03,deduction:0},{min:36e3,max:144e3,rate:.1,deduction:2520},{min:144e3,max:3e5,rate:.2,deduction:16920},{min:3e5,max:42e4,rate:.25,deduction:31920},{min:42e4,max:66e4,rate:.3,deduction:52920},{min:66e4,max:96e4,rate:.35,deduction:85920},{min:96e4,max:1/0,rate:.45,deduction:181920}],c=[{min:-1/0,max:3e3,rate:.03,deduction:0},{min:3e3,max:12e3,rate:.1,deduction:210},{min:12e3,max:25e3,rate:.2,deduction:1410},{min:25e3,max:35e3,rate:.25,deduction:2660},{min:35e3,max:55e3,rate:.3,deduction:4410},{min:55e3,max:8e4,rate:.35,deduction:7160},{min:8e4,max:1/0,rate:.45,deduction:15160}],m=[{min:-1/0,max:2e4,rate:.2,deduction:0},{min:2e4,max:5e4,rate:.3,deduction:2e3},{min:5e4,max:1/0,rate:.4,deduction:7e3}],u=(e,a)=>a.find((a=>e>a.min&&e<=a.max)),o=e=>u(e,l),b=e=>u(e,c),h=e=>u(e,m)}}]);