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use-breakpoints.ts","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/utils/wheel-configuration-utils.ts","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/data/wheel-settings.ts","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/composables/use-wheel-sizing.ts","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/composables/use-wheel-configuration.ts","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/utils/wheel-draw-utils.ts","webpack://@sazka/kasa-loyalty/../../libs/utils/throttle.ts","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/composables/use-wheel-draw.ts","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/kasa-wheel.vue?e00d","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/kasa-wheel.vue","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/kasa-wheel.vue?4fcb","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/components/wheel-construction.vue?2c88","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/components/wheel-construction.vue","webpack://@sazka/kasa-loyalty/./js/app/wheel-of-fortune/wheel-page/components/wheel/components/wheel-construction.vue?2af7"],"sourcesContent":["import { Ref, ref } from \"vue\";\r\nimport { ResponsiveUtils } from \"./responsive-utils\";\r\n\r\ntype BreakpointType = keyof Omit<typeof ResponsiveUtils.breakpoints, \"xs\">;\r\ntype ReactiveBreakpoint = {\r\n key: BreakpointType;\r\n minSize: number;\r\n isInUse: boolean;\r\n value: Ref<boolean>;\r\n};\r\n\r\nconst reactiveBreakpoints: ReactiveBreakpoint[] = Object.keys(ResponsiveUtils.breakpoints)\r\n .filter((x) => x !== \"xs\")\r\n .map((x) => ({\r\n isInUse: false,\r\n key: x as BreakpointType,\r\n minSize: ResponsiveUtils.breakpoints[x],\r\n value: ref(false),\r\n }));\r\n\r\n/**\r\n * Returns ref with boolean value, which means, current breakpoint is same or bigger\r\n * eg. media min-width: x\r\n * since its breakpoint up, it doesnt make sense for 'xs' which would be always true, so its omited\r\n * @param breakpoints breakpoint name eg. 'xs2' or 'xl'\r\n */\r\nexport function useBreakpoints(breakpoints: BreakpointType): Ref<boolean>;\r\n\r\n/**\r\n * Returns object, with keys same as parameter value, their value is ref with boolean value, which means, current breakpoint is same or bigger\r\n * eg. media min-width: x\r\n * Example of return value: { sm: ref(true), md: ref(false) }\r\n * Returns only value passed in parametrs,\r\n * since its breakpoint up, it doesnt make sense for 'xs' which would be always true, so its omited\r\n * @param breakpoints all breakpoint names eg. 'xs2' or 'xl'\r\n */\r\nexport function useBreakpoints(...breakpoints: BreakpointType[]): { [key in BreakpointType]: Ref<boolean> };\r\n\r\nexport function useBreakpoints(...breakpoints: BreakpointType[]) {\r\n if (breakpoints?.length == 0) return;\r\n\r\n if (breakpoints.length > 1) {\r\n return breakpoints.reduce((acc, x) => {\r\n acc[x] = reactiveBreakpoint(x);\r\n return acc;\r\n }, {});\r\n } else {\r\n return reactiveBreakpoint(breakpoints[0]);\r\n }\r\n}\r\n\r\nfunction reactiveBreakpoint(breakpoint: BreakpointType) {\r\n const brkpnt = reactiveBreakpoints.find((x) => x.key === breakpoint);\r\n if (!brkpnt.isInUse) {\r\n brkpnt.isInUse = true;\r\n const media = window.matchMedia(`(min-width: ${brkpnt.minSize}px)`);\r\n brkpnt.value.value = media.matches;\r\n media.onchange = (e) => {\r\n brkpnt.value.value = e.matches;\r\n };\r\n }\r\n return brkpnt.value;\r\n}\r\n","import { WheelConfigurationAward } from \"@/api-connector/ls-admin-public/models/wheel-api-models\";\r\nimport { ColorConfiguration, WheelSegment } from \"../models/wheel-configuration\";\r\n\r\nexport function degToRadius(deg: number) {\r\n return (deg * Math.PI) / 180;\r\n}\r\n\r\nexport function colorLighterOrDarker(color: string, percentage: number) {\r\n let usePound = false;\r\n if (color[0] == \"#\") {\r\n color = color.slice(1);\r\n usePound = true;\r\n }\r\n\r\n const num = parseInt(color, 16);\r\n\r\n let r = (num >> 16) + percentage;\r\n\r\n if (r > 255) r = 255;\r\n else if (r < 0) r = 0;\r\n\r\n let b = ((num >> 8) & 0x00ff) + percentage;\r\n\r\n if (b > 255) b = 255;\r\n else if (b < 0) b = 0;\r\n\r\n let g = (num & 0x0000ff) + percentage;\r\n\r\n if (g > 255) g = 255;\r\n else if (g < 0) g = 0;\r\n\r\n let hexCode = (g | (b << 8) | (r << 16)).toString(16);\r\n while (hexCode.length < 6) {\r\n hexCode = \"0\" + hexCode;\r\n }\r\n return (usePound ? \"#\" : \"\") + hexCode;\r\n}\r\n\r\nexport function transformAwardsToSections(awards: WheelConfigurationAward[], colorConfiguration: ColorConfiguration) {\r\n if (!awards?.length) return [];\r\n\r\n const arc = 360 / awards.length;\r\n const colorsOnPalette = colorConfiguration.background.length;\r\n\r\n return awards.map((award, i) => {\r\n const segment: WheelSegment = {\r\n award: award,\r\n angle: {\r\n start: degToRadius(arc * i - 90),\r\n end: degToRadius(arc * (i + 1) - 90),\r\n },\r\n colors: {\r\n background: colorConfiguration.background[i % colorsOnPalette],\r\n },\r\n };\r\n\r\n \r\n if (award.hoverImage) {\r\n segment.hoverImageElement = new Image();\r\n segment.hoverImageElement.src = award.hoverImage;\r\n }\r\n return segment;\r\n });\r\n}\r\n\r\nexport function generateEmptySections(colorConfiguration: ColorConfiguration) {\r\n const emptyAwardArray = new Array<WheelConfigurationAward>(16);\r\n for (let i = 0; i < emptyAwardArray.length; i++) {\r\n const newAward: WheelConfigurationAward = {\r\n id: i,\r\n wheelText: \"BONUS\",\r\n };\r\n\r\n emptyAwardArray[i] = newAward;\r\n }\r\n\r\n return transformAwardsToSections(emptyAwardArray, colorConfiguration);\r\n}\r\n\r\n/**\r\n * Return true, if the sections are different\r\n * @param wheelSegments1\r\n * @param wheelSegments2\r\n */\r\nexport function areSegmentsDifferent(wheelSegments1: WheelSegment[], wheelSegments2: WheelSegment[]) {\r\n if (!wheelSegments1 && !wheelSegments2) return false;\r\n\r\n if (wheelSegments1?.length != wheelSegments2?.length) return true;\r\n\r\n return wheelSegments1?.some((wheelSegment1, index) => {\r\n const wheelSegment2 = wheelSegments2[index];\r\n if (wheelSegment1.award.id != wheelSegment2.award.id) return true;\r\n\r\n return false;\r\n });\r\n}\r\n\r\nexport function calcMousePositionSegmentIndex(mouseEvent: MouseEvent, canvasRect: DOMRect, wheelSegments: WheelSegment[]) {\r\n // if (\r\n // mouseEvent.pageX < canvasRect.left ||\r\n // mouseEvent.pageX > canvasRect.right ||\r\n // mouseEvent.pageY < canvasRect.top ||\r\n // mouseEvent.pageY > canvasRect.bottom\r\n // )\r\n // return -1;\r\n\r\n const radius = canvasRect.width / 2;\r\n\r\n // translate to center and swap axis x & y\r\n const dy = mouseEvent.clientX - canvasRect.left - radius;\r\n const dx = radius - (mouseEvent.clientY - canvasRect.top);\r\n\r\n // When mouse is outside the canvas circle\r\n //if (dx * dx + dy * dy > wheelRadius.value * wheelRadius.value) return -1;\r\n\r\n const mousePositionAngle = ((Math.atan2(dy, dx) + Math.PI * 2) % (Math.PI * 2)) - Math.PI / 2;\r\n return wheelSegments.findIndex((segment) => segment.angle.start <= mousePositionAngle && segment.angle.end > mousePositionAngle);\r\n}\r\n","import { ColorConfiguration } from \"../models/wheel-configuration\";\r\n\r\nexport const defaultWheelColors: ColorConfiguration = {\r\n background: [\r\n {\r\n startColor: \"#EFEFEF\",\r\n endColor: \"#F2F2F2\",\r\n },\r\n {\r\n startColor: \"#E6FF4F\",\r\n endColor: \"#6FCE44\",\r\n },\r\n ],\r\n hover: {\r\n startColor: \"#FCE428\",\r\n endColor: \"#FFB800\",\r\n },\r\n stroke: \"#79A861\",\r\n shadow: \"#464646\",\r\n text: \"#232157\",\r\n};\r\n","import { reactive, watchEffect } from \"vue\";\r\nimport { TextSizeConfiguration, WheelSizeConfiguration } from \"../models/wheel-configuration\";\r\nimport { useBreakpoints } from \"@/shared/utils/responsive/use-breakpoints\";\r\n\r\nexport default function useWheelSizing() {\r\n const { xs2, sm, lg } = useBreakpoints(\"xs2\", \"sm\", \"lg\");\r\n\r\n /* ******************** WHEEL SIZES **************** */\r\n const wheelSizes = reactive<WheelSizeConfiguration>({\r\n size: 0,\r\n radius: 0,\r\n scaleRatio: window.devicePixelRatio || 1,\r\n });\r\n\r\n const setWheelSizes = () => {\r\n if (lg.value) {\r\n wheelSizes.size = 510;\r\n wheelSizes.radius = 255;\r\n } else if (sm.value) {\r\n wheelSizes.size = 364;\r\n wheelSizes.radius = 182;\r\n } else if (xs2.value) {\r\n wheelSizes.size = 310;\r\n wheelSizes.radius = 155;\r\n } else {\r\n wheelSizes.size = 256;\r\n wheelSizes.radius = 128;\r\n }\r\n\r\n document.documentElement.style.setProperty(\"--wheel-size\", `${wheelSizes.size}px`);\r\n };\r\n\r\n /* ****************** TEXT SIZES ******************** */\r\n const textSizes = reactive<TextSizeConfiguration>({\r\n rimOffset: 0,\r\n rimFontSize: 0,\r\n innerOffset: 0,\r\n innerFontSize: 0,\r\n imgWidth: 0,\r\n });\r\n\r\n const setTextSizes = () => {\r\n if (lg.value) {\r\n textSizes.rimOffset = 8;\r\n textSizes.rimFontSize = 12;\r\n textSizes.innerOffset = 28;\r\n textSizes.innerFontSize = 24;\r\n textSizes.imgWidth = 66;\r\n } else if (sm.value) {\r\n textSizes.rimOffset = 6;\r\n textSizes.rimFontSize = 10;\r\n textSizes.innerOffset = 20;\r\n textSizes.innerFontSize = 17;\r\n textSizes.imgWidth = 50;\r\n } else if (xs2.value) {\r\n textSizes.rimOffset = 5;\r\n textSizes.rimFontSize = 8;\r\n textSizes.innerOffset = 18;\r\n textSizes.innerFontSize = 14;\r\n textSizes.imgWidth = 42;\r\n } else {\r\n textSizes.rimOffset = 4;\r\n textSizes.rimFontSize = 7;\r\n textSizes.innerOffset = 14;\r\n textSizes.innerFontSize = 12;\r\n textSizes.imgWidth = 35;\r\n }\r\n };\r\n\r\n watchEffect(() => {\r\n setWheelSizes();\r\n setTextSizes();\r\n });\r\n\r\n return {\r\n wheelSizes,\r\n textSizes,\r\n };\r\n}\r\n","import { computed } from \"vue\";\r\nimport { MksConfiguration } from \"@/api-connector/ls-admin-public/models/wheel-api-models\";\r\nimport { generateEmptySections, transformAwardsToSections } from \"../utils/wheel-configuration-utils\";\r\nimport useWheelPageData from \"../../../composables/use-wheel-page-data\";\r\nimport { defaultWheelColors } from \"../data/wheel-settings\";\r\nimport { CanvasConfiguration } from \"../models/wheel-configuration\";\r\nimport useWheelSizing from \"./use-wheel-sizing\";\r\n\r\nconst { isMks, currentWheelConfiguration, wonAward } = useWheelPageData();\r\nconst { wheelSizes, textSizes } = useWheelSizing();\r\n\r\nconst canvasConfiguration = computed<CanvasConfiguration>(() => {\r\n return {\r\n colors: defaultWheelColors,\r\n textSizes: textSizes,\r\n wheelSizes: wheelSizes,\r\n };\r\n});\r\n\r\nconst wheelSegments = computed(() => {\r\n if (isMks.value) {\r\n const mksConfiguration = currentWheelConfiguration.value as MksConfiguration;\r\n return transformAwardsToSections(mksConfiguration.awards, canvasConfiguration.value.colors);\r\n }\r\n\r\n return generateEmptySections(canvasConfiguration.value.colors);\r\n});\r\n\r\nconst wheelSegmentsCount = computed(() => wheelSegments.value.length);\r\n\r\nconst winningSegmentIndex = computed(() => {\r\n if (!wonAward.value) return -1;\r\n\r\n if (isMks.value) return wheelSegments.value.findIndex((segment) => segment.award.id == wonAward.value.id);\r\n\r\n return wonAward.value.id;\r\n});\r\n\r\nexport default function useWheelConfiguration() {\r\n return {\r\n canvasConfiguration,\r\n wheelSegments,\r\n wheelSegmentsCount,\r\n winningSegmentIndex,\r\n };\r\n}\r\n","import { CanvasConfiguration, WheelSegment } from \"../models/wheel-configuration\";\r\n\r\nfunction getWheelCanvasFont(fontSize: number) {\r\n return `bold ${fontSize}px \"Sazka Sans\",sans-serif`;\r\n}\r\n\r\nfunction clearCanvas(ctx: CanvasRenderingContext2D, canvasConfiguration: CanvasConfiguration) {\r\n const { size, scaleRatio } = canvasConfiguration.wheelSizes;\r\n\r\n ctx.setTransform(scaleRatio, 0, 0, scaleRatio, 0, 0);\r\n ctx.clearRect(0, 0, size, size);\r\n}\r\n\r\nfunction drawSegment(segment: WheelSegment, ctx: CanvasRenderingContext2D, canvasConfiguration: CanvasConfiguration) {\r\n const { radius } = canvasConfiguration.wheelSizes;\r\n\r\n /******** DRAW SEGMENT RECTANGLE *********** */\r\n ctx.save();\r\n ctx.beginPath();\r\n\r\n ctx.shadowColor = \"transparent\";\r\n const gradientFill = ctx.createRadialGradient(0, 0, radius / 2, 0, 0, radius);\r\n gradientFill.addColorStop(0, segment.colors.background.startColor);\r\n gradientFill.addColorStop(1, segment.colors.background.endColor);\r\n\r\n const region = new Path2D();\r\n region.moveTo(0, 0);\r\n region.arc(0, 0, radius, segment.angle.start, segment.angle.end, false);\r\n\r\n ctx.fillStyle = gradientFill;\r\n ctx.fill(region);\r\n\r\n ctx.strokeStyle = canvasConfiguration.colors.stroke;\r\n ctx.stroke(region);\r\n\r\n /* ************** DRAW INNER TEXT *************** */\r\n const textAngle = segment.angle.end - (segment.angle.end - segment.angle.start) / 2 + Math.PI;\r\n ctx.rotate(textAngle);\r\n\r\n ctx.textAlign = \"start\";\r\n ctx.font = getWheelCanvasFont(canvasConfiguration.textSizes.innerFontSize);\r\n\r\n ctx.fillStyle = canvasConfiguration.colors.text;\r\n ctx.fillText(segment.award.wheelText, -(radius - canvasConfiguration.textSizes.innerOffset), 0);\r\n\r\n /* ************** DRAW RING TEXT *************** */\r\n if (segment.award.wheelTextRim && segment.award.type == \"NFin\") {\r\n ctx.rotate(-Math.PI / 2);\r\n\r\n ctx.textAlign = \"center\";\r\n ctx.font = getWheelCanvasFont(canvasConfiguration.textSizes.rimFontSize);\r\n ctx.fillText(\r\n segment.award.wheelTextRim.toUpperCase(),\r\n 0,\r\n -(radius - canvasConfiguration.textSizes.rimOffset - canvasConfiguration.textSizes.rimFontSize / 2),\r\n );\r\n }\r\n\r\n ctx.restore();\r\n}\r\n\r\nfunction drawSegments(segments: WheelSegment[], ctx: CanvasRenderingContext2D, canvasConfiguration: CanvasConfiguration) {\r\n const sizeToCenter = canvasConfiguration.wheelSizes.size / 2;\r\n\r\n /* ************** BASIC SETTINGS *************** */\r\n ctx.save();\r\n ctx.translate(sizeToCenter, sizeToCenter);\r\n ctx.lineWidth = 1;\r\n ctx.textBaseline = \"middle\";\r\n\r\n for (const segment of segments) {\r\n drawSegment(segment, ctx, canvasConfiguration);\r\n }\r\n ctx.restore();\r\n}\r\n\r\nexport function drawClearCanvas(segments: WheelSegment[], ctx: CanvasRenderingContext2D, canvasConfiguration: CanvasConfiguration) {\r\n clearCanvas(ctx, canvasConfiguration);\r\n drawSegments(segments, ctx, canvasConfiguration);\r\n}\r\n\r\nexport function drawHoverSegment(\r\n segment: WheelSegment,\r\n ctx: CanvasRenderingContext2D,\r\n canvasConfiguration: CanvasConfiguration,\r\n isGrowPhase: boolean,\r\n phaseProgress: number,\r\n) {\r\n const sizeToCenter = canvasConfiguration.wheelSizes.size / 2;\r\n const { radius } = canvasConfiguration.wheelSizes;\r\n\r\n /* ************** BASIC SETTINGS *************** */\r\n ctx.save();\r\n ctx.translate(sizeToCenter, sizeToCenter);\r\n ctx.lineWidth = 1;\r\n ctx.textBaseline = \"middle\";\r\n const arcRadius = radius + 3;\r\n\r\n /***************** RECTANGLE SEGMENT RECTANGLE ************* */\r\n ctx.beginPath();\r\n\r\n ctx.shadowColor = canvasConfiguration.colors.shadow;\r\n ctx.shadowBlur = 15;\r\n ctx.shadowOffsetX = -10;\r\n ctx.shadowOffsetY = 0;\r\n ctx.globalAlpha = isGrowPhase ? phaseProgress : 1;\r\n\r\n const gradientFill = ctx.createRadialGradient(0, 0, radius / 4, 0, 0, radius);\r\n gradientFill.addColorStop(0, canvasConfiguration.colors.hover.startColor);\r\n gradientFill.addColorStop(1, canvasConfiguration.colors.hover.endColor);\r\n\r\n const shrinkPhase = 0.022 * phaseProgress + 0.02;\r\n const region = new Path2D();\r\n region.moveTo(0, 0);\r\n region.arc(0, 0, arcRadius, segment.angle.start - shrinkPhase - 0.01, segment.angle.end + shrinkPhase - 0.01, false);\r\n\r\n ctx.fillStyle = gradientFill;\r\n ctx.fill(region);\r\n\r\n ctx.strokeStyle = canvasConfiguration.colors.stroke;\r\n ctx.stroke(region);\r\n\r\n /* ***************** CLASIC SEGMENT ********************** */\r\n if (segment.award.type != \"Fin\") {\r\n /* *************** DRAW INNER TEXT **************** */\r\n const textAngle = segment.angle.end - (segment.angle.end - segment.angle.start) / 2 + Math.PI;\r\n ctx.rotate(textAngle);\r\n\r\n ctx.textAlign = \"start\";\r\n ctx.shadowColor = \"transparent\";\r\n ctx.font = getWheelCanvasFont(canvasConfiguration.textSizes.innerFontSize);\r\n\r\n ctx.fillStyle = canvasConfiguration.colors.text;\r\n ctx.fillText(segment.award.wheelText, -(radius - canvasConfiguration.textSizes.innerOffset), 0);\r\n\r\n /* **************** DRAW RING TEXT *************** */\r\n if (segment.award.wheelTextRim) {\r\n ctx.rotate(-Math.PI / 2);\r\n\r\n ctx.textAlign = \"center\";\r\n ctx.font = getWheelCanvasFont(canvasConfiguration.textSizes.rimFontSize);\r\n ctx.fillText(\r\n segment.award.wheelTextRim.toUpperCase(),\r\n 0,\r\n -(radius - canvasConfiguration.textSizes.rimOffset - canvasConfiguration.textSizes.rimFontSize / 2),\r\n );\r\n }\r\n /* ************************** WIN SEGMENT ******************** */\r\n } else {\r\n const textAngle = segment.angle.end - (segment.angle.end - segment.angle.start) / 2 + Math.PI / 2;\r\n ctx.rotate(textAngle);\r\n ctx.textAlign = \"center\";\r\n ctx.shadowColor = \"transparent\";\r\n ctx.fillStyle = canvasConfiguration.colors.text;\r\n\r\n /* **************** DRAW RING TEXT *************** */\r\n let currentOffset = canvasConfiguration.textSizes.rimOffset * 2 + canvasConfiguration.textSizes.innerFontSize / 2;\r\n ctx.font = getWheelCanvasFont(canvasConfiguration.textSizes.innerFontSize);\r\n ctx.fillText(segment.award.wheelText, 0, -(radius - currentOffset));\r\n\r\n /* *************** DRAW INNER TEXT **************** */\r\n currentOffset += canvasConfiguration.textSizes.innerFontSize / 2 + canvasConfiguration.textSizes.rimOffset;\r\n\r\n ctx.font = getWheelCanvasFont(canvasConfiguration.textSizes.rimFontSize);\r\n ctx.fillText(segment.award.wheelTextRim, 0, -(radius - currentOffset - canvasConfiguration.textSizes.rimFontSize / 2));\r\n\r\n /* *************** DRAW INNER IMAGE **************** */\r\n currentOffset += canvasConfiguration.textSizes.rimFontSize * 1.3;\r\n if (segment.hoverImageElement) {\r\n ctx.drawImage(\r\n segment.hoverImageElement,\r\n -canvasConfiguration.textSizes.imgWidth / 2,\r\n -(radius - currentOffset),\r\n canvasConfiguration.textSizes.imgWidth,\r\n canvasConfiguration.textSizes.imgWidth / 2.33,\r\n );\r\n }\r\n }\r\n\r\n ctx.restore();\r\n}\r\n","/**\r\n * Throttle function - use like this:\r\n * var handler = throttle(() => { do the work}, 100);\r\n * $(window).resize(handler);\r\n * @param callback callback function\r\n * @param delay time in milliseconds to wait\r\n * @param immediate if false the callback function will be invoke after delay.\r\n * @returns\r\n */\r\n\r\n// R = return type\r\ntype CallbackFunction<T extends any[] = any[], R = any> = (...args: T) => R;\r\n\r\nexport function throttle<T extends any[]>(\r\n callback: CallbackFunction<T>,\r\n delay: number,\r\n immediate = true\r\n): (...args: T) => void {\r\n let shouldWait = false;\r\n\r\n return function (...args: T) {\r\n if (shouldWait) return;\r\n\r\n if (immediate) callback(...args);\r\n shouldWait = true;\r\n setTimeout(() => {\r\n if (!immediate) callback(...args);\r\n shouldWait = false;\r\n }, delay);\r\n };\r\n}\r\n","import { ComputedRef, Ref, computed, nextTick, onBeforeUnmount, onMounted, watch } from \"vue\";\r\nimport { drawClearCanvas, drawHoverSegment } from \"../utils/wheel-draw-utils\";\r\nimport { areSegmentsDifferent, calcMousePositionSegmentIndex } from \"../utils/wheel-configuration-utils\";\r\nimport useWheelConfiguration from \"./use-wheel-configuration\";\r\nimport useWheelPageData from \"../../../composables/use-wheel-page-data\";\r\nimport { throttle } from \"@sazka/utils/throttle\";\r\n\r\nconst { canvasConfiguration, wheelSegments } = useWheelConfiguration();\r\nconst { setPageState } = useWheelPageData();\r\n\r\nexport default function useWheelDraw(canvas: Ref<HTMLCanvasElement>, isHoverDisabled: ComputedRef<boolean>) {\r\n const ctx = computed(() => canvas.value?.getContext(\"2d\"));\r\n\r\n /* *********************************** AUTO FUNCTIONS *********************************** */\r\n watch(\r\n canvasConfiguration,\r\n () => {\r\n if (!ctx.value) {\r\n return;\r\n }\r\n\r\n nextTick(() => drawClearCanvas(wheelSegments.value, ctx.value, canvasConfiguration.value));\r\n },\r\n { deep: true }\r\n );\r\n\r\n watch(\r\n wheelSegments,\r\n (newWheelSegments, oldWheelSegments) => {\r\n if (!ctx.value) {\r\n return;\r\n }\r\n\r\n if (areSegmentsDifferent(newWheelSegments, oldWheelSegments)) {\r\n drawClearCanvas(wheelSegments.value, ctx.value, canvasConfiguration.value);\r\n }\r\n },\r\n { deep: true }\r\n );\r\n\r\n /* *********************************** HOVER SECTION *********************************** */\r\n let currentHoverSegment = null;\r\n let currentHoverAnimationHandle = 0;\r\n let animationGrowPhase = true;\r\n let animationPhaseProgress = 0;\r\n\r\n const drawHover = () => {\r\n currentHoverAnimationHandle = requestAnimationFrame(() => {\r\n drawClearCanvas(wheelSegments.value, ctx.value, canvasConfiguration.value);\r\n drawHoverSegment(\r\n currentHoverSegment,\r\n ctx.value,\r\n canvasConfiguration.value,\r\n animationGrowPhase,\r\n animationPhaseProgress\r\n );\r\n\r\n // Hover animation\r\n // First phase of animation\r\n if (animationGrowPhase) {\r\n // If segment is not full visible\r\n if (animationPhaseProgress < 1) {\r\n animationPhaseProgress = animationPhaseProgress + 0.2;\r\n drawHover();\r\n } else {\r\n // start second phase\r\n animationGrowPhase = false;\r\n animationPhaseProgress = 1;\r\n }\r\n }\r\n //'animationPhaseProgress' needs to have '1' from 'if' branch\r\n if (!animationGrowPhase) {\r\n // Second phase of animation\r\n if (animationPhaseProgress >= 0) {\r\n animationPhaseProgress = animationPhaseProgress - 0.1;\r\n drawHover();\r\n } else {\r\n // End of animation\r\n animationGrowPhase = true;\r\n animationPhaseProgress = 0;\r\n currentHoverAnimationHandle = 0;\r\n }\r\n }\r\n });\r\n };\r\n\r\n const cancelCurrentHoverAnimation = () => {\r\n if (currentHoverAnimationHandle) {\r\n animationGrowPhase = true;\r\n animationPhaseProgress = 0;\r\n cancelAnimationFrame(currentHoverAnimationHandle);\r\n currentHoverAnimationHandle = 0;\r\n }\r\n };\r\n\r\n const endCurrentHoverAnimation = () => {\r\n cancelCurrentHoverAnimation();\r\n currentHoverSegment = null;\r\n drawClearCanvas(wheelSegments.value, ctx.value, canvasConfiguration.value);\r\n };\r\n\r\n /**\r\n * It draws the wheel with highlighted segment.\r\n * @param segmentIndex Segment index to highlight. When it's missing (or value -1), the wheel will be drawing in default state.\r\n * @returns\r\n */\r\n const highlightSegment = (segmentIndex = -1) => {\r\n const hoverSegment = wheelSegments.value[segmentIndex];\r\n if (hoverSegment === currentHoverSegment) {\r\n return;\r\n }\r\n\r\n if (!hoverSegment) {\r\n endCurrentHoverAnimation();\r\n return;\r\n }\r\n\r\n cancelCurrentHoverAnimation();\r\n currentHoverSegment = hoverSegment;\r\n drawHover();\r\n };\r\n\r\n /* *********************************** HANDLERS *********************************** */\r\n const mouseMoveHandler = throttle((event: MouseEvent) => {\r\n if (isHoverDisabled.value) return;\r\n\r\n const canvasRect = canvas.value.getBoundingClientRect();\r\n const hoverSegmentIndex = calcMousePositionSegmentIndex(event, canvasRect, wheelSegments.value);\r\n\r\n highlightSegment(hoverSegmentIndex);\r\n }, 10);\r\n\r\n const mouseLeaveHandler = throttle(() => {\r\n if (isHoverDisabled.value && !currentHoverSegment) return;\r\n\r\n endCurrentHoverAnimation();\r\n }, 10);\r\n\r\n /* *********************************** INIT *********************************** */\r\n onMounted(() => {\r\n if (!ctx.value) {\r\n setPageState(\"error\", \"Reference to canvas is missing\");\r\n return;\r\n }\r\n\r\n drawClearCanvas(wheelSegments.value, ctx.value, canvasConfiguration.value);\r\n canvas.value.addEventListener(\"mousemove\", mouseMoveHandler, { passive: true });\r\n canvas.value.addEventListener(\"mouseleave\", mouseLeaveHandler, { passive: true });\r\n });\r\n\r\n onBeforeUnmount(() => {\r\n canvas.value.removeEventListener(\"mousemove\", mouseMoveHandler);\r\n canvas.value.removeEventListener(\"mouseleave\", mouseLeaveHandler);\r\n });\r\n\r\n return {\r\n highlightSegment,\r\n };\r\n}\r\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = [\"width\", \"height\"]\n\nimport { ref } from \"vue\";\r\n\r\nimport WheelConstruction from \"./wheel/components/wheel-construction.vue\";\r\nimport WheelRotation from \"./wheel/components/wheel-rotation.vue\";\r\n\r\nimport useWheelConfiguration from \"./wheel/composables/use-wheel-configuration\";\r\nimport useWheelDraw from \"./wheel/composables/use-wheel-draw\";\r\nimport useWheelStateMachine from \"../composables/use-wheel-state-machine\";\r\nimport useWheelPageData from \"../composables/use-wheel-page-data\";\r\n\r\n\nexport default /*@__PURE__*/_defineComponent({\n __name: 'kasa-wheel',\n setup(__props) {\n\r\nconst canvasRef = ref<HTMLCanvasElement>();\r\n\r\nconst { isMks, remainingAwardsCount } = useWheelPageData();\r\nconst { wheelSegmentsCount, canvasConfiguration, winningSegmentIndex } = useWheelConfiguration();\r\nconst { setWheelState, delegateStateAction, isWheelRunning, isWheelDisabled } = useWheelStateMachine();\r\n\r\nconst { highlightSegment } = useWheelDraw(canvasRef, isWheelRunning);\r\n\r\ndelegateStateAction(\"stopped\", () => {\r\n highlightSegment(winningSegmentIndex.value);\r\n});\r\n\r\ndelegateStateAction(\"active\", () => {\r\n highlightSegment();\r\n});\r\n\r\nconst wheelRotationStopped = () => {\r\n setWheelState(\"stopped\", \"Wheel is stopped\");\r\n};\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(WheelConstruction, {\n isMsk: _unref(isMks),\n isWheelDisabled: _unref(isWheelDisabled)\n }, {\n default: _withCtx(() => [\n _createVNode(WheelRotation, {\n stopOnSegmentIndex: _unref(winningSegmentIndex),\n segmentsCount: _unref(wheelSegmentsCount),\n isWheelDisabled: _unref(isWheelDisabled),\n remainingAwardsCount: _unref(remainingAwardsCount),\n onRotationStopped: wheelRotationStopped\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"canvas\", {\n class: \"wheel__canvas\",\n ref_key: \"canvasRef\",\n ref: canvasRef,\n width: _unref(canvasConfiguration).wheelSizes.size * _unref(canvasConfiguration).wheelSizes.scaleRatio,\n height: _unref(canvasConfiguration).wheelSizes.size * _unref(canvasConfiguration).wheelSizes.scaleRatio,\n style: _normalizeStyle({ width: `${_unref(canvasConfiguration).wheelSizes.size}px`, height: `${_unref(canvasConfiguration).wheelSizes.size}px` })\n }, null, 12, _hoisted_1)\n ]),\n _: 1\n }, 8, [\"stopOnSegmentIndex\", \"segmentsCount\", \"isWheelDisabled\", \"remainingAwardsCount\"])\n ]),\n _: 1\n }, 8, [\"isMsk\", \"isWheelDisabled\"]))\n}\n}\n\n})","<template>\r\n <WheelConstruction :isMsk=\"isMks\" :isWheelDisabled=\"isWheelDisabled\">\r\n <WheelRotation\r\n :stopOnSegmentIndex=\"winningSegmentIndex\"\r\n :segmentsCount=\"wheelSegmentsCount\"\r\n :isWheelDisabled=\"isWheelDisabled\"\r\n :remainingAwardsCount=\"remainingAwardsCount\"\r\n @rotationStopped=\"wheelRotationStopped\"\r\n >\r\n <canvas\r\n class=\"wheel__canvas\"\r\n ref=\"canvasRef\"\r\n :width=\"canvasConfiguration.wheelSizes.size * canvasConfiguration.wheelSizes.scaleRatio\"\r\n :height=\"canvasConfiguration.wheelSizes.size * canvasConfiguration.wheelSizes.scaleRatio\"\r\n :style=\"{ width: `${canvasConfiguration.wheelSizes.size}px`, height: `${canvasConfiguration.wheelSizes.size}px` }\"\r\n ></canvas>\r\n </WheelRotation>\r\n </WheelConstruction>\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { ref } from \"vue\";\r\n\r\nimport WheelConstruction from \"./wheel/components/wheel-construction.vue\";\r\nimport WheelRotation from \"./wheel/components/wheel-rotation.vue\";\r\n\r\nimport useWheelConfiguration from \"./wheel/composables/use-wheel-configuration\";\r\nimport useWheelDraw from \"./wheel/composables/use-wheel-draw\";\r\nimport useWheelStateMachine from \"../composables/use-wheel-state-machine\";\r\nimport useWheelPageData from \"../composables/use-wheel-page-data\";\r\n\r\nconst canvasRef = ref<HTMLCanvasElement>();\r\n\r\nconst { isMks, remainingAwardsCount } = useWheelPageData();\r\nconst { wheelSegmentsCount, canvasConfiguration, winningSegmentIndex } = useWheelConfiguration();\r\nconst { setWheelState, delegateStateAction, isWheelRunning, isWheelDisabled } = useWheelStateMachine();\r\n\r\nconst { highlightSegment } = useWheelDraw(canvasRef, isWheelRunning);\r\n\r\ndelegateStateAction(\"stopped\", () => {\r\n highlightSegment(winningSegmentIndex.value);\r\n});\r\n\r\ndelegateStateAction(\"active\", () => {\r\n highlightSegment();\r\n});\r\n\r\nconst wheelRotationStopped = () => {\r\n setWheelState(\"stopped\", \"Wheel is stopped\");\r\n};\r\n</script>\r\n","import script from \"./kasa-wheel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./kasa-wheel.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, createVNode as _createVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"wheel__construction\" }\n\nimport { computed } from \"vue\";\r\nimport WebpImage from \"@sazka/design-system/src/image/webp-image.vue\";\r\n\r\n\nexport default /*@__PURE__*/_defineComponent({\n __name: 'wheel-construction',\n props: {\n isMsk: { type: Boolean },\n isWheelDisabled: { type: Boolean }\n },\n setup(__props: any) {\n\r\nconst props = __props;\r\n\r\nconst headerImg = computed(() => {\r\n if (props.isMsk && !props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-mks-on.png\";\r\n } else if (props.isMsk && props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-mks-off.png\";\r\n } else if (!props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-bks-on.png\";\r\n }\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-bks-off.png\";\r\n});\r\nconst outlineImg = computed(() => {\r\n if (!props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-outline-on.png\";\r\n }\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-outline-off.png\";\r\n});\r\nconst middleImg = computed(() => {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-middle-on.png\";\r\n});\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"section\", {\n class: _normalizeClass([\"wheel\", { disabled: _ctx.isWheelDisabled }])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _cache[0] || (_cache[0] = _createElementVNode(\"div\", { class: \"wheel__construction-shadow\" }, null, -1)),\n _createVNode(WebpImage, {\n alt: \"haeder image\",\n src: headerImg.value,\n cssClass: \"wheel__construction-image wheel-header\"\n }, null, 8, [\"src\"]),\n _createVNode(WebpImage, {\n alt: \"outline image\",\n src: outlineImg.value,\n cssClass: \"wheel__construction-image wheel-outline\"\n }, null, 8, [\"src\"]),\n _createVNode(WebpImage, {\n alt: \"logo sazka image\",\n src: middleImg.value,\n cssClass: \"wheel__construction-image wheel-middle\"\n }, null, 8, [\"src\"])\n ]),\n _renderSlot(_ctx.$slots, \"default\")\n ], 2))\n}\n}\n\n})","<template>\r\n <section class=\"wheel\" :class=\"{ disabled: isWheelDisabled }\">\r\n <div class=\"wheel__construction\">\r\n <div class=\"wheel__construction-shadow\"></div>\r\n <WebpImage alt=\"haeder image\" :src=\"headerImg\" cssClass=\"wheel__construction-image wheel-header\" />\r\n <WebpImage alt=\"outline image\" :src=\"outlineImg\" cssClass=\"wheel__construction-image wheel-outline\" />\r\n <WebpImage alt=\"logo sazka image\" :src=\"middleImg\" cssClass=\"wheel__construction-image wheel-middle\" />\r\n </div>\r\n <slot></slot>\r\n </section>\r\n</template>\r\n\r\n<script lang=\"ts\" setup>\r\nimport { computed } from \"vue\";\r\nimport WebpImage from \"@sazka/design-system/src/image/webp-image.vue\";\r\n\r\nconst props = defineProps<{\r\n isMsk: boolean;\r\n isWheelDisabled: boolean;\r\n}>();\r\n\r\nconst headerImg = computed(() => {\r\n if (props.isMsk && !props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-mks-on.png\";\r\n } else if (props.isMsk && props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-mks-off.png\";\r\n } else if (!props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-bks-on.png\";\r\n }\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-header-bks-off.png\";\r\n});\r\nconst outlineImg = computed(() => {\r\n if (!props.isWheelDisabled) {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-outline-on.png\";\r\n }\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-outline-off.png\";\r\n});\r\nconst middleImg = computed(() => {\r\n return \"/frontend/kasa-loyalty/img/wheel-of-fortune/wof-middle-on.png\";\r\n});\r\n</script>\r\n","import script from \"./wheel-construction.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./wheel-construction.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"names":["reactiveBreakpoints","Object","keys","ResponsiveUtils","breakpoints","filter","x","map","isInUse","key","minSize","value","ref","useBreakpoints","length","reduce","acc","reactiveBreakpoint","breakpoint","brkpnt","find","media","window","matchMedia","matches","onchange","e","degToRadius","deg","Math","PI","transformAwardsToSections","awards","colorConfiguration","arc","colorsOnPalette","background","award","i","segment","angle","start","end","colors","hoverImage","hoverImageElement","Image","src","generateEmptySections","emptyAwardArray","Array","newAward","id","wheelText","areSegmentsDifferent","wheelSegments1","wheelSegments2","some","wheelSegment1","index","wheelSegment2","calcMousePositionSegmentIndex","mouseEvent","canvasRect","wheelSegments","radius","width","dy","clientX","left","dx","clientY","top","mousePositionAngle","atan2","findIndex","defaultWheelColors","startColor","endColor","hover","stroke","shadow","text","useWheelSizing","xs2","sm","lg","wheelSizes","reactive","size","scaleRatio","devicePixelRatio","setWheelSizes","document","documentElement","style","setProperty","textSizes","rimOffset","rimFontSize","innerOffset","innerFontSize","imgWidth","setTextSizes","watchEffect","isMks","currentWheelConfiguration","wonAward","useWheelPageData","canvasConfiguration","computed","mksConfiguration","wheelSegmentsCount","winningSegmentIndex","useWheelConfiguration","getWheelCanvasFont","fontSize","clearCanvas","ctx","setTransform","clearRect","drawSegment","save","beginPath","shadowColor","gradientFill","createRadialGradient","addColorStop","region","Path2D","moveTo","fillStyle","fill","strokeStyle","textAngle","rotate","textAlign","font","fillText","wheelTextRim","type","toUpperCase","restore","drawSegments","segments","sizeToCenter","translate","lineWidth","textBaseline","drawClearCanvas","drawHoverSegment","isGrowPhase","phaseProgress","arcRadius","shadowBlur","shadowOffsetX","shadowOffsetY","globalAlpha","shrinkPhase","currentOffset","drawImage","throttle","callback","delay","immediate","shouldWait","args","setTimeout","setPageState","useWheelDraw","canvas","isHoverDisabled","_canvas$value","getContext","watch","nextTick","deep","newWheelSegments","oldWheelSegments","currentHoverSegment","currentHoverAnimationHandle","animationGrowPhase","animationPhaseProgress","drawHover","requestAnimationFrame","cancelCurrentHoverAnimation","cancelAnimationFrame","endCurrentHoverAnimation","highlightSegment","segmentIndex","hoverSegment","mouseMoveHandler","event","getBoundingClientRect","hoverSegmentIndex","mouseLeaveHandler","onMounted","addEventListener","passive","onBeforeUnmount","removeEventListener","_hoisted_1","_defineComponent","__name","setup","__props","canvasRef","remainingAwardsCount","setWheelState","delegateStateAction","isWheelRunning","isWheelDisabled","useWheelStateMachine","wheelRotationStopped","_ctx","_cache","_openBlock","_createBlock","WheelConstruction","isMsk","_unref","default","_withCtx","_createVNode","WheelRotation","stopOnSegmentIndex","segmentsCount","onRotationStopped","_createElementVNode","class","ref_key","height","_normalizeStyle","_","__exports__","props","Boolean","headerImg","outlineImg","middleImg","_createElementBlock","_normalizeClass","disabled","WebpImage","alt","cssClass","_renderSlot","$slots"],"sourceRoot":""}