rte-utils 1.2.43 → 1.2.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,56 @@
1
1
  import React from 'react';
2
2
  import './Timer.css';
3
3
  export interface TimerProps {
4
- progressEndDate?: number;
5
- leftTime?: number;
6
- progressTime?: number;
4
+ phases: {
5
+ duration: number;
6
+ title?: string;
7
+ }[];
8
+ externalState: {
9
+ currentPhase: number;
10
+ currentTime: number;
11
+ isRunning: boolean;
12
+ isPaused: boolean;
13
+ isFrozen: boolean;
14
+ };
15
+ onStateChange: (state: {
16
+ currentPhase: number;
17
+ currentTime: number;
18
+ isRunning: boolean;
19
+ isPaused: boolean;
20
+ isFrozen: boolean;
21
+ }) => void;
22
+ onComplete?: () => void;
23
+ onPhaseComplete?: (phaseIndex: number, phaseDuration: number) => void;
24
+ onTick?: (currentTime: number, phaseIndex: number) => void;
25
+ onStart?: () => void;
26
+ onPause?: () => void;
27
+ onFreeze?: (frozen: boolean) => void;
28
+ onAnonymiseToggle?: (anonymised: boolean) => void;
29
+ onStop?: () => void;
30
+ onReset?: () => void;
31
+ onPrevious?: () => void;
32
+ onNext?: () => void;
33
+ onPhaseClick?: (phaseIndex: number) => void;
7
34
  className?: string;
35
+ gameActions?: {
36
+ [phaseIndex: number]: string;
37
+ };
38
+ user?: 'actor' | 'admin';
8
39
  }
9
- export declare const Timer: React.FC<TimerProps>;
40
+ export interface TimerRef {
41
+ start: () => void;
42
+ pause: () => void;
43
+ freeze: (force?: boolean) => void;
44
+ toggleAnonymise: (force?: boolean) => void;
45
+ stop: () => void;
46
+ reset: () => void;
47
+ setPhases: (phases: {
48
+ duration: number;
49
+ title?: string;
50
+ }[]) => void;
51
+ getCurrentTime: () => number;
52
+ getCurrentPhase: () => number;
53
+ isRunning: () => boolean;
54
+ isPaused: () => boolean;
55
+ }
56
+ export declare const Timer: React.ForwardRefExoticComponent<TimerProps & React.RefAttributes<TimerRef>>;
@@ -4,9 +4,14 @@ declare const meta: Meta<typeof Timer>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof meta>;
6
6
  export declare const Default: Story;
7
- export declare const LiveProgress: Story;
8
- export declare const PausedAt20Percent: Story;
9
- export declare const PausedAt50Percent: Story;
10
- export declare const PausedAt80Percent: Story;
11
- export declare const WithCustomClassName: Story;
12
- export declare const CompleteProgress: Story;
7
+ export declare const GameTimer: Story;
8
+ export declare const SinglePhase: Story;
9
+ export declare const MinimalTimer: Story;
10
+ export declare const ProgressOnly: Story;
11
+ export declare const WithPhaseTitles: Story;
12
+ export declare const WithCallbacks: Story;
13
+ export declare const ControlledTimer: Story;
14
+ export declare const FreezeDemo: Story;
15
+ export declare const AdminUser: Story;
16
+ export declare const ActorUser: Story;
17
+ export declare const UserComparison: Story;
@@ -7,3 +7,4 @@ export { InputNumber } from './InputNumber';
7
7
  export { Avatar } from './Avatar';
8
8
  export { ValueWithUnit } from './ValueWithUnit';
9
9
  export { Timer } from './Timer';
