"use strict";(globalThis.webpackChunkinfinity_hitab_client=globalThis.webpackChunkinfinity_hitab_client||[]).push([[4573],{54573:(e,t,l)=>{l.r(t),l.d(t,{default:()=>u});var n=l(57268),o=l(94209),r=l(29445);const u=(0,n.aZ)({__name:"gradient-progress-bar",props:{value:null,reverse:{type:Boolean}},emits:["update:value"],setup(e,t){let{emit:l}=t;const u=e,a=(0,r.iH)(),i=(0,r.iH)(!1);function s(e){var t;const n=(null===(t=a.value)||void 0===t?void 0:t.getBoundingClientRect().left)||0;let o=e.clientX-n;u.reverse&&(o=100-o),l("update:value",o)}return(0,n.bv)((()=>{var e;null===(e=a.value)||void 0===e||e.addEventListener("mousedown",(e=>{var t;i.value=!0;const n=(null===(t=a.value)||void 0===t?void 0:t.getBoundingClientRect().left)||0;let o=e.clientX-n;u.reverse&&(o=100-o),l("update:value",o)})),document.addEventListener("mouseup",(()=>{i.value=!1})),document.addEventListener("mousemove",(e=>{var t;if(!i.value)return;const n=(null===(t=a.value)||void 0===t?void 0:t.getBoundingClientRect().left)||0;let o=e.clientX-n;o<0&&(o=0),o>100&&(o=100),u.reverse&&(o=100-o),l("update:value",o)}))})),(0,n.Ah)((()=>{var e;document.removeEventListener("mouseup",(()=>null)),document.removeEventListener("mousemove",(()=>null)),null===(e=a.value)||void 0===e||e.removeEventListener("mousedown",(()=>null))})),(t,l)=>((0,n.wg)(),(0,n.iD)("div",{ref_key:"barRef",ref:a,class:(0,o.normalizeClass)(["relative h-[8px] w-[100px] cursor-pointer rounded-[8px] bg-color-b2 shadow-[inset_0_0_0_1px_rgba(0,0,0,0.08)] dark:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.08)]",[i.value?"cursor-grabbing":"cursor-grab"]]),onClick:s},[(0,n._)("div",{class:(0,o.normalizeClass)(["absolute top-0 bottom-0 h-full rounded-[8px] bg-color-m2 transition-all",[u.reverse?"right-0":"left-0"]]),style:(0,o.normalizeStyle)({width:e.value+"px"})},null,6)],2))}})}}]);