{"version":3,"file":"useScrollEvent.utils.cjs","names":[],"sources":["../../../src/hooks/useScrollEvent/useScrollEvent.utils.ts"],"sourcesContent":["/**\n * @description 스크롤 진행 상태를 반환하는 함수입니다.\n */\nexport const getScrollProgress = (\n  current: number,\n  total: number,\n  clientSize: number\n): number => {\n  const maxScroll = total - clientSize;\n\n  if (maxScroll <= 0) return 0;\n\n  return Math.min(Math.round((current / maxScroll) * 100), 100);\n};\n\n/**\n * @description 스크롤 방향을 반환하는 함수입니다.\n */\nexport const getScrollDirection = (\n  currentScrollX: number,\n  currentScrollY: number,\n  prevScrollY: number,\n  prevScrollX: number\n) => {\n  return {\n    y:\n      currentScrollY === prevScrollY\n        ? \"none\"\n        : currentScrollY > prevScrollY\n        ? \"down\"\n        : \"up\",\n    x:\n      currentScrollX === prevScrollX\n        ? \"none\"\n        : currentScrollX > prevScrollX\n        ? \"right\"\n        : \"left\",\n  } as const;\n};\n"],"mappings":";;;;AAGA,MAAa,qBACX,SACA,OACA,eACW;CACX,MAAM,YAAY,QAAQ;CAE1B,IAAI,aAAa,GAAG,OAAO;CAE3B,OAAO,KAAK,IAAI,KAAK,MAAO,UAAU,YAAa,IAAI,EAAE,IAAI;;;;;AAM/D,MAAa,sBACX,gBACA,gBACA,aACA,gBACG;CACH,OAAO;EACL,GACE,mBAAmB,cACf,SACA,iBAAiB,cACjB,SACA;EACN,GACE,mBAAmB,cACf,SACA,iBAAiB,cACjB,UACA;EACP"}