10
+ export type { TimerProps, TimerRef } from './Timer';
package/dist/index.css CHANGED
@@ -1 +1 @@
1
- .input-container,.input-field{position:relative;width:100%}.input-element{background-color:#fff;border:2px solid #e0e0e0;border-radius:4px;box-sizing:border-box;font-size:16px;outline:none;padding:8px 0 8px 12px;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.input-element:focus{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-label{background-color:#fff;color:#999;font-size:16px;left:12px;padding:0 4px;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:all .2s ease;white-space:nowrap}.input-required{color:#e74c3c;margin-left:2px}.input-container--floating .input-label,.input-container--focused .input-label{font-size:12px;font-weight:500;top:0;transform:translateY(-50%)}.input-container--focused .input-element{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-container--focused .input-label{color:#009cdf}.input-container--error .input-element{border-color:#e74c3c}.input-container--error .input-element:focus{border-color:#e74c3c;box-shadow:0 0 0 2px rgba(231,76,60,.1)}.input-container--error .input-label,.input-error{color:#e74c3c}.input-error{font-size:12px;margin-top:4px;padding-left:12px}.input-container--disabled .input-element{background-color:#f5f5f5;border-color:#d0d0d0;color:#999;cursor:not-allowed}.input-container--disabled .input-label{color:#999}.input-element:not(:disabled):hover{border-color:#009cdf}.input-container--error .input-element:not(:disabled):hover{border-color:#e74c3c}.input-element:-webkit-autofill{-webkit-text-fill-color:inherit!important}.input-element:-webkit-autofill,.input-element:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 30px #fff!important}.input-container--small .input-element{font-size:14px;padding:12px 8px 6px}.input-container--small .input-label{font-size:14px;left:8px}.input-container--small.input-container--floating .input-label,.input-container--small.input-container--focused .input-label{font-size:10px}.input-container--large .input-element{font-size:18px;padding:20px 16px 10px}.input-container--large .input-label{font-size:18px;left:16px}.input-container--large.input-container--floating .input-label,.input-container--large.input-container--focused .input-label{font-size:14px}.input-constraints{align-items:center;display:flex;gap:8px;justify-content:space-between}.input-max,.input-min{color:#999;font-size:12px;text-align:center}.input-container--focused .input-max,.input-container--focused .input-min{color:#009cdf;font-weight:500}.input-element[type=number]::-webkit-inner-spin-button,.input-element[type=number]::-webkit-outer-spin-button{-webkit-appearance:auto;cursor:pointer;margin:0;opacity:1}.input-element[type=number]{-moz-appearance:textfield}.input-element[type=number]:hover::-webkit-inner-spin-button,.input-element[type=number]:hover::-webkit-outer-spin-button{opacity:1}.switch-container{align-items:center;display:flex;gap:8px}.switch-wrapper{align-items:center;display:flex;flex-direction:column;gap:4px}.switch-icon{height:16px;width:16px}.switch-icon,.switch-label{align-items:center;display:flex;justify-content:center}.switch-label{color:#666;font-size:12px;font-weight:500;min-height:16px;padding:0 2px}.switch-power-icon{height:100%;object-fit:contain;width:100%}.switch{background:none;border:none;cursor:pointer;outline:none;padding:0;transition:all .2s ease}.switch:focus-visible{outline:2px solid #009cdf;outline-offset:2px}.switch--disabled{cursor:not-allowed;opacity:.5}.switch-track{background-color:#999fa1;border-radius:60px;display:block;position:relative;transition:background-color .2s ease}.switch--checked .switch-track{background-color:#82d4f6}.switch-wrapper--checked .switch-label{color:#82d4f6}.switch-thumb{align-items:center;background-color:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2);display:flex;justify-content:center;left:0;position:absolute;top:-3px;transition:transform .2s ease}.switch-thumb-icon{height:100%;object-fit:contain;width:100%}.switch-track{height:10px;width:32px}.switch-thumb{height:16px;width:16px}.switch--checked .switch-thumb{transform:translateX(16px)}.switch:not(.switch--disabled):hover .switch-track{filter:brightness(1.1)}.switch:not(.switch--disabled):active .switch-thumb{transform:scale(1.1)}.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(16px) scale(1.1)}.switch--small.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(12px) scale(1.1)}.switch--large.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(20px) scale(1.1)}.production-unit-container{align-items:center;display:flex;height:64px;justify-content:space-between;padding-right:24px}.production-unit-content{align-items:center;display:flex;gap:16px}.production-unit-chip{display:flex;flex-direction:column;flex-shrink:0}.production-unit-chip-name{word-wrap:break-word;color:#11161a;font-size:16px;font-weight:600;line-height:24px}.production-unit-switch-container{width:156px}.chip-container{align-items:center;background-color:var(--chip-bg-color,#e0e0e0);border-radius:60px;color:var(--chip-text-color,#000);display:inline-flex;min-width:84px;padding:4px 8px}.chip-container--fit-content{width:fit-content}.chip-container--full-width{width:100%}.chip-content{align-items:center;display:flex;flex-grow:1;gap:.5rem;justify-content:center}.chip-label{font-size:14px;font-weight:600;margin:0}.production-unit-container-box{border-radius:64px;box-shadow:0 2px 16px 0 rgba(0,0,0,.16);box-sizing:border-box;width:100%}@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");*{font-family:Open Sans,sans-serif}.histogram-container{height:auto;max-width:54px;position:relative}.histogram-container--horizontal{max-width:none;width:auto}.histogram-content{align-items:center;display:flex;flex-direction:column;gap:8px;width:100%}.histogram-content--horizontal{align-items:center;flex-direction:row;height:100%}.histogram-bar{position:relative}.histogram-svg{display:block}.histogram-text-container{align-items:center;display:flex;flex-direction:column;gap:0;justify-content:center;width:100%}.histogram-text-container--horizontal{align-items:flex-start;margin-left:8px}.histogram-value-container{text-align:center;width:40px}.histogram-value{font-size:16px;line-height:14px}.histogram-unit,.histogram-value{color:#000;display:block;font-weight:600;margin:0}.histogram-unit{font-size:12px}.histogram-label{color:#6f6f6f;font-size:12px;font-style:normal;font-weight:400;line-height:18px;margin:0;text-align:left;white-space:nowrap}.avatar-container{align-items:center;border:1px solid #f5f3ed;border-radius:50%;color:#333;display:inline-flex;font-size:20px;font-weight:500;height:64px;justify-content:center;overflow:hidden;position:relative;user-select:none;width:64px}.avatar-container--clickable{cursor:pointer;transition:transform .2s ease,box-shadow .2s ease}.avatar-container--clickable:hover{box-shadow:0 2px 8px rgba(0,0,0,.15);transform:scale(1.05)}.avatar-container--clickable:active{transform:scale(.95)}.avatar-content{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.avatar-content img{height:100%;object-fit:cover;width:100%}.avatar-content{line-height:1;text-transform:uppercase}.cost-text-container{align-items:baseline;display:flex;gap:3px}.cost-number{font-size:16px;font-weight:700}.cost-unit{font-size:16px;font-weight:500}.cost-number,.cost-unit{letter-spacing:0;line-height:14px}.cost-unit-per{font-size:12px;font-weight:400;letter-spacing:0;line-height:18px;text-transform:uppercase}.timer-progress-bar{background:#000;border-radius:4px;height:8px;overflow:hidden;position:relative;width:124px}.timer-progress-fill{background:#009cdf;border-radius:4px;height:100%;transition:width .3s ease}
1
+ .input-container,.input-field{position:relative;width:100%}.input-element{background-color:#fff;border:2px solid #e0e0e0;border-radius:4px;box-sizing:border-box;font-size:16px;outline:none;padding:8px 0 8px 12px;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.input-element:focus{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-label{background-color:#fff;color:#999;font-size:16px;left:12px;padding:0 4px;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:all .2s ease;white-space:nowrap}.input-required{color:#e74c3c;margin-left:2px}.input-container--floating .input-label,.input-container--focused .input-label{font-size:12px;font-weight:500;top:0;transform:translateY(-50%)}.input-container--focused .input-element{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-container--focused .input-label{color:#009cdf}.input-container--error .input-element{border-color:#e74c3c}.input-container--error .input-element:focus{border-color:#e74c3c;box-shadow:0 0 0 2px rgba(231,76,60,.1)}.input-container--error .input-label,.input-error{color:#e74c3c}.input-error{font-size:12px;margin-top:4px;padding-left:12px}.input-container--disabled .input-element{background-color:#f5f5f5;border-color:#d0d0d0;color:#999;cursor:not-allowed}.input-container--disabled .input-label{color:#999}.input-element:not(:disabled):hover{border-color:#009cdf}.input-container--error .input-element:not(:disabled):hover{border-color:#e74c3c}.input-element:-webkit-autofill{-webkit-text-fill-color:inherit!important}.input-element:-webkit-autofill,.input-element:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 30px #fff!important}.input-container--small .input-element{font-size:14px;padding:12px 8px 6px}.input-container--small .input-label{font-size:14px;left:8px}.input-container--small.input-container--floating .input-label,.input-container--small.input-container--focused .input-label{font-size:10px}.input-container--large .input-element{font-size:18px;padding:20px 16px 10px}.input-container--large .input-label{font-size:18px;left:16px}.input-container--large.input-container--floating .input-label,.input-container--large.input-container--focused .input-label{font-size:14px}.input-constraints{align-items:center;display:flex;gap:8px;justify-content:space-between}.input-max,.input-min{color:#999;font-size:12px;text-align:center}.input-container--focused .input-max,.input-container--focused .input-min{color:#009cdf;font-weight:500}.input-element[type=number]::-webkit-inner-spin-button,.input-element[type=number]::-webkit-outer-spin-button{-webkit-appearance:auto;cursor:pointer;margin:0;opacity:1}.input-element[type=number]{-moz-appearance:textfield}.input-element[type=number]:hover::-webkit-inner-spin-button,.input-element[type=number]:hover::-webkit-outer-spin-button{opacity:1}.switch-container{align-items:center;display:flex;gap:8px}.switch-wrapper{align-items:center;display:flex;flex-direction:column;gap:4px}.switch-icon{height:16px;width:16px}.switch-icon,.switch-label{align-items:center;display:flex;justify-content:center}.switch-label{color:#666;font-size:12px;font-weight:500;min-height:16px;padding:0 2px}.switch-power-icon{height:100%;object-fit:contain;width:100%}.switch{background:none;border:none;cursor:pointer;outline:none;padding:0;transition:all .2s ease}.switch:focus-visible{outline:2px solid #009cdf;outline-offset:2px}.switch--disabled{cursor:not-allowed;opacity:.5}.switch-track{background-color:#999fa1;border-radius:60px;display:block;position:relative;transition:background-color .2s ease}.switch--checked .switch-track{background-color:#82d4f6}.switch-wrapper--checked .switch-label{color:#82d4f6}.switch-thumb{align-items:center;background-color:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2);display:flex;justify-content:center;left:0;position:absolute;top:-3px;transition:transform .2s ease}.switch-thumb-icon{height:100%;object-fit:contain;width:100%}.switch-track{height:10px;width:32px}.switch-thumb{height:16px;width:16px}.switch--checked .switch-thumb{transform:translateX(16px)}.switch:not(.switch--disabled):hover .switch-track{filter:brightness(1.1)}.switch:not(.switch--disabled):active .switch-thumb{transform:scale(1.1)}.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(16px) scale(1.1)}.switch--small.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(12px) scale(1.1)}.switch--large.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(20px) scale(1.1)}.production-unit-container{align-items:center;display:flex;height:64px;justify-content:space-between;padding-right:24px}.production-unit-content{align-items:center;display:flex;gap:16px}.production-unit-chip{display:flex;flex-direction:column;flex-shrink:0}.production-unit-chip-name{word-wrap:break-word;color:#11161a;font-size:16px;font-weight:600;line-height:24px}.production-unit-switch-container{width:156px}.chip-container{align-items:center;background-color:var(--chip-bg-color,#e0e0e0);border-radius:60px;color:var(--chip-text-color,#000);display:inline-flex;min-width:84px;padding:4px 8px}.chip-container--fit-content{width:fit-content}.chip-container--full-width{width:100%}.chip-content{align-items:center;display:flex;flex-grow:1;gap:.5rem;justify-content:center}.chip-label{font-size:14px;font-weight:600;margin:0}.production-unit-container-box{border-radius:64px;box-shadow:0 2px 16px 0 rgba(0,0,0,.16);box-sizing:border-box;width:100%}@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");*{font-family:Open Sans,sans-serif}.histogram-container{height:auto;max-width:54px;position:relative}.histogram-container--horizontal{max-width:none;width:auto}.histogram-content{align-items:center;display:flex;flex-direction:column;gap:8px;width:100%}.histogram-content--horizontal{align-items:center;flex-direction:row;height:100%}.histogram-bar{position:relative}.histogram-svg{display:block}.histogram-text-container{align-items:center;display:flex;flex-direction:column;gap:0;justify-content:center;width:100%}.histogram-text-container--horizontal{align-items:flex-start;margin-left:8px}.histogram-value-container{text-align:center;width:40px}.histogram-value{font-size:16px;line-height:14px}.histogram-unit,.histogram-value{color:#000;display:block;font-weight:600;margin:0}.histogram-unit{font-size:12px}.histogram-label{color:#6f6f6f;font-size:12px;font-style:normal;font-weight:400;line-height:18px;margin:0;text-align:left;white-space:nowrap}.avatar-container{align-items:center;border:1px solid #f5f3ed;border-radius:50%;color:#333;display:inline-flex;font-size:20px;font-weight:500;height:64px;justify-content:center;overflow:hidden;position:relative;user-select:none;width:64px}.avatar-container--clickable{cursor:pointer;transition:transform .2s ease,box-shadow .2s ease}.avatar-container--clickable:hover{box-shadow:0 2px 8px rgba(0,0,0,.15);transform:scale(1.05)}.avatar-container--clickable:active{transform:scale(.95)}.avatar-content{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.avatar-content img{height:100%;object-fit:cover;width:100%}.avatar-content{line-height:1;text-transform:uppercase}.cost-text-container{align-items:baseline;display:flex;gap:3px}.cost-number{font-size:16px;font-weight:700}.cost-unit{font-size:16px;font-weight:500}.cost-number,.cost-unit{letter-spacing:0;line-height:14px}.cost-unit-per{font-size:12px;font-weight:400;letter-spacing:0;line-height:18px;text-transform:uppercase}.timer-header-control{border:1px solid red;box-sizing:border-box;display:flex;font-family:Open Sans,sans-serif;width:100%}.timer-section{background-color:#fff;border-bottom-left-radius:16px;border-top-left-radius:16px;display:flex;flex-shrink:0;padding:10px 0 10px 16px}.timer-content{align-items:center;display:flex;gap:8px;padding-right:8px}.timer-display-area{display:flex;flex-direction:column;flex-shrink:0;gap:10px}.timer-header{align-items:baseline;color:#11161a;display:flex;justify-content:space-between;width:124px}.timer-title{flex-shrink:0;font-size:12px;font-weight:700;line-height:12px;min-width:64px;text-align:left;text-transform:uppercase}.timer-time,.timer-title{font-family:Open Sans,sans-serif}.timer-time{font-size:20px;font-weight:600;line-height:14px;text-align:right;white-space:nowrap;width:61px}.timer-progress-bar{background:#000;border-radius:4px;height:8px;overflow:hidden;position:relative;width:124px}.timer-progress-fill{background:#009cdf;border-radius:4px;height:100%;transition:width .3s ease}.step-indicators{align-items:center;display:flex;gap:4px}.step-indicator{align-items:center;border-radius:50%;color:#fff;display:flex;flex-shrink:0;font-family:Open Sans,sans-serif;font-size:12px;font-weight:600;height:16px;justify-content:center;line-height:18px;width:16px}.step-indicator--active{background-color:#009cdf}.step-indicator--active.step-indicator--actor{height:40px;margin-right:4px;width:40px}.step-indicator--active.step-indicator--admin{height:16px;width:16px}.step-indicator--completed{background-color:#005896}.step-indicator--upcoming{background-color:#b7bec2}.step-expand{align-items:center;background-color:#292e33;border-radius:50%;color:#fff;display:flex;justify-content:center;margin-left:4px;transform:rotate(90deg)}.timer-controls-section{align-items:center;align-self:stretch;background-color:#fff;display:flex;flex-shrink:0;gap:10px;padding:10px 16px 10px 10px}.control-button{align-items:center;background:none;background:#d9d9d9;border:none;cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;position:relative;width:24px}.control-button,.control-button:before{border-radius:50%;height:32px;width:32px}.control-button:before{background:radial-gradient(circle,rgba(0,0,0,.1) 0,transparent 70%);content:"";left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:-1}.control-button:hover:before{background:radial-gradient(circle,rgba(0,0,0,.15) 0,transparent 70%)}.control-button svg{color:#000;height:16px;width:16px}.timer--running .step-indicator--active{animation:pulse 1s ease-in-out infinite alternate}.timer--frozen .timer-progress-fill{background:#7aa6b9}.control-button--anonymise-active{background-color:#444;color:#fff}.control-button--freeze-active{background:#7aa6b9}.control-button--freeze-active svg path{fill:#000}@keyframes pulse{0%{background-color:#009cdf}to{background-color:#0081b8}}.step-indicator--placeholder{background-color:#e9ecef;color:#6c757d;position:relative}.step-indicator--placeholder:after{content:attr(data-step);font-size:10px;font-weight:700;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.step-expand.step-expand--end{background-color:#1a7f37;transform:none}.timer-header--block{display:flex;flex-direction:column;gap:10px;margin-right:10px}@media (max-width:480px){.timer-header-control{flex-direction:column}.timer-section{border-radius:16px 16px 0 0}.timer-controls-section{border-radius:0 0 16px 16px;justify-content:center}}.step-indicator--clickable{cursor:pointer;position:relative;transition:background-color .2s ease,box-shadow .2s ease,transform .1s ease}.step-indicator--clickable:focus-visible{box-shadow:0 0 0 2px #11161a;outline:2px solid #fff;outline-offset:2px}.step-indicator--clickable:hover{filter:brightness(1.1)}.step-indicator--clickable:active{transform:scale(.9)}.step-indicator--selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #ffb100}
@@ -1 +1 @@
1
- .input-container,.input-field{position:relative;width:100%}.input-element{background-color:#fff;border:2px solid #e0e0e0;border-radius:4px;box-sizing:border-box;font-size:16px;outline:none;padding:8px 0 8px 12px;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.input-element:focus{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-label{background-color:#fff;color:#999;font-size:16px;left:12px;padding:0 4px;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:all .2s ease;white-space:nowrap}.input-required{color:#e74c3c;margin-left:2px}.input-container--floating .input-label,.input-container--focused .input-label{font-size:12px;font-weight:500;top:0;transform:translateY(-50%)}.input-container--focused .input-element{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-container--focused .input-label{color:#009cdf}.input-container--error .input-element{border-color:#e74c3c}.input-container--error .input-element:focus{border-color:#e74c3c;box-shadow:0 0 0 2px rgba(231,76,60,.1)}.input-container--error .input-label,.input-error{color:#e74c3c}.input-error{font-size:12px;margin-top:4px;padding-left:12px}.input-container--disabled .input-element{background-color:#f5f5f5;border-color:#d0d0d0;color:#999;cursor:not-allowed}.input-container--disabled .input-label{color:#999}.input-element:not(:disabled):hover{border-color:#009cdf}.input-container--error .input-element:not(:disabled):hover{border-color:#e74c3c}.input-element:-webkit-autofill{-webkit-text-fill-color:inherit!important}.input-element:-webkit-autofill,.input-element:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 30px #fff!important}.input-container--small .input-element{font-size:14px;padding:12px 8px 6px}.input-container--small .input-label{font-size:14px;left:8px}.input-container--small.input-container--floating .input-label,.input-container--small.input-container--focused .input-label{font-size:10px}.input-container--large .input-element{font-size:18px;padding:20px 16px 10px}.input-container--large .input-label{font-size:18px;left:16px}.input-container--large.input-container--floating .input-label,.input-container--large.input-container--focused .input-label{font-size:14px}.input-constraints{align-items:center;display:flex;gap:8px;justify-content:space-between}.input-max,.input-min{color:#999;font-size:12px;text-align:center}.input-container--focused .input-max,.input-container--focused .input-min{color:#009cdf;font-weight:500}.input-element[type=number]::-webkit-inner-spin-button,.input-element[type=number]::-webkit-outer-spin-button{-webkit-appearance:auto;cursor:pointer;margin:0;opacity:1}.input-element[type=number]{-moz-appearance:textfield}.input-element[type=number]:hover::-webkit-inner-spin-button,.input-element[type=number]:hover::-webkit-outer-spin-button{opacity:1}.switch-container{align-items:center;display:flex;gap:8px}.switch-wrapper{align-items:center;display:flex;flex-direction:column;gap:4px}.switch-icon{height:16px;width:16px}.switch-icon,.switch-label{align-items:center;display:flex;justify-content:center}.switch-label{color:#666;font-size:12px;font-weight:500;min-height:16px;padding:0 2px}.switch-power-icon{height:100%;object-fit:contain;width:100%}.switch{background:none;border:none;cursor:pointer;outline:none;padding:0;transition:all .2s ease}.switch:focus-visible{outline:2px solid #009cdf;outline-offset:2px}.switch--disabled{cursor:not-allowed;opacity:.5}.switch-track{background-color:#999fa1;border-radius:60px;display:block;position:relative;transition:background-color .2s ease}.switch--checked .switch-track{background-color:#82d4f6}.switch-wrapper--checked .switch-label{color:#82d4f6}.switch-thumb{align-items:center;background-color:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2);display:flex;justify-content:center;left:0;position:absolute;top:-3px;transition:transform .2s ease}.switch-thumb-icon{height:100%;object-fit:contain;width:100%}.switch-track{height:10px;width:32px}.switch-thumb{height:16px;width:16px}.switch--checked .switch-thumb{transform:translateX(16px)}.switch:not(.switch--disabled):hover .switch-track{filter:brightness(1.1)}.switch:not(.switch--disabled):active .switch-thumb{transform:scale(1.1)}.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(16px) scale(1.1)}.switch--small.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(12px) scale(1.1)}.switch--large.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(20px) scale(1.1)}.production-unit-container{align-items:center;display:flex;height:64px;justify-content:space-between;padding-right:24px}.production-unit-content{align-items:center;display:flex;gap:16px}.production-unit-chip{display:flex;flex-direction:column;flex-shrink:0}.production-unit-chip-name{word-wrap:break-word;color:#11161a;font-size:16px;font-weight:600;line-height:24px}.production-unit-switch-container{width:156px}.chip-container{align-items:center;background-color:var(--chip-bg-color,#e0e0e0);border-radius:60px;color:var(--chip-text-color,#000);display:inline-flex;min-width:84px;padding:4px 8px}.chip-container--fit-content{width:fit-content}.chip-container--full-width{width:100%}.chip-content{align-items:center;display:flex;flex-grow:1;gap:.5rem;justify-content:center}.chip-label{font-size:14px;font-weight:600;margin:0}.production-unit-container-box{border-radius:64px;box-shadow:0 2px 16px 0 rgba(0,0,0,.16);box-sizing:border-box;width:100%}@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");*{font-family:Open Sans,sans-serif}.histogram-container{height:auto;max-width:54px;position:relative}.histogram-container--horizontal{max-width:none;width:auto}.histogram-content{align-items:center;display:flex;flex-direction:column;gap:8px;width:100%}.histogram-content--horizontal{align-items:center;flex-direction:row;height:100%}.histogram-bar{position:relative}.histogram-svg{display:block}.histogram-text-container{align-items:center;display:flex;flex-direction:column;gap:0;justify-content:center;width:100%}.histogram-text-container--horizontal{align-items:flex-start;margin-left:8px}.histogram-value-container{text-align:center;width:40px}.histogram-value{font-size:16px;line-height:14px}.histogram-unit,.histogram-value{color:#000;display:block;font-weight:600;margin:0}.histogram-unit{font-size:12px}.histogram-label{color:#6f6f6f;font-size:12px;font-style:normal;font-weight:400;line-height:18px;margin:0;text-align:left;white-space:nowrap}.avatar-container{align-items:center;border:1px solid #f5f3ed;border-radius:50%;color:#333;display:inline-flex;font-size:20px;font-weight:500;height:64px;justify-content:center;overflow:hidden;position:relative;user-select:none;width:64px}.avatar-container--clickable{cursor:pointer;transition:transform .2s ease,box-shadow .2s ease}.avatar-container--clickable:hover{box-shadow:0 2px 8px rgba(0,0,0,.15);transform:scale(1.05)}.avatar-container--clickable:active{transform:scale(.95)}.avatar-content{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.avatar-content img{height:100%;object-fit:cover;width:100%}.avatar-content{line-height:1;text-transform:uppercase}.cost-text-container{align-items:baseline;display:flex;gap:3px}.cost-number{font-size:16px;font-weight:700}.cost-unit{font-size:16px;font-weight:500}.cost-number,.cost-unit{letter-spacing:0;line-height:14px}.cost-unit-per{font-size:12px;font-weight:400;letter-spacing:0;line-height:18px;text-transform:uppercase}.timer-progress-bar{background:#000;border-radius:4px;height:8px;overflow:hidden;position:relative;width:124px}.timer-progress-fill{background:#009cdf;border-radius:4px;height:100%;transition:width .3s ease}
1
+ .input-container,.input-field{position:relative;width:100%}.input-element{background-color:#fff;border:2px solid #e0e0e0;border-radius:4px;box-sizing:border-box;font-size:16px;outline:none;padding:8px 0 8px 12px;transition:border-color .2s ease,box-shadow .2s ease;width:100%}.input-element:focus{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-label{background-color:#fff;color:#999;font-size:16px;left:12px;padding:0 4px;pointer-events:none;position:absolute;top:50%;transform:translateY(-50%);transition:all .2s ease;white-space:nowrap}.input-required{color:#e74c3c;margin-left:2px}.input-container--floating .input-label,.input-container--focused .input-label{font-size:12px;font-weight:500;top:0;transform:translateY(-50%)}.input-container--focused .input-element{border-color:#009cdf;box-shadow:0 0 0 2px rgba(0,156,223,.1)}.input-container--focused .input-label{color:#009cdf}.input-container--error .input-element{border-color:#e74c3c}.input-container--error .input-element:focus{border-color:#e74c3c;box-shadow:0 0 0 2px rgba(231,76,60,.1)}.input-container--error .input-label,.input-error{color:#e74c3c}.input-error{font-size:12px;margin-top:4px;padding-left:12px}.input-container--disabled .input-element{background-color:#f5f5f5;border-color:#d0d0d0;color:#999;cursor:not-allowed}.input-container--disabled .input-label{color:#999}.input-element:not(:disabled):hover{border-color:#009cdf}.input-container--error .input-element:not(:disabled):hover{border-color:#e74c3c}.input-element:-webkit-autofill{-webkit-text-fill-color:inherit!important}.input-element:-webkit-autofill,.input-element:-webkit-autofill:focus{-webkit-box-shadow:inset 0 0 0 30px #fff!important}.input-container--small .input-element{font-size:14px;padding:12px 8px 6px}.input-container--small .input-label{font-size:14px;left:8px}.input-container--small.input-container--floating .input-label,.input-container--small.input-container--focused .input-label{font-size:10px}.input-container--large .input-element{font-size:18px;padding:20px 16px 10px}.input-container--large .input-label{font-size:18px;left:16px}.input-container--large.input-container--floating .input-label,.input-container--large.input-container--focused .input-label{font-size:14px}.input-constraints{align-items:center;display:flex;gap:8px;justify-content:space-between}.input-max,.input-min{color:#999;font-size:12px;text-align:center}.input-container--focused .input-max,.input-container--focused .input-min{color:#009cdf;font-weight:500}.input-element[type=number]::-webkit-inner-spin-button,.input-element[type=number]::-webkit-outer-spin-button{-webkit-appearance:auto;cursor:pointer;margin:0;opacity:1}.input-element[type=number]{-moz-appearance:textfield}.input-element[type=number]:hover::-webkit-inner-spin-button,.input-element[type=number]:hover::-webkit-outer-spin-button{opacity:1}.switch-container{align-items:center;display:flex;gap:8px}.switch-wrapper{align-items:center;display:flex;flex-direction:column;gap:4px}.switch-icon{height:16px;width:16px}.switch-icon,.switch-label{align-items:center;display:flex;justify-content:center}.switch-label{color:#666;font-size:12px;font-weight:500;min-height:16px;padding:0 2px}.switch-power-icon{height:100%;object-fit:contain;width:100%}.switch{background:none;border:none;cursor:pointer;outline:none;padding:0;transition:all .2s ease}.switch:focus-visible{outline:2px solid #009cdf;outline-offset:2px}.switch--disabled{cursor:not-allowed;opacity:.5}.switch-track{background-color:#999fa1;border-radius:60px;display:block;position:relative;transition:background-color .2s ease}.switch--checked .switch-track{background-color:#82d4f6}.switch-wrapper--checked .switch-label{color:#82d4f6}.switch-thumb{align-items:center;background-color:#fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2);display:flex;justify-content:center;left:0;position:absolute;top:-3px;transition:transform .2s ease}.switch-thumb-icon{height:100%;object-fit:contain;width:100%}.switch-track{height:10px;width:32px}.switch-thumb{height:16px;width:16px}.switch--checked .switch-thumb{transform:translateX(16px)}.switch:not(.switch--disabled):hover .switch-track{filter:brightness(1.1)}.switch:not(.switch--disabled):active .switch-thumb{transform:scale(1.1)}.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(16px) scale(1.1)}.switch--small.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(12px) scale(1.1)}.switch--large.switch--checked:not(.switch--disabled):active .switch-thumb{transform:translateX(20px) scale(1.1)}.production-unit-container{align-items:center;display:flex;height:64px;justify-content:space-between;padding-right:24px}.production-unit-content{align-items:center;display:flex;gap:16px}.production-unit-chip{display:flex;flex-direction:column;flex-shrink:0}.production-unit-chip-name{word-wrap:break-word;color:#11161a;font-size:16px;font-weight:600;line-height:24px}.production-unit-switch-container{width:156px}.chip-container{align-items:center;background-color:var(--chip-bg-color,#e0e0e0);border-radius:60px;color:var(--chip-text-color,#000);display:inline-flex;min-width:84px;padding:4px 8px}.chip-container--fit-content{width:fit-content}.chip-container--full-width{width:100%}.chip-content{align-items:center;display:flex;flex-grow:1;gap:.5rem;justify-content:center}.chip-label{font-size:14px;font-weight:600;margin:0}.production-unit-container-box{border-radius:64px;box-shadow:0 2px 16px 0 rgba(0,0,0,.16);box-sizing:border-box;width:100%}@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&display=swap");*{font-family:Open Sans,sans-serif}.histogram-container{height:auto;max-width:54px;position:relative}.histogram-container--horizontal{max-width:none;width:auto}.histogram-content{align-items:center;display:flex;flex-direction:column;gap:8px;width:100%}.histogram-content--horizontal{align-items:center;flex-direction:row;height:100%}.histogram-bar{position:relative}.histogram-svg{display:block}.histogram-text-container{align-items:center;display:flex;flex-direction:column;gap:0;justify-content:center;width:100%}.histogram-text-container--horizontal{align-items:flex-start;margin-left:8px}.histogram-value-container{text-align:center;width:40px}.histogram-value{font-size:16px;line-height:14px}.histogram-unit,.histogram-value{color:#000;display:block;font-weight:600;margin:0}.histogram-unit{font-size:12px}.histogram-label{color:#6f6f6f;font-size:12px;font-style:normal;font-weight:400;line-height:18px;margin:0;text-align:left;white-space:nowrap}.avatar-container{align-items:center;border:1px solid #f5f3ed;border-radius:50%;color:#333;display:inline-flex;font-size:20px;font-weight:500;height:64px;justify-content:center;overflow:hidden;position:relative;user-select:none;width:64px}.avatar-container--clickable{cursor:pointer;transition:transform .2s ease,box-shadow .2s ease}.avatar-container--clickable:hover{box-shadow:0 2px 8px rgba(0,0,0,.15);transform:scale(1.05)}.avatar-container--clickable:active{transform:scale(.95)}.avatar-content{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.avatar-content img{height:100%;object-fit:cover;width:100%}.avatar-content{line-height:1;text-transform:uppercase}.cost-text-container{align-items:baseline;display:flex;gap:3px}.cost-number{font-size:16px;font-weight:700}.cost-unit{font-size:16px;font-weight:500}.cost-number,.cost-unit{letter-spacing:0;line-height:14px}.cost-unit-per{font-size:12px;font-weight:400;letter-spacing:0;line-height:18px;text-transform:uppercase}.timer-header-control{border:1px solid red;box-sizing:border-box;display:flex;font-family:Open Sans,sans-serif;width:100%}.timer-section{background-color:#fff;border-bottom-left-radius:16px;border-top-left-radius:16px;display:flex;flex-shrink:0;padding:10px 0 10px 16px}.timer-content{align-items:center;display:flex;gap:8px;padding-right:8px}.timer-display-area{display:flex;flex-direction:column;flex-shrink:0;gap:10px}.timer-header{align-items:baseline;color:#11161a;display:flex;justify-content:space-between;width:124px}.timer-title{flex-shrink:0;font-size:12px;font-weight:700;line-height:12px;min-width:64px;text-align:left;text-transform:uppercase}.timer-time,.timer-title{font-family:Open Sans,sans-serif}.timer-time{font-size:20px;font-weight:600;line-height:14px;text-align:right;white-space:nowrap;width:61px}.timer-progress-bar{background:#000;border-radius:4px;height:8px;overflow:hidden;position:relative;width:124px}.timer-progress-fill{background:#009cdf;border-radius:4px;height:100%;transition:width .3s ease}.step-indicators{align-items:center;display:flex;gap:4px}.step-indicator{align-items:center;border-radius:50%;color:#fff;display:flex;flex-shrink:0;font-family:Open Sans,sans-serif;font-size:12px;font-weight:600;height:16px;justify-content:center;line-height:18px;width:16px}.step-indicator--active{background-color:#009cdf}.step-indicator--active.step-indicator--actor{height:40px;margin-right:4px;width:40px}.step-indicator--active.step-indicator--admin{height:16px;width:16px}.step-indicator--completed{background-color:#005896}.step-indicator--upcoming{background-color:#b7bec2}.step-expand{align-items:center;background-color:#292e33;border-radius:50%;color:#fff;display:flex;justify-content:center;margin-left:4px;transform:rotate(90deg)}.timer-controls-section{align-items:center;align-self:stretch;background-color:#fff;display:flex;flex-shrink:0;gap:10px;padding:10px 16px 10px 10px}.control-button{align-items:center;background:none;background:#d9d9d9;border:none;cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;position:relative;width:24px}.control-button,.control-button:before{border-radius:50%;height:32px;width:32px}.control-button:before{background:radial-gradient(circle,rgba(0,0,0,.1) 0,transparent 70%);content:"";left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);z-index:-1}.control-button:hover:before{background:radial-gradient(circle,rgba(0,0,0,.15) 0,transparent 70%)}.control-button svg{color:#000;height:16px;width:16px}.timer--running .step-indicator--active{animation:pulse 1s ease-in-out infinite alternate}.timer--frozen .timer-progress-fill{background:#7aa6b9}.control-button--anonymise-active{background-color:#444;color:#fff}.control-button--freeze-active{background:#7aa6b9}.control-button--freeze-active svg path{fill:#000}@keyframes pulse{0%{background-color:#009cdf}to{background-color:#0081b8}}.step-indicator--placeholder{background-color:#e9ecef;color:#6c757d;position:relative}.step-indicator--placeholder:after{content:attr(data-step);font-size:10px;font-weight:700;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.step-expand.step-expand--end{background-color:#1a7f37;transform:none}.timer-header--block{display:flex;flex-direction:column;gap:10px;margin-right:10px}@media (max-width:480px){.timer-header-control{flex-direction:column}.timer-section{border-radius:16px 16px 0 0}.timer-controls-section{border-radius:0 0 16px 16px;justify-content:center}}.step-indicator--clickable{cursor:pointer;position:relative;transition:background-color .2s ease,box-shadow .2s ease,transform .1s ease}.step-indicator--clickable:focus-visible{box-shadow:0 0 0 2px #11161a;outline:2px solid #fff;outline-offset:2px}.step-indicator--clickable:hover{filter:brightness(1.1)}.step-indicator--clickable:active{transform:scale(.9)}.step-indicator--selected{box-shadow:0 0 0 2px #fff,0 0 0 4px #ffb100}
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useState as a,useRef as e,useEffect as n}from"react";var o=function(o){var c=o.label,l=o.value,r=void 0===l?"":l,d=o.onChange,h=o.disabled,s=void 0!==h&&h,v=o.className,u=void 0===v?"":v,m=o.required,f=void 0!==m&&m,p=o.min,g=void 0===p?{value:0,label:"Pmin"}:p,b=o.max,N=void 0===b?{value:100,label:"Pmax"}:b,w=a(r),C=w[0],x=w[1],L=a(!1),R=L[0],M=L[1],y=a(!1),k=y[0],z=y[1],F=e(null);n(function(){x(r)},[r]);var P=["input-container",R?"input-container--focused":"",R||C.length>0?"input-container--floating":"",s?"input-container--disabled":"",k?"input-container--error":"",u].filter(Boolean).join(" ");return t("div",{className:P,children:i("div",{className:"input-constraints",children:[i("div",{className:"input-min",children:[g.label,t("br",{}),g.value]}),i("div",{className:"input-field",children:[t("input",{ref:F,type:"number",value:C,onChange:function(t){var i=t.target.value;if(x(i),""!==i){var a=parseFloat(i);if(isNaN(a))z(!1),null==d||d(i);else{var e=a<g.value||a>N.value;if(z(e),e){var n=Math.max(g.value,Math.min(N.value,a));null==d||d(n.toString())}else null==d||d(i)}}else z(!1),null==d||d(i)},onFocus:function(){M(!0)},onBlur:function(){if(M(!1),""!==C){var t=parseFloat(C);if(!isNaN(t)){var i=Math.max(g.value,Math.min(N.value,t));if(i!==t){var a=i.toString();x(a),null==d||d(a)}z(!1)}}},disabled:s,required:f,className:"input-element","aria-label":c,min:g.value,max:N.value,step:1}),i("label",{className:"input-label",children:[c,f&&t("span",{className:"input-required",children:"*"})]})]}),i("div",{className:"input-max",children:[N.label,t("br",{})," ",N.value]})]})})},c=function(i){var a=i.isOff;return t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z",fill:a?"#999FA1":"#009CDF"})})},l=function(i){var a=i.isOff;return t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("circle",{cx:"16",cy:"16",r:"16",fill:a?"white":"#009cdf"})})},r=function(e){var n=e.checked,o=void 0!==n&&n,r=e.onChange,d=e.disabled,h=void 0!==d&&d,s=e.showIcon,v=void 0===s||s,u=e.label,m=a(o),f=m[0],p=m[1],g=void 0!==o?o:f,b=["switch",g?"switch--checked":"",h?"switch--disabled":""].filter(Boolean).join(" "),N=["switch-wrapper",g?"switch-wrapper--checked":""].filter(Boolean).join(" ");return t("div",{className:"switch-container",children:i("div",{className:N,children:[v?t("div",{className:"switch-icon",children:t(c,{isOff:!g})}):u?t("div",{className:"switch-label",children:u}):null,t("button",{type:"button",role:"switch","aria-checked":g,className:b,onClick:function(){if(!h){var t=!g;void 0===o&&p(t),null==r||r(t)}},disabled:h,children:t("span",{className:"switch-track",children:t("span",{className:"switch-thumb",children:t(l,{isOff:!g})})})})]})})},d=function(i){var a=i.children,e=i.bgColor,n=i.width,o=["chip-container","full-width"===(void 0===n?"fit-content":n)?"chip-container--full-width":"chip-container--fit-content"].join(" ");return t("div",{className:o,style:{backgroundColor:e},children:t("div",{className:"chip-content",children:t("div",{className:"chip-label",children:a})})})},h=function(i){var a=i.bgColor,e=void 0===a?"#fff":a,n=i.children,o=i.height;return t("div",{className:"production-unit-container-box",style:{backgroundColor:e,height:o},children:n})},s=function(e){var n=e.onChangeInput,c=e.onChangeSwitch,l=e.defaultValue,s=e.defaultChecked,v=void 0!==s&&s,u=e.value,f=e.checked,p=e.unitName,g=void 0===p?"Production Unit":p,b=e.energyCost,N=void 0===b?0:b,w=e.checkedImage,C=e.uncheckedImage,x=e.readonly,L=void 0!==x&&x,R=e.min,M=void 0===R?{value:10,label:"Pmin"}:R,y=e.max,k=void 0===y?{value:100,label:"Pmax"}:y,z=a(v),F=z[0],P=z[1],B=a(l),D=B[0],I=B[1],j=void 0!==f?f:F,q=void 0!==u?u:D;return t(h,{children:i("div",{className:"production-unit-container",children:[i("div",{className:"production-unit-content",children:[t("div",{className:"image-preview-container",children:j?w:C}),i("div",{className:"production-unit-chip",children:[t("div",{className:"production-unit-chip-name",children:g}),t(d,{width:"fit-content",bgColor:"#E1F5FD",children:t(m,{cost:N,textColor:"#005896"})})]}),i("div",{className:"production-unit-switch-container",children:[t(o,{label:"PA",onChange:function(t){if(""===t)return void 0===u&&I(void 0),void(n&&n(0));var i=parseFloat(t);isNaN(i)||(void 0===u&&I(i),n&&n(i))},value:void 0!==q?q.toString():void 0,disabled:!j||L,min:{value:M.value,label:M.label},max:{value:k.value,label:k.label}})," "]})]}),t(r,{checked:j,onChange:function(t){void 0===f&&P(t),c&&c(t)},disabled:L})]})})},v=function(e){var o,c,l,r,d=e.max,h=e.relative,s=e.barHeight,v=void 0===s?103:s,u=e.barWidth,m=void 0===u?32:u,f=e.orientation,p=void 0===f?"vertical":f,g=e.cornerRadius,b=e.children,N=a(0),w=N[0],C=N[1],x=a(0),L=x[0],R=x[1],M=Math.min(h.value/d.value*100,100)/100*v,y=Math.min(h.value/d.value*100,100)/100*("horizontal"===p?v:m);n(function(){C(0),R(0);var t=Date.now(),i=function(){var a=Date.now()-t,e=Math.min(a/1e3,1),n=1-Math.pow(1-e,4);C(M*n),R(y*n),e<1&&requestAnimationFrame(i)};requestAnimationFrame(i)},[M,y]);var k="horizontal"===p?v:m,z="horizontal"===p?m:v,F="horizontal"===p?v:m,P="horizontal"===p?m:v,B=function(t,i,a,e,n){var o=n.topLeft,c=n.topRight,l=n.bottomLeft,r=n.bottomRight;return"\n M ".concat(t+o," ").concat(i,"\n L ").concat(t+a-c," ").concat(i,"\n Q ").concat(t+a," ").concat(i," ").concat(t+a," ").concat(i+c,"\n L ").concat(t+a," ").concat(i+e-r,"\n Q ").concat(t+a," ").concat(i+e," ").concat(t+a-r," ").concat(i+e,"\n L ").concat(t+l," ").concat(i+e,"\n Q ").concat(t," ").concat(i+e," ").concat(t," ").concat(i+e-l,"\n L ").concat(t," ").concat(i+o,"\n Q ").concat(t," ").concat(i," ").concat(t+o," ").concat(i,"\n Z\n ").trim().replace(/\s+/g," ")},D={topLeft:2,topRight:2,bottomLeft:2,bottomRight:2},I=g?{topLeft:null!==(o=g.topLeft)&&void 0!==o?o:D.topLeft,topRight:null!==(c=g.topRight)&&void 0!==c?c:D.topRight,bottomLeft:null!==(l=g.bottomLeft)&&void 0!==l?l:D.bottomLeft,bottomRight:null!==(r=g.bottomRight)&&void 0!==r?r:D.bottomRight}:D;return t("div",{className:"histogram-container ".concat("horizontal"===p?"histogram-container--horizontal":""),children:i("div",{className:"histogram-content ".concat("horizontal"===p?"histogram-content--horizontal":""),children:[t("div",{className:"histogram-bar",style:{height:"".concat(z,"px"),width:"".concat(k,"px")},children:i("svg",{width:F,height:P,viewBox:"0 0 ".concat(F," ").concat(P),className:"histogram-svg",children:[t("defs",{children:t("clipPath",{id:"histogram-clip-".concat(F,"-").concat(P,"-").concat(I.topLeft),children:t("path",{d:B(0,0,F,P,I)})})}),t("path",{d:B(0,0,F,P,I),fill:d.color,fillOpacity:d.opacity||1}),t("path","vertical"===p?{d:B(0,P-w,F,w,{topLeft:w>=P?I.topLeft:0,topRight:w>=P?I.topRight:0,bottomLeft:I.bottomLeft,bottomRight:I.bottomRight}),fill:h.color,clipPath:"url(#histogram-clip-".concat(F,"-").concat(P,"-").concat(I.topLeft,")")}:{d:B(0,0,L,P,{topLeft:I.topLeft,topRight:L>=F?I.topRight:0,bottomLeft:I.bottomLeft,bottomRight:L>=F?I.bottomRight:0}),fill:h.color,clipPath:"url(#histogram-clip-".concat(F,"-").concat(P,"-").concat(I.topLeft,")")})]})}),b&&t("div",{className:"histogram-text-container ".concat("horizontal"===p?"histogram-text-container--horizontal":""),children:b})]})})},u=function(i){var a=i.children;return t("div",{className:"avatar-container avatar-container--clickable",children:t("div",{className:"avatar-content",children:a})})},m=function(a){var e=a.cost,n=a.textColor,o=a.type,c=void 0===o?"europermegawatt":o;return i("div",{className:"cost-text-container",children:[t("div",{className:"cost-number",style:{color:n},children:e}),t("div",{className:"cost-unit",style:{color:n},children:"euro"===c||"europermegawatt"===c?"€":"MWh"}),"europermegawatt"===c&&t("div",{className:"cost-unit-per",style:{color:n},children:"/MWh"})]})},f=function(i){var e=i.progressEndDate,o=i.leftTime,c=i.progressTime,l=i.className,r=void 0===l?"":l,d=a(0),h=d[0],s=d[1],v=a(Date.now())[0];return n(function(){var t=null;if(!e||o||c){if(void 0!==o&&void 0!==c){var i=Math.max(0,Math.min(100,(c-o)/c*100));s(i)}}else{var a=function(){var i=Date.now(),a=Math.max(0,e-i),n=e-v,o=i-v,c=Math.max(0,Math.min(100,o/n*100));s(c),a<=0&&(s(100),t&&clearInterval(t))};a(),t=setInterval(a,100)}return function(){t&&clearInterval(t)}},[e,o,c,v]),t("div",{className:"timer-progress-bar ".concat(r),children:t("div",{className:"timer-progress-fill",style:{width:"".concat(h,"%")}})})};f.displayName="Timer";export{u as Avatar,d as Chip,v as Histogram,o as InputNumber,s as ProductionUnit,h as ProductionUnitContainer,r as Switch,f as Timer,m as ValueWithUnit};
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import n,{useState as i,useRef as o,useEffect as l,useCallback as a}from"react";var c=function(n){var a=n.label,c=n.value,r=void 0===c?"":c,d=n.onChange,s=n.disabled,u=void 0!==s&&s,h=n.className,C=void 0===h?"":h,v=n.required,m=void 0!==v&&v,p=n.min,f=void 0===p?{value:0,label:"Pmin"}:p,g=n.max,L=void 0===g?{value:100,label:"Pmax"}:g,b=i(r),w=b[0],N=b[1],k=i(!1),R=k[0],x=k[1],M=i(!1),y=M[0],P=M[1],Z=o(null);l(function(){N(r)},[r]);var V=["input-container",R?"input-container--focused":"",R||w.length>0?"input-container--floating":"",u?"input-container--disabled":"",y?"input-container--error":"",C].filter(Boolean).join(" ");return e("div",{className:V,children:t("div",{className:"input-constraints",children:[t("div",{className:"input-min",children:[f.label,e("br",{}),f.value]}),t("div",{className:"input-field",children:[e("input",{ref:Z,type:"number",value:w,onChange:function(e){var t=e.target.value;if(N(t),""!==t){var n=parseFloat(t);if(isNaN(n))P(!1),null==d||d(t);else{var i=n<f.value||n>L.value;if(P(i),i){var o=Math.max(f.value,Math.min(L.value,n));null==d||d(o.toString())}else null==d||d(t)}}else P(!1),null==d||d(t)},onFocus:function(){x(!0)},onBlur:function(){if(x(!1),""!==w){var e=parseFloat(w);if(!isNaN(e)){var t=Math.max(f.value,Math.min(L.value,e));if(t!==e){var n=t.toString();N(n),null==d||d(n)}P(!1)}}},disabled:u,required:m,className:"input-element","aria-label":a,min:f.value,max:L.value,step:1}),t("label",{className:"input-label",children:[a,m&&e("span",{className:"input-required",children:"*"})]})]}),t("div",{className:"input-max",children:[L.label,e("br",{})," ",L.value]})]})})},r=function(t){var n=t.isOff;return e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z",fill:n?"#999FA1":"#009CDF"})})},d=function(t){var n=t.isOff;return e("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("circle",{cx:"16",cy:"16",r:"16",fill:n?"white":"#009cdf"})})},s=function(n){var o=n.checked,l=void 0!==o&&o,a=n.onChange,c=n.disabled,s=void 0!==c&&c,u=n.showIcon,h=void 0===u||u,C=n.label,v=i(l),m=v[0],p=v[1],f=void 0!==l?l:m,g=["switch",f?"switch--checked":"",s?"switch--disabled":""].filter(Boolean).join(" "),L=["switch-wrapper",f?"switch-wrapper--checked":""].filter(Boolean).join(" ");return e("div",{className:"switch-container",children:t("div",{className:L,children:[h?e("div",{className:"switch-icon",children:e(r,{isOff:!f})}):C?e("div",{className:"switch-label",children:C}):null,e("button",{type:"button",role:"switch","aria-checked":f,className:g,onClick:function(){if(!s){var e=!f;void 0===l&&p(e),null==a||a(e)}},disabled:s,children:e("span",{className:"switch-track",children:e("span",{className:"switch-thumb",children:e(d,{isOff:!f})})})})]})})},u=function(t){var n=t.children,i=t.bgColor,o=t.width,l=["chip-container","full-width"===(void 0===o?"fit-content":o)?"chip-container--full-width":"chip-container--fit-content"].join(" ");return e("div",{className:l,style:{backgroundColor:i},children:e("div",{className:"chip-content",children:e("div",{className:"chip-label",children:n})})})},h=function(t){var n=t.bgColor,i=void 0===n?"#fff":n,o=t.children,l=t.height;return e("div",{className:"production-unit-container-box",style:{backgroundColor:i,height:l},children:o})},C=function(n){var o=n.onChangeInput,l=n.onChangeSwitch,a=n.defaultValue,r=n.defaultChecked,d=void 0!==r&&r,C=n.value,v=n.checked,m=n.unitName,f=void 0===m?"Production Unit":m,g=n.energyCost,L=void 0===g?0:g,b=n.checkedImage,w=n.uncheckedImage,N=n.readonly,k=void 0!==N&&N,R=n.min,x=void 0===R?{value:10,label:"Pmin"}:R,M=n.max,y=void 0===M?{value:100,label:"Pmax"}:M,P=i(d),Z=P[0],V=P[1],z=i(a),H=z[0],S=z[1],F=void 0!==v?v:Z,B=void 0!==C?C:H;return e(h,{children:t("div",{className:"production-unit-container",children:[t("div",{className:"production-unit-content",children:[e("div",{className:"image-preview-container",children:F?b:w}),t("div",{className:"production-unit-chip",children:[e("div",{className:"production-unit-chip-name",children:f}),e(u,{width:"fit-content",bgColor:"#E1F5FD",children:e(p,{cost:L,textColor:"#005896"})})]}),t("div",{className:"production-unit-switch-container",children:[e(c,{label:"PA",onChange:function(e){if(""===e)return void 0===C&&S(void 0),void(o&&o(0));var t=parseFloat(e);isNaN(t)||(void 0===C&&S(t),o&&o(t))},value:void 0!==B?B.toString():void 0,disabled:!F||k,min:{value:x.value,label:x.label},max:{value:y.value,label:y.label}})," "]})]}),e(s,{checked:F,onChange:function(e){void 0===v&&V(e),l&&l(e)},disabled:k})]})})},v=function(n){var o,a,c,r,d=n.max,s=n.relative,u=n.barHeight,h=void 0===u?103:u,C=n.barWidth,v=void 0===C?32:C,m=n.orientation,p=void 0===m?"vertical":m,f=n.cornerRadius,g=n.children,L=i(0),b=L[0],w=L[1],N=i(0),k=N[0],R=N[1],x=Math.min(s.value/d.value*100,100)/100*h,M=Math.min(s.value/d.value*100,100)/100*("horizontal"===p?h:v);l(function(){w(0),R(0);var e=Date.now(),t=function(){var n=Date.now()-e,i=Math.min(n/1e3,1),o=1-Math.pow(1-i,4);w(x*o),R(M*o),i<1&&requestAnimationFrame(t)};requestAnimationFrame(t)},[x,M]);var y="horizontal"===p?h:v,P="horizontal"===p?v:h,Z="horizontal"===p?h:v,V="horizontal"===p?v:h,z=function(e,t,n,i,o){var l=o.topLeft,a=o.topRight,c=o.bottomLeft,r=o.bottomRight;return"\n M ".concat(e+l," ").concat(t,"\n L ").concat(e+n-a," ").concat(t,"\n Q ").concat(e+n," ").concat(t," ").concat(e+n," ").concat(t+a,"\n L ").concat(e+n," ").concat(t+i-r,"\n Q ").concat(e+n," ").concat(t+i," ").concat(e+n-r," ").concat(t+i,"\n L ").concat(e+c," ").concat(t+i,"\n Q ").concat(e," ").concat(t+i," ").concat(e," ").concat(t+i-c,"\n L ").concat(e," ").concat(t+l,"\n Q ").concat(e," ").concat(t," ").concat(e+l," ").concat(t,"\n Z\n ").trim().replace(/\s+/g," ")},H={topLeft:2,topRight:2,bottomLeft:2,bottomRight:2},S=f?{topLeft:null!==(o=f.topLeft)&&void 0!==o?o:H.topLeft,topRight:null!==(a=f.topRight)&&void 0!==a?a:H.topRight,bottomLeft:null!==(c=f.bottomLeft)&&void 0!==c?c:H.bottomLeft,bottomRight:null!==(r=f.bottomRight)&&void 0!==r?r:H.bottomRight}:H;return e("div",{className:"histogram-container ".concat("horizontal"===p?"histogram-container--horizontal":""),children:t("div",{className:"histogram-content ".concat("horizontal"===p?"histogram-content--horizontal":""),children:[e("div",{className:"histogram-bar",style:{height:"".concat(P,"px"),width:"".concat(y,"px")},children:t("svg",{width:Z,height:V,viewBox:"0 0 ".concat(Z," ").concat(V),className:"histogram-svg",children:[e("defs",{children:e("clipPath",{id:"histogram-clip-".concat(Z,"-").concat(V,"-").concat(S.topLeft),children:e("path",{d:z(0,0,Z,V,S)})})}),e("path",{d:z(0,0,Z,V,S),fill:d.color,fillOpacity:d.opacity||1}),e("path","vertical"===p?{d:z(0,V-b,Z,b,{topLeft:b>=V?S.topLeft:0,topRight:b>=V?S.topRight:0,bottomLeft:S.bottomLeft,bottomRight:S.bottomRight}),fill:s.color,clipPath:"url(#histogram-clip-".concat(Z,"-").concat(V,"-").concat(S.topLeft,")")}:{d:z(0,0,k,V,{topLeft:S.topLeft,topRight:k>=Z?S.topRight:0,bottomLeft:S.bottomLeft,bottomRight:k>=Z?S.bottomRight:0}),fill:s.color,clipPath:"url(#histogram-clip-".concat(Z,"-").concat(V,"-").concat(S.topLeft,")")})]})}),g&&e("div",{className:"histogram-text-container ".concat("horizontal"===p?"histogram-text-container--horizontal":""),children:g})]})})},m=function(t){var n=t.children;return e("div",{className:"avatar-container avatar-container--clickable",children:e("div",{className:"avatar-content",children:n})})},p=function(n){var i=n.cost,o=n.textColor,l=n.type,a=void 0===l?"europermegawatt":l;return t("div",{className:"cost-text-container",children:[e("div",{className:"cost-number",style:{color:o},children:i}),e("div",{className:"cost-unit",style:{color:o},children:"euro"===a||"europermegawatt"===a?"€":"MWh"}),"europermegawatt"===a&&e("div",{className:"cost-unit-per",style:{color:o},children:"/MWh"})]})},f=function(){return f=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},f.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var g=function(e){var t=Math.floor(e/60),n=e%60;return"".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"))},L=n.forwardRef(function(c,r){var d,s,u,h=c.phases,C=void 0===h?[]:h,v=c.externalState,m=c.onStateChange,p=c.onComplete,L=c.onPhaseComplete,b=c.onTick,w=c.onStart,N=c.onPause,k=c.onFreeze,R=c.onAnonymiseToggle,x=c.onStop,M=c.onReset,y=c.onPrevious,P=c.onNext,Z=c.onPhaseClick,V=c.className,z=void 0===V?"":V,H=c.gameActions,S=void 0===H?{}:H,F=c.user,B=void 0===F?"admin":F,I=v.currentPhase,j=v.currentTime,T=v.isRunning,A=v.isPaused,O=v.isFrozen,E=i(null),W=E[0],D=E[1],q=i(!1),Q=q[0],U=q[1],K=o(null),G=a(function(){0===C.length||I>=C.length||(m(f(f({},v),{isRunning:!0,isPaused:!1})),null==w||w())},[C.length,I,v,m,w]),J=a(function(){O||(m(f(f({},v),{isRunning:!1,isPaused:!0})),null==N||N())},[O,v,m,N]),X=a(function(e){var t=void 0===e?!O:e,n=f(f({},v),{isFrozen:t,isRunning:!t&&!v.isPaused,isPaused:v.isPaused});m(n),null==k||k(t)},[O,v,m,k]),Y=a(function(e){U(function(t){var n=void 0===e?!t:e;return null==R||R(n),n})},[R]),$=a(function(){m({currentPhase:0,currentTime:0,isRunning:!1,isPaused:!1,isFrozen:!1}),null==x||x()},[m,x]),_=a(function(){m({currentPhase:0,currentTime:0,isRunning:!1,isPaused:!1,isFrozen:!1}),null==M||M()},[m,M]),ee=a(function(){},[]);n.useImperativeHandle(r,function(){return{start:G,pause:J,freeze:X,toggleAnonymise:Y,stop:$,reset:_,setPhases:ee,getCurrentTime:function(){return j},getCurrentPhase:function(){return I},isRunning:function(){return T},isPaused:function(){return A}}}),l(function(){return T&&!O&&I<C.length?K.current=setInterval(function(){var e,t,n=j+1;m(f(f({},v),{currentTime:n})),null==b||b(n,I),n>((null===(e=C[I])||void 0===e?void 0:e.duration)||0)&&(null==L||L(I,(null===(t=C[I])||void 0===t?void 0:t.duration)||0),I+1<C.length?m(f(f({},v),{currentPhase:I+1,currentTime:0})):(m(f(f({},v),{isRunning:!1,isPaused:!1})),null==p||p()))},1e3):K.current&&(clearInterval(K.current),K.current=null),function(){K.current&&clearInterval(K.current)}},[T,O,I,j,C,v,m,b,L,p]);var te=(null===(d=C[I])||void 0===d?void 0:d.duration)||0,ne=te>0?j/te*100:0,ie=C.length>0&&!T&&I===Math.max(0,C.length-1)&&j>=((null===(s=C[Math.max(0,I)])||void 0===s?void 0:s.duration)||0),oe=["timer-header-control",z,T?"timer--running":"",A?"timer--paused":"",O?"timer--frozen":"",ie?"timer--completed":""].filter(Boolean).join(" "),le=te>0?te-j:0;return t("div",{className:oe,children:[e("div",{className:"timer-section",children:e("div",{className:"timer-content",children:t("div",{className:"timer-display-area",children:["admin"===B&&t("div",{className:"timer-header",children:[e("span",{className:"timer-title",children:((null===(u=C[I])||void 0===u?void 0:u.title)||"TIMER").toUpperCase()}),e("span",{className:"timer-time",children:g(Math.max(0,le))})]}),"admin"===B&&e("div",{className:"timer-progress-bar",children:e("div",{className:"timer-progress-fill",style:{width:"".concat(Math.min(100,ne),"%")}})}),function(){for(var n,i,o,l=[],a=C.length,c=function(a){var c=a===I,r=a<I,d=S[a],s=c||r,u="step-indicator";u+=d||c||r?c?" step-indicator--active"+("actor"===B?" step-indicator--actor":" step-indicator--admin"):r?" step-indicator--completed":" step-indicator--upcoming":" step-indicator--placeholder",s&&(u+=" step-indicator--clickable"),W===a&&(u+=" step-indicator--selected");var h=function(){s&&(D(a),null==Z||Z(a))},v={key:a,className:u,"data-step":a+1,title:(null===(n=C[a])||void 0===n?void 0:n.title)?"Step ".concat(a+1,": ").concat(null===(i=C[a])||void 0===i?void 0:i.title):d?"Step ".concat(a+1,": ").concat(d):"Step ".concat(a+1),onClick:s?h:void 0,role:s?"button":void 0,tabIndex:s?0:void 0,onKeyDown:s?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),h())}:void 0};l.push(e("div",f({},v,{children:d||c||r?a+1:""}))),"actor"===B&&c&&l.push(t("div",{className:"timer-header--block",children:[t("div",{className:"timer-header timer-header--inline",children:[e("span",{className:"timer-title",children:((null===(o=C[I])||void 0===o?void 0:o.title)||"TIMER").toUpperCase()}),e("span",{className:"timer-time",children:g(Math.max(0,le))})]}),e("div",{className:"timer-progress-bar timer-progress-bar--inline",children:e("div",{className:"timer-progress-fill",style:{width:"".concat(Math.min(100,ne),"%")}})})]},"header-inline-".concat(a)))},r=0;r<a;r++)c(r);return t("div",{className:"step-indicators",children:[l,e("div",{className:"step-expand ".concat(ie?"step-expand--end":""),title:ie?"All steps completed":"In progress",children:"actor"===B?t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("rect",{x:"24",width:"24",height:"24",rx:"12",transform:"rotate(90 24 0)",fill:"#292E33"}),e("path",{d:"M20 12C20 12.276 19.776 12.5 19.5 12.5L17.4766 12.5C17.238 15.1345 15.1345 17.238 12.5 17.4766L12.5 19.5C12.5 19.776 12.276 20 12 20C11.724 20 11.5 19.776 11.5 19.5L11.5 17.4766C8.86554 17.238 6.763 15.1345 6.52441 12.5L4.5 12.5C4.224 12.5 4 12.276 4 12C4 11.724 4.224 11.5 4.5 11.5L6.52441 11.5C6.763 8.86555 8.86554 6.76198 11.5 6.52344L11.5 4.5C11.5 4.224 11.724 4 12 4C12.276 4 12.5 4.224 12.5 4.5L12.5 6.52344C15.1345 6.76199 17.238 8.86551 17.4766 11.5L19.5 11.5C19.776 11.5 20 11.724 20 12ZM16.5 12C16.5 9.51867 14.4813 7.5 12 7.5C9.51867 7.5 7.5 9.51867 7.5 12C7.5 14.4813 9.51867 16.5 12 16.5C14.4813 16.5 16.5 14.4813 16.5 12ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z",fill:"white"})]}):e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M16 8C16 8.276 15.776 8.5 15.5 8.5L13.4766 8.5C13.238 11.1345 11.1345 13.238 8.5 13.4766L8.5 15.5C8.5 15.776 8.276 16 8 16C7.724 16 7.5 15.776 7.5 15.5L7.5 13.4766C4.86554 13.238 2.763 11.1345 2.52441 8.5L0.5 8.5C0.224 8.5 -3.61755e-07 8.276 -3.49691e-07 8C-3.29564e-07 7.724 0.224 7.5 0.5 7.5L2.52441 7.5C2.763 4.86555 4.86554 2.76198 7.5 2.52344L7.5 0.5C7.5 0.224 7.724 -3.61755e-07 8 -3.4969e-07C8.276 -3.29563e-07 8.5 0.224 8.5 0.5L8.5 2.52344C11.1345 2.76199 13.238 4.86551 13.4766 7.5L15.5 7.5C15.776 7.5 16 7.724 16 8ZM12.5 8C12.5 5.51867 10.4813 3.5 8 3.5C5.51867 3.5 3.5 5.51867 3.5 8C3.5 10.4813 5.51867 12.5 8 12.5C10.4813 12.5 12.5 10.4813 12.5 8ZM10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z",fill:"currentColor"})})})]})}()]})})}),"admin"===B&&t("div",{className:"timer-controls-section",children:[e("button",{className:"control-button control-button--previous",onClick:function(){return null==y?void 0:y()},disabled:0===I,title:"Previous",children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9813 2.39178C12.1589 2.38845 12.3342 2.43251 12.4892 2.51941C12.6441 2.60631 12.7731 2.73291 12.8629 2.88621C12.9527 3.0395 13 3.21395 13 3.3916L12.5 3.3916H13V12.6085C13 12.7862 12.9527 12.9606 12.8629 13.1139C12.7731 13.2672 12.6441 13.3938 12.4892 13.4807C12.3342 13.5676 12.1589 13.6117 11.9813 13.6084C11.8037 13.605 11.6301 13.5545 11.4785 13.4618L3.93741 8.85335C3.79124 8.76403 3.67046 8.63865 3.58667 8.48923C3.50287 8.33982 3.45886 8.17138 3.45886 8.00007C3.45886 7.82877 3.50287 7.66033 3.58667 7.51092C3.67046 7.3615 3.79124 7.23612 3.93741 7.14679L11.4785 2.53832C11.6301 2.44568 11.8037 2.3951 11.9813 2.39178ZM12 3.3916L4.45886 8.00007L4.19814 7.57343L4.45886 8.00007L12 12.6085V3.3916Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 2C2.27614 2 2.5 2.22386 2.5 2.5V13.5C2.5 13.7761 2.27614 14 2 14C1.72386 14 1.5 13.7761 1.5 13.5V2.5C1.5 2.22386 1.72386 2 2 2Z",fill:"black"})]})}),e("button",{className:"control-button control-button--next",onClick:function(){return null==P?void 0:P()},disabled:!(ie&&I<C.length-1),title:"Next",children:t("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.51084 2.51941C3.66579 2.43251 3.84109 2.38845 4.01871 2.39178C4.19633 2.3951 4.36986 2.44568 4.52145 2.53832L12.0626 7.14679C12.2088 7.23612 12.3295 7.3615 12.4133 7.51092C12.4971 7.66033 12.5411 7.82877 12.5411 8.00007C12.5411 8.17138 12.4971 8.33982 12.4133 8.48923C12.3295 8.63865 12.2088 8.76403 12.0626 8.85335L4.52145 13.4618C4.36986 13.5545 4.19633 13.605 4.01871 13.6084C3.84109 13.6117 3.66579 13.5676 3.51084 13.4807C3.3559 13.3938 3.2269 13.2672 3.13711 13.1139C3.04733 12.9606 3 12.7862 3 12.6085V3.3916C3 3.21395 3.04733 3.0395 3.13711 2.88621C3.22689 2.73292 3.35589 2.60631 3.51084 2.51941ZM11.5411 8.00007L4 3.3916V12.6085L11.5411 8.00007Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2C14.2761 2 14.5 2.22386 14.5 2.5V13.5C14.5 13.7761 14.2761 14 14 14C13.7239 14 13.5 13.7761 13.5 13.5V2.5C13.5 2.22386 13.7239 2 14 2Z",fill:"black"})]})}),e("button",{className:"control-button control-button--play-pause ".concat(T?"control-button--pause":"control-button--play"," ").concat(O?"control-button--disabled":""),onClick:T?J:G,title:O?"Frozen":T?"Pause":A?"Resume":"Start",disabled:O,children:t("svg",T?{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C7.85786 4.5 4.5 7.85786 4.5 12C4.5 15.1788 6.47789 17.8975 9.27283 18.989C9.65866 19.1397 9.8493 19.5746 9.69862 19.9604C9.54794 20.3463 9.113 20.5369 8.72717 20.3862C5.37607 19.0775 3 15.8172 3 12C3 7.02944 7.02944 3 12 3C16.2192 3 19.7585 5.90255 20.7337 9.81878C20.9078 10.5179 21 11.2487 21 12C21 12.4142 20.6642 12.75 20.25 12.75C19.8358 12.75 19.5 12.4142 19.5 12C19.5 11.3719 19.4229 10.7628 19.2781 10.1812C18.4655 6.91754 15.5141 4.5 12 4.5Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.75 15.75V22.25H20.25V15.75H18.75ZM17.25 15.3636C17.25 14.5918 17.9689 14.25 18.4615 14.25H20.5385C21.0311 14.25 21.75 14.5918 21.75 15.3636V22.6364C21.75 23.4082 21.0311 23.75 20.5385 23.75H18.4615C17.9689 23.75 17.25 23.4082 17.25 22.6364V15.3636Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.75 15.75V22.25H14.25V15.75H12.75ZM11.25 15.3636C11.25 14.5918 11.9689 14.25 12.4615 14.25H14.5385C15.0311 14.25 15.75 14.5918 15.75 15.3636V22.6364C15.75 23.4082 15.0311 23.75 14.5385 23.75H12.4615C11.9689 23.75 11.25 23.4082 11.25 22.6364V15.3636Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.54996 7.40004C8.21858 7.64857 8.15143 8.11867 8.39996 8.45004L11.4 12.45C11.6485 12.7814 12.1186 12.8486 12.45 12.6C12.7813 12.3515 12.8485 11.8814 12.6 11.55L9.59996 7.55004C9.35143 7.21867 8.88133 7.15152 8.54996 7.40004Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 0.75C9 0.335786 9.33579 0 9.75 0H14.25C14.6642 0 15 0.335786 15 0.75C15 1.16421 14.6642 1.5 14.25 1.5H9.75C9.33579 1.5 9 1.16421 9 0.75Z",fill:"black"})]}:{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{d:"M20.25 12C20.25 11.3103 20.1654 10.6404 20.0059 10C19.112 6.41005 15.8666 3.75 12 3.75C7.44365 3.75 3.75 7.44365 3.75 12C3.75 15.498 5.92698 18.4875 9 19.6876",stroke:"black",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round"}),e("path",{d:"M12 12L9 8",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M9.75 0.75H14.25",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e("path",{d:"M20.7759 18.1242L13.7125 14.0646C13.6415 14.0238 13.5603 14.0015 13.4771 14.0001C13.3939 13.9986 13.3118 14.018 13.2392 14.0563C13.1667 14.0946 13.1063 14.1503 13.0642 14.2178C13.0222 14.2854 13 14.3622 13 14.4404V22.5596C13 22.6378 13.0222 22.7146 13.0642 22.7822C13.1063 22.8497 13.1667 22.9054 13.2392 22.9437C13.3118 22.982 13.3939 23.0014 13.4771 22.9999C13.5603 22.9985 13.6415 22.9762 13.7125 22.9354L20.7759 18.8758C20.8443 18.8365 20.9009 18.7813 20.9401 18.7154C20.9794 18.6496 21 18.5755 21 18.5C21 18.4245 20.9794 18.3504 20.9401 18.2846C20.9009 18.2187 20.8443 18.1635 20.7759 18.1242V18.1242Z",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e("button",{className:"control-button control-button--freeze ".concat(O?"control-button--freeze-active":""),onClick:function(){return X()},title:O?"Unfreeze":"Freeze",disabled:!T&&!A&&!O,children:e("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e("path",{d:"M8.14697 0.146484C8.34224 -0.0486747 8.65878 -0.0487434 8.854 0.146484C9.04889 0.341739 9.04905 0.658358 8.854 0.853516L7.50049 2.20703V5.13281L10.0337 3.66992L10.5298 1.82129C10.6012 1.5547 10.8755 1.3966 11.1421 1.46777C11.4088 1.53922 11.5679 1.8134 11.4966 2.08008L11.0767 3.64648L12.6421 4.06543C12.9088 4.1369 13.0681 4.41198 12.9966 4.67871C12.925 4.94527 12.6499 5.10368 12.3833 5.03223L10.5347 4.53613L7.99951 5.99902L10.5347 7.46191L12.3833 6.96777C12.65 6.8963 12.9251 7.05456 12.9966 7.32129C13.068 7.58799 12.9088 7.86213 12.6421 7.93359L11.0767 8.35352L11.4966 9.91992C11.5677 10.1865 11.4086 10.4608 11.1421 10.5322C10.8756 10.6033 10.6013 10.4451 10.5298 10.1787L10.0337 8.32812L7.50049 6.86523V9.79297L8.854 11.1465C9.04889 11.3417 9.04905 11.6584 8.854 11.8535C8.65885 12.0487 8.34226 12.0484 8.14697 11.8535L7.00049 10.707L5.854 11.8535C5.65885 12.0487 5.34226 12.0484 5.14697 11.8535C4.95171 11.6583 4.95171 11.3417 5.14697 11.1465L6.50049 9.79297V6.86523L3.96533 8.32812L3.47021 10.1787C3.39865 10.4451 3.12439 10.6034 2.85791 10.5322C2.59128 10.4608 2.43314 10.1866 2.50439 9.91992L2.92334 8.35352L1.35791 7.93359C1.09118 7.86212 0.932919 7.58802 1.00439 7.32129C1.07593 7.05464 1.35001 6.89631 1.6167 6.96777L3.46436 7.46191L5.99951 5.99902L3.46436 4.53613L1.6167 5.03223C1.35014 5.10366 1.07608 4.94513 1.00439 4.67871C0.932919 4.41198 1.09118 4.1369 1.35791 4.06543L2.92334 3.64648L2.50439 2.08008C2.43293 1.81334 2.59118 1.53924 2.85791 1.46777C3.12453 1.39654 3.39878 1.55467 3.47021 1.82129L3.96533 3.66992L6.50049 5.13281V2.20703L5.14697 0.853516C4.95171 0.658253 4.95171 0.341747 5.14697 0.146484C5.34224 -0.0486746 5.65878 -0.0487434 5.854 0.146484L7.00049 1.29297L8.14697 0.146484Z",fill:"black"})})}),e("button",{className:"control-button control-button--anonymise ".concat(Q?"control-button--anonymise-active":""),onClick:function(){return Y()},title:Q?"Show Names":"Hide Names",children:t("svg",{width:"18",height:"12",viewBox:"0 0 18 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19571 0.9375H13.9316L13.9576 0.939919L13.9055 1.5C13.9576 0.939919 13.958 0.939955 13.9584 0.939992L13.9593 0.940074L13.9612 0.940263L13.966 0.940753L13.9794 0.942218C13.9899 0.943426 14.0036 0.945121 14.0203 0.947429C14.0536 0.952044 14.0989 0.959129 14.1545 0.969722C14.2655 0.990879 14.4186 1.02621 14.5998 1.08426C14.9611 1.20007 15.4415 1.40866 15.9224 1.78153C16.9079 2.54562 17.8125 3.93493 17.8125 6.375C17.8125 8.84977 16.7446 10.2418 15.6228 10.9916C15.0757 11.3573 14.5319 11.5602 14.1264 11.6723C13.9228 11.7285 13.7514 11.7626 13.6282 11.7828C13.5666 11.7929 13.5167 11.7996 13.4807 11.8039C13.4626 11.8061 13.448 11.8076 13.437 11.8087L13.4234 11.81L13.4186 11.8104L13.4168 11.8106L13.416 11.8106C13.4157 11.8107 13.4154 11.8107 13.3704 11.25L13.416 11.8106L13.3929 11.8125H13.3704C12.4693 11.8125 11.7717 11.6348 11.2171 11.3425C10.6627 11.0503 10.2868 10.6623 10.0046 10.2977C9.86569 10.1182 9.74696 9.94078 9.64616 9.78996C9.5407 9.6322 9.46023 9.51197 9.38106 9.41262C9.22707 9.21935 9.16773 9.21939 9.13503 9.21941H9.13398C9.09752 9.21941 9.03241 9.22191 8.87346 9.41718C8.79345 9.51548 8.71127 9.63581 8.60695 9.79107C8.60069 9.80039 8.59437 9.80981 8.58797 9.81934C8.49236 9.96175 8.38151 10.1269 8.25589 10.2929C7.98421 10.6519 7.62551 11.0405 7.10214 11.335C6.57573 11.6313 5.91831 11.8125 5.07599 11.8125H5.0488L5.02173 11.8099L5.07599 11.25C5.02173 11.8099 5.02205 11.8099 5.02173 11.8099L5.0204 11.8097L5.01868 11.8096L5.01405 11.8091L5.00016 11.8076C4.98888 11.8063 4.97357 11.8045 4.95451 11.8019C4.91641 11.7969 4.8632 11.7892 4.79703 11.7779C4.66485 11.7553 4.47999 11.718 4.25972 11.6585C3.82115 11.5401 3.23123 11.3305 2.63538 10.9643C1.42058 10.2176 0.212463 8.83259 0.187947 6.38062C0.163902 3.97575 1.11355 2.587 2.13375 1.81616C2.63171 1.43991 3.12954 1.22329 3.50294 1.10027C3.69026 1.03855 3.84839 0.999684 3.96267 0.975868C4.01989 0.963945 4.06636 0.955744 4.10027 0.950316C4.11724 0.947601 4.13108 0.945576 4.14159 0.944124L4.15484 0.942358L4.15953 0.941769L4.16139 0.941543L4.1622 0.941446C4.16257 0.941403 4.16292 0.941361 4.22872 1.5L4.1622 0.941446L4.19571 0.9375ZM4.26997 2.0625C4.25203 2.06549 4.22575 2.07021 4.19218 2.07721C4.11398 2.09351 3.99723 2.1219 3.85498 2.16877C3.56924 2.26291 3.18912 2.42877 2.81194 2.71376C2.08184 3.2654 1.29234 4.31414 1.31289 6.36938C1.33297 8.37752 2.28763 9.43001 3.22447 10.0058C3.70444 10.3008 4.18756 10.4737 4.55306 10.5724C4.73484 10.6215 4.88477 10.6515 4.98688 10.669C5.03785 10.6778 5.07667 10.6833 5.1013 10.6866C5.10355 10.6869 5.10569 10.6871 5.10771 10.6874C5.76441 10.683 6.21815 10.5416 6.55042 10.3546C6.89104 10.1629 7.13992 9.90327 7.35877 9.61404C7.46458 9.47422 7.55912 9.33345 7.65787 9.18641L7.67313 9.1637C7.77297 9.01508 7.8831 8.85179 8.00097 8.70698C8.23778 8.41606 8.59073 8.09441 9.13398 8.09441C9.6812 8.09441 10.0292 8.42071 10.2609 8.71155C10.3706 8.8492 10.4746 9.00486 10.569 9.14611L10.5815 9.1648C10.6838 9.31787 10.7824 9.46461 10.8943 9.6092C11.1139 9.89292 11.3735 10.1532 11.7416 10.3472C12.1049 10.5387 12.6087 10.6838 13.3424 10.6874C13.3439 10.6873 13.3456 10.6871 13.3473 10.6869C13.368 10.6844 13.4015 10.6799 13.4459 10.6727C13.5349 10.658 13.6667 10.6321 13.8268 10.5879C14.1487 10.4989 14.5748 10.3389 14.9976 10.0563C15.8156 9.50956 16.6875 8.46406 16.6875 6.375C16.6875 4.25124 15.9198 3.20305 15.2331 2.6706C14.8779 2.3952 14.5221 2.24075 14.2564 2.1556C14.124 2.11316 14.0158 2.08853 13.944 2.07485C13.9117 2.0687 13.887 2.0648 13.8709 2.0625H4.26997ZM13.8498 2.05973C13.8494 2.05969 13.8497 2.05972 13.8508 2.05985L13.8498 2.05973Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.0625C4.77651 5.0625 4.3125 5.59288 4.3125 6C4.3125 6.40712 4.77651 6.9375 5.625 6.9375C6.47349 6.9375 6.9375 6.40712 6.9375 6C6.9375 5.59288 6.47349 5.0625 5.625 5.0625ZM3.1875 6C3.1875 4.75027 4.40242 3.9375 5.625 3.9375C6.84758 3.9375 8.0625 4.75027 8.0625 6C8.0625 7.24973 6.84758 8.0625 5.625 8.0625C4.40242 8.0625 3.1875 7.24973 3.1875 6Z",fill:"black"}),e("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.375 5.0625C11.5265 5.0625 11.0625 5.59288 11.0625 6C11.0625 6.40712 11.5265 6.9375 12.375 6.9375C13.2235 6.9375 13.6875 6.40712 13.6875 6C13.6875 5.59288 13.2235 5.0625 12.375 5.0625ZM9.9375 6C9.9375 4.75027 11.1524 3.9375 12.375 3.9375C13.5976 3.9375 14.8125 4.75027 14.8125 6C14.8125 7.24973 13.5976 8.0625 12.375 8.0625C11.1524 8.0625 9.9375 7.24973 9.9375 6Z",fill:"black"})]})})]})]})});L.displayName="Timer";export{m as Avatar,u as Chip,v as Histogram,c as InputNumber,C as ProductionUnit,h as ProductionUnitContainer,s as Switch,L as Timer,p as ValueWithUnit};
2
2
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../src/components/InputNumber.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/ProductionUnitContainer.tsx","../src/components/ProductionUnit.tsx","../src/components/Histogram.tsx","../src/components/Avatar.tsx","../src/components/ValueWithUnit.tsx","../src/components/Timer.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport './InputNumber.css';\n\ninterface InputNumberProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const InputNumber: React.FC<InputNumberProps> = ({\n label,\n value = '',\n onChange,\n disabled = false,\n className = '',\n required = false,\n min = { value: 0, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const [isOutOfRange, setIsOutOfRange] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n\n // Always update internal value for display\n setInternalValue(newValue);\n\n // Check if value is out of range for visual feedback\n if (newValue !== '') {\n const numValue = parseFloat(newValue);\n if (!isNaN(numValue)) {\n const outOfRange = numValue < min.value || numValue > max.value;\n setIsOutOfRange(outOfRange);\n\n if (outOfRange) {\n // Clamp the value and notify parent with clamped value\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n onChange?.(clampedValue.toString());\n } else {\n // Value is in range, notify parent with actual value\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n };\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n\n // Clamp value on blur\n if (internalValue !== '') {\n const numValue = parseFloat(internalValue);\n if (!isNaN(numValue)) {\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n if (clampedValue !== numValue) {\n const clampedString = clampedValue.toString();\n setInternalValue(clampedString);\n onChange?.(clampedString);\n }\n setIsOutOfRange(false); // Reset out-of-range state after clamping\n }\n }\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n 'input-container',\n isFocused ? 'input-container--focused' : '',\n isLabelFloating ? 'input-container--floating' : '',\n disabled ? 'input-container--disabled' : '',\n isOutOfRange ? 'input-container--error' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type=\"number\"\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n min={min.value}\n max={max.value}\n step={1}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport './Switch.css';\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? '#999FA1' : '#009CDF'}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? 'white' : '#009cdf'} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n label?: string;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n label,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n // Use controlled value if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !isChecked;\n // Only update internal state if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n 'switch',\n isChecked ? 'switch--checked' : '',\n disabled ? 'switch--disabled' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const wrapperClasses = ['switch-wrapper', isChecked ? 'switch-wrapper--checked' : '']\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className=\"switch-container\">\n <div className={wrapperClasses}>\n {showIcon ? (\n <div className=\"switch-icon\">\n <ImgOn isOff={!isChecked} />\n </div>\n ) : label ? (\n <div className=\"switch-label\">{label}</div>\n ) : null}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!isChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport './Chip.css';\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n children: React.ReactNode;\n bgColor?: string;\n width?: 'fit-content' | 'full-width';\n}\n\nexport const Chip: React.FC<ChipProps> = ({ children, bgColor, width = 'fit-content' }) => {\n const chipClasses = [\n 'chip-container',\n width === 'full-width' ? 'chip-container--full-width' : 'chip-container--fit-content',\n ].join(' ');\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <div className=\"chip-label\">{children}</div>\n </div>\n </div>\n );\n};\n","import './ProductionUnitContainer.css';\n\ninterface ProductionUnitContainerProps {\n bgColor?: string;\n children: React.ReactNode;\n height?: string;\n}\nexport const ProductionUnitContainer = ({\n bgColor = '#fff',\n children,\n height,\n}: ProductionUnitContainerProps) => {\n return (\n <div className=\"production-unit-container-box\" style={{ backgroundColor: bgColor, height }}>\n {children}\n </div>\n );\n};\n","import { useState } from 'react';\nimport { InputNumber } from './InputNumber';\nimport { Switch } from './Switch';\nimport './ProductionUnit.css';\nimport { Chip } from './Chip';\nimport { ProductionUnitContainer } from './ProductionUnitContainer';\nimport { ValueWithUnit } from '.';\n\ntype ProductionUnitLimit = {\n value: number;\n label?: string;\n};\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n value?: number;\n checked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n min?: ProductionUnitLimit;\n max?: ProductionUnitLimit;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n value,\n checked,\n unitName = 'Production Unit',\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n min = { value: 10, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}: ProductionUnitProps) => {\n // Internal state management for uncontrolled mode\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n // Use controlled props if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n const currentValue = value !== undefined ? value : internalValue;\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state only if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n // Only convert to number if the string is not empty and is a valid number\n if (val === '') {\n // Handle empty string case\n if (value === undefined) {\n setInternalValue(undefined);\n }\n if (onChangeInput) {\n onChangeInput(0); // or whatever default you prefer for empty values\n }\n return;\n }\n\n const numValue = parseFloat(val);\n if (!isNaN(numValue)) {\n // Update internal state only if uncontrolled\n if (value === undefined) {\n setInternalValue(numValue);\n }\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n }\n };\n\n return (\n <ProductionUnitContainer>\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">{isChecked ? checkedImage : uncheckedImage}</div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip width=\"fit-content\" bgColor=\"#E1F5FD\">\n <ValueWithUnit cost={energyCost} textColor=\"#005896\" />\n </Chip>\n </div>\n <div className=\"production-unit-switch-container\">\n <InputNumber\n label=\"PA\"\n onChange={handleInputChange}\n value={currentValue !== undefined ? currentValue.toString() : undefined}\n disabled={!isChecked || readonly}\n min={{ value: min.value, label: min.label }}\n max={{ value: max.value, label: max.label }}\n />{' '}\n </div>\n </div>\n\n <Switch checked={isChecked} onChange={handleSwitchChange} disabled={readonly} />\n </div>\n </ProductionUnitContainer>\n );\n};\n","import React, { useEffect, useState } from 'react';\nimport './Histogram.css';\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * (orientation === 'horizontal' ? barHeight : barWidth);\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n\n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n\n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n\n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `\n .trim()\n .replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius\n ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n }\n : defaultCornerRadius;\n\n return (\n <div\n className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}\n >\n <div\n className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}\n >\n <div\n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`,\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Define clipping path with rounded corners matching the background */}\n <defs>\n <clipPath id={`histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft}`}>\n <path d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)} />\n </clipPath>\n </defs>\n \n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n \n {/* Foreground bar (relative value) with clipping to stay within rounded corners */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(0, svgHeight - animatedHeight, svgWidth, animatedHeight, {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n ) : (\n <path\n d={createRoundedRectPath(0, 0, animatedWidth, svgHeight, {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n )}\n </svg>\n </div>\n {children && (\n <div\n className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}\n >\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport './Avatar.css';\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n","import React from 'react';\nimport './ValueWithUnit.css';\n\ninterface ValueWithUnitProps {\n cost?: number;\n textColor?: string;\n type?: 'euro' | 'megawatt' | 'europermegawatt';\n}\n\nexport const ValueWithUnit: React.FC<ValueWithUnitProps> = ({ cost, textColor, type = 'europermegawatt' }) => {\n return (\n <div className=\"cost-text-container\">\n <div className=\"cost-number\" style={{ color: textColor }}>\n {cost}\n </div>\n <div className=\"cost-unit\" style={{ color: textColor }}>\n {type === 'euro' || type === 'europermegawatt' ? '€' : 'MWh'}\n </div>\n {type === 'europermegawatt' && (\n <div className=\"cost-unit-per\" style={{ color: textColor }}>\n /MWh\n </div>\n )}\n </div>\n );\n};\n\n","import React, { useState, useEffect } from 'react';\nimport './Timer.css';\n\nexport interface TimerProps {\n progressEndDate?: number;\n leftTime?: number;\n progressTime?: number;\n className?: string;\n}\n\nexport const Timer: React.FC<TimerProps> = ({ \n progressEndDate, \n leftTime, \n progressTime, \n className = '' \n}) => {\n const [progress, setProgress] = useState(0);\n const [startTime] = useState(Date.now());\n\n useEffect(() => {\n let interval: NodeJS.Timeout | null = null;\n\n if (progressEndDate && !leftTime && !progressTime) {\n const updateProgress = () => {\n const now = Date.now();\n const timeLeft = Math.max(0, progressEndDate - now);\n const totalTime = progressEndDate - startTime;\n const elapsed = now - startTime;\n const progressPercent = Math.max(0, Math.min(100, (elapsed / totalTime) * 100));\n setProgress(progressPercent);\n\n if (timeLeft <= 0) {\n setProgress(100);\n if (interval) clearInterval(interval);\n }\n };\n\n updateProgress();\n interval = setInterval(updateProgress, 100);\n } else if (leftTime !== undefined && progressTime !== undefined) {\n const progressPercent = Math.max(0, Math.min(100, ((progressTime - leftTime) / progressTime) * 100));\n setProgress(progressPercent);\n }\n\n return () => {\n if (interval) clearInterval(interval);\n };\n }, [progressEndDate, leftTime, progressTime, startTime]);\n\n return (\n <div className={`timer-progress-bar ${className}`}>\n <div \n className=\"timer-progress-fill\" \n style={{ width: `${progress}%` }}\n />\n </div>\n );\n};\n\nTimer.displayName = 'Timer';\n"],"names":["InputNumber","_a","label","_b","value","onChange","_c","disabled","_d","className","_e","required","_f","min","_g","max","_h","useState","internalValue","setInternalValue","_j","isFocused","setIsFocused","_k","isOutOfRange","setIsOutOfRange","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","ref","type","e","newValue","target","numValue","parseFloat","isNaN","outOfRange","clampedValue","Math","toString","onFocus","onBlur","clampedString","step","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","isChecked","undefined","switchClasses","wrapperClasses","role","onClick","newChecked","Chip","bgColor","chipClasses","style","backgroundColor","ProductionUnitContainer","ProductionUnit","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","currentValue","ValueWithUnit","cost","textColor","val","Histogram","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","targetWidth","startTime","Date","now","animate","elapsed","progress","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","x","y","radii","topLeft","topRight","bottomLeft","bottomRight","concat","trim","replace","defaultCornerRadius","corners","id","color","fillOpacity","opacity","clipPath","Avatar","Timer","progressEndDate","leftTime","progressTime","setProgress","interval","progressPercent","updateProgress","timeLeft","totalTime","clearInterval","setInterval","displayName"],"mappings":"8GAcO,IAAMA,EAA0C,SAACC,GACtD,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAK,IAAAD,EAAG,GAAEA,EACVE,EAAQJ,EAAAI,SACRC,EAAgBL,EAAAM,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAP,EAAAQ,UAAAA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAAgBT,EAAAU,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAX,EAAAY,IAAAA,OAAM,IAAAD,EAAA,CAAER,MAAO,EAAGF,MAAO,QAAQU,EACjCE,EAAmCb,EAAAc,IAAnCA,OAAG,IAAAD,EAAG,CAAEV,MAAO,IAAKF,MAAO,QAAQY,EAE7BE,EAAoCC,EAASb,GAA5Cc,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA4BH,GAAS,GAApCI,EAASD,EAAA,GAAEE,EAAYF,EAAA,GACxBG,EAAkCN,GAAS,GAA1CO,EAAYD,EAAA,GAAEE,EAAeF,EAAA,GAC9BG,EAAWC,EAAyB,MAE1CC,EAAU,WACRT,EAAiBf,EACnB,EAAG,CAACA,IAEJ,IAsDMyB,EAAmB,CACvB,kBACAR,EAAY,2BAA6B,GAJnBA,GAAaH,EAAcY,OAAS,EAKxC,4BAA8B,GAChDvB,EAAW,4BAA8B,GACzCiB,EAAe,yBAA2B,GAC1Cf,GAECsB,OAAOC,SACPC,KAAK,KAER,OACEC,EAAK,MAAA,CAAAzB,UAAWoB,EACdM,SAAAC,E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ACZ9I,EAAcF,EAAAQ,UAAdA,OAAS,IAAAN,EAAG,GAAEA,EAERG,EAA0BW,EAAS,GAAlCkG,EAAQ7G,EAAA,GAAE4I,EAAW5I,EAAA,GACrBwG,EAAa7F,EAAS8F,KAAKC,OAAM,GAgCxC,OA9BApF,EAAU,WACR,IAAIuH,EAAkC,KAEtC,IAAIJ,GAAoBC,GAAaC,GAiB9B,QAAiB1E,IAAbyE,QAA2CzE,IAAjB0E,EAA4B,CAC/D,IAAMG,EAAkBrG,KAAKhC,IAAI,EAAGgC,KAAKlC,IAAI,KAAOoI,EAAeD,GAAYC,EAAgB,MAC/FC,EAAYE,EACb,MApBkD,CACjD,IAAMC,EAAiB,WACrB,IAAMrC,EAAMD,KAAKC,MACXsC,EAAWvG,KAAKhC,IAAI,EAAGgI,EAAkB/B,GACzCuC,EAAYR,EAAkBjC,EAC9BI,EAAUF,EAAMF,EAChBsC,EAAkBrG,KAAKhC,IAAI,EAAGgC,KAAKlC,IAAI,IAAMqG,EAAUqC,EAAa,MAC1EL,EAAYE,GAERE,GAAY,IACdJ,EAAY,KACRC,GAAUK,cAAcL,GAEhC,EAEAE,IACAF,EAAWM,YAAYJ,EAAgB,IACxC,CAKD,OAAO,WACDF,GAAUK,cAAcL,EAC9B,CACD,EAAE,CAACJ,EAAiBC,EAAUC,EAAcnC,IAG3C5E,EAAK,MAAA,CAAAzB,UAAW,sBAAA0H,OAAsB1H,GAAW0B,SAC/CD,EACE,MAAA,CAAAzB,UAAU,sBACVuE,MAAO,CAAEzB,MAAO,GAAA4E,OAAGhB,EAAQ,SAInC,EAEA2B,EAAMY,YAAc"}
1
+ {"version":3,"file":"index.esm.js","sources":["../src/components/InputNumber.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/ProductionUnitContainer.tsx","../src/components/ProductionUnit.tsx","../src/components/Histogram.tsx","../src/components/Avatar.tsx","../src/components/ValueWithUnit.tsx","../node_modules/tslib/tslib.es6.js","../src/components/Timer.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport './InputNumber.css';\n\ninterface InputNumberProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const InputNumber: React.FC<InputNumberProps> = ({\n label,\n value = '',\n onChange,\n disabled = false,\n className = '',\n required = false,\n min = { value: 0, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const [isOutOfRange, setIsOutOfRange] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n\n // Always update internal value for display\n setInternalValue(newValue);\n\n // Check if value is out of range for visual feedback\n if (newValue !== '') {\n const numValue = parseFloat(newValue);\n if (!isNaN(numValue)) {\n const outOfRange = numValue < min.value || numValue > max.value;\n setIsOutOfRange(outOfRange);\n\n if (outOfRange) {\n // Clamp the value and notify parent with clamped value\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n onChange?.(clampedValue.toString());\n } else {\n // Value is in range, notify parent with actual value\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n };\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n\n // Clamp value on blur\n if (internalValue !== '') {\n const numValue = parseFloat(internalValue);\n if (!isNaN(numValue)) {\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n if (clampedValue !== numValue) {\n const clampedString = clampedValue.toString();\n setInternalValue(clampedString);\n onChange?.(clampedString);\n }\n setIsOutOfRange(false); // Reset out-of-range state after clamping\n }\n }\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n 'input-container',\n isFocused ? 'input-container--focused' : '',\n isLabelFloating ? 'input-container--floating' : '',\n disabled ? 'input-container--disabled' : '',\n isOutOfRange ? 'input-container--error' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type=\"number\"\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n min={min.value}\n max={max.value}\n step={1}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport './Switch.css';\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? '#999FA1' : '#009CDF'}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? 'white' : '#009cdf'} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n label?: string;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n label,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n // Use controlled value if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !isChecked;\n // Only update internal state if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n 'switch',\n isChecked ? 'switch--checked' : '',\n disabled ? 'switch--disabled' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const wrapperClasses = ['switch-wrapper', isChecked ? 'switch-wrapper--checked' : '']\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className=\"switch-container\">\n <div className={wrapperClasses}>\n {showIcon ? (\n <div className=\"switch-icon\">\n <ImgOn isOff={!isChecked} />\n </div>\n ) : label ? (\n <div className=\"switch-label\">{label}</div>\n ) : null}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!isChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport './Chip.css';\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n children: React.ReactNode;\n bgColor?: string;\n width?: 'fit-content' | 'full-width';\n}\n\nexport const Chip: React.FC<ChipProps> = ({ children, bgColor, width = 'fit-content' }) => {\n const chipClasses = [\n 'chip-container',\n width === 'full-width' ? 'chip-container--full-width' : 'chip-container--fit-content',\n ].join(' ');\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <div className=\"chip-label\">{children}</div>\n </div>\n </div>\n );\n};\n","import './ProductionUnitContainer.css';\n\ninterface ProductionUnitContainerProps {\n bgColor?: string;\n children: React.ReactNode;\n height?: string;\n}\nexport const ProductionUnitContainer = ({\n bgColor = '#fff',\n children,\n height,\n}: ProductionUnitContainerProps) => {\n return (\n <div className=\"production-unit-container-box\" style={{ backgroundColor: bgColor, height }}>\n {children}\n </div>\n );\n};\n","import { useState } from 'react';\nimport { InputNumber } from './InputNumber';\nimport { Switch } from './Switch';\nimport './ProductionUnit.css';\nimport { Chip } from './Chip';\nimport { ProductionUnitContainer } from './ProductionUnitContainer';\nimport { ValueWithUnit } from '.';\n\ntype ProductionUnitLimit = {\n value: number;\n label?: string;\n};\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n value?: number;\n checked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n min?: ProductionUnitLimit;\n max?: ProductionUnitLimit;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n value,\n checked,\n unitName = 'Production Unit',\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n min = { value: 10, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}: ProductionUnitProps) => {\n // Internal state management for uncontrolled mode\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n // Use controlled props if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n const currentValue = value !== undefined ? value : internalValue;\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state only if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n // Only convert to number if the string is not empty and is a valid number\n if (val === '') {\n // Handle empty string case\n if (value === undefined) {\n setInternalValue(undefined);\n }\n if (onChangeInput) {\n onChangeInput(0); // or whatever default you prefer for empty values\n }\n return;\n }\n\n const numValue = parseFloat(val);\n if (!isNaN(numValue)) {\n // Update internal state only if uncontrolled\n if (value === undefined) {\n setInternalValue(numValue);\n }\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n }\n };\n\n return (\n <ProductionUnitContainer>\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">{isChecked ? checkedImage : uncheckedImage}</div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip width=\"fit-content\" bgColor=\"#E1F5FD\">\n <ValueWithUnit cost={energyCost} textColor=\"#005896\" />\n </Chip>\n </div>\n <div className=\"production-unit-switch-container\">\n <InputNumber\n label=\"PA\"\n onChange={handleInputChange}\n value={currentValue !== undefined ? currentValue.toString() : undefined}\n disabled={!isChecked || readonly}\n min={{ value: min.value, label: min.label }}\n max={{ value: max.value, label: max.label }}\n />{' '}\n </div>\n </div>\n\n <Switch checked={isChecked} onChange={handleSwitchChange} disabled={readonly} />\n </div>\n </ProductionUnitContainer>\n );\n};\n","import React, { useEffect, useState } from 'react';\nimport './Histogram.css';\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * (orientation === 'horizontal' ? barHeight : barWidth);\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n\n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n\n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n\n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `\n .trim()\n .replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius\n ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n }\n : defaultCornerRadius;\n\n return (\n <div\n className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}\n >\n <div\n className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}\n >\n <div\n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`,\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Define clipping path with rounded corners matching the background */}\n <defs>\n <clipPath id={`histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft}`}>\n <path d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)} />\n </clipPath>\n </defs>\n \n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n \n {/* Foreground bar (relative value) with clipping to stay within rounded corners */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(0, svgHeight - animatedHeight, svgWidth, animatedHeight, {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n ) : (\n <path\n d={createRoundedRectPath(0, 0, animatedWidth, svgHeight, {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n )}\n </svg>\n </div>\n {children && (\n <div\n className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}\n >\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport './Avatar.css';\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n","import React from 'react';\nimport './ValueWithUnit.css';\n\ninterface ValueWithUnitProps {\n cost?: number;\n textColor?: string;\n type?: 'euro' | 'megawatt' | 'europermegawatt';\n}\n\nexport const ValueWithUnit: React.FC<ValueWithUnitProps> = ({ cost, textColor, type = 'europermegawatt' }) => {\n return (\n <div className=\"cost-text-container\">\n <div className=\"cost-number\" style={{ color: textColor }}>\n {cost}\n </div>\n <div className=\"cost-unit\" style={{ color: textColor }}>\n {type === 'euro' || type === 'europermegawatt' ? '€' : 'MWh'}\n </div>\n {type === 'europermegawatt' && (\n <div className=\"cost-unit-per\" style={{ color: textColor }}>\n /MWh\n </div>\n )}\n </div>\n );\n};\n\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import React, { useState, useEffect, useRef, useCallback } from 'react';\nimport './Timer.css';\n\nexport interface TimerProps {\n // Required phase configuration\n phases: { duration: number; title?: string }[];\n \n // Required external state - always controlled\n externalState: {\n currentPhase: number;\n currentTime: number;\n isRunning: boolean;\n isPaused: boolean;\n isFrozen: boolean;\n };\n \n // Required state change handler\n onStateChange: (state: {\n currentPhase: number;\n currentTime: number;\n isRunning: boolean;\n isPaused: boolean;\n isFrozen: boolean;\n }) => void;\n \n // Optional event callbacks\n onComplete?: () => void;\n onPhaseComplete?: (phaseIndex: number, phaseDuration: number) => void;\n onTick?: (currentTime: number, phaseIndex: number) => void;\n onStart?: () => void;\n onPause?: () => void;\n onFreeze?: (frozen: boolean) => void;\n onAnonymiseToggle?: (anonymised: boolean) => void;\n onStop?: () => void;\n onReset?: () => void;\n onPrevious?: () => void;\n onNext?: () => void;\n onPhaseClick?: (phaseIndex: number) => void;\n \n // UI configuration\n className?: string;\n gameActions?: { [phaseIndex: number]: string };\n user?: 'actor' | 'admin';\n}\n\nexport interface TimerRef {\n start: () => void;\n pause: () => void;\n freeze: (force?: boolean) => void; // toggle or force\n toggleAnonymise: (force?: boolean) => void; // NEW\n stop: () => void;\n reset: () => void;\n setPhases: (phases: { duration: number; title?: string }[]) => void;\n getCurrentTime: () => number;\n getCurrentPhase: () => number;\n isRunning: () => boolean;\n isPaused: () => boolean;\n}\n\nconst formatTime = (seconds: number): string => {\n const minutes = Math.floor(seconds / 60);\n const secs = seconds % 60;\n return `${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;\n};\n\nexport const Timer = React.forwardRef<TimerRef, TimerProps>(\n (\n {\n phases = [],\n externalState,\n onStateChange,\n onComplete,\n onPhaseComplete,\n onTick,\n onStart,\n onPause,\n onFreeze,\n onAnonymiseToggle,\n onStop,\n onReset,\n onPrevious,\n onNext,\n onPhaseClick,\n className = '',\n gameActions = {},\n user = 'admin',\n },\n ref\n ) => {\n // Extract state from externalState - no internal timer state\n const {\n currentPhase,\n currentTime,\n isRunning,\n isPaused,\n isFrozen,\n } = externalState;\n\n // Keep only UI-specific state (not timer logic)\n const [selectedPhase, setSelectedPhase] = useState<number | null>(null);\n const [isAnonymised, setIsAnonymised] = useState(false);\n const intervalRef = useRef<NodeJS.Timeout | null>(null);\n\n const start = useCallback(() => {\n if (phases.length === 0 || currentPhase >= phases.length) return;\n \n onStateChange({\n ...externalState,\n isRunning: true,\n isPaused: false,\n });\n onStart?.();\n }, [phases.length, currentPhase, externalState, onStateChange, onStart]);\n\n const pause = useCallback(() => {\n if (isFrozen) return;\n \n onStateChange({\n ...externalState,\n isRunning: false,\n isPaused: true,\n });\n onPause?.();\n }, [isFrozen, externalState, onStateChange, onPause]);\n\n const freeze = useCallback((force?: boolean) => {\n \n const nextFrozen = force === undefined ? !isFrozen : force;\n \n const newState = {\n ...externalState,\n isFrozen: nextFrozen,\n // When unfreezing, restore to running state (unless it was explicitly paused)\n // When freezing, stop running but preserve pause state\n isRunning: nextFrozen ? false : !externalState.isPaused,\n isPaused: externalState.isPaused, // Preserve pause state\n };\n \n onStateChange(newState);\n onFreeze?.(nextFrozen);\n }, [isFrozen, externalState, onStateChange, onFreeze]);\n\n const toggleAnonymise = useCallback(\n (force?: boolean) => {\n setIsAnonymised((prev) => {\n const next = force === undefined ? !prev : force;\n onAnonymiseToggle?.(next);\n return next;\n });\n },\n [onAnonymiseToggle]\n );\n\n const stop = useCallback(() => {\n onStateChange({\n currentPhase: 0,\n currentTime: 0,\n isRunning: false,\n isPaused: false,\n isFrozen: false,\n });\n onStop?.();\n }, [onStateChange, onStop]);\n\n const reset = useCallback(() => {\n onStateChange({\n currentPhase: 0,\n currentTime: 0,\n isRunning: false,\n isPaused: false,\n isFrozen: false,\n });\n onReset?.();\n }, [onStateChange, onReset]);\n\n const setTimerPhases = useCallback(() => {\n // No-op since phases come from props\n }, []);\n\n React.useImperativeHandle(ref, () => ({\n start,\n pause,\n freeze,\n toggleAnonymise,\n stop,\n reset,\n setPhases: setTimerPhases,\n getCurrentTime: () => currentTime,\n getCurrentPhase: () => currentPhase,\n isRunning: () => isRunning,\n isPaused: () => isPaused,\n }));\n\n\n useEffect(() => {\n if (isRunning && !isFrozen && currentPhase < phases.length) {\n intervalRef.current = setInterval(() => {\n const newTime = currentTime + 1;\n \n // Always update the time first\n onStateChange({\n ...externalState,\n currentTime: newTime,\n });\n onTick?.(newTime, currentPhase);\n\n // Check if current phase is complete (after showing the duration)\n // Complete when newTime > duration, not when newTime >= duration\n if (newTime > (phases[currentPhase]?.duration || 0)) {\n onPhaseComplete?.(currentPhase, phases[currentPhase]?.duration || 0);\n\n // Move to next phase or complete\n if (currentPhase + 1 < phases.length) {\n onStateChange({\n ...externalState,\n currentPhase: currentPhase + 1,\n currentTime: 0,\n });\n } else {\n // All phases complete\n onStateChange({\n ...externalState,\n isRunning: false,\n isPaused: false,\n });\n onComplete?.();\n }\n }\n }, 1000);\n } else {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }\n\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n };\n }, [isRunning, isFrozen, currentPhase, currentTime, phases, externalState, onStateChange, onTick, onPhaseComplete, onComplete]);\n\n const currentPhaseDuration = phases[currentPhase]?.duration || 0;\n const progress = currentPhaseDuration > 0 ? (currentTime / currentPhaseDuration) * 100 : 0;\n // Determine if we finished all steps and are at the end\n const isAtEnd =\n phases.length > 0 &&\n !isRunning &&\n currentPhase === Math.max(0, phases.length - 1) &&\n currentTime >= (phases[Math.max(0, currentPhase)]?.duration || 0);\n\n const timerClasses = [\n 'timer-header-control',\n className,\n isRunning ? 'timer--running' : '',\n isPaused ? 'timer--paused' : '',\n isFrozen ? 'timer--frozen' : '',\n // isAnonymised ? 'timer--anonymised' : '',\n isAtEnd ? 'timer--completed' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const remainingTime = currentPhaseDuration > 0 ? currentPhaseDuration - currentTime : 0;\n\n const renderStepIndicators = () => {\n const steps = [] as React.ReactNode[];\n const maxSteps = phases.length;\n\n for (let i = 0; i < maxSteps; i++) {\n const isActive = i === currentPhase;\n const isCompleted = i < currentPhase;\n const hasAction = gameActions[i];\n const isClickable = isActive || isCompleted; // only active or completed\n\n let stepClass = 'step-indicator';\n if (!hasAction && !isActive && !isCompleted) {\n stepClass += ' step-indicator--placeholder';\n } else if (isActive) {\n stepClass +=\n ' step-indicator--active' +\n (user === 'actor' ? ' step-indicator--actor' : ' step-indicator--admin');\n } else if (isCompleted) {\n stepClass += ' step-indicator--completed';\n } else {\n stepClass += ' step-indicator--upcoming';\n }\n if (isClickable) stepClass += ' step-indicator--clickable'; // add clickable style\n if (selectedPhase === i) stepClass += ' step-indicator--selected'; // highlight clicked\n\n const handleClick = () => {\n if (!isClickable) return;\n setSelectedPhase(i);\n onPhaseClick?.(i);\n };\n\n const commonProps = {\n key: i,\n className: stepClass,\n 'data-step': i + 1,\n title: phases[i]?.title\n ? `Step ${i + 1}: ${phases[i]?.title}`\n : hasAction\n ? `Step ${i + 1}: ${hasAction}`\n : `Step ${i + 1}`,\n onClick: isClickable ? handleClick : undefined,\n role: isClickable ? ('button' as const) : undefined,\n tabIndex: isClickable ? 0 : undefined,\n onKeyDown: isClickable\n ? (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleClick();\n }\n }\n : undefined,\n };\n\n steps.push(<div {...commonProps}>{hasAction || isActive || isCompleted ? i + 1 : ''}</div>);\n\n if (user === 'actor' && isActive) {\n steps.push(\n <div key={`header-inline-${i}`} className=\"timer-header--block\">\n <div className=\"timer-header timer-header--inline\">\n <span className=\"timer-title\">\n {(phases[currentPhase]?.title || 'TIMER').toUpperCase()}\n </span>\n <span className=\"timer-time\">{formatTime(Math.max(0, remainingTime))}</span>\n </div>\n <div className=\"timer-progress-bar timer-progress-bar--inline\">\n <div\n className=\"timer-progress-fill\"\n style={{ width: `${Math.min(100, progress)}%` }}\n />\n </div>\n </div>\n );\n }\n }\n\n return (\n <div className=\"step-indicators\">\n {steps}\n <div\n className={`step-expand ${isAtEnd ? 'step-expand--end' : ''}`}\n title={isAtEnd ? 'All steps completed' : 'In progress'}\n >\n {user === 'actor' ? (\n isAtEnd ? (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect\n x=\"24\"\n width=\"24\"\n height=\"24\"\n rx=\"12\"\n transform=\"rotate(90 24 0)\"\n fill=\"#292E33\"\n />\n <path\n d=\"M20 12C20 12.276 19.776 12.5 19.5 12.5L17.4766 12.5C17.238 15.1345 15.1345 17.238 12.5 17.4766L12.5 19.5C12.5 19.776 12.276 20 12 20C11.724 20 11.5 19.776 11.5 19.5L11.5 17.4766C8.86554 17.238 6.763 15.1345 6.52441 12.5L4.5 12.5C4.224 12.5 4 12.276 4 12C4 11.724 4.224 11.5 4.5 11.5L6.52441 11.5C6.763 8.86555 8.86554 6.76198 11.5 6.52344L11.5 4.5C11.5 4.224 11.724 4 12 4C12.276 4 12.5 4.224 12.5 4.5L12.5 6.52344C15.1345 6.76199 17.238 8.86551 17.4766 11.5L19.5 11.5C19.776 11.5 20 11.724 20 12ZM16.5 12C16.5 9.51867 14.4813 7.5 12 7.5C9.51867 7.5 7.5 9.51867 7.5 12C7.5 14.4813 9.51867 16.5 12 16.5C14.4813 16.5 16.5 14.4813 16.5 12ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z\"\n fill=\"white\"\n />\n </svg>\n ) : (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect\n x=\"24\"\n width=\"24\"\n height=\"24\"\n rx=\"12\"\n transform=\"rotate(90 24 0)\"\n fill=\"#292E33\"\n />\n <path\n d=\"M20 12C20 12.276 19.776 12.5 19.5 12.5L17.4766 12.5C17.238 15.1345 15.1345 17.238 12.5 17.4766L12.5 19.5C12.5 19.776 12.276 20 12 20C11.724 20 11.5 19.776 11.5 19.5L11.5 17.4766C8.86554 17.238 6.763 15.1345 6.52441 12.5L4.5 12.5C4.224 12.5 4 12.276 4 12C4 11.724 4.224 11.5 4.5 11.5L6.52441 11.5C6.763 8.86555 8.86554 6.76198 11.5 6.52344L11.5 4.5C11.5 4.224 11.724 4 12 4C12.276 4 12.5 4.224 12.5 4.5L12.5 6.52344C15.1345 6.76199 17.238 8.86551 17.4766 11.5L19.5 11.5C19.776 11.5 20 11.724 20 12ZM16.5 12C16.5 9.51867 14.4813 7.5 12 7.5C9.51867 7.5 7.5 9.51867 7.5 12C7.5 14.4813 9.51867 16.5 12 16.5C14.4813 16.5 16.5 14.4813 16.5 12ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z\"\n fill=\"white\"\n />\n </svg>\n )\n ) : isAtEnd ? (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 8C16 8.276 15.776 8.5 15.5 8.5L13.4766 8.5C13.238 11.1345 11.1345 13.238 8.5 13.4766L8.5 15.5C8.5 15.776 8.276 16 8 16C7.724 16 7.5 15.776 7.5 15.5L7.5 13.4766C4.86554 13.238 2.763 11.1345 2.52441 8.5L0.5 8.5C0.224 8.5 -3.61755e-07 8.276 -3.49691e-07 8C-3.29564e-07 7.724 0.224 7.5 0.5 7.5L2.52441 7.5C2.763 4.86555 4.86554 2.76198 7.5 2.52344L7.5 0.5C7.5 0.224 7.724 -3.61755e-07 8 -3.4969e-07C8.276 -3.29563e-07 8.5 0.224 8.5 0.5L8.5 2.52344C11.1345 2.76199 13.238 4.86551 13.4766 7.5L15.5 7.5C15.776 7.5 16 7.724 16 8ZM12.5 8C12.5 5.51867 10.4813 3.5 8 3.5C5.51867 3.5 3.5 5.51867 3.5 8C3.5 10.4813 5.51867 12.5 8 12.5C10.4813 12.5 12.5 10.4813 12.5 8ZM10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z\"\n fill=\"currentColor\"\n />\n </svg>\n ) : (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 8C16 8.276 15.776 8.5 15.5 8.5L13.4766 8.5C13.238 11.1345 11.1345 13.238 8.5 13.4766L8.5 15.5C8.5 15.776 8.276 16 8 16C7.724 16 7.5 15.776 7.5 15.5L7.5 13.4766C4.86554 13.238 2.763 11.1345 2.52441 8.5L0.5 8.5C0.224 8.5 -3.61755e-07 8.276 -3.49691e-07 8C-3.29564e-07 7.724 0.224 7.5 0.5 7.5L2.52441 7.5C2.763 4.86555 4.86554 2.76198 7.5 2.52344L7.5 0.5C7.5 0.224 7.724 -3.61755e-07 8 -3.4969e-07C8.276 -3.29563e-07 8.5 0.224 8.5 0.5L8.5 2.52344C11.1345 2.76199 13.238 4.86551 13.4766 7.5L15.5 7.5C15.776 7.5 16 7.724 16 8ZM12.5 8C12.5 5.51867 10.4813 3.5 8 3.5C5.51867 3.5 3.5 5.51867 3.5 8C3.5 10.4813 5.51867 12.5 8 12.5C10.4813 12.5 12.5 10.4813 12.5 8ZM10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </div>\n </div>\n );\n };\n\n return (\n <div className={timerClasses}>\n <div className=\"timer-section\">\n <div className=\"timer-content\">\n <div className=\"timer-display-area\">\n {user === 'admin' && (\n <div className=\"timer-header\">\n <span className=\"timer-title\">\n {(phases[currentPhase]?.title || 'TIMER').toUpperCase()}\n </span>\n <span className=\"timer-time\">{formatTime(Math.max(0, remainingTime))}</span>\n </div>\n )}\n {user === 'admin' && (\n <div className=\"timer-progress-bar\">\n <div\n className=\"timer-progress-fill\"\n style={{ width: `${Math.min(100, progress)}%` }}\n />\n </div>\n )}\n {renderStepIndicators()}\n </div>\n </div>\n </div>\n\n {user === 'admin' && (\n <div className=\"timer-controls-section\">\n <button\n className=\"control-button control-button--previous\"\n onClick={() => onPrevious?.()}\n disabled={currentPhase === 0}\n title=\"Previous\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.9813 2.39178C12.1589 2.38845 12.3342 2.43251 12.4892 2.51941C12.6441 2.60631 12.7731 2.73291 12.8629 2.88621C12.9527 3.0395 13 3.21395 13 3.3916L12.5 3.3916H13V12.6085C13 12.7862 12.9527 12.9606 12.8629 13.1139C12.7731 13.2672 12.6441 13.3938 12.4892 13.4807C12.3342 13.5676 12.1589 13.6117 11.9813 13.6084C11.8037 13.605 11.6301 13.5545 11.4785 13.4618L3.93741 8.85335C3.79124 8.76403 3.67046 8.63865 3.58667 8.48923C3.50287 8.33982 3.45886 8.17138 3.45886 8.00007C3.45886 7.82877 3.50287 7.66033 3.58667 7.51092C3.67046 7.3615 3.79124 7.23612 3.93741 7.14679L11.4785 2.53832C11.6301 2.44568 11.8037 2.3951 11.9813 2.39178ZM12 3.3916L4.45886 8.00007L4.19814 7.57343L4.45886 8.00007L12 12.6085V3.3916Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M2 2C2.27614 2 2.5 2.22386 2.5 2.5V13.5C2.5 13.7761 2.27614 14 2 14C1.72386 14 1.5 13.7761 1.5 13.5V2.5C1.5 2.22386 1.72386 2 2 2Z\"\n fill=\"black\"\n />\n </svg>\n </button>\n\n <button\n className=\"control-button control-button--next\"\n onClick={() => onNext?.()}\n disabled={!(isAtEnd && currentPhase < phases.length - 1)}\n title=\"Next\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.51084 2.51941C3.66579 2.43251 3.84109 2.38845 4.01871 2.39178C4.19633 2.3951 4.36986 2.44568 4.52145 2.53832L12.0626 7.14679C12.2088 7.23612 12.3295 7.3615 12.4133 7.51092C12.4971 7.66033 12.5411 7.82877 12.5411 8.00007C12.5411 8.17138 12.4971 8.33982 12.4133 8.48923C12.3295 8.63865 12.2088 8.76403 12.0626 8.85335L4.52145 13.4618C4.36986 13.5545 4.19633 13.605 4.01871 13.6084C3.84109 13.6117 3.66579 13.5676 3.51084 13.4807C3.3559 13.3938 3.2269 13.2672 3.13711 13.1139C3.04733 12.9606 3 12.7862 3 12.6085V3.3916C3 3.21395 3.04733 3.0395 3.13711 2.88621C3.22689 2.73292 3.35589 2.60631 3.51084 2.51941ZM11.5411 8.00007L4 3.3916V12.6085L11.5411 8.00007Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M14 2C14.2761 2 14.5 2.22386 14.5 2.5V13.5C14.5 13.7761 14.2761 14 14 14C13.7239 14 13.5 13.7761 13.5 13.5V2.5C13.5 2.22386 13.7239 2 14 2Z\"\n fill=\"black\"\n />\n </svg>\n </button>\n\n <button\n className={`control-button control-button--play-pause ${\n isRunning ? 'control-button--pause' : 'control-button--play'\n } ${isFrozen ? 'control-button--disabled' : ''}`}\n onClick={isRunning ? pause : start}\n title={isFrozen ? 'Frozen' : isRunning ? 'Pause' : isPaused ? 'Resume' : 'Start'}\n disabled={isFrozen}\n >\n {isRunning ? (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 4.5C7.85786 4.5 4.5 7.85786 4.5 12C4.5 15.1788 6.47789 17.8975 9.27283 18.989C9.65866 19.1397 9.8493 19.5746 9.69862 19.9604C9.54794 20.3463 9.113 20.5369 8.72717 20.3862C5.37607 19.0775 3 15.8172 3 12C3 7.02944 7.02944 3 12 3C16.2192 3 19.7585 5.90255 20.7337 9.81878C20.9078 10.5179 21 11.2487 21 12C21 12.4142 20.6642 12.75 20.25 12.75C19.8358 12.75 19.5 12.4142 19.5 12C19.5 11.3719 19.4229 10.7628 19.2781 10.1812C18.4655 6.91754 15.5141 4.5 12 4.5Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M18.75 15.75V22.25H20.25V15.75H18.75ZM17.25 15.3636C17.25 14.5918 17.9689 14.25 18.4615 14.25H20.5385C21.0311 14.25 21.75 14.5918 21.75 15.3636V22.6364C21.75 23.4082 21.0311 23.75 20.5385 23.75H18.4615C17.9689 23.75 17.25 23.4082 17.25 22.6364V15.3636Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.75 15.75V22.25H14.25V15.75H12.75ZM11.25 15.3636C11.25 14.5918 11.9689 14.25 12.4615 14.25H14.5385C15.0311 14.25 15.75 14.5918 15.75 15.3636V22.6364C15.75 23.4082 15.0311 23.75 14.5385 23.75H12.4615C11.9689 23.75 11.25 23.4082 11.25 22.6364V15.3636Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.54996 7.40004C8.21858 7.64857 8.15143 8.11867 8.39996 8.45004L11.4 12.45C11.6485 12.7814 12.1186 12.8486 12.45 12.6C12.7813 12.3515 12.8485 11.8814 12.6 11.55L9.59996 7.55004C9.35143 7.21867 8.88133 7.15152 8.54996 7.40004Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 0.75C9 0.335786 9.33579 0 9.75 0H14.25C14.6642 0 15 0.335786 15 0.75C15 1.16421 14.6642 1.5 14.25 1.5H9.75C9.33579 1.5 9 1.16421 9 0.75Z\"\n fill=\"black\"\n />\n </svg>\n ) : (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M20.25 12C20.25 11.3103 20.1654 10.6404 20.0059 10C19.112 6.41005 15.8666 3.75 12 3.75C7.44365 3.75 3.75 7.44365 3.75 12C3.75 15.498 5.92698 18.4875 9 19.6876\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeMiterlimit=\"10\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M12 12L9 8\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M9.75 0.75H14.25\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M20.7759 18.1242L13.7125 14.0646C13.6415 14.0238 13.5603 14.0015 13.4771 14.0001C13.3939 13.9986 13.3118 14.018 13.2392 14.0563C13.1667 14.0946 13.1063 14.1503 13.0642 14.2178C13.0222 14.2854 13 14.3622 13 14.4404V22.5596C13 22.6378 13.0222 22.7146 13.0642 22.7822C13.1063 22.8497 13.1667 22.9054 13.2392 22.9437C13.3118 22.982 13.3939 23.0014 13.4771 22.9999C13.5603 22.9985 13.6415 22.9762 13.7125 22.9354L20.7759 18.8758C20.8443 18.8365 20.9009 18.7813 20.9401 18.7154C20.9794 18.6496 21 18.5755 21 18.5C21 18.4245 20.9794 18.3504 20.9401 18.2846C20.9009 18.2187 20.8443 18.1635 20.7759 18.1242V18.1242Z\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )}\n </button>\n\n <button\n className={`control-button control-button--freeze ${isFrozen ? 'control-button--freeze-active' : ''}`}\n onClick={() => freeze()}\n title={isFrozen ? 'Unfreeze' : 'Freeze'}\n disabled={!isRunning && !isPaused && !isFrozen}\n >\n {/* Simple snowflake / asterisk style placeholder icon */}\n <svg width=\"14\" height=\"12\" viewBox=\"0 0 14 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M8.14697 0.146484C8.34224 -0.0486747 8.65878 -0.0487434 8.854 0.146484C9.04889 0.341739 9.04905 0.658358 8.854 0.853516L7.50049 2.20703V5.13281L10.0337 3.66992L10.5298 1.82129C10.6012 1.5547 10.8755 1.3966 11.1421 1.46777C11.4088 1.53922 11.5679 1.8134 11.4966 2.08008L11.0767 3.64648L12.6421 4.06543C12.9088 4.1369 13.0681 4.41198 12.9966 4.67871C12.925 4.94527 12.6499 5.10368 12.3833 5.03223L10.5347 4.53613L7.99951 5.99902L10.5347 7.46191L12.3833 6.96777C12.65 6.8963 12.9251 7.05456 12.9966 7.32129C13.068 7.58799 12.9088 7.86213 12.6421 7.93359L11.0767 8.35352L11.4966 9.91992C11.5677 10.1865 11.4086 10.4608 11.1421 10.5322C10.8756 10.6033 10.6013 10.4451 10.5298 10.1787L10.0337 8.32812L7.50049 6.86523V9.79297L8.854 11.1465C9.04889 11.3417 9.04905 11.6584 8.854 11.8535C8.65885 12.0487 8.34226 12.0484 8.14697 11.8535L7.00049 10.707L5.854 11.8535C5.65885 12.0487 5.34226 12.0484 5.14697 11.8535C4.95171 11.6583 4.95171 11.3417 5.14697 11.1465L6.50049 9.79297V6.86523L3.96533 8.32812L3.47021 10.1787C3.39865 10.4451 3.12439 10.6034 2.85791 10.5322C2.59128 10.4608 2.43314 10.1866 2.50439 9.91992L2.92334 8.35352L1.35791 7.93359C1.09118 7.86212 0.932919 7.58802 1.00439 7.32129C1.07593 7.05464 1.35001 6.89631 1.6167 6.96777L3.46436 7.46191L5.99951 5.99902L3.46436 4.53613L1.6167 5.03223C1.35014 5.10366 1.07608 4.94513 1.00439 4.67871C0.932919 4.41198 1.09118 4.1369 1.35791 4.06543L2.92334 3.64648L2.50439 2.08008C2.43293 1.81334 2.59118 1.53924 2.85791 1.46777C3.12453 1.39654 3.39878 1.55467 3.47021 1.82129L3.96533 3.66992L6.50049 5.13281V2.20703L5.14697 0.853516C4.95171 0.658253 4.95171 0.341747 5.14697 0.146484C5.34224 -0.0486746 5.65878 -0.0487434 5.854 0.146484L7.00049 1.29297L8.14697 0.146484Z\" fill=\"black\"/>\n</svg>\n\n </button>\n <button\n className={`control-button control-button--anonymise ${isAnonymised ? 'control-button--anonymise-active' : ''}`}\n onClick={() => toggleAnonymise()}\n title={isAnonymised ? 'Show Names' : 'Hide Names'}\n >\n {/* Simple snowflake / asterisk style placeholder icon */}\n <svg width=\"18\" height=\"12\" viewBox=\"0 0 18 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M4.19571 0.9375H13.9316L13.9576 0.939919L13.9055 1.5C13.9576 0.939919 13.958 0.939955 13.9584 0.939992L13.9593 0.940074L13.9612 0.940263L13.966 0.940753L13.9794 0.942218C13.9899 0.943426 14.0036 0.945121 14.0203 0.947429C14.0536 0.952044 14.0989 0.959129 14.1545 0.969722C14.2655 0.990879 14.4186 1.02621 14.5998 1.08426C14.9611 1.20007 15.4415 1.40866 15.9224 1.78153C16.9079 2.54562 17.8125 3.93493 17.8125 6.375C17.8125 8.84977 16.7446 10.2418 15.6228 10.9916C15.0757 11.3573 14.5319 11.5602 14.1264 11.6723C13.9228 11.7285 13.7514 11.7626 13.6282 11.7828C13.5666 11.7929 13.5167 11.7996 13.4807 11.8039C13.4626 11.8061 13.448 11.8076 13.437 11.8087L13.4234 11.81L13.4186 11.8104L13.4168 11.8106L13.416 11.8106C13.4157 11.8107 13.4154 11.8107 13.3704 11.25L13.416 11.8106L13.3929 11.8125H13.3704C12.4693 11.8125 11.7717 11.6348 11.2171 11.3425C10.6627 11.0503 10.2868 10.6623 10.0046 10.2977C9.86569 10.1182 9.74696 9.94078 9.64616 9.78996C9.5407 9.6322 9.46023 9.51197 9.38106 9.41262C9.22707 9.21935 9.16773 9.21939 9.13503 9.21941H9.13398C9.09752 9.21941 9.03241 9.22191 8.87346 9.41718C8.79345 9.51548 8.71127 9.63581 8.60695 9.79107C8.60069 9.80039 8.59437 9.80981 8.58797 9.81934C8.49236 9.96175 8.38151 10.1269 8.25589 10.2929C7.98421 10.6519 7.62551 11.0405 7.10214 11.335C6.57573 11.6313 5.91831 11.8125 5.07599 11.8125H5.0488L5.02173 11.8099L5.07599 11.25C5.02173 11.8099 5.02205 11.8099 5.02173 11.8099L5.0204 11.8097L5.01868 11.8096L5.01405 11.8091L5.00016 11.8076C4.98888 11.8063 4.97357 11.8045 4.95451 11.8019C4.91641 11.7969 4.8632 11.7892 4.79703 11.7779C4.66485 11.7553 4.47999 11.718 4.25972 11.6585C3.82115 11.5401 3.23123 11.3305 2.63538 10.9643C1.42058 10.2176 0.212463 8.83259 0.187947 6.38062C0.163902 3.97575 1.11355 2.587 2.13375 1.81616C2.63171 1.43991 3.12954 1.22329 3.50294 1.10027C3.69026 1.03855 3.84839 0.999684 3.96267 0.975868C4.01989 0.963945 4.06636 0.955744 4.10027 0.950316C4.11724 0.947601 4.13108 0.945576 4.14159 0.944124L4.15484 0.942358L4.15953 0.941769L4.16139 0.941543L4.1622 0.941446C4.16257 0.941403 4.16292 0.941361 4.22872 1.5L4.1622 0.941446L4.19571 0.9375ZM4.26997 2.0625C4.25203 2.06549 4.22575 2.07021 4.19218 2.07721C4.11398 2.09351 3.99723 2.1219 3.85498 2.16877C3.56924 2.26291 3.18912 2.42877 2.81194 2.71376C2.08184 3.2654 1.29234 4.31414 1.31289 6.36938C1.33297 8.37752 2.28763 9.43001 3.22447 10.0058C3.70444 10.3008 4.18756 10.4737 4.55306 10.5724C4.73484 10.6215 4.88477 10.6515 4.98688 10.669C5.03785 10.6778 5.07667 10.6833 5.1013 10.6866C5.10355 10.6869 5.10569 10.6871 5.10771 10.6874C5.76441 10.683 6.21815 10.5416 6.55042 10.3546C6.89104 10.1629 7.13992 9.90327 7.35877 9.61404C7.46458 9.47422 7.55912 9.33345 7.65787 9.18641L7.67313 9.1637C7.77297 9.01508 7.8831 8.85179 8.00097 8.70698C8.23778 8.41606 8.59073 8.09441 9.13398 8.09441C9.6812 8.09441 10.0292 8.42071 10.2609 8.71155C10.3706 8.8492 10.4746 9.00486 10.569 9.14611L10.5815 9.1648C10.6838 9.31787 10.7824 9.46461 10.8943 9.6092C11.1139 9.89292 11.3735 10.1532 11.7416 10.3472C12.1049 10.5387 12.6087 10.6838 13.3424 10.6874C13.3439 10.6873 13.3456 10.6871 13.3473 10.6869C13.368 10.6844 13.4015 10.6799 13.4459 10.6727C13.5349 10.658 13.6667 10.6321 13.8268 10.5879C14.1487 10.4989 14.5748 10.3389 14.9976 10.0563C15.8156 9.50956 16.6875 8.46406 16.6875 6.375C16.6875 4.25124 15.9198 3.20305 15.2331 2.6706C14.8779 2.3952 14.5221 2.24075 14.2564 2.1556C14.124 2.11316 14.0158 2.08853 13.944 2.07485C13.9117 2.0687 13.887 2.0648 13.8709 2.0625H4.26997ZM13.8498 2.05973C13.8494 2.05969 13.8497 2.05972 13.8508 2.05985L13.8498 2.05973Z\" fill=\"black\"/>\n<path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M5.625 5.0625C4.77651 5.0625 4.3125 5.59288 4.3125 6C4.3125 6.40712 4.77651 6.9375 5.625 6.9375C6.47349 6.9375 6.9375 6.40712 6.9375 6C6.9375 5.59288 6.47349 5.0625 5.625 5.0625ZM3.1875 6C3.1875 4.75027 4.40242 3.9375 5.625 3.9375C6.84758 3.9375 8.0625 4.75027 8.0625 6C8.0625 7.24973 6.84758 8.0625 5.625 8.0625C4.40242 8.0625 3.1875 7.24973 3.1875 6Z\" fill=\"black\"/>\n<path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M12.375 5.0625C11.5265 5.0625 11.0625 5.59288 11.0625 6C11.0625 6.40712 11.5265 6.9375 12.375 6.9375C13.2235 6.9375 13.6875 6.40712 13.6875 6C13.6875 5.59288 13.2235 5.0625 12.375 5.0625ZM9.9375 6C9.9375 4.75027 11.1524 3.9375 12.375 3.9375C13.5976 3.9375 14.8125 4.75027 14.8125 6C14.8125 7.24973 13.5976 8.0625 12.375 8.0625C11.1524 8.0625 9.9375 7.24973 9.9375 6Z\" fill=\"black\"/>\n</svg>\n\n </button>\n </div>\n )}\n </div>\n );\n }\n);\n\nTimer.displayName = 'Timer';\n"],"names":["InputNumber","_a","label","_b","value","onChange","_c","disabled","_d","className","_e","required","_f","min","_g","max","_h","useState","internalValue","setInternalValue","_j","isFocused","setIsFocused","_k","isOutOfRange","setIsOutOfRange","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","ref","type","e","newValue","target","numValue","parseFloat","isNaN","outOfRange","clampedValue","Math","toString","onFocus","onBlur","clampedString","step","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","isChecked","undefined","switchClasses","wrapperClasses","role","onClick","newChecked","Chip","bgColor","chipClasses","style","backgroundColor","ProductionUnitContainer","ProductionUnit","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","currentValue","ValueWithUnit","cost","textColor","val","Histogram","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","targetWidth","startTime","Date","now","animate","elapsed","progress","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","x","y","radii","topLeft","topRight","bottomLeft","bottomRight","concat","trim","replace","defaultCornerRadius","corners","id","color","fillOpacity","opacity","clipPath","Avatar","__assign","Object","assign","t","s","i","n","arguments","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","formatTime","seconds","minutes","floor","secs","padStart","Timer","React","forwardRef","phases","externalState","onStateChange","onComplete","onPhaseComplete","onTick","onStart","onPause","onFreeze","onAnonymiseToggle","onStop","onReset","onPrevious","onNext","onPhaseClick","gameActions","user","currentPhase","currentTime","isRunning","isPaused","isFrozen","selectedPhase","setSelectedPhase","isAnonymised","setIsAnonymised","intervalRef","start","useCallback","pause","freeze","force","nextFrozen","newState","toggleAnonymise","prev","next","stop","reset","setTimerPhases","useImperativeHandle","setPhases","getCurrentTime","getCurrentPhase","current","setInterval","newTime","duration","clearInterval","currentPhaseDuration","isAtEnd","timerClasses","remainingTime","title","toUpperCase","steps","maxSteps","isActive","isCompleted","hasAction","isClickable","stepClass","handleClick","commonProps","key","tabIndex","onKeyDown","preventDefault","push","rx","transform","renderStepIndicators","fillRule","clipRule","stroke","strokeWidth","strokeMiterlimit","strokeLinecap","strokeLinejoin","displayName"],"mappings":"kIAcO,IAAMA,EAA0C,SAACC,GACtD,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAK,IAAAD,EAAG,GAAEA,EACVE,EAAQJ,EAAAI,SACRC,EAAgBL,EAAAM,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAP,EAAAQ,UAAAA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAAgBT,EAAAU,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAX,EAAAY,IAAAA,OAAM,IAAAD,EAAA,CAAER,MAAO,EAAGF,MAAO,QAAQU,EACjCE,EAAmCb,EAAAc,IAAnCA,OAAG,IAAAD,EAAG,CAAEV,MAAO,IAAKF,MAAO,QAAQY,EAE7BE,EAAoCC,EAASb,GAA5Cc,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA4BH,GAAS,GAApCI,EAASD,EAAA,GAAEE,EAAYF,EAAA,GACxBG,EAAkCN,GAAS,GAA1CO,EAAYD,EAAA,GAAEE,EAAeF,EAAA,GAC9BG,EAAWC,EAAyB,MAE1CC,EAAU,WACRT,EAAiBf,EACnB,EAAG,CAACA,IAEJ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B,EAAE,imBACFoL,OAAO,QACPC,YAAY,MACZE,cAAc,QACdC,eAAe,eAMvBlN,EAAA,SAAA,CACEzB,UAAW,yCAAA0H,OAAyCwD,EAAW,gCAAkC,IACjGhH,QAAS,WAAM,OAAAyH,GAAA,EACfuB,MAAOhC,EAAW,WAAa,SAC/BpL,UAAWkL,IAAcC,IAAaC,EAGtCxJ,SAAAD,EAAA,MAAA,CAAKqB,MAAM,KAAKC,OAAO,KAAKC,QAAQ,YAAYC,KAAK,OAAOC,MAAM,6BAA4BxB,SAC5GD,EAAM,OAAA,CAAA0B,EAAE,orDAAorDF,KAAK,cAIrrDxB,EAAA,SAAA,CACEzB,UAAW,mDAA4CqL,EAAe,mCAAqC,IAC3GnH,QAAS,WAAM,OAAA6H,GAAiB,EAChCmB,MAAO7B,EAAe,aAAe,aAGrC3J,SAAAC,EAAA,MAAA,CAAKmB,MAAM,KAAKC,OAAO,KAAKC,QAAQ,YAAYC,KAAK,OAAOC,MAAM,6BAA4BxB,SAAA,CAC5GD,UAAM4M,SAAS,UAAUC,SAAS,UAAUnL,EAAE,k/GAAk/GF,KAAK,UACriHxB,EAAA,OAAA,CAAM4M,SAAS,UAAUC,SAAS,UAAUnL,EAAE,mWAAmWF,KAAK,UACtZxB,EAAM,OAAA,CAAA4M,SAAS,UAAUC,SAAS,UAAUnL,EAAE,iXAAiXF,KAAK,oBAQla,GAGFyG,EAAMkF,YAAc","x_google_ignoreList":[8]}
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("react/jsx-runtime"),e=require("react"),a=function(a){var i=a.label,n=a.value,o=void 0===n?"":n,c=a.onChange,l=a.disabled,r=void 0!==l&&l,s=a.className,d=void 0===s?"":s,h=a.required,u=void 0!==h&&h,v=a.min,m=void 0===v?{value:0,label:"Pmin"}:v,p=a.max,f=void 0===p?{value:100,label:"Pmax"}:p,x=e.useState(o),g=x[0],b=x[1],j=e.useState(!1),N=j[0],w=j[1],C=e.useState(!1),L=C[0],R=C[1],M=e.useRef(null);e.useEffect(function(){b(o)},[o]);var y=["input-container",N?"input-container--focused":"",N||g.length>0?"input-container--floating":"",r?"input-container--disabled":"",L?"input-container--error":"",d].filter(Boolean).join(" ");return t.jsx("div",{className:y,children:t.jsxs("div",{className:"input-constraints",children:[t.jsxs("div",{className:"input-min",children:[m.label,t.jsx("br",{}),m.value]}),t.jsxs("div",{className:"input-field",children:[t.jsx("input",{ref:M,type:"number",value:g,onChange:function(t){var e=t.target.value;if(b(e),""!==e){var a=parseFloat(e);if(isNaN(a))R(!1),null==c||c(e);else{var i=a<m.value||a>f.value;if(R(i),i){var n=Math.max(m.value,Math.min(f.value,a));null==c||c(n.toString())}else null==c||c(e)}}else R(!1),null==c||c(e)},onFocus:function(){w(!0)},onBlur:function(){if(w(!1),""!==g){var t=parseFloat(g);if(!isNaN(t)){var e=Math.max(m.value,Math.min(f.value,t));if(e!==t){var a=e.toString();b(a),null==c||c(a)}R(!1)}}},disabled:r,required:u,className:"input-element","aria-label":i,min:m.value,max:f.value,step:1}),t.jsxs("label",{className:"input-label",children:[i,u&&t.jsx("span",{className:"input-required",children:"*"})]})]}),t.jsxs("div",{className:"input-max",children:[f.label,t.jsx("br",{})," ",f.value]})]})})},i=function(e){var a=e.isOff;return t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z",fill:a?"#999FA1":"#009CDF"})})},n=function(e){var a=e.isOff;return t.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("circle",{cx:"16",cy:"16",r:"16",fill:a?"white":"#009cdf"})})},o=function(a){var o=a.checked,c=void 0!==o&&o,l=a.onChange,r=a.disabled,s=void 0!==r&&r,d=a.showIcon,h=void 0===d||d,u=a.label,v=e.useState(c),m=v[0],p=v[1],f=void 0!==c?c:m,x=["switch",f?"switch--checked":"",s?"switch--disabled":""].filter(Boolean).join(" "),g=["switch-wrapper",f?"switch-wrapper--checked":""].filter(Boolean).join(" ");return t.jsx("div",{className:"switch-container",children:t.jsxs("div",{className:g,children:[h?t.jsx("div",{className:"switch-icon",children:t.jsx(i,{isOff:!f})}):u?t.jsx("div",{className:"switch-label",children:u}):null,t.jsx("button",{type:"button",role:"switch","aria-checked":f,className:x,onClick:function(){if(!s){var t=!f;void 0===c&&p(t),null==l||l(t)}},disabled:s,children:t.jsx("span",{className:"switch-track",children:t.jsx("span",{className:"switch-thumb",children:t.jsx(n,{isOff:!f})})})})]})})},c=function(e){var a=e.children,i=e.bgColor,n=e.width,o=["chip-container","full-width"===(void 0===n?"fit-content":n)?"chip-container--full-width":"chip-container--fit-content"].join(" ");return t.jsx("div",{className:o,style:{backgroundColor:i},children:t.jsx("div",{className:"chip-content",children:t.jsx("div",{className:"chip-label",children:a})})})},l=function(e){var a=e.bgColor,i=void 0===a?"#fff":a,n=e.children,o=e.height;return t.jsx("div",{className:"production-unit-container-box",style:{backgroundColor:i,height:o},children:n})},r=function(e){var a=e.cost,i=e.textColor,n=e.type,o=void 0===n?"europermegawatt":n;return t.jsxs("div",{className:"cost-text-container",children:[t.jsx("div",{className:"cost-number",style:{color:i},children:a}),t.jsx("div",{className:"cost-unit",style:{color:i},children:"euro"===o||"europermegawatt"===o?"€":"MWh"}),"europermegawatt"===o&&t.jsx("div",{className:"cost-unit-per",style:{color:i},children:"/MWh"})]})},s=function(a){var i=a.progressEndDate,n=a.leftTime,o=a.progressTime,c=a.className,l=void 0===c?"":c,r=e.useState(0),s=r[0],d=r[1],h=e.useState(Date.now())[0];return e.useEffect(function(){var t=null;if(!i||n||o){if(void 0!==n&&void 0!==o){var e=Math.max(0,Math.min(100,(o-n)/o*100));d(e)}}else{var a=function(){var e=Date.now(),a=Math.max(0,i-e),n=i-h,o=e-h,c=Math.max(0,Math.min(100,o/n*100));d(c),a<=0&&(d(100),t&&clearInterval(t))};a(),t=setInterval(a,100)}return function(){t&&clearInterval(t)}},[i,n,o,h]),t.jsx("div",{className:"timer-progress-bar ".concat(l),children:t.jsx("div",{className:"timer-progress-fill",style:{width:"".concat(s,"%")}})})};s.displayName="Timer",exports.Avatar=function(e){var a=e.children;return t.jsx("div",{className:"avatar-container avatar-container--clickable",children:t.jsx("div",{className:"avatar-content",children:a})})},exports.Chip=c,exports.Histogram=function(a){var i,n,o,c,l=a.max,r=a.relative,s=a.barHeight,d=void 0===s?103:s,h=a.barWidth,u=void 0===h?32:h,v=a.orientation,m=void 0===v?"vertical":v,p=a.cornerRadius,f=a.children,x=e.useState(0),g=x[0],b=x[1],j=e.useState(0),N=j[0],w=j[1],C=Math.min(r.value/l.value*100,100)/100*d,L=Math.min(r.value/l.value*100,100)/100*("horizontal"===m?d:u);e.useEffect(function(){b(0),w(0);var t=Date.now(),e=function(){var a=Date.now()-t,i=Math.min(a/1e3,1),n=1-Math.pow(1-i,4);b(C*n),w(L*n),i<1&&requestAnimationFrame(e)};requestAnimationFrame(e)},[C,L]);var R="horizontal"===m?d:u,M="horizontal"===m?u:d,y="horizontal"===m?d:u,S="horizontal"===m?u:d,k=function(t,e,a,i,n){var o=n.topLeft,c=n.topRight,l=n.bottomLeft,r=n.bottomRight;return"\n M ".concat(t+o," ").concat(e,"\n L ").concat(t+a-c," ").concat(e,"\n Q ").concat(t+a," ").concat(e," ").concat(t+a," ").concat(e+c,"\n L ").concat(t+a," ").concat(e+i-r,"\n Q ").concat(t+a," ").concat(e+i," ").concat(t+a-r," ").concat(e+i,"\n L ").concat(t+l," ").concat(e+i,"\n Q ").concat(t," ").concat(e+i," ").concat(t," ").concat(e+i-l,"\n L ").concat(t," ").concat(e+o,"\n Q ").concat(t," ").concat(e," ").concat(t+o," ").concat(e,"\n Z\n ").trim().replace(/\s+/g," ")},z={topLeft:2,topRight:2,bottomLeft:2,bottomRight:2},P=p?{topLeft:null!==(i=p.topLeft)&&void 0!==i?i:z.topLeft,topRight:null!==(n=p.topRight)&&void 0!==n?n:z.topRight,bottomLeft:null!==(o=p.bottomLeft)&&void 0!==o?o:z.bottomLeft,bottomRight:null!==(c=p.bottomRight)&&void 0!==c?c:z.bottomRight}:z;return t.jsx("div",{className:"histogram-container ".concat("horizontal"===m?"histogram-container--horizontal":""),children:t.jsxs("div",{className:"histogram-content ".concat("horizontal"===m?"histogram-content--horizontal":""),children:[t.jsx("div",{className:"histogram-bar",style:{height:"".concat(M,"px"),width:"".concat(R,"px")},children:t.jsxs("svg",{width:y,height:S,viewBox:"0 0 ".concat(y," ").concat(S),className:"histogram-svg",children:[t.jsx("defs",{children:t.jsx("clipPath",{id:"histogram-clip-".concat(y,"-").concat(S,"-").concat(P.topLeft),children:t.jsx("path",{d:k(0,0,y,S,P)})})}),t.jsx("path",{d:k(0,0,y,S,P),fill:l.color,fillOpacity:l.opacity||1}),"vertical"===m?t.jsx("path",{d:k(0,S-g,y,g,{topLeft:g>=S?P.topLeft:0,topRight:g>=S?P.topRight:0,bottomLeft:P.bottomLeft,bottomRight:P.bottomRight}),fill:r.color,clipPath:"url(#histogram-clip-".concat(y,"-").concat(S,"-").concat(P.topLeft,")")}):t.jsx("path",{d:k(0,0,N,S,{topLeft:P.topLeft,topRight:N>=y?P.topRight:0,bottomLeft:P.bottomLeft,bottomRight:N>=y?P.bottomRight:0}),fill:r.color,clipPath:"url(#histogram-clip-".concat(y,"-").concat(S,"-").concat(P.topLeft,")")})]})}),f&&t.jsx("div",{className:"histogram-text-container ".concat("horizontal"===m?"histogram-text-container--horizontal":""),children:f})]})})},exports.InputNumber=a,exports.ProductionUnit=function(i){var n=i.onChangeInput,s=i.onChangeSwitch,d=i.defaultValue,h=i.defaultChecked,u=void 0!==h&&h,v=i.value,m=i.checked,p=i.unitName,f=void 0===p?"Production Unit":p,x=i.energyCost,g=void 0===x?0:x,b=i.checkedImage,j=i.uncheckedImage,N=i.readonly,w=void 0!==N&&N,C=i.min,L=void 0===C?{value:10,label:"Pmin"}:C,R=i.max,M=void 0===R?{value:100,label:"Pmax"}:R,y=e.useState(u),S=y[0],k=y[1],z=e.useState(d),P=z[0],F=z[1],I=void 0!==m?m:S,q=void 0!==v?v:P;return t.jsx(l,{children:t.jsxs("div",{className:"production-unit-container",children:[t.jsxs("div",{className:"production-unit-content",children:[t.jsx("div",{className:"image-preview-container",children:I?b:j}),t.jsxs("div",{className:"production-unit-chip",children:[t.jsx("div",{className:"production-unit-chip-name",children:f}),t.jsx(c,{width:"fit-content",bgColor:"#E1F5FD",children:t.jsx(r,{cost:g,textColor:"#005896"})})]}),t.jsxs("div",{className:"production-unit-switch-container",children:[t.jsx(a,{label:"PA",onChange:function(t){if(""===t)return void 0===v&&F(void 0),void(n&&n(0));var e=parseFloat(t);isNaN(e)||(void 0===v&&F(e),n&&n(e))},value:void 0!==q?q.toString():void 0,disabled:!I||w,min:{value:L.value,label:L.label},max:{value:M.value,label:M.label}})," "]})]}),t.jsx(o,{checked:I,onChange:function(t){void 0===m&&k(t),s&&s(t)},disabled:w})]})})},exports.ProductionUnitContainer=l,exports.Switch=o,exports.Timer=s,exports.ValueWithUnit=r;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=function(n){var i=n.label,o=n.value,a=void 0===o?"":o,l=n.onChange,c=n.disabled,s=void 0!==c&&c,r=n.className,d=void 0===r?"":r,u=n.required,h=void 0!==u&&u,C=n.min,v=void 0===C?{value:0,label:"Pmin"}:C,p=n.max,m=void 0===p?{value:100,label:"Pmax"}:p,f=t.useState(a),x=f[0],g=f[1],L=t.useState(!1),b=L[0],j=L[1],w=t.useState(!1),N=w[0],k=w[1],R=t.useRef(null);t.useEffect(function(){g(a)},[a]);var M=["input-container",b?"input-container--focused":"",b||x.length>0?"input-container--floating":"",s?"input-container--disabled":"",N?"input-container--error":"",d].filter(Boolean).join(" ");return e.jsx("div",{className:M,children:e.jsxs("div",{className:"input-constraints",children:[e.jsxs("div",{className:"input-min",children:[v.label,e.jsx("br",{}),v.value]}),e.jsxs("div",{className:"input-field",children:[e.jsx("input",{ref:R,type:"number",value:x,onChange:function(e){var t=e.target.value;if(g(t),""!==t){var n=parseFloat(t);if(isNaN(n))k(!1),null==l||l(t);else{var i=n<v.value||n>m.value;if(k(i),i){var o=Math.max(v.value,Math.min(m.value,n));null==l||l(o.toString())}else null==l||l(t)}}else k(!1),null==l||l(t)},onFocus:function(){j(!0)},onBlur:function(){if(j(!1),""!==x){var e=parseFloat(x);if(!isNaN(e)){var t=Math.max(v.value,Math.min(m.value,e));if(t!==e){var n=t.toString();g(n),null==l||l(n)}k(!1)}}},disabled:s,required:h,className:"input-element","aria-label":i,min:v.value,max:m.value,step:1}),e.jsxs("label",{className:"input-label",children:[i,h&&e.jsx("span",{className:"input-required",children:"*"})]})]}),e.jsxs("div",{className:"input-max",children:[m.label,e.jsx("br",{})," ",m.value]})]})})},i=function(t){var n=t.isOff;return e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z",fill:n?"#999FA1":"#009CDF"})})},o=function(t){var n=t.isOff;return e.jsx("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("circle",{cx:"16",cy:"16",r:"16",fill:n?"white":"#009cdf"})})},a=function(n){var a=n.checked,l=void 0!==a&&a,c=n.onChange,s=n.disabled,r=void 0!==s&&s,d=n.showIcon,u=void 0===d||d,h=n.label,C=t.useState(l),v=C[0],p=C[1],m=void 0!==l?l:v,f=["switch",m?"switch--checked":"",r?"switch--disabled":""].filter(Boolean).join(" "),x=["switch-wrapper",m?"switch-wrapper--checked":""].filter(Boolean).join(" ");return e.jsx("div",{className:"switch-container",children:e.jsxs("div",{className:x,children:[u?e.jsx("div",{className:"switch-icon",children:e.jsx(i,{isOff:!m})}):h?e.jsx("div",{className:"switch-label",children:h}):null,e.jsx("button",{type:"button",role:"switch","aria-checked":m,className:f,onClick:function(){if(!r){var e=!m;void 0===l&&p(e),null==c||c(e)}},disabled:r,children:e.jsx("span",{className:"switch-track",children:e.jsx("span",{className:"switch-thumb",children:e.jsx(o,{isOff:!m})})})})]})})},l=function(t){var n=t.children,i=t.bgColor,o=t.width,a=["chip-container","full-width"===(void 0===o?"fit-content":o)?"chip-container--full-width":"chip-container--fit-content"].join(" ");return e.jsx("div",{className:a,style:{backgroundColor:i},children:e.jsx("div",{className:"chip-content",children:e.jsx("div",{className:"chip-label",children:n})})})},c=function(t){var n=t.bgColor,i=void 0===n?"#fff":n,o=t.children,a=t.height;return e.jsx("div",{className:"production-unit-container-box",style:{backgroundColor:i,height:a},children:o})},s=function(t){var n=t.cost,i=t.textColor,o=t.type,a=void 0===o?"europermegawatt":o;return e.jsxs("div",{className:"cost-text-container",children:[e.jsx("div",{className:"cost-number",style:{color:i},children:n}),e.jsx("div",{className:"cost-unit",style:{color:i},children:"euro"===a||"europermegawatt"===a?"€":"MWh"}),"europermegawatt"===a&&e.jsx("div",{className:"cost-unit-per",style:{color:i},children:"/MWh"})]})},r=function(){return r=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var d=function(e){var t=Math.floor(e/60),n=e%60;return"".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"))},u=t.forwardRef(function(n,i){var o,a,l,c=n.phases,s=void 0===c?[]:c,u=n.externalState,h=n.onStateChange,C=n.onComplete,v=n.onPhaseComplete,p=n.onTick,m=n.onStart,f=n.onPause,x=n.onFreeze,g=n.onAnonymiseToggle,L=n.onStop,b=n.onReset,j=n.onPrevious,w=n.onNext,N=n.onPhaseClick,k=n.className,R=void 0===k?"":k,M=n.gameActions,P=void 0===M?{}:M,y=n.user,Z=void 0===y?"admin":y,S=u.currentPhase,V=u.currentTime,z=u.isRunning,H=u.isPaused,F=u.isFrozen,B=t.useState(null),I=B[0],T=B[1],E=t.useState(!1),A=E[0],O=E[1],W=t.useRef(null),q=t.useCallback(function(){0===s.length||S>=s.length||(h(r(r({},u),{isRunning:!0,isPaused:!1})),null==m||m())},[s.length,S,u,h,m]),U=t.useCallback(function(){F||(h(r(r({},u),{isRunning:!1,isPaused:!0})),null==f||f())},[F,u,h,f]),D=t.useCallback(function(e){var t=void 0===e?!F:e,n=r(r({},u),{isFrozen:t,isRunning:!t&&!u.isPaused,isPaused:u.isPaused});h(n),null==x||x(t)},[F,u,h,x]),Q=t.useCallback(function(e){O(function(t){var n=void 0===e?!t:e;return null==g||g(n),n})},[g]),K=t.useCallback(function(){h({currentPhase:0,currentTime:0,isRunning:!1,isPaused:!1,isFrozen:!1}),null==L||L()},[h,L]),G=t.useCallback(function(){h({currentPhase:0,currentTime:0,isRunning:!1,isPaused:!1,isFrozen:!1}),null==b||b()},[h,b]),J=t.useCallback(function(){},[]);t.useImperativeHandle(i,function(){return{start:q,pause:U,freeze:D,toggleAnonymise:Q,stop:K,reset:G,setPhases:J,getCurrentTime:function(){return V},getCurrentPhase:function(){return S},isRunning:function(){return z},isPaused:function(){return H}}}),t.useEffect(function(){return z&&!F&&S<s.length?W.current=setInterval(function(){var e,t,n=V+1;h(r(r({},u),{currentTime:n})),null==p||p(n,S),n>((null===(e=s[S])||void 0===e?void 0:e.duration)||0)&&(null==v||v(S,(null===(t=s[S])||void 0===t?void 0:t.duration)||0),S+1<s.length?h(r(r({},u),{currentPhase:S+1,currentTime:0})):(h(r(r({},u),{isRunning:!1,isPaused:!1})),null==C||C()))},1e3):W.current&&(clearInterval(W.current),W.current=null),function(){W.current&&clearInterval(W.current)}},[z,F,S,V,s,u,h,p,v,C]);var X=(null===(o=s[S])||void 0===o?void 0:o.duration)||0,Y=X>0?V/X*100:0,$=s.length>0&&!z&&S===Math.max(0,s.length-1)&&V>=((null===(a=s[Math.max(0,S)])||void 0===a?void 0:a.duration)||0),_=["timer-header-control",R,z?"timer--running":"",H?"timer--paused":"",F?"timer--frozen":"",$?"timer--completed":""].filter(Boolean).join(" "),ee=X>0?X-V:0;return e.jsxs("div",{className:_,children:[e.jsx("div",{className:"timer-section",children:e.jsx("div",{className:"timer-content",children:e.jsxs("div",{className:"timer-display-area",children:["admin"===Z&&e.jsxs("div",{className:"timer-header",children:[e.jsx("span",{className:"timer-title",children:((null===(l=s[S])||void 0===l?void 0:l.title)||"TIMER").toUpperCase()}),e.jsx("span",{className:"timer-time",children:d(Math.max(0,ee))})]}),"admin"===Z&&e.jsx("div",{className:"timer-progress-bar",children:e.jsx("div",{className:"timer-progress-fill",style:{width:"".concat(Math.min(100,Y),"%")}})}),function(){for(var t,n,i,o=[],a=s.length,l=function(a){var l=a===S,c=a<S,u=P[a],h=l||c,C="step-indicator";C+=u||l||c?l?" step-indicator--active"+("actor"===Z?" step-indicator--actor":" step-indicator--admin"):c?" step-indicator--completed":" step-indicator--upcoming":" step-indicator--placeholder",h&&(C+=" step-indicator--clickable"),I===a&&(C+=" step-indicator--selected");var v=function(){h&&(T(a),null==N||N(a))},p={key:a,className:C,"data-step":a+1,title:(null===(t=s[a])||void 0===t?void 0:t.title)?"Step ".concat(a+1,": ").concat(null===(n=s[a])||void 0===n?void 0:n.title):u?"Step ".concat(a+1,": ").concat(u):"Step ".concat(a+1),onClick:h?v:void 0,role:h?"button":void 0,tabIndex:h?0:void 0,onKeyDown:h?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),v())}:void 0};o.push(e.jsx("div",r({},p,{children:u||l||c?a+1:""}))),"actor"===Z&&l&&o.push(e.jsxs("div",{className:"timer-header--block",children:[e.jsxs("div",{className:"timer-header timer-header--inline",children:[e.jsx("span",{className:"timer-title",children:((null===(i=s[S])||void 0===i?void 0:i.title)||"TIMER").toUpperCase()}),e.jsx("span",{className:"timer-time",children:d(Math.max(0,ee))})]}),e.jsx("div",{className:"timer-progress-bar timer-progress-bar--inline",children:e.jsx("div",{className:"timer-progress-fill",style:{width:"".concat(Math.min(100,Y),"%")}})})]},"header-inline-".concat(a)))},c=0;c<a;c++)l(c);return e.jsxs("div",{className:"step-indicators",children:[o,e.jsx("div",{className:"step-expand ".concat($?"step-expand--end":""),title:$?"All steps completed":"In progress",children:"actor"===Z?e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"24",width:"24",height:"24",rx:"12",transform:"rotate(90 24 0)",fill:"#292E33"}),e.jsx("path",{d:"M20 12C20 12.276 19.776 12.5 19.5 12.5L17.4766 12.5C17.238 15.1345 15.1345 17.238 12.5 17.4766L12.5 19.5C12.5 19.776 12.276 20 12 20C11.724 20 11.5 19.776 11.5 19.5L11.5 17.4766C8.86554 17.238 6.763 15.1345 6.52441 12.5L4.5 12.5C4.224 12.5 4 12.276 4 12C4 11.724 4.224 11.5 4.5 11.5L6.52441 11.5C6.763 8.86555 8.86554 6.76198 11.5 6.52344L11.5 4.5C11.5 4.224 11.724 4 12 4C12.276 4 12.5 4.224 12.5 4.5L12.5 6.52344C15.1345 6.76199 17.238 8.86551 17.4766 11.5L19.5 11.5C19.776 11.5 20 11.724 20 12ZM16.5 12C16.5 9.51867 14.4813 7.5 12 7.5C9.51867 7.5 7.5 9.51867 7.5 12C7.5 14.4813 9.51867 16.5 12 16.5C14.4813 16.5 16.5 14.4813 16.5 12ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z",fill:"white"})]}):e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M16 8C16 8.276 15.776 8.5 15.5 8.5L13.4766 8.5C13.238 11.1345 11.1345 13.238 8.5 13.4766L8.5 15.5C8.5 15.776 8.276 16 8 16C7.724 16 7.5 15.776 7.5 15.5L7.5 13.4766C4.86554 13.238 2.763 11.1345 2.52441 8.5L0.5 8.5C0.224 8.5 -3.61755e-07 8.276 -3.49691e-07 8C-3.29564e-07 7.724 0.224 7.5 0.5 7.5L2.52441 7.5C2.763 4.86555 4.86554 2.76198 7.5 2.52344L7.5 0.5C7.5 0.224 7.724 -3.61755e-07 8 -3.4969e-07C8.276 -3.29563e-07 8.5 0.224 8.5 0.5L8.5 2.52344C11.1345 2.76199 13.238 4.86551 13.4766 7.5L15.5 7.5C15.776 7.5 16 7.724 16 8ZM12.5 8C12.5 5.51867 10.4813 3.5 8 3.5C5.51867 3.5 3.5 5.51867 3.5 8C3.5 10.4813 5.51867 12.5 8 12.5C10.4813 12.5 12.5 10.4813 12.5 8ZM10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z",fill:"currentColor"})})})]})}()]})})}),"admin"===Z&&e.jsxs("div",{className:"timer-controls-section",children:[e.jsx("button",{className:"control-button control-button--previous",onClick:function(){return null==j?void 0:j()},disabled:0===S,title:"Previous",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9813 2.39178C12.1589 2.38845 12.3342 2.43251 12.4892 2.51941C12.6441 2.60631 12.7731 2.73291 12.8629 2.88621C12.9527 3.0395 13 3.21395 13 3.3916L12.5 3.3916H13V12.6085C13 12.7862 12.9527 12.9606 12.8629 13.1139C12.7731 13.2672 12.6441 13.3938 12.4892 13.4807C12.3342 13.5676 12.1589 13.6117 11.9813 13.6084C11.8037 13.605 11.6301 13.5545 11.4785 13.4618L3.93741 8.85335C3.79124 8.76403 3.67046 8.63865 3.58667 8.48923C3.50287 8.33982 3.45886 8.17138 3.45886 8.00007C3.45886 7.82877 3.50287 7.66033 3.58667 7.51092C3.67046 7.3615 3.79124 7.23612 3.93741 7.14679L11.4785 2.53832C11.6301 2.44568 11.8037 2.3951 11.9813 2.39178ZM12 3.3916L4.45886 8.00007L4.19814 7.57343L4.45886 8.00007L12 12.6085V3.3916Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 2C2.27614 2 2.5 2.22386 2.5 2.5V13.5C2.5 13.7761 2.27614 14 2 14C1.72386 14 1.5 13.7761 1.5 13.5V2.5C1.5 2.22386 1.72386 2 2 2Z",fill:"black"})]})}),e.jsx("button",{className:"control-button control-button--next",onClick:function(){return null==w?void 0:w()},disabled:!($&&S<s.length-1),title:"Next",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.51084 2.51941C3.66579 2.43251 3.84109 2.38845 4.01871 2.39178C4.19633 2.3951 4.36986 2.44568 4.52145 2.53832L12.0626 7.14679C12.2088 7.23612 12.3295 7.3615 12.4133 7.51092C12.4971 7.66033 12.5411 7.82877 12.5411 8.00007C12.5411 8.17138 12.4971 8.33982 12.4133 8.48923C12.3295 8.63865 12.2088 8.76403 12.0626 8.85335L4.52145 13.4618C4.36986 13.5545 4.19633 13.605 4.01871 13.6084C3.84109 13.6117 3.66579 13.5676 3.51084 13.4807C3.3559 13.3938 3.2269 13.2672 3.13711 13.1139C3.04733 12.9606 3 12.7862 3 12.6085V3.3916C3 3.21395 3.04733 3.0395 3.13711 2.88621C3.22689 2.73292 3.35589 2.60631 3.51084 2.51941ZM11.5411 8.00007L4 3.3916V12.6085L11.5411 8.00007Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14 2C14.2761 2 14.5 2.22386 14.5 2.5V13.5C14.5 13.7761 14.2761 14 14 14C13.7239 14 13.5 13.7761 13.5 13.5V2.5C13.5 2.22386 13.7239 2 14 2Z",fill:"black"})]})}),e.jsx("button",{className:"control-button control-button--play-pause ".concat(z?"control-button--pause":"control-button--play"," ").concat(F?"control-button--disabled":""),onClick:z?U:q,title:F?"Frozen":z?"Pause":H?"Resume":"Start",disabled:F,children:z?e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4.5C7.85786 4.5 4.5 7.85786 4.5 12C4.5 15.1788 6.47789 17.8975 9.27283 18.989C9.65866 19.1397 9.8493 19.5746 9.69862 19.9604C9.54794 20.3463 9.113 20.5369 8.72717 20.3862C5.37607 19.0775 3 15.8172 3 12C3 7.02944 7.02944 3 12 3C16.2192 3 19.7585 5.90255 20.7337 9.81878C20.9078 10.5179 21 11.2487 21 12C21 12.4142 20.6642 12.75 20.25 12.75C19.8358 12.75 19.5 12.4142 19.5 12C19.5 11.3719 19.4229 10.7628 19.2781 10.1812C18.4655 6.91754 15.5141 4.5 12 4.5Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.75 15.75V22.25H20.25V15.75H18.75ZM17.25 15.3636C17.25 14.5918 17.9689 14.25 18.4615 14.25H20.5385C21.0311 14.25 21.75 14.5918 21.75 15.3636V22.6364C21.75 23.4082 21.0311 23.75 20.5385 23.75H18.4615C17.9689 23.75 17.25 23.4082 17.25 22.6364V15.3636Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.75 15.75V22.25H14.25V15.75H12.75ZM11.25 15.3636C11.25 14.5918 11.9689 14.25 12.4615 14.25H14.5385C15.0311 14.25 15.75 14.5918 15.75 15.3636V22.6364C15.75 23.4082 15.0311 23.75 14.5385 23.75H12.4615C11.9689 23.75 11.25 23.4082 11.25 22.6364V15.3636Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.54996 7.40004C8.21858 7.64857 8.15143 8.11867 8.39996 8.45004L11.4 12.45C11.6485 12.7814 12.1186 12.8486 12.45 12.6C12.7813 12.3515 12.8485 11.8814 12.6 11.55L9.59996 7.55004C9.35143 7.21867 8.88133 7.15152 8.54996 7.40004Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 0.75C9 0.335786 9.33579 0 9.75 0H14.25C14.6642 0 15 0.335786 15 0.75C15 1.16421 14.6642 1.5 14.25 1.5H9.75C9.33579 1.5 9 1.16421 9 0.75Z",fill:"black"})]}):e.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M20.25 12C20.25 11.3103 20.1654 10.6404 20.0059 10C19.112 6.41005 15.8666 3.75 12 3.75C7.44365 3.75 3.75 7.44365 3.75 12C3.75 15.498 5.92698 18.4875 9 19.6876",stroke:"black",strokeWidth:"1.5",strokeMiterlimit:"10",strokeLinecap:"round"}),e.jsx("path",{d:"M12 12L9 8",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9.75 0.75H14.25",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M20.7759 18.1242L13.7125 14.0646C13.6415 14.0238 13.5603 14.0015 13.4771 14.0001C13.3939 13.9986 13.3118 14.018 13.2392 14.0563C13.1667 14.0946 13.1063 14.1503 13.0642 14.2178C13.0222 14.2854 13 14.3622 13 14.4404V22.5596C13 22.6378 13.0222 22.7146 13.0642 22.7822C13.1063 22.8497 13.1667 22.9054 13.2392 22.9437C13.3118 22.982 13.3939 23.0014 13.4771 22.9999C13.5603 22.9985 13.6415 22.9762 13.7125 22.9354L20.7759 18.8758C20.8443 18.8365 20.9009 18.7813 20.9401 18.7154C20.9794 18.6496 21 18.5755 21 18.5C21 18.4245 20.9794 18.3504 20.9401 18.2846C20.9009 18.2187 20.8443 18.1635 20.7759 18.1242V18.1242Z",stroke:"black",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),e.jsx("button",{className:"control-button control-button--freeze ".concat(F?"control-button--freeze-active":""),onClick:function(){return D()},title:F?"Unfreeze":"Freeze",disabled:!z&&!H&&!F,children:e.jsx("svg",{width:"14",height:"12",viewBox:"0 0 14 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M8.14697 0.146484C8.34224 -0.0486747 8.65878 -0.0487434 8.854 0.146484C9.04889 0.341739 9.04905 0.658358 8.854 0.853516L7.50049 2.20703V5.13281L10.0337 3.66992L10.5298 1.82129C10.6012 1.5547 10.8755 1.3966 11.1421 1.46777C11.4088 1.53922 11.5679 1.8134 11.4966 2.08008L11.0767 3.64648L12.6421 4.06543C12.9088 4.1369 13.0681 4.41198 12.9966 4.67871C12.925 4.94527 12.6499 5.10368 12.3833 5.03223L10.5347 4.53613L7.99951 5.99902L10.5347 7.46191L12.3833 6.96777C12.65 6.8963 12.9251 7.05456 12.9966 7.32129C13.068 7.58799 12.9088 7.86213 12.6421 7.93359L11.0767 8.35352L11.4966 9.91992C11.5677 10.1865 11.4086 10.4608 11.1421 10.5322C10.8756 10.6033 10.6013 10.4451 10.5298 10.1787L10.0337 8.32812L7.50049 6.86523V9.79297L8.854 11.1465C9.04889 11.3417 9.04905 11.6584 8.854 11.8535C8.65885 12.0487 8.34226 12.0484 8.14697 11.8535L7.00049 10.707L5.854 11.8535C5.65885 12.0487 5.34226 12.0484 5.14697 11.8535C4.95171 11.6583 4.95171 11.3417 5.14697 11.1465L6.50049 9.79297V6.86523L3.96533 8.32812L3.47021 10.1787C3.39865 10.4451 3.12439 10.6034 2.85791 10.5322C2.59128 10.4608 2.43314 10.1866 2.50439 9.91992L2.92334 8.35352L1.35791 7.93359C1.09118 7.86212 0.932919 7.58802 1.00439 7.32129C1.07593 7.05464 1.35001 6.89631 1.6167 6.96777L3.46436 7.46191L5.99951 5.99902L3.46436 4.53613L1.6167 5.03223C1.35014 5.10366 1.07608 4.94513 1.00439 4.67871C0.932919 4.41198 1.09118 4.1369 1.35791 4.06543L2.92334 3.64648L2.50439 2.08008C2.43293 1.81334 2.59118 1.53924 2.85791 1.46777C3.12453 1.39654 3.39878 1.55467 3.47021 1.82129L3.96533 3.66992L6.50049 5.13281V2.20703L5.14697 0.853516C4.95171 0.658253 4.95171 0.341747 5.14697 0.146484C5.34224 -0.0486746 5.65878 -0.0487434 5.854 0.146484L7.00049 1.29297L8.14697 0.146484Z",fill:"black"})})}),e.jsx("button",{className:"control-button control-button--anonymise ".concat(A?"control-button--anonymise-active":""),onClick:function(){return Q()},title:A?"Show Names":"Hide Names",children:e.jsxs("svg",{width:"18",height:"12",viewBox:"0 0 18 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.19571 0.9375H13.9316L13.9576 0.939919L13.9055 1.5C13.9576 0.939919 13.958 0.939955 13.9584 0.939992L13.9593 0.940074L13.9612 0.940263L13.966 0.940753L13.9794 0.942218C13.9899 0.943426 14.0036 0.945121 14.0203 0.947429C14.0536 0.952044 14.0989 0.959129 14.1545 0.969722C14.2655 0.990879 14.4186 1.02621 14.5998 1.08426C14.9611 1.20007 15.4415 1.40866 15.9224 1.78153C16.9079 2.54562 17.8125 3.93493 17.8125 6.375C17.8125 8.84977 16.7446 10.2418 15.6228 10.9916C15.0757 11.3573 14.5319 11.5602 14.1264 11.6723C13.9228 11.7285 13.7514 11.7626 13.6282 11.7828C13.5666 11.7929 13.5167 11.7996 13.4807 11.8039C13.4626 11.8061 13.448 11.8076 13.437 11.8087L13.4234 11.81L13.4186 11.8104L13.4168 11.8106L13.416 11.8106C13.4157 11.8107 13.4154 11.8107 13.3704 11.25L13.416 11.8106L13.3929 11.8125H13.3704C12.4693 11.8125 11.7717 11.6348 11.2171 11.3425C10.6627 11.0503 10.2868 10.6623 10.0046 10.2977C9.86569 10.1182 9.74696 9.94078 9.64616 9.78996C9.5407 9.6322 9.46023 9.51197 9.38106 9.41262C9.22707 9.21935 9.16773 9.21939 9.13503 9.21941H9.13398C9.09752 9.21941 9.03241 9.22191 8.87346 9.41718C8.79345 9.51548 8.71127 9.63581 8.60695 9.79107C8.60069 9.80039 8.59437 9.80981 8.58797 9.81934C8.49236 9.96175 8.38151 10.1269 8.25589 10.2929C7.98421 10.6519 7.62551 11.0405 7.10214 11.335C6.57573 11.6313 5.91831 11.8125 5.07599 11.8125H5.0488L5.02173 11.8099L5.07599 11.25C5.02173 11.8099 5.02205 11.8099 5.02173 11.8099L5.0204 11.8097L5.01868 11.8096L5.01405 11.8091L5.00016 11.8076C4.98888 11.8063 4.97357 11.8045 4.95451 11.8019C4.91641 11.7969 4.8632 11.7892 4.79703 11.7779C4.66485 11.7553 4.47999 11.718 4.25972 11.6585C3.82115 11.5401 3.23123 11.3305 2.63538 10.9643C1.42058 10.2176 0.212463 8.83259 0.187947 6.38062C0.163902 3.97575 1.11355 2.587 2.13375 1.81616C2.63171 1.43991 3.12954 1.22329 3.50294 1.10027C3.69026 1.03855 3.84839 0.999684 3.96267 0.975868C4.01989 0.963945 4.06636 0.955744 4.10027 0.950316C4.11724 0.947601 4.13108 0.945576 4.14159 0.944124L4.15484 0.942358L4.15953 0.941769L4.16139 0.941543L4.1622 0.941446C4.16257 0.941403 4.16292 0.941361 4.22872 1.5L4.1622 0.941446L4.19571 0.9375ZM4.26997 2.0625C4.25203 2.06549 4.22575 2.07021 4.19218 2.07721C4.11398 2.09351 3.99723 2.1219 3.85498 2.16877C3.56924 2.26291 3.18912 2.42877 2.81194 2.71376C2.08184 3.2654 1.29234 4.31414 1.31289 6.36938C1.33297 8.37752 2.28763 9.43001 3.22447 10.0058C3.70444 10.3008 4.18756 10.4737 4.55306 10.5724C4.73484 10.6215 4.88477 10.6515 4.98688 10.669C5.03785 10.6778 5.07667 10.6833 5.1013 10.6866C5.10355 10.6869 5.10569 10.6871 5.10771 10.6874C5.76441 10.683 6.21815 10.5416 6.55042 10.3546C6.89104 10.1629 7.13992 9.90327 7.35877 9.61404C7.46458 9.47422 7.55912 9.33345 7.65787 9.18641L7.67313 9.1637C7.77297 9.01508 7.8831 8.85179 8.00097 8.70698C8.23778 8.41606 8.59073 8.09441 9.13398 8.09441C9.6812 8.09441 10.0292 8.42071 10.2609 8.71155C10.3706 8.8492 10.4746 9.00486 10.569 9.14611L10.5815 9.1648C10.6838 9.31787 10.7824 9.46461 10.8943 9.6092C11.1139 9.89292 11.3735 10.1532 11.7416 10.3472C12.1049 10.5387 12.6087 10.6838 13.3424 10.6874C13.3439 10.6873 13.3456 10.6871 13.3473 10.6869C13.368 10.6844 13.4015 10.6799 13.4459 10.6727C13.5349 10.658 13.6667 10.6321 13.8268 10.5879C14.1487 10.4989 14.5748 10.3389 14.9976 10.0563C15.8156 9.50956 16.6875 8.46406 16.6875 6.375C16.6875 4.25124 15.9198 3.20305 15.2331 2.6706C14.8779 2.3952 14.5221 2.24075 14.2564 2.1556C14.124 2.11316 14.0158 2.08853 13.944 2.07485C13.9117 2.0687 13.887 2.0648 13.8709 2.0625H4.26997ZM13.8498 2.05973C13.8494 2.05969 13.8497 2.05972 13.8508 2.05985L13.8498 2.05973Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.625 5.0625C4.77651 5.0625 4.3125 5.59288 4.3125 6C4.3125 6.40712 4.77651 6.9375 5.625 6.9375C6.47349 6.9375 6.9375 6.40712 6.9375 6C6.9375 5.59288 6.47349 5.0625 5.625 5.0625ZM3.1875 6C3.1875 4.75027 4.40242 3.9375 5.625 3.9375C6.84758 3.9375 8.0625 4.75027 8.0625 6C8.0625 7.24973 6.84758 8.0625 5.625 8.0625C4.40242 8.0625 3.1875 7.24973 3.1875 6Z",fill:"black"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.375 5.0625C11.5265 5.0625 11.0625 5.59288 11.0625 6C11.0625 6.40712 11.5265 6.9375 12.375 6.9375C13.2235 6.9375 13.6875 6.40712 13.6875 6C13.6875 5.59288 13.2235 5.0625 12.375 5.0625ZM9.9375 6C9.9375 4.75027 11.1524 3.9375 12.375 3.9375C13.5976 3.9375 14.8125 4.75027 14.8125 6C14.8125 7.24973 13.5976 8.0625 12.375 8.0625C11.1524 8.0625 9.9375 7.24973 9.9375 6Z",fill:"black"})]})})]})]})});u.displayName="Timer",exports.Avatar=function(t){var n=t.children;return e.jsx("div",{className:"avatar-container avatar-container--clickable",children:e.jsx("div",{className:"avatar-content",children:n})})},exports.Chip=l,exports.Histogram=function(n){var i,o,a,l,c=n.max,s=n.relative,r=n.barHeight,d=void 0===r?103:r,u=n.barWidth,h=void 0===u?32:u,C=n.orientation,v=void 0===C?"vertical":C,p=n.cornerRadius,m=n.children,f=t.useState(0),x=f[0],g=f[1],L=t.useState(0),b=L[0],j=L[1],w=Math.min(s.value/c.value*100,100)/100*d,N=Math.min(s.value/c.value*100,100)/100*("horizontal"===v?d:h);t.useEffect(function(){g(0),j(0);var e=Date.now(),t=function(){var n=Date.now()-e,i=Math.min(n/1e3,1),o=1-Math.pow(1-i,4);g(w*o),j(N*o),i<1&&requestAnimationFrame(t)};requestAnimationFrame(t)},[w,N]);var k="horizontal"===v?d:h,R="horizontal"===v?h:d,M="horizontal"===v?d:h,P="horizontal"===v?h:d,y=function(e,t,n,i,o){var a=o.topLeft,l=o.topRight,c=o.bottomLeft,s=o.bottomRight;return"\n M ".concat(e+a," ").concat(t,"\n L ").concat(e+n-l," ").concat(t,"\n Q ").concat(e+n," ").concat(t," ").concat(e+n," ").concat(t+l,"\n L ").concat(e+n," ").concat(t+i-s,"\n Q ").concat(e+n," ").concat(t+i," ").concat(e+n-s," ").concat(t+i,"\n L ").concat(e+c," ").concat(t+i,"\n Q ").concat(e," ").concat(t+i," ").concat(e," ").concat(t+i-c,"\n L ").concat(e," ").concat(t+a,"\n Q ").concat(e," ").concat(t," ").concat(e+a," ").concat(t,"\n Z\n ").trim().replace(/\s+/g," ")},Z={topLeft:2,topRight:2,bottomLeft:2,bottomRight:2},S=p?{topLeft:null!==(i=p.topLeft)&&void 0!==i?i:Z.topLeft,topRight:null!==(o=p.topRight)&&void 0!==o?o:Z.topRight,bottomLeft:null!==(a=p.bottomLeft)&&void 0!==a?a:Z.bottomLeft,bottomRight:null!==(l=p.bottomRight)&&void 0!==l?l:Z.bottomRight}:Z;return e.jsx("div",{className:"histogram-container ".concat("horizontal"===v?"histogram-container--horizontal":""),children:e.jsxs("div",{className:"histogram-content ".concat("horizontal"===v?"histogram-content--horizontal":""),children:[e.jsx("div",{className:"histogram-bar",style:{height:"".concat(R,"px"),width:"".concat(k,"px")},children:e.jsxs("svg",{width:M,height:P,viewBox:"0 0 ".concat(M," ").concat(P),className:"histogram-svg",children:[e.jsx("defs",{children:e.jsx("clipPath",{id:"histogram-clip-".concat(M,"-").concat(P,"-").concat(S.topLeft),children:e.jsx("path",{d:y(0,0,M,P,S)})})}),e.jsx("path",{d:y(0,0,M,P,S),fill:c.color,fillOpacity:c.opacity||1}),"vertical"===v?e.jsx("path",{d:y(0,P-x,M,x,{topLeft:x>=P?S.topLeft:0,topRight:x>=P?S.topRight:0,bottomLeft:S.bottomLeft,bottomRight:S.bottomRight}),fill:s.color,clipPath:"url(#histogram-clip-".concat(M,"-").concat(P,"-").concat(S.topLeft,")")}):e.jsx("path",{d:y(0,0,b,P,{topLeft:S.topLeft,topRight:b>=M?S.topRight:0,bottomLeft:S.bottomLeft,bottomRight:b>=M?S.bottomRight:0}),fill:s.color,clipPath:"url(#histogram-clip-".concat(M,"-").concat(P,"-").concat(S.topLeft,")")})]})}),m&&e.jsx("div",{className:"histogram-text-container ".concat("horizontal"===v?"histogram-text-container--horizontal":""),children:m})]})})},exports.InputNumber=n,exports.ProductionUnit=function(i){var o=i.onChangeInput,r=i.onChangeSwitch,d=i.defaultValue,u=i.defaultChecked,h=void 0!==u&&u,C=i.value,v=i.checked,p=i.unitName,m=void 0===p?"Production Unit":p,f=i.energyCost,x=void 0===f?0:f,g=i.checkedImage,L=i.uncheckedImage,b=i.readonly,j=void 0!==b&&b,w=i.min,N=void 0===w?{value:10,label:"Pmin"}:w,k=i.max,R=void 0===k?{value:100,label:"Pmax"}:k,M=t.useState(h),P=M[0],y=M[1],Z=t.useState(d),S=Z[0],V=Z[1],z=void 0!==v?v:P,H=void 0!==C?C:S;return e.jsx(c,{children:e.jsxs("div",{className:"production-unit-container",children:[e.jsxs("div",{className:"production-unit-content",children:[e.jsx("div",{className:"image-preview-container",children:z?g:L}),e.jsxs("div",{className:"production-unit-chip",children:[e.jsx("div",{className:"production-unit-chip-name",children:m}),e.jsx(l,{width:"fit-content",bgColor:"#E1F5FD",children:e.jsx(s,{cost:x,textColor:"#005896"})})]}),e.jsxs("div",{className:"production-unit-switch-container",children:[e.jsx(n,{label:"PA",onChange:function(e){if(""===e)return void 0===C&&V(void 0),void(o&&o(0));var t=parseFloat(e);isNaN(t)||(void 0===C&&V(t),o&&o(t))},value:void 0!==H?H.toString():void 0,disabled:!z||j,min:{value:N.value,label:N.label},max:{value:R.value,label:R.label}})," "]})]}),e.jsx(a,{checked:z,onChange:function(e){void 0===v&&y(e),r&&r(e)},disabled:j})]})})},exports.ProductionUnitContainer=c,exports.Switch=a,exports.Timer=u,exports.ValueWithUnit=s;
2
2
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/components/InputNumber.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/ProductionUnitContainer.tsx","../src/components/ValueWithUnit.tsx","../src/components/Timer.tsx","../src/components/Avatar.tsx","../src/components/Histogram.tsx","../src/components/ProductionUnit.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport './InputNumber.css';\n\ninterface InputNumberProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const InputNumber: React.FC<InputNumberProps> = ({\n label,\n value = '',\n onChange,\n disabled = false,\n className = '',\n required = false,\n min = { value: 0, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const [isOutOfRange, setIsOutOfRange] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n\n // Always update internal value for display\n setInternalValue(newValue);\n\n // Check if value is out of range for visual feedback\n if (newValue !== '') {\n const numValue = parseFloat(newValue);\n if (!isNaN(numValue)) {\n const outOfRange = numValue < min.value || numValue > max.value;\n setIsOutOfRange(outOfRange);\n\n if (outOfRange) {\n // Clamp the value and notify parent with clamped value\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n onChange?.(clampedValue.toString());\n } else {\n // Value is in range, notify parent with actual value\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n };\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n\n // Clamp value on blur\n if (internalValue !== '') {\n const numValue = parseFloat(internalValue);\n if (!isNaN(numValue)) {\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n if (clampedValue !== numValue) {\n const clampedString = clampedValue.toString();\n setInternalValue(clampedString);\n onChange?.(clampedString);\n }\n setIsOutOfRange(false); // Reset out-of-range state after clamping\n }\n }\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n 'input-container',\n isFocused ? 'input-container--focused' : '',\n isLabelFloating ? 'input-container--floating' : '',\n disabled ? 'input-container--disabled' : '',\n isOutOfRange ? 'input-container--error' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type=\"number\"\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n min={min.value}\n max={max.value}\n step={1}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport './Switch.css';\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? '#999FA1' : '#009CDF'}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? 'white' : '#009cdf'} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n label?: string;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n label,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n // Use controlled value if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !isChecked;\n // Only update internal state if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n 'switch',\n isChecked ? 'switch--checked' : '',\n disabled ? 'switch--disabled' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const wrapperClasses = ['switch-wrapper', isChecked ? 'switch-wrapper--checked' : '']\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className=\"switch-container\">\n <div className={wrapperClasses}>\n {showIcon ? (\n <div className=\"switch-icon\">\n <ImgOn isOff={!isChecked} />\n </div>\n ) : label ? (\n <div className=\"switch-label\">{label}</div>\n ) : null}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!isChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport './Chip.css';\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n children: React.ReactNode;\n bgColor?: string;\n width?: 'fit-content' | 'full-width';\n}\n\nexport const Chip: React.FC<ChipProps> = ({ children, bgColor, width = 'fit-content' }) => {\n const chipClasses = [\n 'chip-container',\n width === 'full-width' ? 'chip-container--full-width' : 'chip-container--fit-content',\n ].join(' ');\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <div className=\"chip-label\">{children}</div>\n </div>\n </div>\n );\n};\n","import './ProductionUnitContainer.css';\n\ninterface ProductionUnitContainerProps {\n bgColor?: string;\n children: React.ReactNode;\n height?: string;\n}\nexport const ProductionUnitContainer = ({\n bgColor = '#fff',\n children,\n height,\n}: ProductionUnitContainerProps) => {\n return (\n <div className=\"production-unit-container-box\" style={{ backgroundColor: bgColor, height }}>\n {children}\n </div>\n );\n};\n","import React from 'react';\nimport './ValueWithUnit.css';\n\ninterface ValueWithUnitProps {\n cost?: number;\n textColor?: string;\n type?: 'euro' | 'megawatt' | 'europermegawatt';\n}\n\nexport const ValueWithUnit: React.FC<ValueWithUnitProps> = ({ cost, textColor, type = 'europermegawatt' }) => {\n return (\n <div className=\"cost-text-container\">\n <div className=\"cost-number\" style={{ color: textColor }}>\n {cost}\n </div>\n <div className=\"cost-unit\" style={{ color: textColor }}>\n {type === 'euro' || type === 'europermegawatt' ? '€' : 'MWh'}\n </div>\n {type === 'europermegawatt' && (\n <div className=\"cost-unit-per\" style={{ color: textColor }}>\n /MWh\n </div>\n )}\n </div>\n );\n};\n\n","import React, { useState, useEffect } from 'react';\nimport './Timer.css';\n\nexport interface TimerProps {\n progressEndDate?: number;\n leftTime?: number;\n progressTime?: number;\n className?: string;\n}\n\nexport const Timer: React.FC<TimerProps> = ({ \n progressEndDate, \n leftTime, \n progressTime, \n className = '' \n}) => {\n const [progress, setProgress] = useState(0);\n const [startTime] = useState(Date.now());\n\n useEffect(() => {\n let interval: NodeJS.Timeout | null = null;\n\n if (progressEndDate && !leftTime && !progressTime) {\n const updateProgress = () => {\n const now = Date.now();\n const timeLeft = Math.max(0, progressEndDate - now);\n const totalTime = progressEndDate - startTime;\n const elapsed = now - startTime;\n const progressPercent = Math.max(0, Math.min(100, (elapsed / totalTime) * 100));\n setProgress(progressPercent);\n\n if (timeLeft <= 0) {\n setProgress(100);\n if (interval) clearInterval(interval);\n }\n };\n\n updateProgress();\n interval = setInterval(updateProgress, 100);\n } else if (leftTime !== undefined && progressTime !== undefined) {\n const progressPercent = Math.max(0, Math.min(100, ((progressTime - leftTime) / progressTime) * 100));\n setProgress(progressPercent);\n }\n\n return () => {\n if (interval) clearInterval(interval);\n };\n }, [progressEndDate, leftTime, progressTime, startTime]);\n\n return (\n <div className={`timer-progress-bar ${className}`}>\n <div \n className=\"timer-progress-fill\" \n style={{ width: `${progress}%` }}\n />\n </div>\n );\n};\n\nTimer.displayName = 'Timer';\n","import React from 'react';\nimport './Avatar.css';\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n","import React, { useEffect, useState } from 'react';\nimport './Histogram.css';\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * (orientation === 'horizontal' ? barHeight : barWidth);\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n\n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n\n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n\n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `\n .trim()\n .replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius\n ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n }\n : defaultCornerRadius;\n\n return (\n <div\n className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}\n >\n <div\n className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}\n >\n <div\n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`,\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Define clipping path with rounded corners matching the background */}\n <defs>\n <clipPath id={`histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft}`}>\n <path d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)} />\n </clipPath>\n </defs>\n \n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n \n {/* Foreground bar (relative value) with clipping to stay within rounded corners */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(0, svgHeight - animatedHeight, svgWidth, animatedHeight, {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n ) : (\n <path\n d={createRoundedRectPath(0, 0, animatedWidth, svgHeight, {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n )}\n </svg>\n </div>\n {children && (\n <div\n className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}\n >\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import { useState } from 'react';\nimport { InputNumber } from './InputNumber';\nimport { Switch } from './Switch';\nimport './ProductionUnit.css';\nimport { Chip } from './Chip';\nimport { ProductionUnitContainer } from './ProductionUnitContainer';\nimport { ValueWithUnit } from '.';\n\ntype ProductionUnitLimit = {\n value: number;\n label?: string;\n};\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n value?: number;\n checked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n min?: ProductionUnitLimit;\n max?: ProductionUnitLimit;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n value,\n checked,\n unitName = 'Production Unit',\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n min = { value: 10, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}: ProductionUnitProps) => {\n // Internal state management for uncontrolled mode\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n // Use controlled props if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n const currentValue = value !== undefined ? value : internalValue;\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state only if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n // Only convert to number if the string is not empty and is a valid number\n if (val === '') {\n // Handle empty string case\n if (value === undefined) {\n setInternalValue(undefined);\n }\n if (onChangeInput) {\n onChangeInput(0); // or whatever default you prefer for empty values\n }\n return;\n }\n\n const numValue = parseFloat(val);\n if (!isNaN(numValue)) {\n // Update internal state only if uncontrolled\n if (value === undefined) {\n setInternalValue(numValue);\n }\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n }\n };\n\n return (\n <ProductionUnitContainer>\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">{isChecked ? checkedImage : uncheckedImage}</div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip width=\"fit-content\" bgColor=\"#E1F5FD\">\n <ValueWithUnit cost={energyCost} textColor=\"#005896\" />\n </Chip>\n </div>\n <div className=\"production-unit-switch-container\">\n <InputNumber\n label=\"PA\"\n onChange={handleInputChange}\n value={currentValue !== undefined ? currentValue.toString() : undefined}\n disabled={!isChecked || readonly}\n min={{ value: min.value, label: min.label }}\n max={{ value: max.value, label: max.label }}\n />{' '}\n </div>\n </div>\n\n <Switch checked={isChecked} onChange={handleSwitchChange} disabled={readonly} />\n </div>\n </ProductionUnitContainer>\n );\n};\n"],"names":["InputNumber","_a","label","_b","value","onChange","_c","disabled","_d","className","_e","required","_f","min","_g","max","_h","useState","internalValue","setInternalValue","_j","isFocused","setIsFocused","_k","isOutOfRange","setIsOutOfRange","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","jsxs","jsx","ref","type","e","newValue","target","numValue","parseFloat","isNaN","outOfRange","clampedValue","Math","toString","onFocus","onBlur","clampedString","step","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","isChecked","undefined","switchClasses","wrapperClasses","role","onClick","newChecked","Chip","bgColor","chipClasses","style","backgroundColor","ProductionUnitContainer","ValueWithUnit","cost","textColor","color","Timer","progressEndDate","leftTime","progressTime","progress","setProgress","startTime","Date","now","interval","progressPercent","updateProgress","timeLeft","totalTime","elapsed","clearInterval","setInterval","concat","displayName","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","targetWidth","animate","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","x","y","radii","topLeft","topRight","bottomLeft","bottomRight","trim","replace","defaultCornerRadius","corners","id","fillOpacity","opacity","clipPath","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","currentValue","val"],"mappings":"mEAcaA,EAA0C,SAACC,GACtD,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAK,IAAAD,EAAG,GAAEA,EACVE,EAAQJ,EAAAI,SACRC,EAAgBL,EAAAM,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAP,EAAAQ,UAAAA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAAgBT,EAAAU,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAX,EAAAY,IAAAA,OAAM,IAAAD,EAAA,CAAER,MAAO,EAAGF,MAAO,QAAQU,EACjCE,EAAmCb,EAAAc,IAAnCA,OAAG,IAAAD,EAAG,CAAEV,MAAO,IAAKF,MAAO,QAAQY,EAE7BE,EAAoCC,EAAAA,SAASb,GAA5Cc,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA4BH,EAAAA,UAAS,GAApCI,EAASD,EAAA,GAAEE,EAAYF,EAAA,GACxBG,EAAkCN,EAAAA,UAAS,GAA1CO,EAAYD,EAAA,GAAEE,EAAeF,EAAA,GAC9BG,EAAWC,SAAyB,MAE1CC,EAAAA,UAAU,WACRT,EAAiBf,EACnB,EAAG,CAACA,IAEJ,IAsDMyB,EAAmB,CACvB,kBACAR,EAAY,2BAA6B,GAJnBA,GAAaH,EAAcY,OAAS,EAKxC,4BAA8B,GAChDvB,EAAW,4BAA8B,GACzCiB,EAAe,yBAA2B,GAC1Cf,GAECsB,OAAOC,SACPC,KAAK,KAER,OACEC,MAAK,MAAA,CAAAzB,UAAWoB,EACdM,SAAAC,EAAAA,KAAA,MAAA,CAAK3B,UAAU,oBAAmB0B,SAAA,CAChCC,EAAKC,KAAA,MAAA,CAAA5B,UAAU,YACZ0B,SAAA,CAAAtB,EAAIX,MACLgC,EAAAI,IAAA,KAAA,CAAA,GACCz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":["../src/components/InputNumber.tsx","../src/components/Switch.tsx","../src/components/Chip.tsx","../src/components/ProductionUnitContainer.tsx","../src/components/ValueWithUnit.tsx","../node_modules/tslib/tslib.es6.js","../src/components/Timer.tsx","../src/components/Avatar.tsx","../src/components/Histogram.tsx","../src/components/ProductionUnit.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\nimport './InputNumber.css';\n\ninterface InputNumberProps {\n label: string;\n value?: string;\n onChange?: (value: string) => void;\n disabled?: boolean;\n className?: string;\n required?: boolean;\n min?: { value: number; label?: string };\n max?: { value: number; label?: string };\n}\n\nexport const InputNumber: React.FC<InputNumberProps> = ({\n label,\n value = '',\n onChange,\n disabled = false,\n className = '',\n required = false,\n min = { value: 0, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}) => {\n const [internalValue, setInternalValue] = useState(value);\n const [isFocused, setIsFocused] = useState(false);\n const [isOutOfRange, setIsOutOfRange] = useState(false);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n setInternalValue(value);\n }, [value]);\n\n const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const newValue = e.target.value;\n\n // Always update internal value for display\n setInternalValue(newValue);\n\n // Check if value is out of range for visual feedback\n if (newValue !== '') {\n const numValue = parseFloat(newValue);\n if (!isNaN(numValue)) {\n const outOfRange = numValue < min.value || numValue > max.value;\n setIsOutOfRange(outOfRange);\n\n if (outOfRange) {\n // Clamp the value and notify parent with clamped value\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n onChange?.(clampedValue.toString());\n } else {\n // Value is in range, notify parent with actual value\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n } else {\n setIsOutOfRange(false);\n onChange?.(newValue);\n }\n };\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n const handleBlur = () => {\n setIsFocused(false);\n\n // Clamp value on blur\n if (internalValue !== '') {\n const numValue = parseFloat(internalValue);\n if (!isNaN(numValue)) {\n const clampedValue = Math.max(min.value, Math.min(max.value, numValue));\n if (clampedValue !== numValue) {\n const clampedString = clampedValue.toString();\n setInternalValue(clampedString);\n onChange?.(clampedString);\n }\n setIsOutOfRange(false); // Reset out-of-range state after clamping\n }\n }\n };\n\n const isLabelFloating = isFocused || internalValue.length > 0;\n\n const containerClasses = [\n 'input-container',\n isFocused ? 'input-container--focused' : '',\n isLabelFloating ? 'input-container--floating' : '',\n disabled ? 'input-container--disabled' : '',\n isOutOfRange ? 'input-container--error' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className={containerClasses}>\n <div className=\"input-constraints\">\n <div className=\"input-min\">\n {min.label}\n <br />\n {min.value}\n </div>\n\n <div className=\"input-field\">\n <input\n ref={inputRef}\n type=\"number\"\n value={internalValue}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n disabled={disabled}\n required={required}\n className=\"input-element\"\n aria-label={label}\n min={min.value}\n max={max.value}\n step={1}\n />\n <label className=\"input-label\">\n {label}\n {required && <span className=\"input-required\">*</span>}\n </label>\n </div>\n <div className=\"input-max\">\n {max.label}\n <br /> {max.value}\n </div>\n </div>\n </div>\n );\n};\n","import React, { useState } from 'react';\nimport './Switch.css';\n\ninterface OnProps {\n isOff?: boolean;\n}\nconst ImgOn = ({ isOff }: OnProps) => (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M9.56529 2.85352C9.66365 2.57607 9.96837 2.43116 10.246 2.5293C13.4295 3.65507 15.3392 6.91015 14.7684 10.2383C14.1974 13.5667 11.3114 16 7.93443 16C4.55739 16 1.67151 13.5667 1.10045 10.2383C0.5296 6.91011 2.4393 3.65504 5.62291 2.5293C5.9005 2.43115 6.20523 2.57605 6.30357 2.85352C6.40176 3.13124 6.2561 3.43599 5.97838 3.53418C3.28438 4.48672 1.669 7.2423 2.1522 10.0586C2.63557 12.8747 5.07706 14.9336 7.93443 14.9336C10.7918 14.9336 13.2333 12.8747 13.7167 10.0586C14.1999 7.24233 12.5844 4.48676 9.89049 3.53418C9.61276 3.43599 9.4671 3.13124 9.56529 2.85352ZM7.93443 0C8.22892 3.10447e-05 8.46754 0.238727 8.46763 0.533203V7.4668C8.46763 7.76135 8.22898 8.00095 7.93443 8.00098C7.63986 8.00098 7.40123 7.76137 7.40123 7.4668V0.533203C7.40132 0.238707 7.63991 0 7.93443 0Z\"\n fill={isOff ? '#999FA1' : '#009CDF'}\n />\n </svg>\n);\nconst SwitchThumb = ({ isOff }: OnProps) => (\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <circle cx=\"16\" cy=\"16\" r=\"16\" fill={isOff ? 'white' : '#009cdf'} />\n </svg>\n);\n\ninterface SwitchProps {\n checked?: boolean;\n onChange?: (checked: boolean) => void;\n disabled?: boolean;\n showIcon?: boolean;\n label?: string;\n}\n\nexport const Switch: React.FC<SwitchProps> = ({\n checked = false,\n onChange,\n disabled = false,\n showIcon = true,\n label,\n}) => {\n const [internalChecked, setInternalChecked] = useState(checked);\n\n // Use controlled value if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n\n const handleToggle = () => {\n if (disabled) return;\n\n const newChecked = !isChecked;\n // Only update internal state if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n onChange?.(newChecked);\n };\n\n const switchClasses = [\n 'switch',\n isChecked ? 'switch--checked' : '',\n disabled ? 'switch--disabled' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const wrapperClasses = ['switch-wrapper', isChecked ? 'switch-wrapper--checked' : '']\n .filter(Boolean)\n .join(' ');\n\n return (\n <div className=\"switch-container\">\n <div className={wrapperClasses}>\n {showIcon ? (\n <div className=\"switch-icon\">\n <ImgOn isOff={!isChecked} />\n </div>\n ) : label ? (\n <div className=\"switch-label\">{label}</div>\n ) : null}\n <button\n type=\"button\"\n role=\"switch\"\n aria-checked={isChecked}\n className={switchClasses}\n onClick={handleToggle}\n disabled={disabled}\n >\n <span className=\"switch-track\">\n <span className=\"switch-thumb\">\n <SwitchThumb isOff={!isChecked} />\n </span>\n </span>\n </button>\n </div>\n </div>\n );\n};\n","import React from 'react';\nimport './Chip.css';\n\ninterface ChipProps {\n // Define any props you want to pass to the Chip component\n children: React.ReactNode;\n bgColor?: string;\n width?: 'fit-content' | 'full-width';\n}\n\nexport const Chip: React.FC<ChipProps> = ({ children, bgColor, width = 'fit-content' }) => {\n const chipClasses = [\n 'chip-container',\n width === 'full-width' ? 'chip-container--full-width' : 'chip-container--fit-content',\n ].join(' ');\n\n return (\n <div className={chipClasses} style={{ backgroundColor: bgColor }}>\n <div className=\"chip-content\">\n <div className=\"chip-label\">{children}</div>\n </div>\n </div>\n );\n};\n","import './ProductionUnitContainer.css';\n\ninterface ProductionUnitContainerProps {\n bgColor?: string;\n children: React.ReactNode;\n height?: string;\n}\nexport const ProductionUnitContainer = ({\n bgColor = '#fff',\n children,\n height,\n}: ProductionUnitContainerProps) => {\n return (\n <div className=\"production-unit-container-box\" style={{ backgroundColor: bgColor, height }}>\n {children}\n </div>\n );\n};\n","import React from 'react';\nimport './ValueWithUnit.css';\n\ninterface ValueWithUnitProps {\n cost?: number;\n textColor?: string;\n type?: 'euro' | 'megawatt' | 'europermegawatt';\n}\n\nexport const ValueWithUnit: React.FC<ValueWithUnitProps> = ({ cost, textColor, type = 'europermegawatt' }) => {\n return (\n <div className=\"cost-text-container\">\n <div className=\"cost-number\" style={{ color: textColor }}>\n {cost}\n </div>\n <div className=\"cost-unit\" style={{ color: textColor }}>\n {type === 'euro' || type === 'europermegawatt' ? '€' : 'MWh'}\n </div>\n {type === 'europermegawatt' && (\n <div className=\"cost-unit-per\" style={{ color: textColor }}>\n /MWh\n </div>\n )}\n </div>\n );\n};\n\n","/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nexport function __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nexport function __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nexport function __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\r\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\r\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nvar ownKeys = function(o) {\r\n ownKeys = Object.getOwnPropertyNames || function (o) {\r\n var ar = [];\r\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\r\n return ar;\r\n };\r\n return ownKeys(o);\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nexport function __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose, inner;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n if (async) inner = dispose;\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nexport function __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n var r, s = 0;\r\n function next() {\r\n while (r = env.stack.pop()) {\r\n try {\r\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\r\n if (r.dispose) {\r\n var result = r.dispose.call(r.value);\r\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n else s |= 1;\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\r\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\r\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\r\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\r\n });\r\n }\r\n return path;\r\n}\r\n\r\nexport default {\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __esDecorate: __esDecorate,\r\n __runInitializers: __runInitializers,\r\n __propKey: __propKey,\r\n __setFunctionName: __setFunctionName,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n __rewriteRelativeImportExtension: __rewriteRelativeImportExtension,\r\n};\r\n","import React, { useState, useEffect, useRef, useCallback } from 'react';\nimport './Timer.css';\n\nexport interface TimerProps {\n // Required phase configuration\n phases: { duration: number; title?: string }[];\n \n // Required external state - always controlled\n externalState: {\n currentPhase: number;\n currentTime: number;\n isRunning: boolean;\n isPaused: boolean;\n isFrozen: boolean;\n };\n \n // Required state change handler\n onStateChange: (state: {\n currentPhase: number;\n currentTime: number;\n isRunning: boolean;\n isPaused: boolean;\n isFrozen: boolean;\n }) => void;\n \n // Optional event callbacks\n onComplete?: () => void;\n onPhaseComplete?: (phaseIndex: number, phaseDuration: number) => void;\n onTick?: (currentTime: number, phaseIndex: number) => void;\n onStart?: () => void;\n onPause?: () => void;\n onFreeze?: (frozen: boolean) => void;\n onAnonymiseToggle?: (anonymised: boolean) => void;\n onStop?: () => void;\n onReset?: () => void;\n onPrevious?: () => void;\n onNext?: () => void;\n onPhaseClick?: (phaseIndex: number) => void;\n \n // UI configuration\n className?: string;\n gameActions?: { [phaseIndex: number]: string };\n user?: 'actor' | 'admin';\n}\n\nexport interface TimerRef {\n start: () => void;\n pause: () => void;\n freeze: (force?: boolean) => void; // toggle or force\n toggleAnonymise: (force?: boolean) => void; // NEW\n stop: () => void;\n reset: () => void;\n setPhases: (phases: { duration: number; title?: string }[]) => void;\n getCurrentTime: () => number;\n getCurrentPhase: () => number;\n isRunning: () => boolean;\n isPaused: () => boolean;\n}\n\nconst formatTime = (seconds: number): string => {\n const minutes = Math.floor(seconds / 60);\n const secs = seconds % 60;\n return `${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;\n};\n\nexport const Timer = React.forwardRef<TimerRef, TimerProps>(\n (\n {\n phases = [],\n externalState,\n onStateChange,\n onComplete,\n onPhaseComplete,\n onTick,\n onStart,\n onPause,\n onFreeze,\n onAnonymiseToggle,\n onStop,\n onReset,\n onPrevious,\n onNext,\n onPhaseClick,\n className = '',\n gameActions = {},\n user = 'admin',\n },\n ref\n ) => {\n // Extract state from externalState - no internal timer state\n const {\n currentPhase,\n currentTime,\n isRunning,\n isPaused,\n isFrozen,\n } = externalState;\n\n // Keep only UI-specific state (not timer logic)\n const [selectedPhase, setSelectedPhase] = useState<number | null>(null);\n const [isAnonymised, setIsAnonymised] = useState(false);\n const intervalRef = useRef<NodeJS.Timeout | null>(null);\n\n const start = useCallback(() => {\n if (phases.length === 0 || currentPhase >= phases.length) return;\n \n onStateChange({\n ...externalState,\n isRunning: true,\n isPaused: false,\n });\n onStart?.();\n }, [phases.length, currentPhase, externalState, onStateChange, onStart]);\n\n const pause = useCallback(() => {\n if (isFrozen) return;\n \n onStateChange({\n ...externalState,\n isRunning: false,\n isPaused: true,\n });\n onPause?.();\n }, [isFrozen, externalState, onStateChange, onPause]);\n\n const freeze = useCallback((force?: boolean) => {\n \n const nextFrozen = force === undefined ? !isFrozen : force;\n \n const newState = {\n ...externalState,\n isFrozen: nextFrozen,\n // When unfreezing, restore to running state (unless it was explicitly paused)\n // When freezing, stop running but preserve pause state\n isRunning: nextFrozen ? false : !externalState.isPaused,\n isPaused: externalState.isPaused, // Preserve pause state\n };\n \n onStateChange(newState);\n onFreeze?.(nextFrozen);\n }, [isFrozen, externalState, onStateChange, onFreeze]);\n\n const toggleAnonymise = useCallback(\n (force?: boolean) => {\n setIsAnonymised((prev) => {\n const next = force === undefined ? !prev : force;\n onAnonymiseToggle?.(next);\n return next;\n });\n },\n [onAnonymiseToggle]\n );\n\n const stop = useCallback(() => {\n onStateChange({\n currentPhase: 0,\n currentTime: 0,\n isRunning: false,\n isPaused: false,\n isFrozen: false,\n });\n onStop?.();\n }, [onStateChange, onStop]);\n\n const reset = useCallback(() => {\n onStateChange({\n currentPhase: 0,\n currentTime: 0,\n isRunning: false,\n isPaused: false,\n isFrozen: false,\n });\n onReset?.();\n }, [onStateChange, onReset]);\n\n const setTimerPhases = useCallback(() => {\n // No-op since phases come from props\n }, []);\n\n React.useImperativeHandle(ref, () => ({\n start,\n pause,\n freeze,\n toggleAnonymise,\n stop,\n reset,\n setPhases: setTimerPhases,\n getCurrentTime: () => currentTime,\n getCurrentPhase: () => currentPhase,\n isRunning: () => isRunning,\n isPaused: () => isPaused,\n }));\n\n\n useEffect(() => {\n if (isRunning && !isFrozen && currentPhase < phases.length) {\n intervalRef.current = setInterval(() => {\n const newTime = currentTime + 1;\n \n // Always update the time first\n onStateChange({\n ...externalState,\n currentTime: newTime,\n });\n onTick?.(newTime, currentPhase);\n\n // Check if current phase is complete (after showing the duration)\n // Complete when newTime > duration, not when newTime >= duration\n if (newTime > (phases[currentPhase]?.duration || 0)) {\n onPhaseComplete?.(currentPhase, phases[currentPhase]?.duration || 0);\n\n // Move to next phase or complete\n if (currentPhase + 1 < phases.length) {\n onStateChange({\n ...externalState,\n currentPhase: currentPhase + 1,\n currentTime: 0,\n });\n } else {\n // All phases complete\n onStateChange({\n ...externalState,\n isRunning: false,\n isPaused: false,\n });\n onComplete?.();\n }\n }\n }, 1000);\n } else {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = null;\n }\n }\n\n return () => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n }\n };\n }, [isRunning, isFrozen, currentPhase, currentTime, phases, externalState, onStateChange, onTick, onPhaseComplete, onComplete]);\n\n const currentPhaseDuration = phases[currentPhase]?.duration || 0;\n const progress = currentPhaseDuration > 0 ? (currentTime / currentPhaseDuration) * 100 : 0;\n // Determine if we finished all steps and are at the end\n const isAtEnd =\n phases.length > 0 &&\n !isRunning &&\n currentPhase === Math.max(0, phases.length - 1) &&\n currentTime >= (phases[Math.max(0, currentPhase)]?.duration || 0);\n\n const timerClasses = [\n 'timer-header-control',\n className,\n isRunning ? 'timer--running' : '',\n isPaused ? 'timer--paused' : '',\n isFrozen ? 'timer--frozen' : '',\n // isAnonymised ? 'timer--anonymised' : '',\n isAtEnd ? 'timer--completed' : '',\n ]\n .filter(Boolean)\n .join(' ');\n\n const remainingTime = currentPhaseDuration > 0 ? currentPhaseDuration - currentTime : 0;\n\n const renderStepIndicators = () => {\n const steps = [] as React.ReactNode[];\n const maxSteps = phases.length;\n\n for (let i = 0; i < maxSteps; i++) {\n const isActive = i === currentPhase;\n const isCompleted = i < currentPhase;\n const hasAction = gameActions[i];\n const isClickable = isActive || isCompleted; // only active or completed\n\n let stepClass = 'step-indicator';\n if (!hasAction && !isActive && !isCompleted) {\n stepClass += ' step-indicator--placeholder';\n } else if (isActive) {\n stepClass +=\n ' step-indicator--active' +\n (user === 'actor' ? ' step-indicator--actor' : ' step-indicator--admin');\n } else if (isCompleted) {\n stepClass += ' step-indicator--completed';\n } else {\n stepClass += ' step-indicator--upcoming';\n }\n if (isClickable) stepClass += ' step-indicator--clickable'; // add clickable style\n if (selectedPhase === i) stepClass += ' step-indicator--selected'; // highlight clicked\n\n const handleClick = () => {\n if (!isClickable) return;\n setSelectedPhase(i);\n onPhaseClick?.(i);\n };\n\n const commonProps = {\n key: i,\n className: stepClass,\n 'data-step': i + 1,\n title: phases[i]?.title\n ? `Step ${i + 1}: ${phases[i]?.title}`\n : hasAction\n ? `Step ${i + 1}: ${hasAction}`\n : `Step ${i + 1}`,\n onClick: isClickable ? handleClick : undefined,\n role: isClickable ? ('button' as const) : undefined,\n tabIndex: isClickable ? 0 : undefined,\n onKeyDown: isClickable\n ? (e: React.KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n handleClick();\n }\n }\n : undefined,\n };\n\n steps.push(<div {...commonProps}>{hasAction || isActive || isCompleted ? i + 1 : ''}</div>);\n\n if (user === 'actor' && isActive) {\n steps.push(\n <div key={`header-inline-${i}`} className=\"timer-header--block\">\n <div className=\"timer-header timer-header--inline\">\n <span className=\"timer-title\">\n {(phases[currentPhase]?.title || 'TIMER').toUpperCase()}\n </span>\n <span className=\"timer-time\">{formatTime(Math.max(0, remainingTime))}</span>\n </div>\n <div className=\"timer-progress-bar timer-progress-bar--inline\">\n <div\n className=\"timer-progress-fill\"\n style={{ width: `${Math.min(100, progress)}%` }}\n />\n </div>\n </div>\n );\n }\n }\n\n return (\n <div className=\"step-indicators\">\n {steps}\n <div\n className={`step-expand ${isAtEnd ? 'step-expand--end' : ''}`}\n title={isAtEnd ? 'All steps completed' : 'In progress'}\n >\n {user === 'actor' ? (\n isAtEnd ? (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect\n x=\"24\"\n width=\"24\"\n height=\"24\"\n rx=\"12\"\n transform=\"rotate(90 24 0)\"\n fill=\"#292E33\"\n />\n <path\n d=\"M20 12C20 12.276 19.776 12.5 19.5 12.5L17.4766 12.5C17.238 15.1345 15.1345 17.238 12.5 17.4766L12.5 19.5C12.5 19.776 12.276 20 12 20C11.724 20 11.5 19.776 11.5 19.5L11.5 17.4766C8.86554 17.238 6.763 15.1345 6.52441 12.5L4.5 12.5C4.224 12.5 4 12.276 4 12C4 11.724 4.224 11.5 4.5 11.5L6.52441 11.5C6.763 8.86555 8.86554 6.76198 11.5 6.52344L11.5 4.5C11.5 4.224 11.724 4 12 4C12.276 4 12.5 4.224 12.5 4.5L12.5 6.52344C15.1345 6.76199 17.238 8.86551 17.4766 11.5L19.5 11.5C19.776 11.5 20 11.724 20 12ZM16.5 12C16.5 9.51867 14.4813 7.5 12 7.5C9.51867 7.5 7.5 9.51867 7.5 12C7.5 14.4813 9.51867 16.5 12 16.5C14.4813 16.5 16.5 14.4813 16.5 12ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z\"\n fill=\"white\"\n />\n </svg>\n ) : (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect\n x=\"24\"\n width=\"24\"\n height=\"24\"\n rx=\"12\"\n transform=\"rotate(90 24 0)\"\n fill=\"#292E33\"\n />\n <path\n d=\"M20 12C20 12.276 19.776 12.5 19.5 12.5L17.4766 12.5C17.238 15.1345 15.1345 17.238 12.5 17.4766L12.5 19.5C12.5 19.776 12.276 20 12 20C11.724 20 11.5 19.776 11.5 19.5L11.5 17.4766C8.86554 17.238 6.763 15.1345 6.52441 12.5L4.5 12.5C4.224 12.5 4 12.276 4 12C4 11.724 4.224 11.5 4.5 11.5L6.52441 11.5C6.763 8.86555 8.86554 6.76198 11.5 6.52344L11.5 4.5C11.5 4.224 11.724 4 12 4C12.276 4 12.5 4.224 12.5 4.5L12.5 6.52344C15.1345 6.76199 17.238 8.86551 17.4766 11.5L19.5 11.5C19.776 11.5 20 11.724 20 12ZM16.5 12C16.5 9.51867 14.4813 7.5 12 7.5C9.51867 7.5 7.5 9.51867 7.5 12C7.5 14.4813 9.51867 16.5 12 16.5C14.4813 16.5 16.5 14.4813 16.5 12ZM14 12C14 13.1046 13.1046 14 12 14C10.8954 14 10 13.1046 10 12C10 10.8954 10.8954 10 12 10C13.1046 10 14 10.8954 14 12Z\"\n fill=\"white\"\n />\n </svg>\n )\n ) : isAtEnd ? (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 8C16 8.276 15.776 8.5 15.5 8.5L13.4766 8.5C13.238 11.1345 11.1345 13.238 8.5 13.4766L8.5 15.5C8.5 15.776 8.276 16 8 16C7.724 16 7.5 15.776 7.5 15.5L7.5 13.4766C4.86554 13.238 2.763 11.1345 2.52441 8.5L0.5 8.5C0.224 8.5 -3.61755e-07 8.276 -3.49691e-07 8C-3.29564e-07 7.724 0.224 7.5 0.5 7.5L2.52441 7.5C2.763 4.86555 4.86554 2.76198 7.5 2.52344L7.5 0.5C7.5 0.224 7.724 -3.61755e-07 8 -3.4969e-07C8.276 -3.29563e-07 8.5 0.224 8.5 0.5L8.5 2.52344C11.1345 2.76199 13.238 4.86551 13.4766 7.5L15.5 7.5C15.776 7.5 16 7.724 16 8ZM12.5 8C12.5 5.51867 10.4813 3.5 8 3.5C5.51867 3.5 3.5 5.51867 3.5 8C3.5 10.4813 5.51867 12.5 8 12.5C10.4813 12.5 12.5 10.4813 12.5 8ZM10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z\"\n fill=\"currentColor\"\n />\n </svg>\n ) : (\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M16 8C16 8.276 15.776 8.5 15.5 8.5L13.4766 8.5C13.238 11.1345 11.1345 13.238 8.5 13.4766L8.5 15.5C8.5 15.776 8.276 16 8 16C7.724 16 7.5 15.776 7.5 15.5L7.5 13.4766C4.86554 13.238 2.763 11.1345 2.52441 8.5L0.5 8.5C0.224 8.5 -3.61755e-07 8.276 -3.49691e-07 8C-3.29564e-07 7.724 0.224 7.5 0.5 7.5L2.52441 7.5C2.763 4.86555 4.86554 2.76198 7.5 2.52344L7.5 0.5C7.5 0.224 7.724 -3.61755e-07 8 -3.4969e-07C8.276 -3.29563e-07 8.5 0.224 8.5 0.5L8.5 2.52344C11.1345 2.76199 13.238 4.86551 13.4766 7.5L15.5 7.5C15.776 7.5 16 7.724 16 8ZM12.5 8C12.5 5.51867 10.4813 3.5 8 3.5C5.51867 3.5 3.5 5.51867 3.5 8C3.5 10.4813 5.51867 12.5 8 12.5C10.4813 12.5 12.5 10.4813 12.5 8ZM10 8C10 9.10457 9.10457 10 8 10C6.89543 10 6 9.10457 6 8C6 6.89543 6.89543 6 8 6C9.10457 6 10 6.89543 10 8Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n </div>\n </div>\n );\n };\n\n return (\n <div className={timerClasses}>\n <div className=\"timer-section\">\n <div className=\"timer-content\">\n <div className=\"timer-display-area\">\n {user === 'admin' && (\n <div className=\"timer-header\">\n <span className=\"timer-title\">\n {(phases[currentPhase]?.title || 'TIMER').toUpperCase()}\n </span>\n <span className=\"timer-time\">{formatTime(Math.max(0, remainingTime))}</span>\n </div>\n )}\n {user === 'admin' && (\n <div className=\"timer-progress-bar\">\n <div\n className=\"timer-progress-fill\"\n style={{ width: `${Math.min(100, progress)}%` }}\n />\n </div>\n )}\n {renderStepIndicators()}\n </div>\n </div>\n </div>\n\n {user === 'admin' && (\n <div className=\"timer-controls-section\">\n <button\n className=\"control-button control-button--previous\"\n onClick={() => onPrevious?.()}\n disabled={currentPhase === 0}\n title=\"Previous\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M11.9813 2.39178C12.1589 2.38845 12.3342 2.43251 12.4892 2.51941C12.6441 2.60631 12.7731 2.73291 12.8629 2.88621C12.9527 3.0395 13 3.21395 13 3.3916L12.5 3.3916H13V12.6085C13 12.7862 12.9527 12.9606 12.8629 13.1139C12.7731 13.2672 12.6441 13.3938 12.4892 13.4807C12.3342 13.5676 12.1589 13.6117 11.9813 13.6084C11.8037 13.605 11.6301 13.5545 11.4785 13.4618L3.93741 8.85335C3.79124 8.76403 3.67046 8.63865 3.58667 8.48923C3.50287 8.33982 3.45886 8.17138 3.45886 8.00007C3.45886 7.82877 3.50287 7.66033 3.58667 7.51092C3.67046 7.3615 3.79124 7.23612 3.93741 7.14679L11.4785 2.53832C11.6301 2.44568 11.8037 2.3951 11.9813 2.39178ZM12 3.3916L4.45886 8.00007L4.19814 7.57343L4.45886 8.00007L12 12.6085V3.3916Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M2 2C2.27614 2 2.5 2.22386 2.5 2.5V13.5C2.5 13.7761 2.27614 14 2 14C1.72386 14 1.5 13.7761 1.5 13.5V2.5C1.5 2.22386 1.72386 2 2 2Z\"\n fill=\"black\"\n />\n </svg>\n </button>\n\n <button\n className=\"control-button control-button--next\"\n onClick={() => onNext?.()}\n disabled={!(isAtEnd && currentPhase < phases.length - 1)}\n title=\"Next\"\n >\n <svg\n width=\"16\"\n height=\"16\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M3.51084 2.51941C3.66579 2.43251 3.84109 2.38845 4.01871 2.39178C4.19633 2.3951 4.36986 2.44568 4.52145 2.53832L12.0626 7.14679C12.2088 7.23612 12.3295 7.3615 12.4133 7.51092C12.4971 7.66033 12.5411 7.82877 12.5411 8.00007C12.5411 8.17138 12.4971 8.33982 12.4133 8.48923C12.3295 8.63865 12.2088 8.76403 12.0626 8.85335L4.52145 13.4618C4.36986 13.5545 4.19633 13.605 4.01871 13.6084C3.84109 13.6117 3.66579 13.5676 3.51084 13.4807C3.3559 13.3938 3.2269 13.2672 3.13711 13.1139C3.04733 12.9606 3 12.7862 3 12.6085V3.3916C3 3.21395 3.04733 3.0395 3.13711 2.88621C3.22689 2.73292 3.35589 2.60631 3.51084 2.51941ZM11.5411 8.00007L4 3.3916V12.6085L11.5411 8.00007Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M14 2C14.2761 2 14.5 2.22386 14.5 2.5V13.5C14.5 13.7761 14.2761 14 14 14C13.7239 14 13.5 13.7761 13.5 13.5V2.5C13.5 2.22386 13.7239 2 14 2Z\"\n fill=\"black\"\n />\n </svg>\n </button>\n\n <button\n className={`control-button control-button--play-pause ${\n isRunning ? 'control-button--pause' : 'control-button--play'\n } ${isFrozen ? 'control-button--disabled' : ''}`}\n onClick={isRunning ? pause : start}\n title={isFrozen ? 'Frozen' : isRunning ? 'Pause' : isPaused ? 'Resume' : 'Start'}\n disabled={isFrozen}\n >\n {isRunning ? (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12 4.5C7.85786 4.5 4.5 7.85786 4.5 12C4.5 15.1788 6.47789 17.8975 9.27283 18.989C9.65866 19.1397 9.8493 19.5746 9.69862 19.9604C9.54794 20.3463 9.113 20.5369 8.72717 20.3862C5.37607 19.0775 3 15.8172 3 12C3 7.02944 7.02944 3 12 3C16.2192 3 19.7585 5.90255 20.7337 9.81878C20.9078 10.5179 21 11.2487 21 12C21 12.4142 20.6642 12.75 20.25 12.75C19.8358 12.75 19.5 12.4142 19.5 12C19.5 11.3719 19.4229 10.7628 19.2781 10.1812C18.4655 6.91754 15.5141 4.5 12 4.5Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M18.75 15.75V22.25H20.25V15.75H18.75ZM17.25 15.3636C17.25 14.5918 17.9689 14.25 18.4615 14.25H20.5385C21.0311 14.25 21.75 14.5918 21.75 15.3636V22.6364C21.75 23.4082 21.0311 23.75 20.5385 23.75H18.4615C17.9689 23.75 17.25 23.4082 17.25 22.6364V15.3636Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M12.75 15.75V22.25H14.25V15.75H12.75ZM11.25 15.3636C11.25 14.5918 11.9689 14.25 12.4615 14.25H14.5385C15.0311 14.25 15.75 14.5918 15.75 15.3636V22.6364C15.75 23.4082 15.0311 23.75 14.5385 23.75H12.4615C11.9689 23.75 11.25 23.4082 11.25 22.6364V15.3636Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M8.54996 7.40004C8.21858 7.64857 8.15143 8.11867 8.39996 8.45004L11.4 12.45C11.6485 12.7814 12.1186 12.8486 12.45 12.6C12.7813 12.3515 12.8485 11.8814 12.6 11.55L9.59996 7.55004C9.35143 7.21867 8.88133 7.15152 8.54996 7.40004Z\"\n fill=\"black\"\n />\n <path\n fillRule=\"evenodd\"\n clipRule=\"evenodd\"\n d=\"M9 0.75C9 0.335786 9.33579 0 9.75 0H14.25C14.6642 0 15 0.335786 15 0.75C15 1.16421 14.6642 1.5 14.25 1.5H9.75C9.33579 1.5 9 1.16421 9 0.75Z\"\n fill=\"black\"\n />\n </svg>\n ) : (\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M20.25 12C20.25 11.3103 20.1654 10.6404 20.0059 10C19.112 6.41005 15.8666 3.75 12 3.75C7.44365 3.75 3.75 7.44365 3.75 12C3.75 15.498 5.92698 18.4875 9 19.6876\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeMiterlimit=\"10\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M12 12L9 8\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M9.75 0.75H14.25\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M20.7759 18.1242L13.7125 14.0646C13.6415 14.0238 13.5603 14.0015 13.4771 14.0001C13.3939 13.9986 13.3118 14.018 13.2392 14.0563C13.1667 14.0946 13.1063 14.1503 13.0642 14.2178C13.0222 14.2854 13 14.3622 13 14.4404V22.5596C13 22.6378 13.0222 22.7146 13.0642 22.7822C13.1063 22.8497 13.1667 22.9054 13.2392 22.9437C13.3118 22.982 13.3939 23.0014 13.4771 22.9999C13.5603 22.9985 13.6415 22.9762 13.7125 22.9354L20.7759 18.8758C20.8443 18.8365 20.9009 18.7813 20.9401 18.7154C20.9794 18.6496 21 18.5755 21 18.5C21 18.4245 20.9794 18.3504 20.9401 18.2846C20.9009 18.2187 20.8443 18.1635 20.7759 18.1242V18.1242Z\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )}\n </button>\n\n <button\n className={`control-button control-button--freeze ${isFrozen ? 'control-button--freeze-active' : ''}`}\n onClick={() => freeze()}\n title={isFrozen ? 'Unfreeze' : 'Freeze'}\n disabled={!isRunning && !isPaused && !isFrozen}\n >\n {/* Simple snowflake / asterisk style placeholder icon */}\n <svg width=\"14\" height=\"12\" viewBox=\"0 0 14 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path d=\"M8.14697 0.146484C8.34224 -0.0486747 8.65878 -0.0487434 8.854 0.146484C9.04889 0.341739 9.04905 0.658358 8.854 0.853516L7.50049 2.20703V5.13281L10.0337 3.66992L10.5298 1.82129C10.6012 1.5547 10.8755 1.3966 11.1421 1.46777C11.4088 1.53922 11.5679 1.8134 11.4966 2.08008L11.0767 3.64648L12.6421 4.06543C12.9088 4.1369 13.0681 4.41198 12.9966 4.67871C12.925 4.94527 12.6499 5.10368 12.3833 5.03223L10.5347 4.53613L7.99951 5.99902L10.5347 7.46191L12.3833 6.96777C12.65 6.8963 12.9251 7.05456 12.9966 7.32129C13.068 7.58799 12.9088 7.86213 12.6421 7.93359L11.0767 8.35352L11.4966 9.91992C11.5677 10.1865 11.4086 10.4608 11.1421 10.5322C10.8756 10.6033 10.6013 10.4451 10.5298 10.1787L10.0337 8.32812L7.50049 6.86523V9.79297L8.854 11.1465C9.04889 11.3417 9.04905 11.6584 8.854 11.8535C8.65885 12.0487 8.34226 12.0484 8.14697 11.8535L7.00049 10.707L5.854 11.8535C5.65885 12.0487 5.34226 12.0484 5.14697 11.8535C4.95171 11.6583 4.95171 11.3417 5.14697 11.1465L6.50049 9.79297V6.86523L3.96533 8.32812L3.47021 10.1787C3.39865 10.4451 3.12439 10.6034 2.85791 10.5322C2.59128 10.4608 2.43314 10.1866 2.50439 9.91992L2.92334 8.35352L1.35791 7.93359C1.09118 7.86212 0.932919 7.58802 1.00439 7.32129C1.07593 7.05464 1.35001 6.89631 1.6167 6.96777L3.46436 7.46191L5.99951 5.99902L3.46436 4.53613L1.6167 5.03223C1.35014 5.10366 1.07608 4.94513 1.00439 4.67871C0.932919 4.41198 1.09118 4.1369 1.35791 4.06543L2.92334 3.64648L2.50439 2.08008C2.43293 1.81334 2.59118 1.53924 2.85791 1.46777C3.12453 1.39654 3.39878 1.55467 3.47021 1.82129L3.96533 3.66992L6.50049 5.13281V2.20703L5.14697 0.853516C4.95171 0.658253 4.95171 0.341747 5.14697 0.146484C5.34224 -0.0486746 5.65878 -0.0487434 5.854 0.146484L7.00049 1.29297L8.14697 0.146484Z\" fill=\"black\"/>\n</svg>\n\n </button>\n <button\n className={`control-button control-button--anonymise ${isAnonymised ? 'control-button--anonymise-active' : ''}`}\n onClick={() => toggleAnonymise()}\n title={isAnonymised ? 'Show Names' : 'Hide Names'}\n >\n {/* Simple snowflake / asterisk style placeholder icon */}\n <svg width=\"18\" height=\"12\" viewBox=\"0 0 18 12\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M4.19571 0.9375H13.9316L13.9576 0.939919L13.9055 1.5C13.9576 0.939919 13.958 0.939955 13.9584 0.939992L13.9593 0.940074L13.9612 0.940263L13.966 0.940753L13.9794 0.942218C13.9899 0.943426 14.0036 0.945121 14.0203 0.947429C14.0536 0.952044 14.0989 0.959129 14.1545 0.969722C14.2655 0.990879 14.4186 1.02621 14.5998 1.08426C14.9611 1.20007 15.4415 1.40866 15.9224 1.78153C16.9079 2.54562 17.8125 3.93493 17.8125 6.375C17.8125 8.84977 16.7446 10.2418 15.6228 10.9916C15.0757 11.3573 14.5319 11.5602 14.1264 11.6723C13.9228 11.7285 13.7514 11.7626 13.6282 11.7828C13.5666 11.7929 13.5167 11.7996 13.4807 11.8039C13.4626 11.8061 13.448 11.8076 13.437 11.8087L13.4234 11.81L13.4186 11.8104L13.4168 11.8106L13.416 11.8106C13.4157 11.8107 13.4154 11.8107 13.3704 11.25L13.416 11.8106L13.3929 11.8125H13.3704C12.4693 11.8125 11.7717 11.6348 11.2171 11.3425C10.6627 11.0503 10.2868 10.6623 10.0046 10.2977C9.86569 10.1182 9.74696 9.94078 9.64616 9.78996C9.5407 9.6322 9.46023 9.51197 9.38106 9.41262C9.22707 9.21935 9.16773 9.21939 9.13503 9.21941H9.13398C9.09752 9.21941 9.03241 9.22191 8.87346 9.41718C8.79345 9.51548 8.71127 9.63581 8.60695 9.79107C8.60069 9.80039 8.59437 9.80981 8.58797 9.81934C8.49236 9.96175 8.38151 10.1269 8.25589 10.2929C7.98421 10.6519 7.62551 11.0405 7.10214 11.335C6.57573 11.6313 5.91831 11.8125 5.07599 11.8125H5.0488L5.02173 11.8099L5.07599 11.25C5.02173 11.8099 5.02205 11.8099 5.02173 11.8099L5.0204 11.8097L5.01868 11.8096L5.01405 11.8091L5.00016 11.8076C4.98888 11.8063 4.97357 11.8045 4.95451 11.8019C4.91641 11.7969 4.8632 11.7892 4.79703 11.7779C4.66485 11.7553 4.47999 11.718 4.25972 11.6585C3.82115 11.5401 3.23123 11.3305 2.63538 10.9643C1.42058 10.2176 0.212463 8.83259 0.187947 6.38062C0.163902 3.97575 1.11355 2.587 2.13375 1.81616C2.63171 1.43991 3.12954 1.22329 3.50294 1.10027C3.69026 1.03855 3.84839 0.999684 3.96267 0.975868C4.01989 0.963945 4.06636 0.955744 4.10027 0.950316C4.11724 0.947601 4.13108 0.945576 4.14159 0.944124L4.15484 0.942358L4.15953 0.941769L4.16139 0.941543L4.1622 0.941446C4.16257 0.941403 4.16292 0.941361 4.22872 1.5L4.1622 0.941446L4.19571 0.9375ZM4.26997 2.0625C4.25203 2.06549 4.22575 2.07021 4.19218 2.07721C4.11398 2.09351 3.99723 2.1219 3.85498 2.16877C3.56924 2.26291 3.18912 2.42877 2.81194 2.71376C2.08184 3.2654 1.29234 4.31414 1.31289 6.36938C1.33297 8.37752 2.28763 9.43001 3.22447 10.0058C3.70444 10.3008 4.18756 10.4737 4.55306 10.5724C4.73484 10.6215 4.88477 10.6515 4.98688 10.669C5.03785 10.6778 5.07667 10.6833 5.1013 10.6866C5.10355 10.6869 5.10569 10.6871 5.10771 10.6874C5.76441 10.683 6.21815 10.5416 6.55042 10.3546C6.89104 10.1629 7.13992 9.90327 7.35877 9.61404C7.46458 9.47422 7.55912 9.33345 7.65787 9.18641L7.67313 9.1637C7.77297 9.01508 7.8831 8.85179 8.00097 8.70698C8.23778 8.41606 8.59073 8.09441 9.13398 8.09441C9.6812 8.09441 10.0292 8.42071 10.2609 8.71155C10.3706 8.8492 10.4746 9.00486 10.569 9.14611L10.5815 9.1648C10.6838 9.31787 10.7824 9.46461 10.8943 9.6092C11.1139 9.89292 11.3735 10.1532 11.7416 10.3472C12.1049 10.5387 12.6087 10.6838 13.3424 10.6874C13.3439 10.6873 13.3456 10.6871 13.3473 10.6869C13.368 10.6844 13.4015 10.6799 13.4459 10.6727C13.5349 10.658 13.6667 10.6321 13.8268 10.5879C14.1487 10.4989 14.5748 10.3389 14.9976 10.0563C15.8156 9.50956 16.6875 8.46406 16.6875 6.375C16.6875 4.25124 15.9198 3.20305 15.2331 2.6706C14.8779 2.3952 14.5221 2.24075 14.2564 2.1556C14.124 2.11316 14.0158 2.08853 13.944 2.07485C13.9117 2.0687 13.887 2.0648 13.8709 2.0625H4.26997ZM13.8498 2.05973C13.8494 2.05969 13.8497 2.05972 13.8508 2.05985L13.8498 2.05973Z\" fill=\"black\"/>\n<path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M5.625 5.0625C4.77651 5.0625 4.3125 5.59288 4.3125 6C4.3125 6.40712 4.77651 6.9375 5.625 6.9375C6.47349 6.9375 6.9375 6.40712 6.9375 6C6.9375 5.59288 6.47349 5.0625 5.625 5.0625ZM3.1875 6C3.1875 4.75027 4.40242 3.9375 5.625 3.9375C6.84758 3.9375 8.0625 4.75027 8.0625 6C8.0625 7.24973 6.84758 8.0625 5.625 8.0625C4.40242 8.0625 3.1875 7.24973 3.1875 6Z\" fill=\"black\"/>\n<path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M12.375 5.0625C11.5265 5.0625 11.0625 5.59288 11.0625 6C11.0625 6.40712 11.5265 6.9375 12.375 6.9375C13.2235 6.9375 13.6875 6.40712 13.6875 6C13.6875 5.59288 13.2235 5.0625 12.375 5.0625ZM9.9375 6C9.9375 4.75027 11.1524 3.9375 12.375 3.9375C13.5976 3.9375 14.8125 4.75027 14.8125 6C14.8125 7.24973 13.5976 8.0625 12.375 8.0625C11.1524 8.0625 9.9375 7.24973 9.9375 6Z\" fill=\"black\"/>\n</svg>\n\n </button>\n </div>\n )}\n </div>\n );\n }\n);\n\nTimer.displayName = 'Timer';\n","import React from 'react';\nimport './Avatar.css';\n\ninterface AvatarProps {\n children: React.ReactNode;\n}\n\nexport const Avatar: React.FC<AvatarProps> = ({ children }) => {\n return (\n <div className=\"avatar-container avatar-container--clickable\">\n <div className=\"avatar-content\">{children}</div>\n </div>\n );\n};\n","import React, { useEffect, useState } from 'react';\nimport './Histogram.css';\n\ninterface HistogramProps {\n /** Maximum value configuration with value and color */\n max: {\n value: number;\n color: string;\n opacity?: number;\n };\n /** Relative/current value configuration with value and color */\n relative: {\n value: number;\n color: string;\n };\n /** Height of the histogram bar in pixels */\n barHeight?: number;\n /** Width of the histogram bar in pixels */\n barWidth?: number;\n /** Orientation of the histogram - 'vertical' or 'horizontal' */\n orientation?: 'vertical' | 'horizontal';\n /** Corner radius configuration for individual corners */\n cornerRadius?: {\n topLeft?: number;\n topRight?: number;\n bottomLeft?: number;\n bottomRight?: number;\n };\n /** Child components (typically text content) */\n children?: React.ReactNode;\n}\n\nexport const Histogram: React.FC<HistogramProps> = ({\n max,\n relative,\n barHeight = 103,\n barWidth = 32,\n orientation = 'vertical',\n cornerRadius,\n children,\n}) => {\n const [animatedHeight, setAnimatedHeight] = useState(0);\n const [animatedWidth, setAnimatedWidth] = useState(0);\n\n // Calculate target dimensions based on orientation\n const targetHeight = (Math.min((relative.value / max.value) * 100, 100) / 100) * barHeight;\n const targetWidth = (Math.min((relative.value / max.value) * 100, 100) / 100) * (orientation === 'horizontal' ? barHeight : barWidth);\n\n // Simple Chart.js-like animation: always animate from 0 to target\n useEffect(() => {\n setAnimatedHeight(0);\n setAnimatedWidth(0);\n\n const startTime = Date.now();\n const duration = 1000;\n\n const animate = () => {\n const elapsed = Date.now() - startTime;\n const progress = Math.min(elapsed / duration, 1);\n\n // Chart.js-like easing (easeOutQuart)\n const easeOutQuart = 1 - Math.pow(1 - progress, 4);\n\n setAnimatedHeight(targetHeight * easeOutQuart);\n setAnimatedWidth(targetWidth * easeOutQuart);\n\n if (progress < 1) {\n requestAnimationFrame(animate);\n }\n };\n\n requestAnimationFrame(animate);\n }, [targetHeight, targetWidth]);\n\n const displayWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const displayHeight = orientation === 'horizontal' ? barWidth : barHeight;\n const svgWidth = orientation === 'horizontal' ? barHeight : barWidth;\n const svgHeight = orientation === 'horizontal' ? barWidth : barHeight;\n\n // Helper function to create rounded rectangle path\n const createRoundedRectPath = (\n x: number,\n y: number,\n width: number,\n height: number,\n radii: { topLeft: number; topRight: number; bottomLeft: number; bottomRight: number }\n ) => {\n const { topLeft, topRight, bottomLeft, bottomRight } = radii;\n\n return `\n M ${x + topLeft} ${y}\n L ${x + width - topRight} ${y}\n Q ${x + width} ${y} ${x + width} ${y + topRight}\n L ${x + width} ${y + height - bottomRight}\n Q ${x + width} ${y + height} ${x + width - bottomRight} ${y + height}\n L ${x + bottomLeft} ${y + height}\n Q ${x} ${y + height} ${x} ${y + height - bottomLeft}\n L ${x} ${y + topLeft}\n Q ${x} ${y} ${x + topLeft} ${y}\n Z\n `\n .trim()\n .replace(/\\s+/g, ' ');\n };\n\n // Default corner radius values\n const defaultCornerRadius = { topLeft: 2, topRight: 2, bottomLeft: 2, bottomRight: 2 };\n const corners = cornerRadius\n ? {\n topLeft: cornerRadius.topLeft ?? defaultCornerRadius.topLeft,\n topRight: cornerRadius.topRight ?? defaultCornerRadius.topRight,\n bottomLeft: cornerRadius.bottomLeft ?? defaultCornerRadius.bottomLeft,\n bottomRight: cornerRadius.bottomRight ?? defaultCornerRadius.bottomRight,\n }\n : defaultCornerRadius;\n\n return (\n <div\n className={`histogram-container ${orientation === 'horizontal' ? 'histogram-container--horizontal' : ''}`}\n >\n <div\n className={`histogram-content ${orientation === 'horizontal' ? 'histogram-content--horizontal' : ''}`}\n >\n <div\n className=\"histogram-bar\"\n style={{\n height: `${displayHeight}px`,\n width: `${displayWidth}px`,\n }}\n >\n <svg\n width={svgWidth}\n height={svgHeight}\n viewBox={`0 0 ${svgWidth} ${svgHeight}`}\n className=\"histogram-svg\"\n >\n {/* Define clipping path with rounded corners matching the background */}\n <defs>\n <clipPath id={`histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft}`}>\n <path d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)} />\n </clipPath>\n </defs>\n \n {/* Background bar (max value) */}\n <path\n d={createRoundedRectPath(0, 0, svgWidth, svgHeight, corners)}\n fill={max.color}\n fillOpacity={max.opacity || 1}\n />\n \n {/* Foreground bar (relative value) with clipping to stay within rounded corners */}\n {orientation === 'vertical' ? (\n <path\n d={createRoundedRectPath(0, svgHeight - animatedHeight, svgWidth, animatedHeight, {\n topLeft: animatedHeight >= svgHeight ? corners.topLeft : 0,\n topRight: animatedHeight >= svgHeight ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: corners.bottomRight,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n ) : (\n <path\n d={createRoundedRectPath(0, 0, animatedWidth, svgHeight, {\n topLeft: corners.topLeft,\n topRight: animatedWidth >= svgWidth ? corners.topRight : 0,\n bottomLeft: corners.bottomLeft,\n bottomRight: animatedWidth >= svgWidth ? corners.bottomRight : 0,\n })}\n fill={relative.color}\n clipPath={`url(#histogram-clip-${svgWidth}-${svgHeight}-${corners.topLeft})`}\n />\n )}\n </svg>\n </div>\n {children && (\n <div\n className={`histogram-text-container ${orientation === 'horizontal' ? 'histogram-text-container--horizontal' : ''}`}\n >\n {children}\n </div>\n )}\n </div>\n </div>\n );\n};\n","import { useState } from 'react';\nimport { InputNumber } from './InputNumber';\nimport { Switch } from './Switch';\nimport './ProductionUnit.css';\nimport { Chip } from './Chip';\nimport { ProductionUnitContainer } from './ProductionUnitContainer';\nimport { ValueWithUnit } from '.';\n\ntype ProductionUnitLimit = {\n value: number;\n label?: string;\n};\ninterface ProductionUnitProps {\n onChangeInput?: (value: number) => void;\n onChangeSwitch?: (checked: boolean) => void;\n defaultValue?: number;\n defaultChecked?: boolean;\n value?: number;\n checked?: boolean;\n unitName?: string;\n energyCost?: number;\n checkedImage?: React.ReactNode;\n uncheckedImage?: React.ReactNode;\n readonly?: boolean;\n min?: ProductionUnitLimit;\n max?: ProductionUnitLimit;\n}\nexport const ProductionUnit = ({\n onChangeInput,\n onChangeSwitch,\n defaultValue,\n defaultChecked = false,\n value,\n checked,\n unitName = 'Production Unit',\n energyCost = 0,\n checkedImage,\n uncheckedImage,\n readonly = false,\n min = { value: 10, label: 'Pmin' },\n max = { value: 100, label: 'Pmax' },\n}: ProductionUnitProps) => {\n // Internal state management for uncontrolled mode\n const [internalChecked, setInternalChecked] = useState(defaultChecked);\n const [internalValue, setInternalValue] = useState(defaultValue);\n\n // Use controlled props if provided, otherwise use internal state\n const isChecked = checked !== undefined ? checked : internalChecked;\n const currentValue = value !== undefined ? value : internalValue;\n\n const handleSwitchChange = (newChecked: boolean) => {\n // Update internal state only if uncontrolled\n if (checked === undefined) {\n setInternalChecked(newChecked);\n }\n\n // Notify parent component if handler provided\n if (onChangeSwitch) {\n onChangeSwitch(newChecked);\n }\n };\n\n const handleInputChange = (val: string) => {\n // Only convert to number if the string is not empty and is a valid number\n if (val === '') {\n // Handle empty string case\n if (value === undefined) {\n setInternalValue(undefined);\n }\n if (onChangeInput) {\n onChangeInput(0); // or whatever default you prefer for empty values\n }\n return;\n }\n\n const numValue = parseFloat(val);\n if (!isNaN(numValue)) {\n // Update internal state only if uncontrolled\n if (value === undefined) {\n setInternalValue(numValue);\n }\n\n // Notify parent component if handler provided\n if (onChangeInput) {\n onChangeInput(numValue);\n }\n }\n };\n\n return (\n <ProductionUnitContainer>\n <div className=\"production-unit-container\">\n <div className=\"production-unit-content\">\n <div className=\"image-preview-container\">{isChecked ? checkedImage : uncheckedImage}</div>\n <div className=\"production-unit-chip\">\n <div className=\"production-unit-chip-name\">{unitName}</div>\n\n <Chip width=\"fit-content\" bgColor=\"#E1F5FD\">\n <ValueWithUnit cost={energyCost} textColor=\"#005896\" />\n </Chip>\n </div>\n <div className=\"production-unit-switch-container\">\n <InputNumber\n label=\"PA\"\n onChange={handleInputChange}\n value={currentValue !== undefined ? currentValue.toString() : undefined}\n disabled={!isChecked || readonly}\n min={{ value: min.value, label: min.label }}\n max={{ value: max.value, label: max.label }}\n />{' '}\n </div>\n </div>\n\n <Switch checked={isChecked} onChange={handleSwitchChange} disabled={readonly} />\n </div>\n </ProductionUnitContainer>\n );\n};\n"],"names":["InputNumber","_a","label","_b","value","onChange","_c","disabled","_d","className","_e","required","_f","min","_g","max","_h","useState","internalValue","setInternalValue","_j","isFocused","setIsFocused","_k","isOutOfRange","setIsOutOfRange","inputRef","useRef","useEffect","containerClasses","length","filter","Boolean","join","_jsx","children","_jsxs","jsxs","jsx","ref","type","e","newValue","target","numValue","parseFloat","isNaN","outOfRange","clampedValue","Math","toString","onFocus","onBlur","clampedString","step","ImgOn","isOff","width","height","viewBox","fill","xmlns","d","SwitchThumb","cx","cy","r","Switch","checked","showIcon","internalChecked","setInternalChecked","isChecked","undefined","switchClasses","wrapperClasses","role","onClick","newChecked","Chip","bgColor","chipClasses","style","backgroundColor","ProductionUnitContainer","ValueWithUnit","cost","textColor","color","__assign","Object","assign","t","s","i","n","arguments","p","prototype","hasOwnProperty","call","apply","this","SuppressedError","formatTime","seconds","minutes","floor","secs","concat","padStart","Timer","React","forwardRef","phases","externalState","onStateChange","onComplete","onPhaseComplete","onTick","onStart","onPause","onFreeze","onAnonymiseToggle","onStop","onReset","onPrevious","onNext","onPhaseClick","gameActions","user","currentPhase","currentTime","isRunning","isPaused","isFrozen","selectedPhase","setSelectedPhase","isAnonymised","setIsAnonymised","intervalRef","start","useCallback","pause","freeze","force","nextFrozen","newState","toggleAnonymise","prev","next","stop","reset","setTimerPhases","useImperativeHandle","setPhases","getCurrentTime","getCurrentPhase","current","setInterval","newTime","duration","clearInterval","currentPhaseDuration","progress","isAtEnd","timerClasses","remainingTime","title","toUpperCase","steps","maxSteps","isActive","isCompleted","hasAction","isClickable","stepClass","handleClick","commonProps","key","tabIndex","onKeyDown","preventDefault","push","x","rx","transform","renderStepIndicators","fillRule","clipRule","stroke","strokeWidth","strokeMiterlimit","strokeLinecap","strokeLinejoin","displayName","relative","barHeight","barWidth","orientation","cornerRadius","animatedHeight","setAnimatedHeight","animatedWidth","setAnimatedWidth","targetHeight","targetWidth","startTime","Date","now","animate","elapsed","easeOutQuart","pow","requestAnimationFrame","displayWidth","displayHeight","svgWidth","svgHeight","createRoundedRectPath","y","radii","topLeft","topRight","bottomLeft","bottomRight","trim","replace","defaultCornerRadius","corners","id","fillOpacity","opacity","clipPath","onChangeInput","onChangeSwitch","defaultValue","defaultChecked","unitName","energyCost","checkedImage","uncheckedImage","readonly","currentValue","val"],"mappings":"mEAcaA,EAA0C,SAACC,GACtD,IAAAC,EAAKD,EAAAC,MACLC,EAAUF,EAAAG,MAAVA,OAAK,IAAAD,EAAG,GAAEA,EACVE,EAAQJ,EAAAI,SACRC,EAAgBL,EAAAM,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAP,EAAAQ,UAAAA,OAAY,IAAAD,EAAA,GAAEA,EACdE,EAAgBT,EAAAU,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAAAX,EAAAY,IAAAA,OAAM,IAAAD,EAAA,CAAER,MAAO,EAAGF,MAAO,QAAQU,EACjCE,EAAmCb,EAAAc,IAAnCA,OAAG,IAAAD,EAAG,CAAEV,MAAO,IAAKF,MAAO,QAAQY,EAE7BE,EAAoCC,EAAAA,SAASb,GAA5Cc,EAAaF,EAAA,GAAEG,EAAgBH,EAAA,GAChCI,EAA4B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E,MAAM,KACNG,SA1Cc,SAAC+O,GAEzB,GAAY,KAARA,EAQF,YANc3K,IAAVrE,GACFe,OAAiBsD,QAEfiK,GACFA,EAAc,IAKlB,IAAM9L,EAAWC,WAAWuM,GACvBtM,MAAMF,UAEK6B,IAAVrE,GACFe,EAAiByB,GAIf8L,GACFA,EAAc9L,GAGpB,EAkBYxC,WAAwBqE,IAAjB0K,EAA6BA,EAAajM,gBAAauB,EAC9DlE,UAAWiE,GAAa0K,EACxBrO,IAAK,CAAET,MAAOS,EAAIT,MAAOF,MAAOW,EAAIX,OACpCa,IAAK,CAAEX,MAAOW,EAAIX,MAAOF,MAAOa,EAAIb,SACnC,UAIPgC,EAAAA,IAACiC,EAAO,CAAAC,QAASI,EAAWnE,SA/DP,SAACyE,QAEVL,IAAZL,GACFG,EAAmBO,GAIjB6J,GACFA,EAAe7J,EAEnB,EAqDgEvE,SAAU2O,QAI5E","x_google_ignoreList":[5]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rte-utils",
3
- "version": "1.2.43",
3
+ "version": "1.2.46",
4
4
  "description": "React components library in TypeScript for agigox projects",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",